diff --git a/lisp/repeat.el b/lisp/repeat.el index 93c4a397335..e472f48e6d1 100644 --- a/lisp/repeat.el +++ b/lisp/repeat.el @@ -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)