]> code.delx.au - gnu-emacs/blobdiff - lisp/notifications.el
* lisp/comint.el (comint-dynamic-complete-as-filename)
[gnu-emacs] / lisp / notifications.el
index 68db58e54faa818557dddf4e13f98360da7f0d84..adb9fdd641a0fcce1431f2543abd0d329789abc8 100644 (file)
@@ -1,6 +1,6 @@
 ;;; notifications.el --- Client interface to desktop notifications.
 
-;; Copyright (C) 2010 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2011 Free Software Foundation, Inc.
 
 ;; Author: Julien Danjou <julien@danjou.info>
 ;; Keywords: comm desktop notifications
       (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'."
               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.
@@ -208,8 +210,8 @@ used to manipulate the notification item with
       (add-to-list 'hints `(:dict-entry
                             "urgency"
                             (:variant :byte ,(case urgency
-                                               ('low 0)
-                                               ('critical 2)
+                                               (low 0)
+                                               (critical 2)
                                                (t 1)))) t))
     (when category
       (add-to-list 'hints `(:dict-entry