bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#63967: 28.2; switch-to-buffer in normal window fails if minibuffer w


From: Alan Mackenzie
Subject: bug#63967: 28.2; switch-to-buffer in normal window fails if minibuffer window is active
Date: Sat, 17 Jun 2023 11:31:54 +0000

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@petrofsky.org, rudalics@gmx.at, monnier@iro.umontreal.ca,
> >   63967@debbugs.gnu.org, acm@muc.de
> > From: Alan Mackenzie <acm@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).





reply via email to

[Prev in Thread] Current Thread [Next in Thread]