emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/transient bf29731a72 13/38: transient--post-command: Do


From: Jonas Bernoulli
Subject: [elpa] externals/transient bf29731a72 13/38: transient--post-command: Don't pop and push equal redisplay maps
Date: Tue, 11 Jan 2022 05:37:44 -0500 (EST)

branch: externals/transient
commit bf29731a721118ec1c1ed94f45e57ca67815550a
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    transient--post-command: Don't pop and push equal redisplay maps
    
    `set-transient-map' arranges for the exit function not to be called
    if another transient map was added later.  While we don't use that
    function ourselves, this feature still backfires when we replace the
    redisplay map, causing e.g. `mouse-drag-track's transient map to be
    left in place when it should be removed.
---
 lisp/transient.el | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 386d4d2ad3..478e32aaef 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2100,9 +2100,12 @@ value.  Otherwise return CHILDREN as is."
       (transient--post-exit))
      ((eq this-command (oref transient--prefix command)))
      (t
-      (transient--pop-keymap 'transient--redisplay-map)
-      (setq transient--redisplay-map (transient--make-redisplay-map))
-      (transient--push-keymap 'transient--redisplay-map)
+      (let ((old transient--redisplay-map)
+            (new (transient--make-redisplay-map)))
+        (unless (equal old new)
+          (transient--pop-keymap 'transient--redisplay-map)
+          (setq transient--redisplay-map new)
+          (transient--push-keymap 'transient--redisplay-map)))
       (transient--redisplay)))))
 
 (defun transient--post-exit ()



reply via email to

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