emacs-devel
[Top][All Lists]
Advanced

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

Re: Stop frames stealing eachothers' minibuffers!


From: Alan Mackenzie
Subject: Re: Stop frames stealing eachothers' minibuffers!
Date: Sat, 14 Nov 2020 18:48:58 +0000

Hello, Eli.

On Sat, Nov 14, 2020 at 19:12:24 +0200, Eli Zaretskii wrote:
> > Date: Sat, 14 Nov 2020 15:36:43 +0200
> > From: Eli Zaretskii <eliz@gnu.org>
> > Cc: enometh@meer.net, monnier@iro.umontreal.ca, andreyk.mad@gmail.com,
> >  emacs-devel@gnu.org

> > > Date: Wed, 11 Nov 2020 20:37:16 +0000
> > > Cc: Andrii Kolomoiets <andreyk.mad@gmail.com>, monnier@iro.umontreal.ca,
> > >   enometh@meer.net, emacs-devel@gnu.org
> > > From: Alan Mackenzie <acm@muc.de>

> > > > > C-x 5 2
> > > > > M-x
> > > > > C-x 5 o
> > > > > M-x

> > > > > With the default setting of `enable-recursive-minibuffers`, the
> > > > > minibuffer is moved to active frame, but the error message is 
> > > > > displayed
> > > > > in the other frame.

> > > > Arguably a bug.  Alan, could you please look into this?

> > > I think this is a bug, too.

> > > I've been looking at the C sources for some while but haven't found
> > > anything useful.  I've tried setting echo_area_window during the frame
> > > change, but this doesn't have any visible effect.

> > > I'll carry on with the diagnosis.  Any quick tips would be welcome.

> > My guess is that this is somehow related to the fact that error
> > messages are displayed as part of handling an error signal, which
> > causes a throw to top level.

> Specifically, read-from-minibuffer (called when we type the first M-x)
> binds some variables, then enters recursive-edit.  When the error
> unwinds the stack, it restores the original window configuration,
> which includes the frame which was selected back then.  And that
> undoes the effect of "C-x 5 o", so the error message is displayed on
> the original frame.

Thanks!  I was approaching the same conclusion myself, but much more
slowly than you.  ;-)

Arguably, Fset_window_configuration selecting the pertinent frame is a
bug in the specification of that function - one should be able to restore
a frame's configuration without selecting the frame as well.  However,
backwards compatibility, and all that....

I propose fixing the bug at the place where read_minibuf saves the frame
configuration.  As well as saving that frame configuration, it should
additionally save another Lisp_Object for which nil means "restore the
selected frame", non-nil means "don't restore it".
Fset_window_configuration would acquire an extra &optional parameter with
the same meaning.

The function restore_window_configuration, frustratingly, is used in only
one place apart from read_minibuf, and that is in an obsolete byte code
in bytecode.c.

What do you think?

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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