]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/repeat.el (repeat-exit-key): Replace type 'key-sequence' with 'key'.
authorJuri Linkov <juri@linkov.net>
Mon, 3 Oct 2022 19:54:16 +0000 (22:54 +0300)
committerJuri Linkov <juri@linkov.net>
Mon, 3 Oct 2022 19:55:11 +0000 (22:55 +0300)
(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

index df6b8140a69f07d3ce048947249a351e776b9737..d773e440670faffd50493ae949df9d774c47f584 100644 (file)
@@ -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)