+2005-03-06 Yoichi NAKAYAMA <yoichi@geiin.org>
+
+ * 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 <lapis-lazuli@pop06.odn.ne.jp>
* modb.el (elmo-msgdb-update-entity): New API and define generic
(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)
(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)
(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))))))))