emacs-diffs
[Top][All Lists]
Advanced

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

master b4eb84d 2/2: * lisp/repeat.el (repeat-post-hook): Check for prefi


From: Juri Linkov
Subject: master b4eb84d 2/2: * lisp/repeat.el (repeat-post-hook): Check for prefix-arg.
Date: Thu, 8 Apr 2021 14:55:47 -0400 (EDT)

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

    * lisp/repeat.el (repeat-post-hook): Check for prefix-arg.
    
    This is instead of checking for a list of argument-related commands
    that set prefix-arg anyway.
---
 lisp/repeat.el | 17 ++++++-----------
 1 file changed, 6 insertions(+), 11 deletions(-)

diff --git a/lisp/repeat.el b/lisp/repeat.el
index 8cbfaa0..b3c58f2 100644
--- a/lisp/repeat.el
+++ b/lisp/repeat.el
@@ -382,25 +382,17 @@ When Repeat mode is enabled, and the command symbol has 
the property named
       (when rep-map
         (when (boundp rep-map)
           (setq rep-map (symbol-value rep-map)))
-        (let ((prefix-command-p (memq this-original-command
-                                      '(universal-argument
-                                        universal-argument-more
-                                        digit-argument
-                                        negative-argument)))
-              (map (copy-keymap rep-map))
+        (let ((map (copy-keymap rep-map))
               keys)
 
           ;; Exit when the last char is not among repeatable keys,
           ;; so e.g. `C-x u u' repeats undo, whereas `C-/ u' doesn't.
           (when (and (zerop (minibuffer-depth)) ; avoid remapping in prompts
                      (or (lookup-key map (this-command-keys-vector))
-                         prefix-command-p))
-
-            (when (and repeat-keep-prefix (not prefix-command-p))
-              (setq prefix-arg current-prefix-arg))
+                         prefix-arg))
 
             ;; Messaging
-            (unless prefix-command-p
+            (unless prefix-arg
               (map-keymap (lambda (key _) (push key keys)) map)
               (let ((mess (format-message
                            "Repeat with %s%s"
@@ -419,6 +411,9 @@ When Repeat mode is enabled, and the command symbol has the 
property named
             (when repeat-exit-key
               (define-key map repeat-exit-key 'ignore))
 
+            (when (and repeat-keep-prefix (not prefix-arg))
+              (setq prefix-arg current-prefix-arg))
+
             (set-transient-map map))))))
   (setq repeat-map nil))
 



reply via email to

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