Subject: Re: bug#56305: 29.0.50; 'yes-or-no-p' deselects minibuffer frame

From: Alan Mackenzie <[email-masked]>
Date: Thu, 30 Jun 2022 20:32:06 +0000

Hello, Eli and Martin.

On Wed, Jun 29, 2022 at 22:10:49 +0300, Eli Zaretskii wrote:
> > Date: Wed, 29 Jun 2022 19:54:44 +0200
> > From: martin rudalics <[email-masked]>

> > With emacs -Q --load "~/mini.el" which contains the three lines

> > (setq use-dialog-box nil)
> > (setq default-frame-alist '((minibuffer . nil)))
> > (shell)

> > and type C-x C-c in the minibuffer frame.  This asks a 'yes-or-no-p'
> > question in the minibuffer frame but selects the *Process List* window
> > on the other frame.

> > FWICT this worked correctly until Emacs 26, was broken in Emacs 27,
> > returned to work in Emacs 28.1 and is now broken on both, release and
> > master branch, again.

> Alan, could you please look into this?  Emacs 28.2 is about to start
> pretest.

In your (Martin's) scenario, the yes-or-no-p seems to work just before
the following commit, but goes into an infinite loop after it:

commit dfa3e6f424b20fe27d9041b2ce7d69811df5d8cd
Author: Alan Mackenzie <[email-masked]>
Date:   Fri May 20 20:18:38 2022 +0000

    Restore the Fselect_window call in gui_consider_frame_title.

There's something suspicious in that commit, namely:

* src/frame.c (do_switch_frame): When the selected window in the target frame
is the mini-window, switch away from this window unless there is a valid
minibuffer there.

Maybe that's a red herring, but it might be relevant.

I'll look at this in more detail tomorrow.

> Thanks.

-- 
Alan Mackenzie (Nuremberg, Germany).