From: yoichi Date: Sun, 6 Mar 2005 14:20:48 +0000 (+0000) Subject: * elmo-signal.el (elmo-connect-signal): Document. X-Git-Tag: wl-2_14-root~9 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b840fec90087e0421b8f6fdd4d92730f0d0e950;p=elisp%2Fwanderlust.git * elmo-signal.el (elmo-connect-signal): Document. (elmo-emit-signal): Ditto. (elmo-emit-signal): It should pass source argument to filter and handler, not slot-source. --- diff --git a/elmo/ChangeLog b/elmo/ChangeLog index ba4d96a..ba7bcc8 100644 --- a/elmo/ChangeLog +++ b/elmo/ChangeLog @@ -1,3 +1,10 @@ +2005-03-06 Yoichi NAKAYAMA + + * elmo-signal.el (elmo-connect-signal): Document. + (elmo-emit-signal): Ditto. + (elmo-emit-signal): It should pass source argument to filter and + handler, not slot-source. + 2005-03-05 Hiroya Murata * modb.el (elmo-msgdb-update-entity): New API and define generic diff --git a/elmo/elmo-signal.el b/elmo/elmo-signal.el index afb8af4..2c15333 100644 --- a/elmo/elmo-signal.el +++ b/elmo/elmo-signal.el @@ -135,7 +135,11 @@ This function is for internal use only." (defun elmo-connect-signal (source signal-name listener function &optional filter handback) - "Add FUNCTION as a listener of a signal identified by SIGNAL-NAME." + "Add FUNCTION as a listener of a signal identified by SIGNAL-NAME. +If SOURCE has non-nil value, FUNCTION will be invoked only if SOURCE is same as +source argument of `elmo-emit-signal'. Comparison is done with `eq'. If SOURCE +is nil, react on signals from any sources. +You can specify further filter function by FILTER." (let ((symbol (intern (symbol-name signal-name) elmo-signal-slot-obarray))) (set symbol (cons (elmo-make-slot source listener function filter handback) (if (boundp symbol) @@ -158,7 +162,7 @@ This function is for internal use only." (fillarray elmo-signal-slot-obarray 0)) (defun elmo-emit-signal (signal-name source &rest args) - "Emit SIGNAL." + "Emit signal with SIGNAL-NAME." (let ((symbol (intern-soft (symbol-name signal-name) elmo-signal-slot-obarray)) signal) @@ -171,11 +175,11 @@ This function is for internal use only." (ignore-errors (funcall (elmo-slot-filter slot) (elmo-slot-listener slot) - (elmo-slot-source slot) + source args)))) (funcall (elmo-slot-function slot) (elmo-slot-listener slot) - (elmo-slot-source slot) + source args (elmo-slot-handback slot))))))))