# HG changeset patch # User Michael Albinus # Date 1233001570 0 # Node ID 5951f5343bb5a6beccb49b7ca2418587349f7b28 # Parent 58326376a152d6abd8cb83fc977f5f7da52a40d9 * net/dbus.el (dbus-event-error-hooks): New variable. (dbus-handle-event): Use it. diff -r 58326376a152 -r 5951f5343bb5 lisp/net/dbus.el --- a/lisp/net/dbus.el Mon Jan 26 20:23:49 2009 +0000 +++ b/lisp/net/dbus.el Mon Jan 26 20:26:10 2009 +0000 @@ -97,6 +97,11 @@ (put 'dbus-ignore-errors 'edebug-form-spec '(form body)) (font-lock-add-keywords 'emacs-lisp-mode '("\\")) +(defvar dbus-event-error-hooks nil + "Functions to be called when a D-Bus error happens in the event handler. +Every function must accept one argument, the error variable +catched in `condition-case' by `dbus-error'.") + ;;; Hash table of registered functions. @@ -374,6 +379,7 @@ (dbus-method-error-internal (nth 1 event) (nth 3 event) (nth 4 event) (cadr err)))) ;; Propagate D-Bus error messages. + (run-hook-with-args 'dbus-event-error-hooks err) (when (or dbus-debug (= dbus-message-type-error (nth 2 event))) (signal (car err) (cdr err))))))