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, 20 Mar 2021 12:24:55 +0000

Hello, Eli.

On Sat, Mar 20, 2021 at 12:49:05 +0200, Eli Zaretskii wrote:
> > Date: Sat, 20 Mar 2021 10:28:26 +0000
> > Cc: rudalics@gmx.at, monnier@iro.umontreal.ca, jakanakaevangeli@chiru.no,
> >   emacs-devel@gnu.org
> > From: Alan Mackenzie <acm@muc.de>

> > > I think this is the initial frame that exists in every Emacs session
> > > when it starts, except that in the daemon we don't delete it.  It's a
> > > non-GUI frame which exists just to keep code that expects some frame
> > > to exist happy.

> > This initial frame gets used as a normal frame when one calls

> >     $ emacsclient foo

> > for the first time.

> Are you sure?  ISTR that we create a new frame on the terminal from
> which emacsclient was invoked.  The initial frame is never used except
> at startup and when the daemon should do something while it has no
> clients.

Apologies, I was wrong.  On the first emacsclient call, a second frame
gets created.  The initial frame is marked in some way so that, e.g., C-x
5 o doesn't see it.

> > It stays in use until one clicks on its close
> > button (I think this is actually the close button of the containing
> > xterm).  When a new GUI frame is brought up by

> >     M-: (run-at-time 10 nil #'make-frame '((window-system . x)))

> > , the initial frame may or may not have been "closed" by clicking its
> > close button.  I think you're telling me that it's not possible to
> > distinguish these two cases.  If so, that's surely a defect in Emacs.

> No, I'm saying that the initial frame is never deleted.  At least
> that's my recollection.

So, when a new frame is created (possibly with emacsclient), and there
are now exactly two frames, we want to copy any minibuffers from the
other frame to the new one when that other frame is the initial frame.

I still can't find a way of identifying the initial frame for sure - it
lacks a 'display frame parameter, but so do ordinary frames on a tty.  It
lacks a 'client frame parameter, but so do ordinary frames when Emacs is
started normally and M-x server-start invoked.

Would it, perhaps, be useful to add another frame parameter
'initial-frame to identify this frame?

[ .... ]

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

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