1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-30 04:10:54 -08:00

* lisp/repeat.el (repeat-mode): Use 'called-interactively-p'.

This logic is copied from 'define-minor-mode' that displays a message
about mode activation only when called interactively (bug#79081).
This commit is contained in:
Juri Linkov 2025-07-23 20:56:05 +03:00
parent c142f0d246
commit 128e8311be

View file

@ -448,15 +448,18 @@ See `describe-repeat-maps' for a list of all repeatable commands."
(when repeat-keep-prefix
(add-hook 'pre-command-hook 'repeat-pre-hook))
(add-hook 'post-command-hook 'repeat-post-hook)
(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))))))
(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)))))))
(defun repeat--command-property (property)
(or (and (symbolp this-command)