branch: externals/transient commit 1a1ae036008ef152c7e77acab083133e346b9a67 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
Remove transient--pre-command later Do it alongside the removal of `transient--pre-command' instead of as early as possible. It just complicates matters if we treat these two hook functions differently --- lisp/transient.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index abfff6062d..1d2030cbaa 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1959,7 +1959,6 @@ value. Otherwise return CHILDREN as is." (transient--timer-cancel) (transient--pop-keymap 'transient--transient-map) (transient--pop-keymap 'transient--redisplay-map) - (remove-hook 'pre-command-hook #'transient--pre-command) (unless transient--showp (let ((message-log-max nil)) (message ""))) @@ -1997,8 +1996,8 @@ value. Otherwise return CHILDREN as is." (unless (> (minibuffer-depth) 1) (unless transient--exitp (transient--pop-keymap 'transient--transient-map) - (transient--pop-keymap 'transient--redisplay-map) - (remove-hook 'pre-command-hook #'transient--pre-command)) + (transient--pop-keymap 'transient--redisplay-map)) + (remove-hook 'pre-command-hook #'transient--pre-command) (remove-hook 'post-command-hook #'transient--post-command))) (defun transient--minibuffer-exit () @@ -2006,8 +2005,8 @@ value. Otherwise return CHILDREN as is." (unless (> (minibuffer-depth) 1) (unless transient--exitp (transient--push-keymap 'transient--transient-map) - (transient--push-keymap 'transient--redisplay-map) - (add-hook 'pre-command-hook #'transient--pre-command)) + (transient--push-keymap 'transient--redisplay-map)) + (add-hook 'pre-command-hook #'transient--pre-command) (add-hook 'post-command-hook #'transient--post-command))) (defun transient--suspend-override (&optional minibuffer-hooks) @@ -2041,6 +2040,7 @@ value. Otherwise return CHILDREN as is." ;; The current command could act as a prefix, ;; but decided not to call `transient-setup'. (prog1 nil (transient--stack-zap)))) + (remove-hook 'pre-command-hook #'transient--pre-command) (remove-hook 'minibuffer-setup-hook #'transient--minibuffer-setup) (remove-hook 'minibuffer-exit-hook #'transient--minibuffer-exit) (advice-remove 'abort-recursive-edit #'transient--minibuffer-exit)