summaryrefslogtreecommitdiff
path: root/lisp/descr-text.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2020-07-15 02:19:49 +0300
committerJuri Linkov <juri@linkov.net>2020-07-15 02:19:49 +0300
commit363f1d4d5e836d0b95242d5fa8b7f32af3411419 (patch)
tree63310e70ad8419a8693589d2b8b1fec8ec18e829 /lisp/descr-text.el
parent36e6019034ab5af18f634644187c75863ef6ca80 (diff)
downloademacs-363f1d4d5e836d0b95242d5fa8b7f32af3411419.tar.gz
Improve display of composed character names in "C-u C-x =" on GUI frames
* lisp/descr-text.el (describe-char): On GUI frames, display the Unicode names of really composed characters only (Bug#42256)
Diffstat (limited to 'lisp/descr-text.el')
-rw-r--r--lisp/descr-text.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/descr-text.el b/lisp/descr-text.el
index 5cbdf444cf9..be5e01435a7 100644
--- a/lisp/descr-text.el
+++ b/lisp/descr-text.el
@@ -775,13 +775,16 @@ The character information includes:
(setq glyph (lgstring-glyph gstring from)))
(insert (format " %S\n" glyph))
(setq from (1+ from)))
- (insert "from these characters:\n")
- (dotimes (i (lgstring-char-len gstring))
- (let ((char (lgstring-char gstring i)))
- (insert (format " %c (#x%x) %s\n"
- char char
- (get-char-code-property
- char 'name))))))
+ (when (and (stringp (car composition))
+ (string-match "\"\\([^\"]+\\)\"" (car composition)))
+ (insert "with these character(s):\n")
+ (let ((chars (match-string 1 (car composition))))
+ (dotimes (i (length chars))
+ (let ((char (aref chars i)))
+ (insert (format " %c (#x%x) %s\n"
+ char char
+ (get-char-code-property
+ char 'name))))))))
;; TTY frame: show composition in terms of characters.
(insert " by these characters:\n")
(while (and (<= from to)