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 15:06:09 +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="20836"; mail-complaints-to="usenet@ciao.gmane.io" Cc: martin rudalics , Eli Zaretskii , 56305@debbugs.gnu.org, acm@muc.de To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 17 17:07:15 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 1oD5rX-0005DS-72 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Jul 2022 17:07:15 +0200 Original-Received: from localhost ([::1]:49522 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oD5rW-0002pI-3E for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 17 Jul 2022 11:07:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oD5rM-0002os-2l for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 11:07:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50564) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oD5rK-00083c-MJ for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 11:07:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oD5rK-0004AN-I3 for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2022 11:07:02 -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 15:07:02 +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.165807038115970 (code B ref 56305); Sun, 17 Jul 2022 15:07:02 +0000 Original-Received: (at 56305) by debbugs.gnu.org; 17 Jul 2022 15:06:21 +0000 Original-Received: from localhost ([127.0.0.1]:48323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oD5qe-00049W-Tb for submit@debbugs.gnu.org; Sun, 17 Jul 2022 11:06:21 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:14580 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1oD5qb-00049F-AB for 56305@debbugs.gnu.org; Sun, 17 Jul 2022 11:06:19 -0400 Original-Received: (qmail 92900 invoked by uid 3782); 17 Jul 2022 15:06:10 -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 17:06:10 +0200 Original-Received: (qmail 7622 invoked by uid 1000); 17 Jul 2022 15:06:09 -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:237276 Archived-At: Hello, Stefan. On Sun, Jul 17, 2022 at 10:03:23 -0400, Stefan Monnier wrote: > > 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. > But the interactive calls have nil for `norecord`. Some of them might not. I don't see how that observation relates to my quoted paragraph, though. > >> 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. > Currently `norecord` is the flag used to indicate that this is an > "internal" `select-window` call, typically part of something like > `with-selected-window` or `save-window-excursion`, which seem like good > candidates to use the more "bare bones" select-window semantics (whose > difference in semantics I don't fully comprehend, to be honest, so > hopefully, this discussion will lead to doc (or at least comment) > changes to describe those differences). I was thinking about some primitive such as select_window_no_focus, and/or select_frame_no_focus (although do_switch_frame pretty much is this, now). These would do what s-w and s-f do, but rigorously refrain from setting the focus, redirecting the focus in any frame, raising a frame, and so on. > There might indeed be other calls to `select-window` that specify the > `norecord` arg for some other reason, so maybe linking the two that > way is not a good idea, I don't know. I think it is a fundamentally bad idea. There's no conceptual connection between recording a position in a window list and changing a window manager's focus. > > 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. > Yes, I didn't mean to say they didn't exist, just that I wasn't able > to see them. OK. > > 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. > As you might know, I'm in that same boat :-) Ah, good. ;-) Are you able and willing to formalise bugs in this area, so that we can set about eradicating them? As you know, I only rarely run Emacs on a window manager. > Stefan -- Alan Mackenzie (Nuremberg, Germany).