summaryrefslogtreecommitdiff
path: root/lisp/repeat.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2021-09-17 19:00:03 +0300
committerJuri Linkov <juri@linkov.net>2021-09-17 19:00:03 +0300
commitde0b5227e08ce250b60226f9b2413dda50456c60 (patch)
tree91c453697594a069a48e1e50d20abd199e86d222 /lisp/repeat.el
parenta8103cf9e08cdc159c4824d2b3b08cc5882fae76 (diff)
downloademacs-de0b5227e08ce250b60226f9b2413dda50456c60.tar.gz
* lisp/repeat.el (repeat-echo-message): Clear only own added part of message.
(describe-repeat-maps, repeat-mode): Refer to each other in docstrings.
Diffstat (limited to 'lisp/repeat.el')
-rw-r--r--lisp/repeat.el23
1 files changed, 15 insertions, 8 deletions
diff --git a/lisp/repeat.el b/lisp/repeat.el
index 6c3ffec18fc..0b761fff1e3 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -386,7 +386,8 @@ the map can't be set on the command symbol property `repeat-map'.")
(define-minor-mode repeat-mode
"Toggle Repeat mode.
When Repeat mode is enabled, and the command symbol has the property named
-`repeat-map', this map is activated temporarily for the next command."
+`repeat-map', this map is activated temporarily for the next command.
+See `describe-repeat-maps' for a list of all repeatable command."
:global t :group 'convenience
(if (not repeat-mode)
(remove-hook 'post-command-hook 'repeat-post-hook)
@@ -470,13 +471,18 @@ When Repeat mode is enabled, and the command symbol has the property named
(defun repeat-echo-message (keymap)
"Display available repeating keys in the echo area."
(if keymap
- (let ((mess (repeat-echo-message-string keymap)))
+ (let ((message (repeat-echo-message-string keymap)))
(if (current-message)
- (message "%s [%s]" (current-message) mess)
- (message mess)))
- (and (current-message)
- (string-search "Repeat with " (current-message))
- (message nil))))
+ (message "%s [%s]" (current-message) message)
+ (message "%s" message)))
+ (let ((message (current-message)))
+ (when message
+ (cond
+ ((string-prefix-p "Repeat with " message)
+ (message nil))
+ ((string-search " [Repeat with " message)
+ (message "%s" (replace-regexp-in-string
+ " \\[Repeat with .*\\'" "" message))))))))
(defvar repeat-echo-mode-line-string
(propertize "[Repeating...] " 'face 'mode-line-emphasis)
@@ -491,7 +497,8 @@ When Repeat mode is enabled, and the command symbol has the property named
(force-mode-line-update t)))
(defun describe-repeat-maps ()
- "Describe mappings of commands repeatable by symbol property `repeat-map'."
+ "Describe mappings of commands repeatable by symbol property `repeat-map'.
+Used in `repeat-mode'."
(interactive)
(help-setup-xref (list #'describe-repeat-maps)
(called-interactively-p 'interactive))