GNU bug report logs - #63967
28.2; switch-to-buffer in normal window fails if minibuffer window is active

Previous Next

Package: emacs;

Reported by: Al Petrofsky <al <at> petrofsky.org>

Date: Fri, 9 Jun 2023 04:10:02 UTC

Severity: normal

Found in version 28.2

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #89 received at 63967 <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: al <at> petrofsky.org, rudalics <at> gmx.at, acm <at> muc.de, monnier <at> iro.umontreal.ca,
 63967 <at> debbugs.gnu.org
Subject: Re: bug#63967: 28.2; switch-to-buffer in normal window fails if
 minibuffer window is active
Date: Tue, 13 Jun 2023 21:36:37 +0000
Hello, Eli.

On Tue, Jun 13, 2023 at 21:43:13 +0300, Eli Zaretskii wrote:
> > Cc: al <at> petrofsky.org, rudalics <at> gmx.at, monnier <at> iro.umontreal.ca,
> >  63967 <at> debbugs.gnu.org
> > Date: Sun, 11 Jun 2023 16:53:48 +0300
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > 
> > > Do you want me to fix this bug?  It seems there are quite a lot of people
> > > who've made observations about it in the last couple of days.
> > 
> > I want to fix the bug whose recipe is in
> > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63967#5 and other
> > similar ones, yes.  Basically, if Emacs reads from a recursive
> > minibuffer when the selected window before that was not a mini-window,
> > we now signal a user-error, which is a regression since Emacs 28, and
> > I'd like that to be solved.  But please begin by looking at the
> > solution proposed by Martin in
> > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63967#38 and tell if it
> > looks good to you, and if not, why not.

> Ping!  Any progress there?

Sorry.  I've had a few very busy days in real life.

Firstly, I'm reasonably sure that the Fset_frame_selected_window I put
into minibuf_unwind was a mistake based on the misconception that after
reading the minibuffer recursively, we always wanted to go back to the
next outer minibuffer.

I think Martin's patch (from 2023-06-10 08:52 +0200) is along the right
lines, i.e. go back to the invoking window rather than the minibuffer
window.  But I'm not sure whether it might be better, from the point of
view of preserving maintainability of read_minibuf, to try to get the
restore_window_buffer_configuration call to go back to the calling
window, rather than adding the extra parameter to minibuffer_unwind.

It would be somewhat complicated by the need to go to some other window
if that calling window no longer exists.  We need to decide which
window.  This dilemma might have been what moved me to put that
Fset_frame_selected_window in in the first place.  :-(

So I see the fix somewhat along the lines of removing the offending
Fset_frame_selected_window from minibuffer_unwind, and maybe rearranging
the calls to record_unwind_protect* in read_minibuf to arrange for the
window configuration call to do the job of restoring the "current"
window.

It seems to me you might want to put the fix into Emacs 29.  Am I right?

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 1 year and 340 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.