changeset 109962:aa3e4f636621

* 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.
author Michael Albinus <michael.albinus@gmx.de>
date Mon, 23 Aug 2010 15:08:54 +0200
parents 25b9c8c975be
children 8a3f86c30b0c
files lisp/ChangeLog lisp/net/dbus.el
diffstat 2 files changed, 38 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Aug 23 15:02:00 2010 +0200
+++ b/lisp/ChangeLog	Mon Aug 23 15:08:54 2010 +0200
@@ -1,3 +1,13 @@
+2010-08-23  Michael Albinus  <michael.albinus@gmx.de>
+
+	* 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.
+
 2010-08-23  Juanma Barranquero  <lekktu@gmail.com>
 
 	* ido.el (ido-use-virtual-buffers): Fix typo in docstring.
--- a/lisp/net/dbus.el	Mon Aug 23 15:02:00 2010 +0200
+++ b/lisp/net/dbus.el	Mon Aug 23 15:08:54 2010 +0200
@@ -108,15 +108,12 @@
 
 ;;; Hash table of registered functions.
 
-;; We create it here.  So we have a simple test in dbusbind.c, whether
-;; the Lisp code has been loaded.
-(setq dbus-registered-objects-table (make-hash-table :test 'equal))
-
 (defvar dbus-return-values-table (make-hash-table :test 'equal)
   "Hash table for temporary storing arguments of reply messages.
-A key in this hash table is a list (BUS SERIAL).  BUS is either the
-symbol `:system' or the symbol `:session'.  SERIAL is the serial number
-of the reply message.  See `dbus-call-method-non-blocking-handler' and
+A key in this hash table is a list (BUS SERIAL).  BUS is either a
+Lisp symbol, `:system' or `:session', or a string denoting the
+bus address.  SERIAL is the serial number of the reply message.
+See `dbus-call-method-non-blocking-handler' and
 `dbus-call-method-non-blocking'.")
 
 (defun dbus-list-hash-table ()
@@ -187,8 +184,8 @@
 
 (defun dbus-unregister-service (bus service)
   "Unregister all objects related to SERVICE from D-Bus BUS.
-BUS must be either the symbol `:system' or the symbol `:session'.
-SERVICE must be a known service name."
+BUS is either a Lisp symbol, `:system' or `:session', or a string
+denoting the bus address.  SERVICE must be a known service name."
   (maphash
    (lambda (key value)
      (dolist (elt value)
@@ -353,15 +350,15 @@
   (dbus-event BUS TYPE SERIAL SERVICE PATH INTERFACE MEMBER HANDLER &rest ARGS)
 
 BUS identifies the D-Bus the message is coming from.  It is
-either the symbol `:system' or the symbol `:session'.  TYPE is
-the D-Bus message type which has caused the event, SERIAL is the
-serial number of the received D-Bus message.  SERVICE and PATH
-are the unique name and the object path of the D-Bus object
-emitting the message.  INTERFACE and MEMBER denote the message
-which has been sent.  HANDLER is the function which has been
-registered for this message.  ARGS are the arguments passed to
-HANDLER, when it is called during event handling in
-`dbus-handle-event'.
+either a Lisp symbol, `:system' or `:session', or a string
+denoting the bus address.  TYPE is the D-Bus message type which
+has caused the event, SERIAL is the serial number of the received
+D-Bus message.  SERVICE and PATH are the unique name and the
+object path of the D-Bus object emitting the message.  INTERFACE
+and MEMBER denote the message which has been sent.  HANDLER is
+the function which has been registered for this message.  ARGS
+are the arguments passed to HANDLER, when it is called during
+event handling in `dbus-handle-event'.
 
 This function raises a `dbus-error' signal in case the event is
 not well formed."
@@ -369,7 +366,8 @@
   (unless (and (listp event)
 	       (eq (car event) 'dbus-event)
 	       ;; Bus symbol.
-	       (symbolp (nth 1 event))
+	       (or (symbolp (nth 1 event))
+		   (stringp (nth 1 event)))
 	       ;; Type.
 	       (and (natnump (nth 2 event))
 		    (< dbus-message-type-invalid (nth 2 event)))
@@ -434,9 +432,10 @@
 
 (defun dbus-event-bus-name (event)
   "Return the bus name the event is coming from.
-The result is either the symbol `:system' or the symbol `:session'.
-EVENT is a D-Bus event, see `dbus-check-event'.  This function
-raises a `dbus-error' signal in case the event is not well formed."
+The result is either a Lisp symbol, `:system' or `:session', or a
+string denoting the bus address.  EVENT is a D-Bus event, see
+`dbus-check-event'.  This function raises a `dbus-error' signal
+in case the event is not well formed."
   (dbus-check-event event)
   (nth 1 event))
 
@@ -566,10 +565,11 @@
   "Return all interfaces and sub-nodes of SERVICE,
 registered at object path PATH at bus BUS.
 
-BUS must be either the symbol `:system' or the symbol `:session'.
-SERVICE must be a known service name, and PATH must be a valid
-object path.  The last two parameters are strings.  The result,
-the introspection data, is a string in XML format."
+BUS is either a Lisp symbol, `:system' or `:session', or a string
+denoting the bus address.  SERVICE must be a known service name,
+and PATH must be a valid object path.  The last two parameters
+are strings.  The result, the introspection data, is a string in
+XML format."
   ;; We don't want to raise errors.  `dbus-call-method-non-blocking'
   ;; is used, because the handler can be registered in our Emacs
   ;; instance; caller an callee would block each other.
@@ -873,7 +873,8 @@
   (bus service path interface property access value &optional emits-signal)
   "Register property PROPERTY on the D-Bus BUS.
 
-BUS is either the symbol `:system' or the symbol `:session'.
+BUS is either a Lisp symbol, `:system' or `:session', or a string
+denoting the bus address.
 
 SERVICE is the D-Bus service name of the D-Bus.  It must be a
 known name.