Don't show char name for multi-char translations
authorRobert Pluim <rpluim@gmail.com>
Mon, 24 Jun 2024 12:33:30 +0000 (14:33 +0200)
committerRobert Pluim <rpluim@gmail.com>
Mon, 24 Jun 2024 12:39:03 +0000 (14:39 +0200)
I forgot about shift-translation when implementing this originally, so
this code was being triggered for things like 'C-S-<up>'.

* lisp/help.el (help-key-description): Check if the translation result
is a single char.

(Bug#71411)

lisp/help.el

index 878dd40425616e36ccb3fbabd323ebfa91a705f1..adc1724d504ea0a2b5d9e3934432dea0ab840d5d 100644 (file)
@@ -883,7 +883,8 @@ If INSERT (the prefix arg) is non-nil, insert the message in the buffer."
       (let ((otherstring (help--key-description-fontified untranslated)))
        (if (equal string otherstring)
            string
-          (if-let ((char-name (char-to-name (aref string 0))))
+          (if-let ((char-name (and (length= string 1)
+                                   (char-to-name (aref string 0)))))
               (format "%s '%s' (translated from %s)" string char-name otherstring)
             (format "%s (translated from %s)" string otherstring)))))))