emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master b374952b51 2/2: * lisp/repeat.el (repeat-exit-key): Replace type


From: Juri Linkov
Subject: master b374952b51 2/2: * lisp/repeat.el (repeat-exit-key): Replace type 'key-sequence' with 'key'.
Date: Mon, 3 Oct 2022 15:55:49 -0400 (EDT)

branch: master
commit b374952b5117990e84a9d51da78ad94b2c82ecbb
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/repeat.el (repeat-exit-key): Replace type 'key-sequence' with 'key'.
    
    (repeat-post-hook, repeat-echo-message-string): Add backward-compatibility
    code for repeat-exit-key to keep support for 'key-sequence' type 
(bug#55986).
---
 lisp/repeat.el | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/lisp/repeat.el b/lisp/repeat.el
index df6b8140a6..d773e44067 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -344,7 +344,7 @@ recently executed command not bound to an input event\"."
   "Key that stops the modal repeating of keys in sequence.
 For example, you can set it to <return> like `isearch-exit'."
   :type '(choice (const :tag "No special key to exit repeating sequence" nil)
-                 (key-sequence :tag "Key that exits repeating sequence"))
+                 (key :tag "Kbd keys that exit repeating sequence"))
   :group 'repeat
   :version "28.1")
 
@@ -475,7 +475,10 @@ See `describe-repeat-maps' for a list of all repeatable 
commands."
 
               ;; Adding an exit key
               (when repeat-exit-key
-                (define-key map repeat-exit-key 'ignore))
+                (define-key map (if (key-valid-p 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))
@@ -526,7 +529,9 @@ This function can be used to force exit of repetition while 
it's active."
                     (if repeat-exit-key
                         (substitute-command-keys
                          (format ", or exit with \\`%s'"
-                                 (key-description repeat-exit-key)))
+                                 (if (key-valid-p repeat-exit-key)
+                                     repeat-exit-key
+                                   (key-description repeat-exit-key))))
                       ""))))
 
 (defun repeat-echo-message (keymap)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]