Skip to content

Commit

Permalink
transient--post-command: Clear transient-current-* variables here
Browse files Browse the repository at this point in the history
These variables are only intended to be accessible by the command that
was invoked as a suffix of a prefix.  It we only clear their values when
we exit the prefix (but not when a non-exiting suffix is done), then the
values remain accessible in timers and while the prefix is suspended
(e.g., while using the minibuffer).
  • Loading branch information
tarsius committed Jun 26, 2024
1 parent 2d6fae0 commit 0e0ece3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -2553,7 +2553,11 @@ 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--redisplay))))))
(transient--debug 'clear-current)
(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 All @@ -2576,9 +2580,6 @@ value. Otherwise return CHILDREN as is."
(remove-hook 'pre-command-hook #'transient--pre-command)
(remove-hook 'post-command-hook #'transient--post-command)
(advice-remove 'recursive-edit #'transient--recursive-edit))
(setq transient-current-prefix nil)
(setq transient-current-command nil)
(setq transient-current-suffixes nil)
(let ((resume (and transient--stack
(not (memq transient--exitp '(replace suspend))))))
(unless (or resume (eq transient--exitp 'replace))
Expand Down

0 comments on commit 0e0ece3

Please sign in to comment.