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

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

[elpa] externals/transient 79c999d263 325/366: transient--post-exit: New


From: Jonas Bernoulli
Subject: [elpa] externals/transient 79c999d263 325/366: transient--post-exit: New function
Date: Tue, 25 Jan 2022 18:54:51 -0500 (EST)

branch: externals/transient
commit 79c999d26351855ece63b2a393ed3271ef6a4ed5
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>

    transient--post-exit: New function
---
 lisp/transient.el | 49 ++++++++++++++++++++++++++-----------------------
 1 file changed, 26 insertions(+), 23 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index 1d2030cbaa..60ba611808 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2034,34 +2034,37 @@ value.  Otherwise return CHILDREN as is."
 (defun transient--post-command ()
   (transient--debug 'post-command)
   (if transient--exitp
-      (progn
-        (unless (and (eq transient--exitp 'replace)
-                     (or transient--prefix
-                         ;; 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)
-          (remove-hook   'post-command-hook     #'transient--post-command))
-        (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))))))
-          (setq transient--exitp nil)
-          (setq transient--helpp nil)
-          (setq transient--editp nil)
-          (run-hooks 'transient-exit-hook)
-          (when resume
-            (transient--stack-pop))))
+      (transient--post-exit)
     (unless (eq this-command (oref transient--prefix command))
       (transient--pop-keymap 'transient--redisplay-map)
       (setq transient--redisplay-map (transient--make-redisplay-map))
       (transient--push-keymap 'transient--redisplay-map)
       (transient--redisplay))))
 
+(defun transient--post-exit ()
+  (transient--debug 'post-exit)
+  (unless (and (eq transient--exitp 'replace)
+               (or transient--prefix
+                   ;; 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)
+    (remove-hook 'post-command-hook #'transient--post-command))
+  (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))))))
+    (setq transient--exitp nil)
+    (setq transient--helpp nil)
+    (setq transient--editp nil)
+    (run-hooks 'transient-exit-hook)
+    (when resume
+      (transient--stack-pop))))
+
 (defun transient--stack-push ()
   (transient--debug 'stack-push)
   (push (list (oref transient--prefix command)
@@ -2130,7 +2133,7 @@ nil) then do nothing."
     (setq transient--stack nil)
     (setq transient--exitp t)
     (transient--pre-exit)
-    (transient--post-command)))
+    (transient--post-exit)))
 
 ;;; Pre-Commands
 



reply via email to

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