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

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

>> 1. C-x 5 5 C-h i
>> 2. C-h e
>> 3. q
>>
>> should make the selected window with the buffer *Messages*.
>
> You get the "correct" interactive behavior with
>
> (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)))
>     (let ((frame (window-frame window)))
>       (set-frame-selected-window frame window)
>       (unless (eq frame (selected-frame))
> 	(select-frame-set-input-focus frame)))))
>
> but I'm not even sure whether we want it.  And it still won't match the
> non-interactive behavior if you can't set frame focus there.

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'.