branch: externals/transient
commit bf29731a721118ec1c1ed94f45e57ca67815550a
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
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 ()