From 363f1d4d5e836d0b95242d5fa8b7f32af3411419 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 15 Jul 2020 02:19:49 +0300 Subject: [PATCH] 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) --- lisp/descr-text.el | 17 ++++++++++------- 1 file 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) -- 2.39.2