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: Sat, 31 Oct 2020 18:45:19 +0200 Message-ID: <83d00ygx9c.fsf@gnu.org> References: <83y2k8y6qs.fsf@gnu.org> <20201014194904.GD7651@ACM> <83sgafy56d.fsf@gnu.org> <20201015180143.GA10229@ACM> <83wnzrwdy5.fsf@gnu.org> <20201021151945.GA19276@ACM> <20201021200438.GF19276@ACM> <83h7qmkzla.fsf@gnu.org> <20201030220917.GA17594@ACM> <83v9eq97sj.fsf@gnu.org> <20201031161422.GA5887@ACM> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22238"; 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 Sat Oct 31 17:47:33 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 1kYu2O-0005gG-Uk for ged-emacs-devel@m.gmane-mx.org; Sat, 31 Oct 2020 17:47:32 +0100 Original-Received: from localhost ([::1]:45600 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYu2N-0003Qa-Ts for ged-emacs-devel@m.gmane-mx.org; Sat, 31 Oct 2020 12:47:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50644) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYu0W-0002SW-9f for emacs-devel@gnu.org; Sat, 31 Oct 2020 12:45:37 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:40734) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYu0V-0008HF-Eq; Sat, 31 Oct 2020 12:45:35 -0400 Original-Received: from [176.228.60.248] (port=3055 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kYu0U-0005f8-Pg; Sat, 31 Oct 2020 12:45:35 -0400 In-Reply-To: <20201031161422.GA5887@ACM> (message from Alan Mackenzie on Sat, 31 Oct 2020 16:14:22 +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:258586 Archived-At: > Date: Sat, 31 Oct 2020 16:14:22 +0000 > Cc: emacs-devel@gnu.org > From: Alan Mackenzie > > > > @@ -416,11 +471,12 @@ read_minibuf (Lisp_Object map, Lisp_Object initial, Lisp_Object prompt, > > > { > > > Lisp_Object str > > > = build_string ("Command attempted to use minibuffer while in minibuffer"); > > > - if (EQ (selected_window, minibuf_window)) > > > - Fsignal (Quser_error, (list1 (str))); > > > + if (!minibuf_follows_frame () > > > + || EQ (selected_window, minibuf_window)) > > > + Fsignal (Quser_error, (list1 (str))); > > > I don't think I understand this change: what does > > minibuffer-follows-selected-frame have to do with recursive minibuffer > > usage? They are two independent features. > > They're not as independent as all that. The existing logic appeared to > say "if we're in the miniwindow, just abort the current command, > otherwise abort all nested commands.". Extending that logic to when we > have several miniwindows, we'd (perhaps) get "if we're in _A_ miniwindow > just abort the current command.". > > Which, further extended, goes "if we're in ANY window, just abort the > current command.". I agree, this is an independent feature from the > main one. But it brings consistency (and, possibly, usability) to this > abort facility. I can put this back to more or less what it was. But > why do we abort the whole command stack when there's just a single > error? Sorry, you've lost me here. The existing logic is: if we are in a minibuffer with minibuf_level > 1, then we throw to top-level, either by signaling a user-error or silently. Your change introduced the call to minibuf_follows_frame into this equation, and I just cannot understand what business does it have here? Recursive minibuffers should be "verboten" regardless of whether the minibuffer follows the selected frame or not. What am I missing here? > > > - /* Empty out the minibuffers of all frames other than the one > > > - where we are going to display one now. > > > - 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; > > > - > > > - if (! NILP (mini_window) && ! EQ (mini_window, minibuf_window) > > > - && !NILP (Fwindow_minibuffer_p (mini_window))) > > > - /* 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); > > > - } > > > Does this mean the minibuffers on other frames will now not be emptied? > > Yes, indeed. If minibuffer-follows-selected-frame, there'll only be a > single mini-window, which we're about to write into, so there's no point > emptying out a null set of other windows. That's the intention, perhaps, but are we really 110% sure this will happen? And where's the alternative code which will make sure the other minibuffers are cleared in this case?