comparison doc/misc/dbus.texi @ 101617:bb28e4b4c12c

* dbus.texi (Errors and Events): Fix typos. Describe second parameter of hook functions.
author Michael Albinus <michael.albinus@gmx.de>
date Wed, 28 Jan 2009 16:07:07 +0000
parents 7b5ca0afd795
children 9bcea07061a8
comparison
equal deleted inserted replaced
101616:3fd27701bdb1 101617:bb28e4b4c12c
1523 @defun dbus-event-path-name event 1523 @defun dbus-event-path-name event
1524 Returns the object path of the D-Bus object @var{event} is coming from. 1524 Returns the object path of the D-Bus object @var{event} is coming from.
1525 @end defun 1525 @end defun
1526 1526
1527 @defun dbus-event-interface-name event 1527 @defun dbus-event-interface-name event
1528 Returns the interface name of of the D-Bus object @var{event} is coming from. 1528 Returns the interface name of the D-Bus object @var{event} is coming from.
1529 @end defun 1529 @end defun
1530 1530
1531 @defun dbus-event-member-name event 1531 @defun dbus-event-member-name event
1532 Returns the member name of of the D-Bus object @var{event} is coming 1532 Returns the member name of the D-Bus object @var{event} is coming
1533 from. It is either a signal name or a method name. 1533 from. It is either a signal name or a method name.
1534 @end defun 1534 @end defun
1535 1535
1536 D-Bus errors are not propagated during event handling, because it is 1536 D-Bus errors are not propagated during event handling, because it is
1537 usually not desired. D-Bus errors in events can be made visible by 1537 usually not desired. D-Bus errors in events can be made visible by
1539 handled by a hook function. 1539 handled by a hook function.
1540 1540
1541 @defvar dbus-event-error-hooks 1541 @defvar dbus-event-error-hooks
1542 This hook variable keeps a list of functions, which are called when a 1542 This hook variable keeps a list of functions, which are called when a
1543 D-Bus error happens in the event handler. Every function must accept 1543 D-Bus error happens in the event handler. Every function must accept
1544 one argument, the error variable catched in @code{condition-case} by 1544 two arguments, the event and the error variable catched in
1545 @code{dbus-error}. Example: 1545 @code{condition-case} by @code{dbus-error}.
1546 1546
1547 @lisp 1547 Such functions can be used the adapt the error signal to be raised.
1548 (defun my-dbus-event-error-handler (err) 1548 Example:
1549 (message "my-dbus-event-error-handler: %S" (cadr err))) 1549
1550 @lisp
1551 (defun my-dbus-event-error-handler (event error)
1552 (when (string-equal (concat dbus-service-emacs ".FileManager")
1553 (dbus-event-interface-name event))
1554 (message "my-dbus-event-error-handler: %S %S" event error)
1555 (signal 'file-error (cdr error))))
1550 1556
1551 (add-hook 'dbus-event-error-hooks 'my-dbus-event-error-handler) 1557 (add-hook 'dbus-event-error-hooks 'my-dbus-event-error-handler)
1552 @end lisp 1558 @end lisp
1553 @end defvar 1559 @end defvar
1560
1561 Hook functions shall take into account, that there might be other
1562 D-Bus applications running. Therefore, they shall check carefully,
1563 whether a given D-Bus error is related to them.
1554 1564
1555 1565
1556 @node GNU Free Documentation License 1566 @node GNU Free Documentation License
1557 @appendix GNU Free Documentation License 1567 @appendix GNU Free Documentation License
1558 @include doclicense.texi 1568 @include doclicense.texi