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: Mon, 2 Nov 2020 18:51:47 +0000 Message-ID: <20201102185147.GC7297@ACM> References: <20201030220917.GA17594@ACM> <83v9eq97sj.fsf@gnu.org> <20201031161422.GA5887@ACM> <83d00ygx9c.fsf@gnu.org> <20201031194419.GC5887@ACM> <834kmago8m.fsf@gnu.org> <20201031203914.GD5887@ACM> <835z6ogc1h.fsf@gnu.org> <20201101195313.GA6190@ACM> <83sg9rd6cp.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="10451"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 02 19:53:27 2020 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 1kZexJ-0002b2-HH for ged-emacs-devel@m.gmane-mx.org; Mon, 02 Nov 2020 19:53:25 +0100 Original-Received: from localhost ([::1]:36156 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZexI-000732-It for ged-emacs-devel@m.gmane-mx.org; Mon, 02 Nov 2020 13:53:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZevn-0005sP-Tg for emacs-devel@gnu.org; Mon, 02 Nov 2020 13:51:51 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:52033 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1kZevl-0002Og-Oj for emacs-devel@gnu.org; Mon, 02 Nov 2020 13:51:51 -0500 Original-Received: (qmail 22812 invoked by uid 3782); 2 Nov 2020 18:51:47 -0000 Original-Received: from acm.muc.de (p4fe15baf.dip0.t-ipconnect.de [79.225.91.175]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Mon, 02 Nov 2020 19:51:47 +0100 Original-Received: (qmail 28800 invoked by uid 1000); 2 Nov 2020 18:51:47 -0000 Content-Disposition: inline In-Reply-To: <83sg9rd6cp.fsf@gnu.org> X-Delivery-Agent: TMDA/1.1.12 (Macallan) 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-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/02 13:51:47 X-ACL-Warn: Detected OS = FreeBSD 9.x or newer [fuzzy] 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:258633 Archived-At: 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 > > /* 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).