diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2009-01-28 16:07:33 +0000 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2009-01-28 16:07:33 +0000 |
commit | 74fc50477b4ee46026a4418d3682c30187130efe (patch) | |
tree | 8ac3f69c8dac7bb8400bb66c27a2537baca6e4ce /doc | |
parent | 8372c367bd2829d8c8a45d95c5446dfd915f6495 (diff) | |
download | emacs-74fc50477b4ee46026a4418d3682c30187130efe.tar.gz |
* dbus.texi (Errors and Events): Fix typos. Describe second parameter
of hook functions.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/misc/ChangeLog | 5 | ||||
-rw-r--r-- | doc/misc/dbus.texi | 22 |
2 files changed, 21 insertions, 6 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index 0155df5acd2..7f6b4c3f325 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog @@ -1,3 +1,8 @@ +2009-01-28 Michael Albinus <michael.albinus@gmx.de> + + * dbus.texi (Errors and Events): Fix typos. Describe second parameter + of hook functions. + 2009-01-28 Carsten Dominik <dominik@science.uva.nl> * org.texi (TODO dependencies): New section. diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi index a6d042a8500..c012647144e 100644 --- a/doc/misc/dbus.texi +++ b/doc/misc/dbus.texi @@ -1525,11 +1525,11 @@ Returns the object path of the D-Bus object @var{event} is coming from. @end defun @defun dbus-event-interface-name event -Returns the interface name of of the D-Bus object @var{event} is coming from. +Returns the interface name of the D-Bus object @var{event} is coming from. @end defun @defun dbus-event-member-name event -Returns the member name of of the D-Bus object @var{event} is coming +Returns the member name of the D-Bus object @var{event} is coming from. It is either a signal name or a method name. @end defun @@ -1541,17 +1541,27 @@ handled by a hook function. @defvar dbus-event-error-hooks This hook variable keeps a list of functions, which are called when a D-Bus error happens in the event handler. Every function must accept -one argument, the error variable catched in @code{condition-case} by -@code{dbus-error}. Example: +two arguments, the event and the error variable catched in +@code{condition-case} by @code{dbus-error}. + +Such functions can be used the adapt the error signal to be raised. +Example: @lisp -(defun my-dbus-event-error-handler (err) - (message "my-dbus-event-error-handler: %S" (cadr err))) +(defun my-dbus-event-error-handler (event error) + (when (string-equal (concat dbus-service-emacs ".FileManager") + (dbus-event-interface-name event)) + (message "my-dbus-event-error-handler: %S %S" event error) + (signal 'file-error (cdr error)))) (add-hook 'dbus-event-error-hooks 'my-dbus-event-error-handler) @end lisp @end defvar +Hook functions shall take into account, that there might be other +D-Bus applications running. Therefore, they shall check carefully, +whether a given D-Bus error is related to them. + @node GNU Free Documentation License @appendix GNU Free Documentation License |