diff options
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/net/dbus.el | 28 |
2 files changed, 24 insertions, 13 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ec02942f2f7..30bbe57f352 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2013-12-05 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/dbus.el (dbus-unregister-service) | ||
| 4 | (dbus-escape-as-identifier, dbus-unescape-from-identifier): | ||
| 5 | Fix docstring. | ||
| 6 | (dbus-unregister-service): Skip :serial entries in | ||
| 7 | `dbus-registered-objects-table'. | ||
| 8 | (dbus-byte-array-to-string): New optional arg MULTIBYTE. | ||
| 9 | |||
| 1 | 2013-12-04 Teodor Zlatanov <tzz@lifelogs.com> | 10 | 2013-12-04 Teodor Zlatanov <tzz@lifelogs.com> |
| 2 | 11 | ||
| 3 | * emacs-lisp/lisp-mnt.el (lm-keywords-list): Trim whitespace | 12 | * emacs-lisp/lisp-mnt.el (lm-keywords-list): Trim whitespace |
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index db444ae199f..a3f19b626f2 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el | |||
| @@ -521,7 +521,7 @@ denoting the bus address. SERVICE must be a known service name. | |||
| 521 | The function returns a keyword, indicating the result of the | 521 | The function returns a keyword, indicating the result of the |
| 522 | operation. One of the following keywords is returned: | 522 | operation. One of the following keywords is returned: |
| 523 | 523 | ||
| 524 | `:released': Service has become the primary owner of the name. | 524 | `:released': We successfully released the service. |
| 525 | 525 | ||
| 526 | `:non-existent': Service name does not exist on this bus. | 526 | `:non-existent': Service name does not exist on this bus. |
| 527 | 527 | ||
| @@ -530,12 +530,13 @@ queue of this service." | |||
| 530 | 530 | ||
| 531 | (maphash | 531 | (maphash |
| 532 | (lambda (key value) | 532 | (lambda (key value) |
| 533 | (dolist (elt value) | 533 | (unless (equal :serial (car key)) |
| 534 | (ignore-errors | 534 | (dolist (elt value) |
| 535 | (when (and (equal bus (cadr key)) (string-equal service (cadr elt))) | 535 | (ignore-errors |
| 536 | (unless | 536 | (when (and (equal bus (cadr key)) (string-equal service (cadr elt))) |
| 537 | (puthash key (delete elt value) dbus-registered-objects-table) | 537 | (unless |
| 538 | (remhash key dbus-registered-objects-table)))))) | 538 | (puthash key (delete elt value) dbus-registered-objects-table) |
| 539 | (remhash key dbus-registered-objects-table))))))) | ||
| 539 | dbus-registered-objects-table) | 540 | dbus-registered-objects-table) |
| 540 | (let ((reply (dbus-call-method | 541 | (let ((reply (dbus-call-method |
| 541 | bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus | 542 | bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus |
| @@ -827,12 +828,13 @@ STRING shall be UTF8 coded." | |||
| 827 | (dolist (elt (string-to-list string) (append '(:array) result)) | 828 | (dolist (elt (string-to-list string) (append '(:array) result)) |
| 828 | (setq result (append result (list :byte elt))))))) | 829 | (setq result (append result (list :byte elt))))))) |
| 829 | 830 | ||
| 830 | (defun dbus-byte-array-to-string (byte-array) | 831 | (defun dbus-byte-array-to-string (byte-array &optional multibyte) |
| 831 | "Transforms BYTE-ARRAY into UTF8 coded string. | 832 | "Transforms BYTE-ARRAY into UTF8 coded string. |
| 832 | BYTE-ARRAY must be a list of structure (c1 c2 ...), or a byte | 833 | BYTE-ARRAY must be a list of structure (c1 c2 ...), or a byte |
| 833 | array as produced by `dbus-string-to-byte-array'." | 834 | array as produced by `dbus-string-to-byte-array'. The resulting |
| 835 | string is unibyte encoded, unless MULTIBYTE is non-nil." | ||
| 834 | (apply | 836 | (apply |
| 835 | 'string | 837 | (if multibyte 'string 'unibyte-string) |
| 836 | (if (equal byte-array '(:array :signature "y")) | 838 | (if (equal byte-array '(:array :signature "y")) |
| 837 | nil | 839 | nil |
| 838 | (let (result) | 840 | (let (result) |
| @@ -855,7 +857,7 @@ and a smaller allowed set. As a special case, \"\" is escaped to | |||
| 855 | \"_\". | 857 | \"_\". |
| 856 | 858 | ||
| 857 | Returns the escaped string. Algorithm taken from | 859 | Returns the escaped string. Algorithm taken from |
| 858 | telepathy-glib's `tp-escape-as-identifier'." | 860 | telepathy-glib's `tp_escape_as_identifier'." |
| 859 | (if (zerop (length string)) | 861 | (if (zerop (length string)) |
| 860 | "_" | 862 | "_" |
| 861 | (replace-regexp-in-string | 863 | (replace-regexp-in-string |
| @@ -864,8 +866,8 @@ telepathy-glib's `tp-escape-as-identifier'." | |||
| 864 | string))) | 866 | string))) |
| 865 | 867 | ||
| 866 | (defun dbus-unescape-from-identifier (string) | 868 | (defun dbus-unescape-from-identifier (string) |
| 867 | "Retrieve the original string from the encoded STRING. | 869 | "Retrieve the original string from the encoded STRING as unibyte string. |
| 868 | STRING must have been coded with `dbus-escape-as-identifier'" | 870 | STRING must have been encoded with `dbus-escape-as-identifier'." |
| 869 | (if (string-equal string "_") | 871 | (if (string-equal string "_") |
| 870 | "" | 872 | "" |
| 871 | (replace-regexp-in-string | 873 | (replace-regexp-in-string |