Don't show char name for multi-char translations

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)
This commit is contained in:
Robert Pluim 2024-06-24 14:33:30 +02:00
parent 0715abfa86
commit 96e27c2ecf

View 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)))))))