emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 363f1d4: Improve display of composed character names in "C-u C-x


From: Juri Linkov
Subject: master 363f1d4: Improve display of composed character names in "C-u C-x =" on GUI frames
Date: Tue, 14 Jul 2020 19:20:37 -0400 (EDT)

branch: master
commit 363f1d4d5e836d0b95242d5fa8b7f32af3411419
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    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 5cbdf44..be5e014 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]