# HG changeset patch # User Michael Albinus # Date 1196891952 0 # Node ID 6cb7edfb2f4e80364c7201f88d09db4f1f918904 # Parent 1ddad0de60e5d9179e6c33332d0942bee447530f * net/dbus.el (dbus-hash-table=): Allow nil as wildcard in the interface and member fields. diff -r 1ddad0de60e5 -r 6cb7edfb2f4e lisp/ChangeLog --- a/lisp/ChangeLog Wed Dec 05 21:53:40 2007 +0000 +++ b/lisp/ChangeLog Wed Dec 05 21:59:12 2007 +0000 @@ -1,3 +1,8 @@ +2007-12-05 Michael Albinus + + * net/dbus.el (dbus-hash-table=): Allow nil as wildcard in the + interface and member fields. + 2007-12-05 Glenn Morris * eshell/em-alias.el (pcomplete-stub): Define for compiler. diff -r 1ddad0de60e5 -r 6cb7edfb2f4e lisp/net/dbus.el --- a/lisp/net/dbus.el Wed Dec 05 21:53:40 2007 +0000 +++ b/lisp/net/dbus.el Wed Dec 05 21:59:12 2007 +0000 @@ -55,15 +55,24 @@ (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))