diff options
| author | Michael Albinus | 2014-07-04 12:03:14 +0200 |
|---|---|---|
| committer | Michael Albinus | 2014-07-04 12:03:14 +0200 |
| commit | b39eecb3c7e7c9120b5107797fbe66cc4bf78bd4 (patch) | |
| tree | 056977b4f1fb0c488b60d36bb768dcff55f4c18c | |
| parent | 9d7b0167fdd06638e019103ef1b77e5956d7fb7b (diff) | |
| download | emacs-b39eecb3c7e7c9120b5107797fbe66cc4bf78bd4.tar.gz emacs-b39eecb3c7e7c9120b5107797fbe66cc4bf78bd4.zip | |
Fix Bug#17858
* net/dbus.el (dbus-peer-handler): New defun.
(dbus-register-service): Register it.
(dbus-managed-objects-handler): Fix docstring.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/net/dbus.el | 22 |
2 files changed, 29 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ed9a1100d49..5c91db50037 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2014-07-04 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/dbus.el (dbus-peer-handler): New defun. | ||
| 4 | (dbus-register-service): Register it. (Bug#17858) | ||
| 5 | (dbus-managed-objects-handler): Fix docstring. | ||
| 6 | |||
| 1 | 2014-07-04 Phil Sainty <psainty@orcon.net.nz> (tiny change) | 7 | 2014-07-04 Phil Sainty <psainty@orcon.net.nz> (tiny change) |
| 2 | 8 | ||
| 3 | * emacs-lisp/lisp.el (narrow-to-defun-include-comments): New var. | 9 | * emacs-lisp/lisp.el (narrow-to-defun-include-comments): New var. |
| @@ -1762,7 +1768,7 @@ | |||
| 1762 | Remove HISTFILE and HISTSIZE; it's too late to set them here. | 1768 | Remove HISTFILE and HISTSIZE; it's too late to set them here. |
| 1763 | Add :version entry. | 1769 | Add :version entry. |
| 1764 | (tramp-open-shell): Do not let-bind `tramp-end-of-output'. | 1770 | (tramp-open-shell): Do not let-bind `tramp-end-of-output'. |
| 1765 | Add "HISTSIZE=/dev/null" to the shell's env arguments. Do not send | 1771 | Add "HISTFILE=/dev/null" to the shell's env arguments. Do not send |
| 1766 | extra "PSx=..." commands. | 1772 | extra "PSx=..." commands. |
| 1767 | (tramp-maybe-open-connection): Setenv HISTFILE to /dev/null. | 1773 | (tramp-maybe-open-connection): Setenv HISTFILE to /dev/null. |
| 1768 | (Bug#17295) | 1774 | (Bug#17295) |
| @@ -3462,7 +3468,7 @@ | |||
| 3462 | 2014-03-10 Michael Albinus <michael.albinus@gmx.de> | 3468 | 2014-03-10 Michael Albinus <michael.albinus@gmx.de> |
| 3463 | 3469 | ||
| 3464 | * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): | 3470 | * net/tramp-sh.el (tramp-open-connection-setup-interactive-shell): |
| 3465 | Do not add `nil' to the environment, when there's no remote `locale'. | 3471 | Do not add nil to the environment, when there's no remote `locale'. |
| 3466 | (tramp-find-inline-encoding): Check, that the remote host has | 3472 | (tramp-find-inline-encoding): Check, that the remote host has |
| 3467 | installed perl, before sending scripts. | 3473 | installed perl, before sending scripts. |
| 3468 | 3474 | ||
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index 66170dafef8..582f54faf4e 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el | |||
| @@ -544,6 +544,10 @@ placed in the queue. | |||
| 544 | 544 | ||
| 545 | `:already-owner': Service is already the primary owner." | 545 | `:already-owner': Service is already the primary owner." |
| 546 | 546 | ||
| 547 | ;; Add Peer handler. | ||
| 548 | (dbus-register-method | ||
| 549 | bus service nil dbus-interface-peer "Ping" 'dbus-peer-handler 'dont-register) | ||
| 550 | |||
| 547 | ;; Add ObjectManager handler. | 551 | ;; Add ObjectManager handler. |
| 548 | (dbus-register-method | 552 | (dbus-register-method |
| 549 | bus service nil dbus-interface-objectmanager "GetManagedObjects" | 553 | bus service nil dbus-interface-objectmanager "GetManagedObjects" |
| @@ -1151,6 +1155,22 @@ apply | |||
| 1151 | bus service dbus-path-dbus dbus-interface-peer "Ping"))) | 1155 | bus service dbus-path-dbus dbus-interface-peer "Ping"))) |
| 1152 | (dbus-error nil))) | 1156 | (dbus-error nil))) |
| 1153 | 1157 | ||
| 1158 | (defun dbus-peer-handler () | ||
| 1159 | "Default handler for the \"org.freedesktop.DBus.Peer\" interface. | ||
| 1160 | It will be registered for all objects created by `dbus-register-service'." | ||
| 1161 | (let* ((last-input-event last-input-event) | ||
| 1162 | (method (dbus-event-member-name last-input-event))) | ||
| 1163 | (cond | ||
| 1164 | ;; "Ping" does not return an output parameter. | ||
| 1165 | ((string-equal method "Ping") | ||
| 1166 | :ignore) | ||
| 1167 | ;; "GetMachineId" returns "s". | ||
| 1168 | ((string-equal method "GetMachineId") | ||
| 1169 | (signal | ||
| 1170 | 'dbus-error | ||
| 1171 | (list | ||
| 1172 | (format "%s.GetMachineId not implemented" dbus-interface-peer))))))) | ||
| 1173 | |||
| 1154 | 1174 | ||
| 1155 | ;;; D-Bus introspection. | 1175 | ;;; D-Bus introspection. |
| 1156 | 1176 | ||
| @@ -1672,7 +1692,7 @@ and \"org.freedesktop.DBus.Properties.GetAll\", which is slow." | |||
| 1672 | 1692 | ||
| 1673 | (defun dbus-managed-objects-handler () | 1693 | (defun dbus-managed-objects-handler () |
| 1674 | "Default handler for the \"org.freedesktop.DBus.ObjectManager\" interface. | 1694 | "Default handler for the \"org.freedesktop.DBus.ObjectManager\" interface. |
| 1675 | It will be registered for all objects created by `dbus-register-method'." | 1695 | It will be registered for all objects created by `dbus-register-service'." |
| 1676 | (let* ((last-input-event last-input-event) | 1696 | (let* ((last-input-event last-input-event) |
| 1677 | (bus (dbus-event-bus-name last-input-event)) | 1697 | (bus (dbus-event-bus-name last-input-event)) |
| 1678 | (path (dbus-event-path-name last-input-event))) | 1698 | (path (dbus-event-path-name last-input-event))) |