branch: externals/transient commit f2ef69cfcc195d20c93f33e1a54cee15a6569007 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
transient--get-predicate-for: New function --- lisp/transient.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lisp/transient.el b/lisp/transient.el index f2cbbd2ea9..8c1a2ccb99 100644 --- a/lisp/transient.el +++ b/lisp/transient.el @@ -1724,10 +1724,8 @@ EDIT may be non-nil." (setq this-command 'transient-set-level)) (t (setq transient--exitp nil) - (when (eq (if-let ((fn (or (lookup-key transient--predicate-map - (vector (transient--suffix-symbol - this-original-command))) - (oref transient--prefix transient-non-suffix)))) + (when (eq (if-let ((fn (transient--get-predicate-for + this-original-command))) (let ((action (funcall fn))) (when (eq action transient--exit) (setq transient--exitp (or transient--exitp t))) @@ -1741,6 +1739,11 @@ EDIT may be non-nil." transient--exit) (transient--pre-exit))))) +(defun transient--get-predicate-for (cmd) + (or (lookup-key transient--predicate-map + (vector (transient--suffix-symbol cmd))) + (oref transient--prefix transient-non-suffix))) + (defun transient--pre-exit () (transient--debug 'pre-exit) (transient--delete-window)