summaryrefslogtreecommitdiff
path: root/lisp/notifications.el
diff options
context:
space:
mode:
authorJulien Danjou <julien@danjou.info>2010-09-25 14:57:02 -0700
committerGlenn Morris <rgm@gnu.org>2010-09-25 14:57:02 -0700
commit4234374700a24ff0e5b94bbdb2481ba623c51a32 (patch)
tree9d301ae611172d0f61d8cadd94acc9b4b00180ba /lisp/notifications.el
parentec60da520ebe8cc187ab44e17a3645147b75ec57 (diff)
downloademacs-4234374700a24ff0e5b94bbdb2481ba623c51a32.tar.gz
* lisp/notifications.el: Call dbus-register-signal only if it is bound.
Diffstat (limited to 'lisp/notifications.el')
-rw-r--r--lisp/notifications.el30
1 files changed, 16 insertions, 14 deletions
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 @@
(funcall (cadr entry) id action)
(remove entry 'notifications-on-action-map))))
-(dbus-register-signal
- :session
- notifications-service
- notifications-path
- notifications-interface
- notifications-action-signal
- 'notifications-on-action-signal)
+(when (fboundp 'dbus-register-signal)
+ (dbus-register-signal
+ :session
+ notifications-service
+ notifications-path
+ notifications-interface
+ notifications-action-signal
+ 'notifications-on-action-signal))
(defun notifications-on-closed-signal (id reason)
"Dispatch signals to callback functions from `notifications-on-closed-map'."
@@ -111,13 +112,14 @@
id (cadr (assoc reason notifications-closed-reason)))
(remove entry 'notifications-on-close-map))))
-(dbus-register-signal
- :session
- notifications-service
- notifications-path
- notifications-interface
- notifications-closed-signal
- 'notifications-on-closed-signal)
+(when (fboundp 'dbus-register-signal)
+ (dbus-register-signal
+ :session
+ notifications-service
+ notifications-path
+ notifications-interface
+ notifications-closed-signal
+ 'notifications-on-closed-signal))
(defun notifications-notify (&rest params)
"Send notification via D-Bus using the Freedesktop notification protocol.