diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-12-02 17:34:10 +0100 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-12-02 17:34:10 +0100 |
commit | 48d1e6e9d9217918b68daac9b23140bf8e36c2bf (patch) | |
tree | d2d693af22046ced07c7c26de55fa608549db6fa /lisp/repeat.el | |
parent | 8ff1a9d00bfe1b4b3b1aae5e2792c5f58e501aee (diff) | |
parent | f38dfa56a0cfef77c2b0d8bb2869642a4e3b2ae4 (diff) | |
download | emacs-48d1e6e9d9217918b68daac9b23140bf8e36c2bf.tar.gz emacs-48d1e6e9d9217918b68daac9b23140bf8e36c2bf.tar.bz2 emacs-48d1e6e9d9217918b68daac9b23140bf8e36c2bf.zip |
Merge from origin/emacs-28
f38dfa56a0 ; Update loaddefs files.
b3d4b18507 ; make change-history-commit
334ff0232e * lisp/repeat.el: Use same logic for repeat-check-key and ...
8230a47ecc * lisp/help.el (help--analyze-key): Prefer posn-set-point ...
# Conflicts:
# lisp/ldefs-boot.el
Diffstat (limited to 'lisp/repeat.el')
-rw-r--r-- | lisp/repeat.el | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/lisp/repeat.el b/lisp/repeat.el index 5930219bd5d..ea6da5d7f9b 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -345,7 +345,9 @@ For example, you can set it to <return> like `isearch-exit'." (defcustom repeat-exit-timeout nil "Break the repetition chain of keys after specified timeout. When a number, exit the transient repeating mode after idle time -of the specified number of seconds." +of the specified number of seconds. +You can also set the property `repeat-exit-timeout' on the command symbol. +This property can override the value of this variable." :type '(choice (const :tag "No timeout to exit repeating sequence" nil) (number :tag "Timeout in seconds to exit repeating")) :group 'convenience @@ -431,8 +433,9 @@ See `describe-repeat-maps' for a list of all repeatable commands." (defun repeat-check-key (key map) "Check if the last key is suitable to activate the repeating MAP." - (let ((property (repeat--command-property 'repeat-check-key))) - (or (if repeat-check-key (eq property 'no) (not (eq property t))) + (let* ((prop (repeat--command-property 'repeat-check-key)) + (check-key (unless (eq prop 'no) (or prop repeat-check-key)))) + (or (not check-key) (lookup-key map (vector key)) ;; Try without modifiers: (lookup-key map (vector (event-basic-type key)))))) @@ -475,14 +478,16 @@ See `describe-repeat-maps' for a list of all repeatable commands." (cancel-timer repeat-exit-timer) (setq repeat-exit-timer nil)) - (when repeat-exit-timeout - (setq repeat-exit-timer - (run-with-idle-timer - repeat-exit-timeout nil - (lambda () - (setq repeat-in-progress nil) - (funcall exitfun) - (funcall repeat-echo-function nil))))))))))) + (let* ((prop (repeat--command-property 'repeat-exit-timeout)) + (timeout (unless (eq prop 'no) (or prop repeat-exit-timeout)))) + (when timeout + (setq repeat-exit-timer + (run-with-idle-timer + timeout nil + (lambda () + (setq repeat-in-progress nil) + (funcall exitfun) + (funcall repeat-echo-function nil)))))))))))) (setq repeat-map nil) (setq repeat--prev-mb (cons (minibuffer-depth) current-minibuffer-command)) |