emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/transient dd67ff9061 12/17: transient--do-pre-command:


From: Jonas Bernoulli
Subject: [elpa] externals/transient dd67ff9061 12/17: transient--do-pre-command: New function
Date: Fri, 25 Mar 2022 06:22:17 -0400 (EDT)

branch: externals/transient
commit dd67ff906198d28439bfec71ecba98edbed55321
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]