From: Juri Linkov Date: Wed, 23 Jul 2025 17:56:05 +0000 (+0300) Subject: * lisp/repeat.el (repeat-mode): Use 'called-interactively-p'. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0c9ebf7b455610df436d3a0c4d7e20fdf1412b74;p=emacs.git * 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). (cherry picked from commit 128e8311be5b2c65a106fe4ee96056751d600b0d) --- diff --git a/lisp/repeat.el b/lisp/repeat.el index 191e335ae24..3fd76aa8700 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -446,15 +446,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)