diff options
| author | Michael Albinus | 2010-08-23 15:08:54 +0200 |
|---|---|---|
| committer | Michael Albinus | 2010-08-23 15:08:54 +0200 |
| commit | e73f184c427e7227e23654d167db770a9621e73c (patch) | |
| tree | 85838bbc225d8930b23ada47a0f8b600eb2daa0b | |
| parent | 0c372655438af1e8792d7532e395eb803d5a13bb (diff) | |
| download | emacs-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/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/net/dbus.el | 55 |
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 @@ | |||
| 1 | 2010-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 | |||
| 1 | 2010-08-23 Juanma Barranquero <lekktu@gmail.com> | 11 | 2010-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. |
| 117 | A key in this hash table is a list (BUS SERIAL). BUS is either the | 113 | A key in this hash table is a list (BUS SERIAL). BUS is either a |
| 118 | symbol `:system' or the symbol `:session'. SERIAL is the serial number | 114 | Lisp symbol, `:system' or `:session', or a string denoting the |
| 119 | of the reply message. See `dbus-call-method-non-blocking-handler' and | 115 | bus address. SERIAL is the serial number of the reply message. |
| 116 | See `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. |
| 190 | BUS must be either the symbol `:system' or the symbol `:session'. | 187 | BUS is either a Lisp symbol, `:system' or `:session', or a string |
| 191 | SERVICE must be a known service name." | 188 | denoting 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 | ||
| 355 | BUS identifies the D-Bus the message is coming from. It is | 352 | BUS identifies the D-Bus the message is coming from. It is |
| 356 | either the symbol `:system' or the symbol `:session'. TYPE is | 353 | either a Lisp symbol, `:system' or `:session', or a string |
| 357 | the D-Bus message type which has caused the event, SERIAL is the | 354 | denoting the bus address. TYPE is the D-Bus message type which |
| 358 | serial number of the received D-Bus message. SERVICE and PATH | 355 | has caused the event, SERIAL is the serial number of the received |
| 359 | are the unique name and the object path of the D-Bus object | 356 | D-Bus message. SERVICE and PATH are the unique name and the |
| 360 | emitting the message. INTERFACE and MEMBER denote the message | 357 | object path of the D-Bus object emitting the message. INTERFACE |
| 361 | which has been sent. HANDLER is the function which has been | 358 | and MEMBER denote the message which has been sent. HANDLER is |
| 362 | registered for this message. ARGS are the arguments passed to | 359 | the function which has been registered for this message. ARGS |
| 363 | HANDLER, when it is called during event handling in | 360 | are the arguments passed to HANDLER, when it is called during |
| 364 | `dbus-handle-event'. | 361 | event handling in `dbus-handle-event'. |
| 365 | 362 | ||
| 366 | This function raises a `dbus-error' signal in case the event is | 363 | This function raises a `dbus-error' signal in case the event is |
| 367 | not well formed." | 364 | not 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. |
| 437 | The result is either the symbol `:system' or the symbol `:session'. | 435 | The result is either a Lisp symbol, `:system' or `:session', or a |
| 438 | EVENT is a D-Bus event, see `dbus-check-event'. This function | 436 | string denoting the bus address. EVENT is a D-Bus event, see |
| 439 | raises a `dbus-error' signal in case the event is not well formed." | 437 | `dbus-check-event'. This function raises a `dbus-error' signal |
| 438 | in 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, |
| 567 | registered at object path PATH at bus BUS. | 566 | registered at object path PATH at bus BUS. |
| 568 | 567 | ||
| 569 | BUS must be either the symbol `:system' or the symbol `:session'. | 568 | BUS is either a Lisp symbol, `:system' or `:session', or a string |
| 570 | SERVICE must be a known service name, and PATH must be a valid | 569 | denoting the bus address. SERVICE must be a known service name, |
| 571 | object path. The last two parameters are strings. The result, | 570 | and PATH must be a valid object path. The last two parameters |
| 572 | the introspection data, is a string in XML format." | 571 | are strings. The result, the introspection data, is a string in |
| 572 | XML 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 | ||
| 876 | BUS is either the symbol `:system' or the symbol `:session'. | 876 | BUS is either a Lisp symbol, `:system' or `:session', or a string |
| 877 | denoting the bus address. | ||
| 877 | 878 | ||
| 878 | SERVICE is the D-Bus service name of the D-Bus. It must be a | 879 | SERVICE is the D-Bus service name of the D-Bus. It must be a |
| 879 | known name. | 880 | known name. |