aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2013-12-04 15:10:09 +0100
committerMichael Albinus2013-12-04 15:10:09 +0100
commit81961e4cea57cd7b57b263ed0a570737c24d6f97 (patch)
tree885e47c2a47922e8047157be8d60756dd1cb95ca
parenta84c99500e38d6e396b911aee69b1d58acdfa488 (diff)
downloademacs-81961e4cea57cd7b57b263ed0a570737c24d6f97.tar.gz
emacs-81961e4cea57cd7b57b263ed0a570737c24d6f97.zip
* net/dbus.el (dbus-byte-array-to-string): Accept also byte arrays
in D-Bus type syntax. (dbus-unescape-from-identifier): Use `byte-to-string' in order to preserve unibyte strings. (Bug#16048)
-rw-r--r--lisp/ChangeLog9
-rw-r--r--lisp/net/dbus.el13
2 files changed, 18 insertions, 4 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 18b404f5362..9ead2f963a1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
12013-12-04 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/dbus.el (dbus-byte-array-to-string): Accept also byte arrays
4 in D-Bus type syntax.
5 (dbus-unescape-from-identifier): Use `byte-to-string' in order to
6 preserve unibyte strings. (Bug#16048)
7
12013-12-04 Stefan Monnier <monnier@iro.umontreal.ca> 82013-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
2 9
3 * emacs-lisp/eldoc.el (eldoc-minibuffer-message): 10 * emacs-lisp/eldoc.el (eldoc-minibuffer-message):
@@ -21,7 +28,7 @@
212013-12-03 Tom Regner <tom@goochesa.de> (tiny change) 282013-12-03 Tom Regner <tom@goochesa.de> (tiny change)
22 29
23 * notifications.el (notifications-close-notification): Call the 30 * notifications.el (notifications-close-notification): Call the
24 D-Bus method with `id' being an `:uint32'. (Bug#16030) 31 D-Bus method with ID being a `:uint32'. (Bug#16030)
25 32
262013-12-03 Katsumi Yamaoka <yamaoka@jpl.org> 332013-12-03 Katsumi Yamaoka <yamaoka@jpl.org>
27 34
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index a05452c430c..db444ae199f 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -829,8 +829,15 @@ STRING shall be UTF8 coded."
829 829
830(defun dbus-byte-array-to-string (byte-array) 830(defun dbus-byte-array-to-string (byte-array)
831 "Transforms BYTE-ARRAY into UTF8 coded string. 831 "Transforms BYTE-ARRAY into UTF8 coded string.
832BYTE-ARRAY must be a list of structure (c1 c2 ...)." 832BYTE-ARRAY must be a list of structure (c1 c2 ...), or a byte
833 (apply 'string byte-array)) 833array as produced by `dbus-string-to-byte-array'."
834 (apply
835 'string
836 (if (equal byte-array '(:array :signature "y"))
837 nil
838 (let (result)
839 (dolist (elt byte-array result)
840 (when (characterp elt) (setq result (append result `(,elt)))))))))
834 841
835(defun dbus-escape-as-identifier (string) 842(defun dbus-escape-as-identifier (string)
836 "Escape an arbitrary STRING so it follows the rules for a C identifier. 843 "Escape an arbitrary STRING so it follows the rules for a C identifier.
@@ -863,7 +870,7 @@ STRING must have been coded with `dbus-escape-as-identifier'"
863 "" 870 ""
864 (replace-regexp-in-string 871 (replace-regexp-in-string
865 "_.." 872 "_.."
866 (lambda (x) (format "%c" (string-to-number (substring x 1) 16))) 873 (lambda (x) (byte-to-string (string-to-number (substring x 1) 16)))
867 string))) 874 string)))
868 875
869 876