mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 09:14:18 +00:00
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:
parent
b0aa799b00
commit
b64e39f1b9
1 changed files with 7 additions and 4 deletions
|
|
@ -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 ", ")
|
||||
|
|
|
|||
Loading…
Reference in a new issue