Skip to content

Commit

Permalink
transient--post-command: Only clear variables on real post-command
Browse files Browse the repository at this point in the history
In [1: 0e0ece3] 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 0e0ece3
   transient--post-command: Clear transient-current-* variables here
  • Loading branch information
tarsius committed Jun 29, 2024
1 parent cfd17a7 commit f2cb28a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f2cb28a

Please sign in to comment.