diff --git a/lisp/repeat.el b/lisp/repeat.el index 7bbb398873..8199bd3287 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -338,6 +338,7 @@ repeat-exit-key "Key that stops the modal repeating of keys in sequence. For example, you can set it to like `isearch-exit'." :type '(choice (const :tag "No special key to exit repeating sequence" nil) + (string :tag "Kbd string that exits repeating sequence") (key-sequence :tag "Key that exits repeating sequence")) :group 'convenience :version "28.1") @@ -437,7 +455,10 @@ repeat-post-hook ;; Adding an exit key (when repeat-exit-key - (define-key map repeat-exit-key 'ignore)) + (define-key map (if (stringp repeat-exit-key) + (kbd repeat-exit-key) + repeat-exit-key) + 'ignore)) (when (and repeat-keep-prefix (not prefix-arg)) (setq prefix-arg current-prefix-arg)) @@ -476,7 +497,9 @@ repeat-echo-message-string keys ", ") (if repeat-exit-key (format ", or exit with %s" - (key-description repeat-exit-key)) + (if (stringp repeat-exit-key) + repeat-exit-key + (key-description repeat-exit-key))) "")))) (defun repeat-echo-message (keymap)