emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master de0b522 1/2: * lisp/repeat.el (repeat-echo-message): Clear only o


From: Juri Linkov
Subject: master de0b522 1/2: * lisp/repeat.el (repeat-echo-message): Clear only own added part of message.
Date: Fri, 17 Sep 2021 12:03:17 -0400 (EDT)

branch: master
commit de0b5227e08ce250b60226f9b2413dda50456c60
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/repeat.el (repeat-echo-message): Clear only own added part of 
message.
    
    (describe-repeat-maps, repeat-mode): Refer to each other in docstrings.
---
 lisp/repeat.el | 23 +++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/lisp/repeat.el b/lisp/repeat.el
index 6c3ffec..0b761ff 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]