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.bugs Subject: bug#56305: 29.0.50; 'yes-or-no-p' deselects minibuffer frame Date: Sun, 17 Jul 2022 11:29:51 +0000 Message-ID: References: <61fe102b-eec2-9711-560e-c141ed3cc6e4@gmx.at> <171bab25-5eb2-884b-5c32-bcfe4fed21cc@gmx.at> 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="8169"; mail-complaints-to="usenet@ciao.gmane.io" Cc: martin rudalics , Eli Zaretskii , 56305@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 17 13:31:21 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oD2Ua-0001zY-VV for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Jul 2022 13:31:20 +0200 Original-Received: from localhost ([::1]:40854 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oD2UZ-0002qj-ET for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Jul 2022 07:31:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46598) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oD2UI-0002qZ-J5 for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 07:31:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:49044) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oD2UI-00028M-7i for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 07:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oD2UH-0004g1-Re for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 07:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Jul 2022 11:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56305 X-GNU-PR-Package: emacs Original-Received: via spool by 56305-submit@debbugs.gnu.org id=B56305.16580574039582 (code B ref 56305); Sun, 17 Jul 2022 11:31:01 +0000 Original-Received: (at 56305) by debbugs.gnu.org; 17 Jul 2022 11:30:03 +0000 Original-Received: from localhost ([127.0.0.1]:46803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oD2TJ-0002UF-VC for submit@debbugs.gnu.org; Sun, 17 Jul 2022 07:30:02 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:64255 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1oD2TH-0002Tm-38 for 56305@debbugs.gnu.org; Sun, 17 Jul 2022 07:30:00 -0400 Original-Received: (qmail 51498 invoked by uid 3782); 17 Jul 2022 11:29:52 -0000 Original-Received: from acm.muc.de (p4fe152b5.dip0.t-ipconnect.de [79.225.82.181]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 17 Jul 2022 13:29:52 +0200 Original-Received: (qmail 6461 invoked by uid 1000); 17 Jul 2022 11:29:51 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:237256 Archived-At: Hello, Stefan. On Sat, Jul 16, 2022 at 19:39:10 -0400, Stefan Monnier wrote: > > You're barking at the wrong tree. That code worked well for half of its > > lifetime. What really got us into the present bredouille was commit > > 6355802033d202c63f6fff4b77bf2b0c7aecceef and its ill-fated decision to > > call Fselect_window instead of directly setting selected frame and > > window as the well-established and tested code in display_mode_lines > > did and still does. > In case you intend to fix this apparent blunder of mine: the point of > that commit was to set the selected window and frame so that ELisp code > run from the `mode-line-format` would see meaningful and consistent > values of selected-frame/window (and companions like the > frame-selected-window of the selected-frame, ...). Yes, like I guessed in my post yesterday in this thread. > If calling `Fselect_window` with a non-nil `norecord` argument messes > things up somehow then maybe we should fix `Fselect_window` accordingly, > or otherwise provide a "more bare bones" function that DTRT. I would be in favour of the "more bare bones" function. Fselect_window is pretty much a command, and does far too much (including sometimes shifting the focus) for an internal low-level function. It's doc string is incomplete in this regard, and its entry in the Elisp manual is vague and shifty. Fselect_frame (or more precisely do_switch_frame) is a place where the trouble occurs, or certainly was before my removal of the 53 lines focus redirecting/shifting code ~10 days ago. That removed code seems to be needed for correct frame switching with a minibuffer-only frame, but in the middle of do_switch_frame doesn't seem to be the optimal place for it. > It seems clear to me, for example, that when called with a non-nil > `norecord` (like in the mode-line code), `Fselect_window` should never > cause any change to the focus redirection (or the focus itself). > And neither should it call things like `resize_mini_window`, I think. It would be a mistake to couple focus switching with NORECORD, something which is only coincidentally tied to the focus. > > In the sequel, obscure bugs began to pile up, all very difficult to > > describe and reproduce (Bug#23124, Bug#24285, Bug#34317) and were fixed > > with some trickery. The origin of all that evil remained in place. > I can't see the connection between these bugs at the above commit, sorry. Neither can I, but Martin's spent quite a few years analysing these things. The mechanisms of these bugs, and their connection with that 2008 patch are likely involved and complicated. The current state of affairs is that Emacs 28 is unusable to some people who prefer a separate minibuffer frame (in particular, Drew Adams) and it may well be worth our while to identify the current bugs and fix them. > Stefan -- Alan Mackenzie (Nuremberg, Germany).