aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2012-11-07 17:55:39 +0100
committerMichael Albinus2012-11-07 17:55:39 +0100
commit499a0f7a985e28139433a3028f8edd7eca445d2c (patch)
tree11215673c2d4d86b1935ecfb088b7cd15e504940
parenteb147960b1b4a42737f31afe1c0e70c6216812b6 (diff)
downloademacs-499a0f7a985e28139433a3028f8edd7eca445d2c.tar.gz
emacs-499a0f7a985e28139433a3028f8edd7eca445d2c.zip
* notifications.el (notifications-get-server-information-method):
New defconst. (notifications-get-capabilities): Fix docstring. (notifications-get-server-information): New defun.
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/notifications.el33
2 files changed, 36 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 31f300b542d..7c51b139ec3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12012-11-07 Michael Albinus <michael.albinus@gmx.de>
2
3 * notifications.el (notifications-get-server-information-method):
4 New defconst.
5 (notifications-get-capabilities): Fix docstring.
6 (notifications-get-server-information): New defun.
7
12012-11-06 Agustín Martín Domingo <agustin.martin@hispalinux.es> 82012-11-06 Agustín Martín Domingo <agustin.martin@hispalinux.es>
2 9
3 * textmodes/ispell.el (ispell-region): Standard re-indent for better 10 * textmodes/ispell.el (ispell-region): Standard re-indent for better
diff --git a/lisp/notifications.el b/lisp/notifications.el
index 792298c26b7..6f477eb4cdd 100644
--- a/lisp/notifications.el
+++ b/lisp/notifications.el
@@ -66,6 +66,9 @@
66(defconst notifications-get-capabilities-method "GetCapabilities" 66(defconst notifications-get-capabilities-method "GetCapabilities"
67 "D-Bus notifications get capabilities method.") 67 "D-Bus notifications get capabilities method.")
68 68
69(defconst notifications-get-server-information-method "GetServerInformation"
70 "D-Bus notifications get server information method.")
71
69(defconst notifications-action-signal "ActionInvoked" 72(defconst notifications-action-signal "ActionInvoked"
70 "D-Bus notifications action signal.") 73 "D-Bus notifications action signal.")
71 74
@@ -349,7 +352,7 @@ BUS can be a string denoting a D-Bus connection, the default is `:session'."
349(defvar dbus-debug) ; used in the macroexpansion of dbus-ignore-errors 352(defvar dbus-debug) ; used in the macroexpansion of dbus-ignore-errors
350 353
351(defun notifications-get-capabilities (&optional bus) 354(defun notifications-get-capabilities (&optional bus)
352 "Return the capabilities of the notification server, a list of strings. 355 "Return the capabilities of the notification server, a list of symbols.
353BUS can be a string denoting a D-Bus connection, the default is `:session'. 356BUS can be a string denoting a D-Bus connection, the default is `:session'.
354The following capabilities can be expected: 357The following capabilities can be expected:
355 358
@@ -371,12 +374,34 @@ The following capabilities can be expected:
371 374
372Further vendor-specific caps start with `:x-vendor', like `:x-gnome-foo-cap'." 375Further vendor-specific caps start with `:x-vendor', like `:x-gnome-foo-cap'."
373 (dbus-ignore-errors 376 (dbus-ignore-errors
374 (mapcar 377 (mapcar
375 (lambda (x) (intern (concat ":" x))) 378 (lambda (x) (intern (concat ":" x)))
379 (dbus-call-method (or bus :session)
380 notifications-service
381 notifications-path
382 notifications-interface
383 notifications-get-capabilities-method))))
384
385(defun notifications-get-server-information (&optional bus)
386 "Return information on the notification server, a list of strings.
387BUS can be a string denoting a D-Bus connection, the default is `:session'.
388The returned list is (NAME VENDOR VERSION SPEC-VERSION).
389
390 NAME The product name of the server.
391 VENDOR The vendor name. For example, \"KDE\", \"GNOME\".
392 VERSION The server's version number.
393 SPEC-VERSION The specification version the server is compliant with.
394
395If SPEC_VERSION is missing, the server supports a specification
396prior to \"1.0\".
397
398See `notifications-specification-version' for the specification
399version this library is compliant with."
400 (dbus-ignore-errors
376 (dbus-call-method (or bus :session) 401 (dbus-call-method (or bus :session)
377 notifications-service 402 notifications-service
378 notifications-path 403 notifications-path
379 notifications-interface 404 notifications-interface
380 notifications-get-capabilities-method)))) 405 notifications-get-server-information-method)))
381 406
382(provide 'notifications) 407(provide 'notifications)