From 56b9ff8b24c5d762190701e7bf2bb6cc0e4937a8 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 9 Jun 2010 22:57:18 +0200 Subject: [PATCH] Passes notification id as argument of on-action and on-close functions Signed-off-by: Julien Danjou --- lisp/net/notifications.el | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/net/notifications.el b/lisp/net/notifications.el index a2147ed..8d897eb 100644 --- a/lisp/net/notifications.el +++ b/lisp/net/notifications.el @@ -87,7 +87,7 @@ (defun notifications-on-action-signal (id action) (let ((entry (assoc id notifications-on-action-map))) (when entry - (funcall (cadr entry) action) + (funcall (cadr entry) id action) (remove entry 'notifications-on-action-map)))) (dbus-register-signal @@ -101,7 +101,7 @@ (defun notifications-on-closed-signal (id reason) (let ((entry (assoc id notifications-on-close-map))) (when entry - (funcall (cadr entry) (cadr (assoc reason notifications-closed-reason))) + (funcall (cadr entry) id (cadr (assoc reason notifications-closed-reason))) (remove entry 'notifications-on-close-map)))) (dbus-register-signal @@ -153,11 +153,13 @@ Various PARAMS can be set: should point to. The \"y\" hint must also be specified. :y Specifies the Y location on the screen that the notification should point to. The \"x\" hint must also be specified. - :on-action Function to call when an action is invoked. The key of the - action is passed as argument to the function. + :on-action Function to call when an action is invoked. + The notification id and the key of the action are passed + as arguments to the function. :on-close Function to call when the notification has been closed by timeout or by the user. - The function receive the closing reason as argument: + The function receive the notification id and the closing + reason as arguments: - `expired' if the notification has expired - `dismissed' if the notification was dismissed by the user - `close-notification' if the notification was closed -- 1.7.1