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

From: Juri Linkov <[email-masked]>
Date: Thu, 03 Apr 2025 21:44:22 +0300

>> 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)))

Looks right to restrict it to the selected frame.
(I don't know if this should be installed since
it only gives an unexpected result in one minor test.)