From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Stop frames stealing eachothers' minibuffers! Date: Wed, 21 Oct 2020 14:32:21 -0400 Message-ID: References: <20201014160240.GA7651@ACM> <83d01kzswk.fsf@gnu.org> <20201014163534.GB7651@ACM> <838sc8zqjj.fsf@gnu.org> <20201014184523.GC7651@ACM> <83y2k8y6qs.fsf@gnu.org> <20201014194904.GD7651@ACM> <83sgafy56d.fsf@gnu.org> <20201015180143.GA10229@ACM> <83wnzrwdy5.fsf@gnu.org> <20201021151945.GA19276@ACM> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29179"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: ghe@sdf.org, Eli Zaretskii , emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Oct 21 20:33:41 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 1kVIvd-0007TJ-Eb for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Oct 2020 20:33:41 +0200 Original-Received: from localhost ([::1]:53526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVIvc-0001s2-HT for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Oct 2020 14:33:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVIuU-000189-0c for emacs-devel@gnu.org; Wed, 21 Oct 2020 14:32:30 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:27901) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVIuR-0005l2-IB; Wed, 21 Oct 2020 14:32:29 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 565A04410A6; Wed, 21 Oct 2020 14:32:24 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E1C5C44050F; Wed, 21 Oct 2020 14:32:22 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1603305142; bh=SQ76AM7Qz94d/6ghSwspRQqUAJcNSIQwBPkGinhxCfw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dObKMN5aUYdMQNoOMd9CgDLZvvAtmJg1N0xEsebBwwpUhgkg9wr3yDVPzrIgOZpjZ 8YTcA+zvPMmWgPTl2pIZmHL5hCBzhxf/q1SxqcRSZKpQ8B2h8Mqx7m5OQDy7BBwLbC JtFO6WM4ps/tOQdnNsHI+oD66hosjca6iGmZdJXQrSgj4Nr83h0PxMw3/GYdbuuZBX XiY2gi91oEyhlgp4akqoRbqbgoEffX5kDTCf5jnPDbY/XzX619YZaJAITJ7nrxr704 QgVez4sAJ8Cf+0bx7Br8+I0YXBodEOf62HNb2aMVMsVb7U5ulz501x0kxjLbfOALcn P6P9tOl7xiLSQ== Original-Received: from alfajor (unknown [157.52.9.240]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B2FAD1202A8; Wed, 21 Oct 2020 14:32:22 -0400 (EDT) In-Reply-To: <20201021151945.GA19276@ACM> (Alan Mackenzie's message of "Wed, 21 Oct 2020 15:19:45 +0000") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/21 14:32:24 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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:258247 Archived-At: Thanks Alan, This looks pretty good to me (haven't tried it yet). Some comments/questions below, Stefan > @@ -86,6 +86,19 @@ useful on systems such as FreeBSD which ships only with "etc/termcap". > * Changes in Emacs 28.1 > > +++ > +** Switching frames when a minibuffer is active has been rationalized. > +By default, the minibuffer is moved to the newly selected frame. When > +the current command is continued (by completing the minibuffer > +action), it takes effect in the frame the minibuffer was first opened > +in. An alternative behavior is available by customizing > +'minibuffer-follows-frame' to nil; here, the minibuffer stays on the > +frame it was first opened on, and you must switch back to this frame > +to continue or abort the current command. The old (pre 28.1), > +somewhat chaotic behavior is no longer available. > + > ++++ > +*** A new system for displaying documentation for groups of function is added. > + > ** New system for displaying documentation for groups of function. > This can either be used by saying 'M-x shortdoc-display-group' and > choosing a group, or clicking a button in the *Help* buffers when Looks like a chunk of Lars's shortdoc got brought along. > +static bool > +minibuf_follows_frame (void) > +{ > + return !NILP (Fdefault_toplevel_value (Qminibuffer_follows_frame)); > +} I can't think of any reason why we'd need to bother with `Fdefault_toplevel_value` here. I think the only justification would be if using some other value could result in a crash or in garbled display, but AFAICT it could only result (in the worst case) in a vaguely unexpected behavior where the mininbuffer follows the frame when it shouldn't or vice versa. > + FOR_EACH_FRAME (tail, frame) > + { > + if (EQ (XWINDOW (XFRAME (frame)->minibuffer_window)->contents, > + buffer)) > + { > + minibuf_window = XFRAME (frame)->minibuffer_window; > + goto after_set; > + } > + minibuf_window = sf->minibuffer_window; > + after_set: ; > + } I don't understand the: minibuf_window = sf->minibuffer_window Won't this undo the minibuf_window = XFRAME (frame)->minibuffer_window; executed in a previous iteration? Should this be moved to just before the loop maybe? > + /* OLD STOUGH, 2020-10-21 */ Not sure how useful this is. I'd either remove this comment or replace it with an actual explanation of what's going on and/or how the code used to work. Stefan