aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2010-08-23 15:08:54 +0200
committerMichael Albinus2010-08-23 15:08:54 +0200
commite73f184c427e7227e23654d167db770a9621e73c (patch)
tree85838bbc225d8930b23ada47a0f8b600eb2daa0b
parent0c372655438af1e8792d7532e395eb803d5a13bb (diff)
downloademacs-e73f184c427e7227e23654d167db770a9621e73c.tar.gz
emacs-e73f184c427e7227e23654d167db770a9621e73c.zip
* net/dbus.el: Accept UNIX domain sockets as bus address.
(top): Don't initialize `dbus-registered-objects-table' anymore, this is done in dbusbind,c. (dbus-check-event): Adapt test for bus. (dbus-return-values-table, dbus-unregister-service) (dbus-event-bus-name, dbus-introspect, dbus-register-property): Adapt doc string.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/net/dbus.el55
2 files changed, 38 insertions, 27 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e3be318395a..1402c45b125 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12010-08-23 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/dbus.el: Accept UNIX domain sockets as bus address.
4 (top): Don't initialize `dbus-registered-objects-table' anymore,
5 this is done in dbusbind,c.
6 (dbus-check-event): Adapt test for bus.
7 (dbus-return-values-table, dbus-unregister-service)
8 (dbus-event-bus-name, dbus-introspect, dbus-register-property):
9 Adapt doc string.
10
12010-08-23 Juanma Barranquero <lekktu@gmail.com> 112010-08-23 Juanma Barranquero <lekktu@gmail.com>
2 12
3 * ido.el (ido-use-virtual-buffers): Fix typo in docstring. 13 * ido.el (ido-use-virtual-buffers): Fix typo in docstring.
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index 870bd2e313d..ee876e04190 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -108,15 +108,12 @@ catched in `condition-case' by `dbus-error'.")
108 108
109;;; Hash table of registered functions. 109;;; Hash table of registered functions.
110 110
111;; We create it here. So we have a simple test in dbusbind.c, whether
112;; the Lisp code has been loaded.
113(setq dbus-registered-objects-table (make-hash-table :test 'equal))
114
115(defvar dbus-return-values-table (make-hash-table :test 'equal) 111(defvar dbus-return-values-table (make-hash-table :test 'equal)
116 "Hash table for temporary storing arguments of reply messages. 112 "Hash table for temporary storing arguments of reply messages.
117A key in this hash table is a list (BUS SERIAL). BUS is either the 113A key in this hash table is a list (BUS SERIAL). BUS is either a
118symbol `:system' or the symbol `:session'. SERIAL is the serial number 114Lisp symbol, `:system' or `:session', or a string denoting the
119of the reply message. See `dbus-call-method-non-blocking-handler' and 115bus address. SERIAL is the serial number of the reply message.
116See `dbus-call-method-non-blocking-handler' and
120`dbus-call-method-non-blocking'.") 117`dbus-call-method-non-blocking'.")
121 118
122(defun dbus-list-hash-table () 119(defun dbus-list-hash-table ()
@@ -187,8 +184,8 @@ association to the service from D-Bus."
187 184
188(defun dbus-unregister-service (bus service) 185(defun dbus-unregister-service (bus service)
189 "Unregister all objects related to SERVICE from D-Bus BUS. 186 "Unregister all objects related to SERVICE from D-Bus BUS.
190BUS must be either the symbol `:system' or the symbol `:session'. 187BUS is either a Lisp symbol, `:system' or `:session', or a string
191SERVICE must be a known service name." 188denoting the bus address. SERVICE must be a known service name."
192 (maphash 189 (maphash
193 (lambda (key value) 190 (lambda (key value)
194 (dolist (elt value) 191 (dolist (elt value)
@@ -353,15 +350,15 @@ EVENT is a list which starts with symbol `dbus-event':
353 (dbus-event BUS TYPE SERIAL SERVICE PATH INTERFACE MEMBER HANDLER &rest ARGS) 350 (dbus-event BUS TYPE SERIAL SERVICE PATH INTERFACE MEMBER HANDLER &rest ARGS)
354 351
355BUS identifies the D-Bus the message is coming from. It is 352BUS identifies the D-Bus the message is coming from. It is
356either the symbol `:system' or the symbol `:session'. TYPE is 353either a Lisp symbol, `:system' or `:session', or a string
357the D-Bus message type which has caused the event, SERIAL is the 354denoting the bus address. TYPE is the D-Bus message type which
358serial number of the received D-Bus message. SERVICE and PATH 355has caused the event, SERIAL is the serial number of the received
359are the unique name and the object path of the D-Bus object 356D-Bus message. SERVICE and PATH are the unique name and the
360emitting the message. INTERFACE and MEMBER denote the message 357object path of the D-Bus object emitting the message. INTERFACE
361which has been sent. HANDLER is the function which has been 358and MEMBER denote the message which has been sent. HANDLER is
362registered for this message. ARGS are the arguments passed to 359the function which has been registered for this message. ARGS
363HANDLER, when it is called during event handling in 360are the arguments passed to HANDLER, when it is called during
364`dbus-handle-event'. 361event handling in `dbus-handle-event'.
365 362
366This function raises a `dbus-error' signal in case the event is 363This function raises a `dbus-error' signal in case the event is
367not well formed." 364not well formed."
@@ -369,7 +366,8 @@ not well formed."
369 (unless (and (listp event) 366 (unless (and (listp event)
370 (eq (car event) 'dbus-event) 367 (eq (car event) 'dbus-event)
371 ;; Bus symbol. 368 ;; Bus symbol.
372 (symbolp (nth 1 event)) 369 (or (symbolp (nth 1 event))
370 (stringp (nth 1 event)))
373 ;; Type. 371 ;; Type.
374 (and (natnump (nth 2 event)) 372 (and (natnump (nth 2 event))
375 (< dbus-message-type-invalid (nth 2 event))) 373 (< dbus-message-type-invalid (nth 2 event)))
@@ -434,9 +432,10 @@ If the HANDLER returns a `dbus-error', it is propagated as return message."
434 432
435(defun dbus-event-bus-name (event) 433(defun dbus-event-bus-name (event)
436 "Return the bus name the event is coming from. 434 "Return the bus name the event is coming from.
437The result is either the symbol `:system' or the symbol `:session'. 435The result is either a Lisp symbol, `:system' or `:session', or a
438EVENT is a D-Bus event, see `dbus-check-event'. This function 436string denoting the bus address. EVENT is a D-Bus event, see
439raises a `dbus-error' signal in case the event is not well formed." 437`dbus-check-event'. This function raises a `dbus-error' signal
438in case the event is not well formed."
440 (dbus-check-event event) 439 (dbus-check-event event)
441 (nth 1 event)) 440 (nth 1 event))
442 441
@@ -566,10 +565,11 @@ apply
566 "Return all interfaces and sub-nodes of SERVICE, 565 "Return all interfaces and sub-nodes of SERVICE,
567registered at object path PATH at bus BUS. 566registered at object path PATH at bus BUS.
568 567
569BUS must be either the symbol `:system' or the symbol `:session'. 568BUS is either a Lisp symbol, `:system' or `:session', or a string
570SERVICE must be a known service name, and PATH must be a valid 569denoting the bus address. SERVICE must be a known service name,
571object path. The last two parameters are strings. The result, 570and PATH must be a valid object path. The last two parameters
572the introspection data, is a string in XML format." 571are strings. The result, the introspection data, is a string in
572XML format."
573 ;; We don't want to raise errors. `dbus-call-method-non-blocking' 573 ;; We don't want to raise errors. `dbus-call-method-non-blocking'
574 ;; is used, because the handler can be registered in our Emacs 574 ;; is used, because the handler can be registered in our Emacs
575 ;; instance; caller an callee would block each other. 575 ;; instance; caller an callee would block each other.
@@ -873,7 +873,8 @@ name of the property, and its value. If there are no properties,
873 (bus service path interface property access value &optional emits-signal) 873 (bus service path interface property access value &optional emits-signal)
874 "Register property PROPERTY on the D-Bus BUS. 874 "Register property PROPERTY on the D-Bus BUS.
875 875
876BUS is either the symbol `:system' or the symbol `:session'. 876BUS is either a Lisp symbol, `:system' or `:session', or a string
877denoting the bus address.
877 878
878SERVICE is the D-Bus service name of the D-Bus. It must be a 879SERVICE is the D-Bus service name of the D-Bus. It must be a
879known name. 880known name.