diff lisp/notifications.el @ 110581:f215ea324ebd

* lisp/notifications.el: Call dbus-register-signal only if it is bound.
author Glenn Morris <rgm@gnu.org>
date Sat, 25 Sep 2010 14:57:02 -0700
parents 14e479cda1d2
children 6378d1b57038
line wrap: on
line diff
--- a/lisp/notifications.el	Sat Sep 25 14:51:55 2010 -0700
+++ b/lisp/notifications.el	Sat Sep 25 14:57:02 2010 -0700
@@ -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.