]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve display of composed character names in "C-u C-x =" on GUI frames
authorJuri Linkov <juri@linkov.net>
Tue, 14 Jul 2020 23:19:49 +0000 (02:19 +0300)
committerJuri Linkov <juri@linkov.net>
Tue, 14 Jul 2020 23:19:49 +0000 (02:19 +0300)
* lisp/descr-text.el (describe-char): On GUI frames, display the
Unicode names of really composed characters only (Bug#42256)

lisp/descr-text.el

index 5cbdf444cf9c12d2df60a557625abeb01e9259ee..be5e01435a7be3031abaa949bb7e8f03d720aea2 100644 (file)
@@ -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)