From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Stop frames stealing eachothers' minibuffers! Date: Mon, 02 Nov 2020 19:19:18 +0200 Message-ID: <83sg9rd6cp.fsf@gnu.org> References: <20201021200438.GF19276@ACM> <83h7qmkzla.fsf@gnu.org> <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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36929"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 02 18:31:54 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 1kZdgQ-0009Vd-CV for ged-emacs-devel@m.gmane-mx.org; Mon, 02 Nov 2020 18:31:54 +0100 Original-Received: from localhost ([::1]:48154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZdgP-0002oa-De for ged-emacs-devel@m.gmane-mx.org; Mon, 02 Nov 2020 12:31:53 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55752) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kZdUP-0005v9-3J for emacs-devel@gnu.org; Mon, 02 Nov 2020 12:19:29 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50701) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kZdUO-0007Vv-5x; Mon, 02 Nov 2020 12:19:28 -0500 Original-Received: from [176.228.60.248] (port=3592 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kZdUN-0000mj-GN; Mon, 02 Nov 2020 12:19:28 -0500 In-Reply-To: <20201101195313.GA6190@ACM> (message from Alan Mackenzie on Sun, 1 Nov 2020 19:53:13 +0000) 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:258632 Archived-At: > 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. Also, won't this condition catch *Minibuf-0* as well?