bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#59862: quit-restore per window buffer


From: martin rudalics
Subject: bug#59862: quit-restore per window buffer
Date: Thu, 10 Oct 2024 16:54:02 +0200
User-agent: Mozilla Thunderbird

> Because tabs have priority over frames.  The precedence is:
> windows -> tabs -> frames.  When there are many tabs
> then quit-restore-window should close tabs, and only
> on the last tab should delete the frame.  This is bug#71386,
> but first need to finish bug#59862.

So which bug are we discussing here?  Bug#59862 or Bug#71386?

>> I don't understand the problem yet.  'window-deletable-p' calls
>> 'frame-deletable-p' iff WINDOW is the root window of the frame.  At this
>> time we can only either delete the frame or show another buffer in
>> WINDOW; tertium non datur.  What am I missing?
>
> The third first-class citizen is the tab-bar.

But I haven't written anything for the tab-bar code.  This is something
you have to provide.  Earlier you proposed


diff --git a/lisp/window.el b/lisp/window.el
index 58120c919c7..82efb3c40ce 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -4120,6 +4120,11 @@ window-deletable-p

   (let ((frame (window-frame window)))
     (cond
+     ((and (eq (nth 1 (window-parameter window 'quit-restore)) 'tab)
+          (< (seq-count (lambda (w) (window-parameter w 'quit-restore))
+                        (window-list-1 nil 'nomini))
+             2))
+      'tab)
      ((frame-root-window-p window)
       ;; WINDOW's frame can be deleted only if there are other frames
       ;; on the same terminal, and it does not contain the active
@@ -4990,6 +4995,9 @@ window--delete
   (unless (and dedicated-only (not (window-dedicated-p window)))
     (let ((deletable (window-deletable-p window)))
       (cond
+       ((eq deletable 'tab)
+       (tab-bar-close-tab)
+       'tab)
        ((eq deletable 'frame)
        (let ((frame (window-frame window)))
          (cond
@@ -5303,10 +5311,8 @@ quit-restore-window
      ((and (not prev-buffer)
           (eq (nth 1 quit-restore) 'tab)
           (eq (nth 3 quit-restore) buffer)
-          (< (seq-count (lambda (w) (window-parameter w 'quit-restore))
-                        (window-list-1 nil 'nomini))
-              2))
-      (tab-bar-close-tab)
+          (window--delete
+           window nil (memq bury-or-kill '(kill killing))))
       ;; If the previously selected window is still alive, select it.
       (window--quit-restore-select-window quit-restore-2))
      ((and (not prev-buffer)


martin





reply via email to

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