diff options
| author | Michael Albinus | 2012-05-13 11:05:04 +0200 |
|---|---|---|
| committer | Michael Albinus | 2012-05-13 11:05:04 +0200 |
| commit | 205a7391f7d6b5ffb4d366a142f69cfa0b8b3ac3 (patch) | |
| tree | a3cbd1d4fc32e9a52fa026348e62b817b52d336d | |
| parent | e5bd0a28953dcf6c3b811a7d17e7664c8d664a7c (diff) | |
| download | emacs-205a7391f7d6b5ffb4d366a142f69cfa0b8b3ac3.tar.gz emacs-205a7391f7d6b5ffb4d366a142f69cfa0b8b3ac3.zip | |
* net/dbus.el (dbus-call-method): Restore events not from D-Bus. (Bug#11447)
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/net/dbus.el | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c12bf638243..1bde354a551 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-05-13 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/dbus.el (dbus-call-method): Restore events not from D-Bus. | ||
| 4 | (Bug#11447) | ||
| 5 | |||
| 1 | 2012-05-13 Stefan Monnier <monnier@iro.umontreal.ca> | 6 | 2012-05-13 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 7 | ||
| 3 | Move define-obsolete-variable-alias before the var's definition. | 8 | Move define-obsolete-variable-alias before the var's definition. |
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index d845a4932e2..c83651b41b5 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el | |||
| @@ -263,12 +263,16 @@ object is returned instead of a list containing this single Lisp object. | |||
| 263 | (apply | 263 | (apply |
| 264 | 'dbus-message-internal dbus-message-type-method-call | 264 | 'dbus-message-internal dbus-message-type-method-call |
| 265 | bus service path interface method 'dbus-call-method-handler args))) | 265 | bus service path interface method 'dbus-call-method-handler args))) |
| 266 | |||
| 266 | ;; Wait until `dbus-call-method-handler' has put the result into | 267 | ;; Wait until `dbus-call-method-handler' has put the result into |
| 267 | ;; `dbus-return-values-table'. If no timeout is given, use the | 268 | ;; `dbus-return-values-table'. If no timeout is given, use the |
| 268 | ;; default 25". | 269 | ;; default 25". Events which are not from D-Bus must be restored. |
| 269 | (with-timeout ((if timeout (/ timeout 1000.0) 25)) | 270 | (with-timeout ((if timeout (/ timeout 1000.0) 25)) |
| 270 | (while (eq (gethash key dbus-return-values-table :ignore) :ignore) | 271 | (while (eq (gethash key dbus-return-values-table :ignore) :ignore) |
| 271 | (read-event nil nil 0.1))) | 272 | (let ((event (let (unread-command-events) (read-event)))) |
| 273 | (when (and event (not (ignore-errors (dbus-check-event event)))) | ||
| 274 | (setq unread-command-events | ||
| 275 | (append unread-command-events (list event))))))) | ||
| 272 | 276 | ||
| 273 | ;; Cleanup `dbus-return-values-table'. Return the result. | 277 | ;; Cleanup `dbus-return-values-table'. Return the result. |
| 274 | (prog1 | 278 | (prog1 |
| @@ -1089,9 +1093,7 @@ denoting the bus address. SERVICE must be a known service name, | |||
| 1089 | and PATH must be a valid object path. The last two parameters | 1093 | and PATH must be a valid object path. The last two parameters |
| 1090 | are strings. The result, the introspection data, is a string in | 1094 | are strings. The result, the introspection data, is a string in |
| 1091 | XML format." | 1095 | XML format." |
| 1092 | ;; We don't want to raise errors. `dbus-call-method-non-blocking' | 1096 | ;; We don't want to raise errors. |
| 1093 | ;; is used, because the handler can be registered in our Emacs | ||
| 1094 | ;; instance; caller and callee would block each other. | ||
| 1095 | (dbus-ignore-errors | 1097 | (dbus-ignore-errors |
| 1096 | (dbus-call-method | 1098 | (dbus-call-method |
| 1097 | bus service path dbus-interface-introspectable "Introspect" | 1099 | bus service path dbus-interface-introspectable "Introspect" |
| @@ -1534,7 +1536,7 @@ The result is a list of objects. Every object is a cons of an | |||
| 1534 | existing path name, and the list of available interface objects. | 1536 | existing path name, and the list of available interface objects. |
| 1535 | An interface object is another cons, which car is the interface | 1537 | An interface object is another cons, which car is the interface |
| 1536 | name, and the cdr is the list of properties as returned by | 1538 | name, and the cdr is the list of properties as returned by |
| 1537 | `dbus-get-all-properties' for that path and interface. Example: | 1539 | `dbus-get-all-properties' for that path and interface. Example: |
| 1538 | 1540 | ||
| 1539 | \(dbus-get-all-managed-objects :session \"org.gnome.SettingsDaemon\" \"/\") | 1541 | \(dbus-get-all-managed-objects :session \"org.gnome.SettingsDaemon\" \"/\") |
| 1540 | 1542 | ||