From: David Kastrup Date: Wed, 22 Apr 2015 12:44:15 +0000 (+0200) Subject: Issue 4357/2: Make dispatchers callable for dispatching X-Git-Tag: release/2.19.21-1~43 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2718522532d6dd30d1c5fcb24e8d54fbe872355e;p=lilypond.git Issue 4357/2: Make dispatchers callable for dispatching --- diff --git a/lily/dispatcher.cc b/lily/dispatcher.cc index efb3ca506c..a394a4b7a8 100644 --- a/lily/dispatcher.cc +++ b/lily/dispatcher.cc @@ -143,8 +143,8 @@ Dispatcher::dispatch (SCM sev) assert (lists[0].prio > last_priority); last_priority = lists[0].prio; - Listener *l = Listener::unsmob (scm_cdar (lists[0].list)); - l->listen (ev->self_scm ()); + SCM l = scm_cdar (lists[0].list); + scm_call_1 (l, ev->self_scm ()); #if 0 sent = true; #endif diff --git a/lily/include/listener.hh b/lily/include/listener.hh index 959f7e510f..3652a271b9 100644 --- a/lily/include/listener.hh +++ b/lily/include/listener.hh @@ -86,6 +86,12 @@ public: void listen (SCM ev) const; + LY_DECLARE_SMOB_PROC (1, 0, 0, (SCM self, SCM ev)) + { + Listener::unsmob (self)->listen (ev); + return SCM_UNSPECIFIED; + } + bool operator == (Listener const &other) const { return type_ == other.type_