diff options
| author | Julien Danjou | 2010-09-25 14:57:02 -0700 |
|---|---|---|
| committer | Glenn Morris | 2010-09-25 14:57:02 -0700 |
| commit | 4234374700a24ff0e5b94bbdb2481ba623c51a32 (patch) | |
| tree | 9d301ae611172d0f61d8cadd94acc9b4b00180ba | |
| parent | ec60da520ebe8cc187ab44e17a3645147b75ec57 (diff) | |
| download | emacs-4234374700a24ff0e5b94bbdb2481ba623c51a32.tar.gz emacs-4234374700a24ff0e5b94bbdb2481ba623c51a32.zip | |
* lisp/notifications.el: Call dbus-register-signal only if it is bound.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/notifications.el | 30 |
2 files changed, 20 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e001afa8979..4840bc4b13b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2010-09-25 Julien Danjou <julien@danjou.info> | ||
| 2 | |||
| 3 | * notifications.el: Call dbus-register-signal only if it is bound. | ||
| 4 | |||
| 1 | 2010-09-25 Glenn Morris <rgm@gnu.org> | 5 | 2010-09-25 Glenn Morris <rgm@gnu.org> |
| 2 | 6 | ||
| 3 | * eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el: | 7 | * eshell/em-alias.el, eshell/em-banner.el, eshell/em-basic.el: |
diff --git a/lisp/notifications.el b/lisp/notifications.el index 68db58e54fa..dc4904db4ca 100644 --- a/lisp/notifications.el +++ b/lisp/notifications.el | |||
| @@ -95,13 +95,14 @@ | |||
| 95 | (funcall (cadr entry) id action) | 95 | (funcall (cadr entry) id action) |
| 96 | (remove entry 'notifications-on-action-map)))) | 96 | (remove entry 'notifications-on-action-map)))) |
| 97 | 97 | ||
| 98 | (dbus-register-signal | 98 | (when (fboundp 'dbus-register-signal) |
| 99 | :session | 99 | (dbus-register-signal |
| 100 | notifications-service | 100 | :session |
| 101 | notifications-path | 101 | notifications-service |
| 102 | notifications-interface | 102 | notifications-path |
| 103 | notifications-action-signal | 103 | notifications-interface |
| 104 | 'notifications-on-action-signal) | 104 | notifications-action-signal |
| 105 | 'notifications-on-action-signal)) | ||
| 105 | 106 | ||
| 106 | (defun notifications-on-closed-signal (id reason) | 107 | (defun notifications-on-closed-signal (id reason) |
| 107 | "Dispatch signals to callback functions from `notifications-on-closed-map'." | 108 | "Dispatch signals to callback functions from `notifications-on-closed-map'." |
| @@ -111,13 +112,14 @@ | |||
| 111 | id (cadr (assoc reason notifications-closed-reason))) | 112 | id (cadr (assoc reason notifications-closed-reason))) |
| 112 | (remove entry 'notifications-on-close-map)))) | 113 | (remove entry 'notifications-on-close-map)))) |
| 113 | 114 | ||
| 114 | (dbus-register-signal | 115 | (when (fboundp 'dbus-register-signal) |
| 115 | :session | 116 | (dbus-register-signal |
| 116 | notifications-service | 117 | :session |
| 117 | notifications-path | 118 | notifications-service |
| 118 | notifications-interface | 119 | notifications-path |
| 119 | notifications-closed-signal | 120 | notifications-interface |
| 120 | 'notifications-on-closed-signal) | 121 | notifications-closed-signal |
| 122 | 'notifications-on-closed-signal)) | ||
| 121 | 123 | ||
| 122 | (defun notifications-notify (&rest params) | 124 | (defun notifications-notify (&rest params) |
| 123 | "Send notification via D-Bus using the Freedesktop notification protocol. | 125 | "Send notification via D-Bus using the Freedesktop notification protocol. |