]> git.eshelyaron.com Git - emacs.git/commitdiff
* net/dbus.el (dbus-hash-table=): Allow nil as wildcard in the
authorMichael Albinus <michael.albinus@gmx.de>
Wed, 5 Dec 2007 21:59:12 +0000 (21:59 +0000)
committerMichael Albinus <michael.albinus@gmx.de>
Wed, 5 Dec 2007 21:59:12 +0000 (21:59 +0000)
interface and member fields.

lisp/ChangeLog
lisp/net/dbus.el

index c6b9997ea770e89a1ef12a9875fcc0c4b2db1471..c334edd6001dc31dda8ac87431c82304ad4406a5 100644 (file)
@@ -1,3 +1,8 @@
+2007-12-05  Michael Albinus  <michael.albinus@gmx.de>
+
+       * net/dbus.el (dbus-hash-table=): Allow nil as wildcard in the
+       interface and member fields.
+
 2007-12-05  Glenn Morris  <rgm@gnu.org>
 
        * eshell/em-alias.el (pcomplete-stub): Define for compiler.
index 8dd17bfea4c9215695a70bd7a153b72e2d86adcd..9221c52a08277c539b5181a140cf2145e9b0265c 100644 (file)
@@ -55,15 +55,24 @@ See `dbus-registered-functions-table' for a description of the hash table."
   (and
    (listp x) (listp y)
    ;; Bus symbol, either :system or :session.
-   (symbolp (car x)) (symbolp (car y)) (equal  (car x) (car y))
+   (symbolp (car x)) (symbolp (car y)) (equal (car x) (car y))
    ;; Interface.
-   (stringp (cadr x)) (stringp (cadr y)) (string-equal  (cadr x) (cadr y))
+   (or
+    (null (cadr x)) (null (cadr y)) ; wildcard
+    (and
+     (stringp (cadr x)) (stringp (cadr y)) (string-equal (cadr x) (cadr y))))
    ;; Member.
-   (stringp (caddr x)) (stringp (caddr y)) (string-equal  (caddr x) (caddr y))))
+   (or
+    (null (caddr x)) (null (caddr y)) ; wildcard
+    (and
+     (stringp (caddr x)) (stringp (caddr y))
+     (string-equal (caddr x) (caddr y))))))
 
-(define-hash-table-test 'dbus-hash-table-test
-  'dbus-hash-table= 'sxhash)
+(define-hash-table-test 'dbus-hash-table-test 'dbus-hash-table= 'sxhash)
 
+;; When we assume that interface and and member are always strings in
+;; the key, we could use `equal' as test function.  But we want to
+;; have also `nil' there, being a wildcard.
 (setq dbus-registered-functions-table
       (make-hash-table :test 'dbus-hash-table-test))