1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-03 10:31:37 -08:00

* net/dbus.el (dbus-call-method): Restore events not from D-Bus. (Bug#11447)

This commit is contained in:
Michael Albinus 2012-05-13 11:05:04 +02:00
parent e5bd0a2895
commit 205a7391f7
2 changed files with 13 additions and 6 deletions

View file

@ -1,3 +1,8 @@
2012-05-13 Michael Albinus <michael.albinus@gmx.de>
* net/dbus.el (dbus-call-method): Restore events not from D-Bus.
(Bug#11447)
2012-05-13 Stefan Monnier <monnier@iro.umontreal.ca>
Move define-obsolete-variable-alias before the var's definition.

View file

@ -263,12 +263,16 @@ object is returned instead of a list containing this single Lisp object.
(apply
'dbus-message-internal dbus-message-type-method-call
bus service path interface method 'dbus-call-method-handler args)))
;; Wait until `dbus-call-method-handler' has put the result into
;; `dbus-return-values-table'. If no timeout is given, use the
;; default 25".
;; default 25". Events which are not from D-Bus must be restored.
(with-timeout ((if timeout (/ timeout 1000.0) 25))
(while (eq (gethash key dbus-return-values-table :ignore) :ignore)
(read-event nil nil 0.1)))
(let ((event (let (unread-command-events) (read-event))))
(when (and event (not (ignore-errors (dbus-check-event event))))
(setq unread-command-events
(append unread-command-events (list event)))))))
;; Cleanup `dbus-return-values-table'. Return the result.
(prog1
@ -1089,9 +1093,7 @@ denoting the bus address. SERVICE must be a known service name,
and PATH must be a valid object path. The last two parameters
are strings. The result, the introspection data, is a string in
XML format."
;; We don't want to raise errors. `dbus-call-method-non-blocking'
;; is used, because the handler can be registered in our Emacs
;; instance; caller and callee would block each other.
;; We don't want to raise errors.
(dbus-ignore-errors
(dbus-call-method
bus service path dbus-interface-introspectable "Introspect"