branch: externals/transient commit dd67ff906198d28439bfec71ecba98edbed55321 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
transient--do-pre-command: New function --- lisp/transient.el | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index 059c3af0a3..8d8c24413f 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1989,20 +1989,22 @@ value. Otherwise return CHILDREN as is." (setq this-command 'transient-set-level)) (t (setq transient--exitp nil) - (when (eq (if-let ((fn (transient--get-predicate-for this-command))) - (let ((action (funcall fn))) - (when (eq action transient--exit) - (setq transient--exitp (or transient--exitp t))) - action) - (if (let ((keys (this-command-keys-vector))) - (eq (aref keys (1- (length keys))) ?\C-g)) - (setq this-command 'transient-noop) - (unless (transient--edebug-command-p) - (setq this-command 'transient-undefined))) - transient--stay) - transient--exit) + (when (eq (transient--do-pre-command) transient--exit) (transient--pre-exit)))))) +(defun transient--do-pre-command () + (if-let ((fn (transient--get-predicate-for this-command))) + (let ((action (funcall fn))) + (when (eq action transient--exit) + (setq transient--exitp (or transient--exitp t))) + action) + (if (let ((keys (this-command-keys-vector))) + (eq (aref keys (1- (length keys))) ?\C-g)) + (setq this-command 'transient-noop) + (unless (transient--edebug-command-p) + (setq this-command 'transient-undefined))) + transient--stay)) + (defun transient--get-predicate-for (cmd) (or (ignore-errors (lookup-key transient--predicate-map