# HG changeset patch # User Michael Albinus # Date 1197844967 0 # Node ID eed31b4b1ca4f4405bf030fa230a104953b66489 # Parent 710ac69daf1f2c258b400c252c8175aa05f2e0be * net/dbus.el (dbus-name-owner-changed-handler): Use `dbus-unregister-signal' for removing old rules. Obey new structure of `dbus-registered-functions-table'. diff -r 710ac69daf1f -r eed31b4b1ca4 lisp/ChangeLog --- a/lisp/ChangeLog Sun Dec 16 22:36:47 2007 +0000 +++ b/lisp/ChangeLog Sun Dec 16 22:42:47 2007 +0000 @@ -1,3 +1,9 @@ +2007-12-16 Michael Albinus + + * net/dbus.el (dbus-name-owner-changed-handler): Use + `dbus-unregister-signal' for removing old rules. Obey new + structure of `dbus-registered-functions-table'. + 2007-12-12 Thien-Thi Nguyen * progmodes/cc-vars.el (defcustom-c-stylevar): Rewrite. diff -r 710ac69daf1f -r eed31b4b1ca4 lisp/net/dbus.el --- a/lisp/net/dbus.el Sun Dec 16 22:36:47 2007 +0000 +++ b/lisp/net/dbus.el Sun Dec 16 22:42:47 2007 +0000 @@ -79,21 +79,17 @@ '(lambda (key value) (dolist (elt value) ;; key has the structure (BUS INTERFACE SIGNAL). - ;; elt has the structure (SERVICE UNAME PATH HANDLER). - (when (string-equal old-owner (cadr elt)) + ;; elt has the structure (UNAME SERVICE PATH HANDLER). + (when (string-equal old-owner (car elt)) ;; Remove old key, and add new entry with changed name. - (when dbus-debug (message "Remove rule for %s %s" key elt)) - ;(dbus-unregister-signal key) - (setcar (cdr elt) new-owner) - (when dbus-debug (message "Add rule for %s %s" key elt)) + (dbus-unregister-signal (list key (cdr elt))) ;; Maybe we could arrange the lists a little bit better ;; that we don't need to extract every single element? - (when (not (zerop (length new-owner))) - (dbus-register-signal - ;; BUS SERVICE PATH - (nth 0 key) (nth 0 elt) (nth 2 elt) - ;; INTERFACE SIGNAL HANDLER - (nth 1 key) (nth 2 key) (nth 3 elt)))))) + (dbus-register-signal + ;; BUS SERVICE PATH + (nth 0 key) (nth 1 elt) (nth 2 elt) + ;; INTERFACE SIGNAL HANDLER + (nth 1 key) (nth 2 key) (nth 3 elt))))) (copy-hash-table dbus-registered-functions-table))))) ;; Register the handler.