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

    transient--post-command: Only clear variables on real post-command
    
    In [1: 0e0ece32] we started clearing `transient-current-*' variables
    here instead of in `transient--post-exit', to make sure their values
    are nil in timers and while using the minibuffer.
    
    The latter was achieved by clearing even during the premature call to
    `transient--post-command', which occurs when the minibuffer is entered,
    i.e., when suspending the transient.  Unfortunately transient state
    cannot be resumed until the outer command really is done, and as a
    result these variables remained cleared for the current command after
    any use of the minibuffer.
    
    This obviously can be fixed by only clearing on the real `post-command'
    run, but that of course means that these variables are once more
    accessible during minibuffer use.  There does not appear to be a way
    around that, but luckily it is unlikely that that would actually lead
    to any unexpected behavior.
    
    Closes #292.
    
    1: 2024-06-26 0e0ece32362bb5eed430328583018a35f44d3c7d
       transient--post-command: Clear transient-current-* variables here
---
 lisp/transient.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index b348b8083f..cd1e8db544 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2553,11 +2553,10 @@ value.  Otherwise return CHILDREN as is."
                  (transient--pop-keymap 'transient--redisplay-map)
                  (setq transient--redisplay-map new)
                  (transient--push-keymap 'transient--redisplay-map))
-               (transient--redisplay))))))
-  (transient--debug 'clear-current)
-  (setq transient-current-prefix nil)
-  (setq transient-current-command nil)
-  (setq transient-current-suffixes nil))
+               (transient--redisplay)))))
+    (setq transient-current-prefix nil)
+    (setq transient-current-command nil)
+    (setq transient-current-suffixes nil)))
 
 (defun transient--post-exit (&optional command)
   (transient--debug 'post-exit)

Reply via email to