* notifications.el (notifications-on-closed-signal): Make `reason'
authorMichael Albinus <michael.albinus@gmx.de>
Tue, 7 Feb 2012 09:06:19 +0000 (10:06 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Tue, 7 Feb 2012 09:06:19 +0000 (10:06 +0100)
  optional.  (Bug#10744)

lisp/ChangeLog
lisp/notifications.el

index f69b94f..e04126b 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-07  Michael Albinus  <michael.albinus@gmx.de>
+
+       * notifications.el (notifications-on-closed-signal): Make `reason'
+       optional.  (Bug#10744)
+
 2012-02-07  Glenn Morris  <rgm@gnu.org>
 
        * emacs-lisp/easy-mmode.el (define-minor-mode):
index c3b6c75..9f7576b 100644 (file)
    notifications-action-signal
    'notifications-on-action-signal))
 
-(defun notifications-on-closed-signal (id reason)
+(defun notifications-on-closed-signal (id &optional reason)
   "Dispatch signals to callback functions from `notifications-on-closed-map'."
-  (let ((entry (assoc id notifications-on-close-map)))
+  ;; notification-daemon prior 0.4.0 does not send a reason.  So we
+  ;; make it optional, and assume `undefined' as default.
+  (let ((entry (assoc id notifications-on-close-map))
+       (reason (or reason 4)))
     (when entry
       (funcall (cadr entry)
               id (cadr (assoc reason notifications-closed-reason)))