branch: externals/transient
commit af85f697606eee9888af87691a53c1415abbdf4d
Author: Jonas Bernoulli <jo...@bernoul.li>
Commit: Jonas Bernoulli <jo...@bernoul.li>

    Create "Delete" section
    
    Place it after the "Display" section, which is concerned with the other
    end of the window's live.  By contrast, deleting the window has little
    to do with "Flow-Control", so despite being used by a function in that
    section, the function that handles the deletion, should not be defined
    there.
---
 lisp/transient.el | 46 ++++++++++++++++++++++++----------------------
 1 file changed, 24 insertions(+), 22 deletions(-)

diff --git a/lisp/transient.el b/lisp/transient.el
index ff699e6ec9..ff405c3a0a 100644
--- a/lisp/transient.el
+++ b/lisp/transient.el
@@ -2571,28 +2571,6 @@ value.  Otherwise return CHILDREN as is.")
   (setq transient--original-buffer nil)
   (setq transient--window nil))
 
-(defun transient--delete-window ()
-  (when (window-live-p transient--window)
-    (let ((win transient--window)
-          (remain-in-minibuffer-window
-           (and (minibuffer-selected-window)
-                (selected-window))))
-      (cond
-       ((eq (car (window-parameter win 'quit-restore)) 'other)
-        ;; Window used to display another buffer.
-        (set-window-parameter win 'no-other-window
-                              (window-parameter win 'prev--no-other-window))
-        (set-window-parameter win 'prev--no-other-window nil))
-       ((with-demoted-errors "Error while exiting transient: %S"
-          (if (window-parent win)
-              (delete-window win)
-            (delete-frame (window-frame win) t)))))
-      (when remain-in-minibuffer-window
-        (select-window remain-in-minibuffer-window))))
-  (when (buffer-live-p transient--buffer)
-    (kill-buffer transient--buffer))
-  (setq transient--buffer nil))
-
 (defun transient--export ()
   (setq transient-current-prefix transient--prefix)
   (setq transient-current-command (oref transient--prefix command))
@@ -4150,6 +4128,30 @@ have a history of their own.")
                               (window-body-width window t)
                               (window-body-height window t))))
 
+;;; Delete
+
+(defun transient--delete-window ()
+  (when (window-live-p transient--window)
+    (let ((win transient--window)
+          (remain-in-minibuffer-window
+           (and (minibuffer-selected-window)
+                (selected-window))))
+      (cond
+       ((eq (car (window-parameter win 'quit-restore)) 'other)
+        ;; Window used to display another buffer.
+        (set-window-parameter win 'no-other-window
+                              (window-parameter win 'prev--no-other-window))
+        (set-window-parameter win 'prev--no-other-window nil))
+       ((with-demoted-errors "Error while exiting transient: %S"
+          (if (window-parent win)
+              (delete-window win)
+            (delete-frame (window-frame win) t)))))
+      (when remain-in-minibuffer-window
+        (select-window remain-in-minibuffer-window))))
+  (when (buffer-live-p transient--buffer)
+    (kill-buffer transient--buffer))
+  (setq transient--buffer nil))
+
 ;;; Format
 
 (defun transient--format-hint ()

Reply via email to