summaryrefslogtreecommitdiff
path: root/lisp/descr-text.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/descr-text.el')
-rw-r--r--lisp/descr-text.el27
1 files changed, 9 insertions, 18 deletions
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 726d3e6e5d8..4b41c2501e5 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -457,16 +457,12 @@ as well as widgets, buttons, overlays, and text properties."
(multibyte-p enable-multibyte-characters)
(overlays (mapcar #'(lambda (o) (overlay-properties o))
(overlays-at pos)))
- item-list max-width unicode)
+ item-list max-width code)
- (if (or (< char 256)
- (memq 'mule-utf-8 (find-coding-systems-region pos (1+ pos)))
- (get-char-property pos 'untranslated-utf-8))
- (setq unicode (or (get-char-property pos 'untranslated-utf-8)
- (encode-char char 'ucs))))
+ (setq code (encode-char char charset))
(setq item-list
`(("character"
- ,(format "%s (0%o, %d, 0x%x%s)"
+ ,(format "%s (0%o, %d, 0x%x)"
(apply 'propertize (if (not multibyte-p)
(single-key-description char)
(if (< char 128)
@@ -474,18 +470,14 @@ as well as widgets, buttons, overlays, and text properties."
(string-to-multibyte
(char-to-string char))))
(text-properties-at pos))
- char char char
- (if unicode
- (format ", U+%04X" unicode)
- "")))
- ("charset"
+ char char char))
+ ("preferred charset"
,(symbol-name charset)
,(format "(%s)" (charset-description charset)))
("code point"
- ,(let ((split (split-char char)))
- (if (= (charset-dimension charset) 1)
- (format "%d" (nth 1 split))
- (format "%d %d" (nth 1 split) (nth 2 split)))))
+ ,(if (integerp code)
+ (format (if (< code 256) "0x%02X" "0x%04X") code)
+ (format "0x%04X%04X" (car code) (cdr code))))
("syntax"
,(let ((syntax (syntax-after pos)))
(with-temp-buffer
@@ -571,8 +563,7 @@ as well as widgets, buttons, overlays, and text properties."
(if display
(format "terminal code %s" display)
"not encodable for terminal"))))))
- ,@(let ((unicodedata (and unicode
- (describe-char-unicode-data unicode))))
+ ,@(let ((unicodedata (describe-char-unicode-data char)))
(if unicodedata
(cons (list "Unicode data" " ") unicodedata)))))
(setq max-width (apply #'max (mapcar #'(lambda (x) (length (car x)))