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

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

[elpa] externals/transient 0ed0094919 4/8: Ensure transient-current-* va


From: Jonas Bernoulli
Subject: [elpa] externals/transient 0ed0094919 4/8: Ensure transient-current-* variables are unset on every exit
Date: Sat, 2 Nov 2024 09:09:38 -0400 (EDT)

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

    Ensure transient-current-* variables are unset on every exit
    
    In the simple case, when `transient--post-command' determines that
    the transient is being exited, it calls `transient--post-exit' to
    unset internal state but takes care to unset `transient-current-*'
    itself.
    
    When the minibuffer is involved and for other recursive edits and
    if an unexpected error occurs, it cannot take care of the latter.
    
    In those cases we can do it in `transient--post-exit' instead, but
    until now we didn't.  Do so if COMMAND is non-nil, which in the
    normal case it is not.
    
    Closes #323.
---
 CHANGELOG         | 6 ++++++
 lisp/transient.el | 8 ++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 4c23fbcf6a..454ac3699b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -12,6 +12,12 @@
   suffix command with the mouse, information about the command is now
   shown in the echo area or using a tooltip.  #282
 
+Bug fixes:
+
+- When the command that exits a transient uses the minibuffer,
+  ~transient-current-*~ variables were not immediately reset to
+  ~nil~. #323
+
 * v0.7.7    2024-10-04
 
 Bug fix:
diff --git a/lisp/transient.el b/lisp/transient.el
index a6e9ee8fd8..0575dc73be 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2457,7 +2457,7 @@ value.  Otherwise return CHILDREN as is."
     (funcall fn) ; Already unwind protected.
     (cond ((memq this-command '(top-level abort-recursive-edit))
            (setq transient--exitp t)
-           (transient--post-exit)
+           (transient--post-exit this-command)
            (transient--delete-window))
           (transient--prefix
            (transient--resume-override)))))
@@ -2631,6 +2631,10 @@ value.  Otherwise return CHILDREN as is."
     (setq transient--all-levels-p nil)
     (setq transient--minibuffer-depth 0)
     (run-hooks 'transient-exit-hook)
+    (when command
+      (setq transient-current-prefix nil)
+      (setq transient-current-command nil)
+      (setq transient-current-suffixes nil))
     (when resume
       (transient--stack-pop))))
 
@@ -2717,7 +2721,7 @@ exit."
     (setq transient--stack nil)
     (setq transient--exitp t)
     (transient--pre-exit)
-    (transient--post-exit)))
+    (transient--post-exit this-command)))
 
 ;;; Pre-Commands
 



reply via email to

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