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 09:55:17 +0300

>> Martin, could you help to understand why this line fails
>>
>>        ;; FIXME: uncomment (should (equal (buffer-name) "*Messages*"))
>>
>> in 'tab-bar-tests-quit-restore-window' in test/lisp/tab-bar-tests.el?
>>
>> It selects an unexpected buffer.  Maybe because the frame focus
>> is broken?
>
> IIUC the context is
>
>       (quit-window)
>       (should (eq (length (window-list)) 1))
>       (should (eq (length (frame-list)) 2))
>       ;; FIXME: uncomment (should (equal (buffer-name) "*Messages*"))
>
> What is 'quit-window' supposed to do - delete the frame?

'q' is supposed to delete one of two windows and move focus
to the remaining window:

1. C-x 5 5 C-h i
2. C-h e
3. q

should make the selected window with the buffer *Messages*.
And it does when trying the same interactively.

> In either case we would have to know which window gets selected when
> the 'quit-window' call returns and which buffer it shows.

Interactively it selects the *Messages* window, but not in tests.
This is because for tests window-system is nil, so it behaves
weirdly in noninteractive tests.