From e12c189f6603088a38752c4f7dea34d5a37e5279 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Mon, 26 Jan 2009 20:26:52 +0000 Subject: [PATCH] * net/dbus.el (dbus-event-error-hooks): New variable. (dbus-handle-event): Use it. --- lisp/ChangeLog | 5 +++++ lisp/net/dbus.el | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 141ea0dd53e..8dbaebaf440 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-01-26 Michael Albinus + + * net/dbus.el (dbus-event-error-hooks): New variable. + (dbus-handle-event): Use it. + 2009-01-26 Glenn Morris * Makefile.in (ELCFILES): Update. diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index ee20db9ac34..39247b0b62d 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el @@ -97,6 +97,11 @@ Otherwise, return result of last form in BODY, or all other errors." (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 @@ If the HANDLER returns an `dbus-error', it is propagated as return message." (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)))))) -- 2.39.5