From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Stop frames stealing eachothers' minibuffers! Date: Sat, 20 Mar 2021 10:28:26 +0000 Message-ID: References: <83blbhcz41.fsf@gnu.org> <83sg4sbs6w.fsf@gnu.org> <694e12db-a19c-31f8-077c-62d32b640eb9@gmx.at> <83o8fgfgjn.fsf@gnu.org> <83mtuze31r.fsf@gnu.org> <838s6jdthq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20515"; mail-complaints-to="usenet@ciao.gmane.io" Cc: rudalics@gmx.at, monnier@iro.umontreal.ca, jakanakaevangeli@chiru.no, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 20 11:29:16 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lNYr6-0005F3-Q7 for ged-emacs-devel@m.gmane-mx.org; Sat, 20 Mar 2021 11:29:16 +0100 Original-Received: from localhost ([::1]:44252 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lNYr4-0000lI-Db for ged-emacs-devel@m.gmane-mx.org; Sat, 20 Mar 2021 06:29:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33424) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lNYqP-0000Ki-Ik for emacs-devel@gnu.org; Sat, 20 Mar 2021 06:28:33 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:43633 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1lNYqN-0003hu-A5 for emacs-devel@gnu.org; Sat, 20 Mar 2021 06:28:33 -0400 Original-Received: (qmail 88012 invoked by uid 3782); 20 Mar 2021 10:28:27 -0000 Original-Received: from acm.muc.de (p2e5d55b2.dip0.t-ipconnect.de [46.93.85.178]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 20 Mar 2021 11:28:26 +0100 Original-Received: (qmail 4952 invoked by uid 1000); 20 Mar 2021 10:28:26 -0000 Content-Disposition: inline In-Reply-To: <838s6jdthq.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266638 Archived-At: Hello, Eli. On Fri, Mar 19, 2021 at 17:59:45 +0200, Eli Zaretskii wrote: > > Date: Fri, 19 Mar 2021 15:35:13 +0000 > > Cc: rudalics@gmx.at, monnier@iro.umontreal.ca, jakanakaevangeli@chiru.no, > > emacs-devel@gnu.org > > From: Alan Mackenzie > > > > , the new frame comes up _with_ the minibuffer visible. I don't > > > > understand how the mini window survived with its contents, and it > > > > worries me. > > > Why does it worry you? You've asked Emacs to create a frame, and a > > > frame by default has a mini-window. Right? > > I understand it a lot better now. The new mini-window gets the > > minibuffers only because I had minibuffer-follows-selected-frame set to > > t. With either of the other values, the minibuffers remain on the old > > inaccessible frame. This is not good. > Can't you move them from those inaccessible frames to this one? The actual moving of the minibuffers isn't the problem .... > > > > Could it be that the last frame isn't actually deleted from the Emacs > > > > daemon when clicking on its close button? > > > I think indeed that's what happens, because otherwise clicking there > > > would have shut down Emacs -- which it doesn't in the daemon case. > > Yes, this is the case. I would dearly like to find a way of determining > > if this last frame is still visible, or iconified, or whatever, as > > opposed to inaccessible. > 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. 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. > > The old frame in the above recipe was a -nw frame, effectively a > > TTY, and `frame-visible-p' returns t for it, even though it is not > > even displayable (it's containing shell has gone). > We don't have a means of knowing whether a TTY frame is displayed, it > conceptually always is. Perhaps we should create some means of knowing this? Maybe in handle-delete-frame, where Emacs has determined there is only one frame left, before calling save-buffers-kill-emacs we could mark the last frame's f->visible to "not visible". Or maybe set up a special non-zero dummy value for f->terminal. Or something like that. > > Hmm. There is effectively nothing about the effect of Emacs as a daemon > > in Elisp. > There's nothing special about that, just some implementation details. OK. I'm not sure I agree, but it's not really a big point. -- Alan Mackenzie (Nuremberg, Germany).