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: Mon, 2 Nov 2020 18:51:47 +0000

Hello, Eli.

On Mon, Nov 02, 2020 at 19:19:18 +0200, Eli Zaretskii wrote:
> > Date: Sun, 1 Nov 2020 19:53:13 +0000
> > Cc: emacs-devel@gnu.org
> > From: Alan Mackenzie <acm@muc.de>

> >   /* Empty out the minibuffers of all frames, except those frames
> >      where there is an active minibuffer.
> >      Set them to point to ` *Minibuf-0*', which is always empty.  */
> >   empty_minibuf = get_minibuffer (0);
> > 
> >   FOR_EACH_FRAME (dummy, frame)
> >     {
> >       Lisp_Object root_window = Fframe_root_window (frame);
> >       Lisp_Object mini_window = XWINDOW (root_window)->next;
> >       Lisp_Object buffer;
> > 
> >       if (!NILP (mini_window) && !EQ (mini_window, minibuf_window)
> >           && !NILP (Fwindow_minibuffer_p (mini_window)))
> >         {
> >           buffer = XWINDOW (mini_window)->contents;
> >           if (NILP (Fminibufferp (buffer, Qt)))       
> > <========================
> >             /* Use set_window_buffer instead of Fset_window_buffer (see
> >                discussion of bug#11984, bug#12025, bug#12026).  */
> >             set_window_buffer (mini_window, empty_minibuf, 0, 0);
> >         }
> >     }

> > Here Fminibufferp (with the new argument Qt) tests for an active
> > minibuffer.  This code appears to work well.

> Please just use the guts of Fminibufferp; the tests it does on its
> argument are not needed here.

Sorry, I can't follow you, here.  What do you mean by "the guts" of
Fminibufferp?  What things do you mean that the word "just" should
exclude?

> Also, won't this condition catch  *Minibuf-0* as well?

The Qt argument will cause Fminibufferp to return Qnil for all buffers
except  *Minibuf-1*,  *Minibuf-2*,  ...,  *Minibuf-n*, where n is
minibuf-level.  In particular, Qnil is returned for  *Minibuf-0*, so any
mini-window showing  *Minibuf-0* would get emptied.

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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