repeat: handle non-character keys with hint strings

When a repeat hint string exists, the hint is formatted using
`read-multiple-choice' formatting.  But `rmc--add-key-description' only
works on characters, not symbols like 'right or 'left.

* lisp/repeat.el (repeat-echo-message-string): check for chars
This commit is contained in:
JD Smith 2026-01-04 18:56:19 -05:00
parent b0aa799b00
commit b64e39f1b9

View file

@ -591,14 +591,17 @@ This function can be used to force exit of repetition while it's active."
(if-let* ((hint (and (symbolp cmd)
(get cmd 'repeat-hint)))
(last (aref key (1- (length key)))))
;; Reuse `read-multiple-choice' formatting.
(if (= (length key) 1)
;; Possibly reuse `read-multiple-choice' formatting.
(if (and (= (length key) 1) (characterp last))
(cdr (rmc--add-key-description (list last hint)))
(format "%s (%s)"
(propertize (key-description key)
'face 'read-multiple-choice-face)
(if (characterp (event-basic-type last))
(cdr (rmc--add-key-description
(list (event-basic-type last) hint)))))
(list (event-basic-type last) hint)))
hint)))
;; No hint
(propertize (key-description key)
'face 'read-multiple-choice-face))))
keys ", ")