Function: repeat-mode
repeat-mode is an autoloaded, interactive and byte-compiled function
defined in repeat.el.gz.
Signature
(repeat-mode &optional ARG)
Documentation
Toggle Repeat mode.
When Repeat mode is enabled, certain commands bound to multi-key sequences can be repeated by typing a single key, after typing the full key sequence once.
The commands that can be repeated in this way are those whose symbols
have the repeat-map property, which specifies a keymap of single keys
for repeating.
Normally, invoking a command outside that keymap terminates the
repeating sequence. However, if the command's repeat-continue
property is non-nil, it may instead continue the current repeating
sequence: if the property is a list of keymaps, then the command
continues when the current repeat map is in the list; if the property is
t, the command always continues the sequence.
See describe-repeat-maps for a list of all repeatable commands.
This is a global minor mode. If called interactively, toggle the
Repeat mode mode. If the prefix argument is positive, enable the
mode, and if it is zero or negative, disable the mode.
If called from Lisp, toggle the mode if ARG is toggle. Enable the
mode if ARG is nil, omitted, or is a positive number. Disable the mode
if ARG is a negative number.
To check whether the minor mode is enabled in the current buffer,
evaluate (default-value \=repeat-mode)'.
The mode's hook is called both when the mode is enabled and when it is disabled.
Probably introduced at or before Emacs version 28.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/repeat.el.gz
;;;###autoload
(define-minor-mode repeat-mode
"Toggle Repeat mode.
When Repeat mode is enabled, certain commands bound to multi-key
sequences can be repeated by typing a single key, after typing the
full key sequence once.
The commands that can be repeated in this way are those whose symbols
have the `repeat-map' property, which specifies a keymap of single keys
for repeating.
Normally, invoking a command outside that keymap terminates the
repeating sequence. However, if the command's `repeat-continue'
property is non-nil, it may instead continue the current repeating
sequence: if the property is a list of keymaps, then the command
continues when the current repeat map is in the list; if the property is
t, the command always continues the sequence.
See `describe-repeat-maps' for a list of all repeatable commands."
:global t :group 'repeat
(if (not repeat-mode)
(progn
(remove-hook 'pre-command-hook 'repeat-pre-hook)
(remove-hook 'post-command-hook 'repeat-post-hook))
(when repeat-keep-prefix
(add-hook 'pre-command-hook 'repeat-pre-hook))
(add-hook 'post-command-hook 'repeat-post-hook)
(when (called-interactively-p 'any)
(let* ((keymaps nil)
(commands (all-completions
"" obarray
(lambda (s)
(and (commandp s)
(get s 'repeat-map)
(push (get s 'repeat-map) keymaps))))))
(message "Repeat mode is enabled for %d commands and %d keymaps; \
see `describe-repeat-maps'"
(length commands)
(length (delete-dups keymaps)))))))