Subject: bug#71386: 29.1; Frame is auto-deleted even when it has multiple tabs

From: martin rudalics <[email-masked]>
Date: Thu, 3 Apr 2025 20:23:21 +0200

> Just removing 'window--quit-restore-select-window' also allows tests to pass.
 >
 > I wonder why it's needed when 'delete-window' already selects
 > the right window with 'set-frame-selected-window'.

But this is not about 'delete-window'.  It's about 'quit-window' and
that function should select the window that was selected at the time
'display-buffer' was called.  It doesn't do that currently when that
window is on a different frame but it certainly should to do that when
the window is on the same frame as the window to quit.  So maybe you
would prefer the following:

(defun window--quit-restore-select-window (window)
   "Select WINDOW after having quit another one.
Do not select an inactive minibuffer window."
   (when (and (window-live-p window)
              (or (not (window-minibuffer-p window))
                  (minibuffer-window-active-p window))
	     (eq (window-frame window) (selected-frame)))
     (select-window window)))

martin