GNU bug report logs -
#63967
28.2; switch-to-buffer in normal window fails if minibuffer window is active
Previous Next
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
View this message in rfc822 format
Hello, Eli.
On Wed, Jun 14, 2023 at 15:15:14 +0300, Eli Zaretskii wrote:
> > Date: Tue, 13 Jun 2023 21:36:37 +0000
> > Cc: al <at> petrofsky.org, rudalics <at> gmx.at, monnier <at> iro.umontreal.ca,
> > 63967 <at> debbugs.gnu.org, acm <at> muc.de
> > From: Alan Mackenzie <acm <at> muc.de>
> >
> > 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?
> Yes. I wouldn't be pinging you if it weren't so.
> So I hope you will present a suggested patch soon, and that it will be
> simple and safe enough to install on the release branch. TIA.
After spending quite some time looking at why that call to
Fset_frame_selected_window went in in the first place, and checking
quite a few of the bug scenarios from 2021, I'm now convinced that the
sole fix we need is to remove that call from minibuffer_unwind.
It's certainly a simple patch, and I think it's safe enough for Emacs
29. Maybe other people (e.g. Martin) would be good enough to give it a
quick going over before we commit it.
diff --git a/src/minibuf.c b/src/minibuf.c
index d5f95968ae1..bcb7eb9375d 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -1266,9 +1266,6 @@ minibuffer_unwind (void)
set_window_buffer (window, Fcar (entry), 0, 0);
Fset_window_start (window, Fcar (Fcdr (entry)), Qnil);
Fset_window_point (window, Fcar (Fcdr (Fcdr (entry))));
- /* set-window-configuration may/will have unselected the
- mini-window as the selected window. Restore it. */
- Fset_frame_selected_window (exp_MB_frame, window, Qnil);
}
else
set_window_buffer (window, nth_minibuffer (0), 0, 0);
--
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.