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#63967: 28.2; switch-to-buffer in normal window fails if minibuffer window is active Date: Tue, 13 Jun 2023 21:36:37 +0000 Message-ID: References: <83o7lo28e6.fsf@gnu.org> <83fs701uts.fsf@gnu.org> <83a5x81m33.fsf@gnu.org> <83a5x6zj38.fsf@gnu.org> <83zg56xfyr.fsf@gnu.org> <83v8frursu.fsf@gnu.org> 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="28848"; mail-complaints-to="usenet@ciao.gmane.io" Cc: al@petrofsky.org, rudalics@gmx.at, acm@muc.de, monnier@iro.umontreal.ca, 63967@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 13 23:37:19 2023 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 1q9BhW-0007FU-5M for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Jun 2023 23:37:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q9BhI-0003TB-DP; Tue, 13 Jun 2023 17:37:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1q9BhG-0003SW-Bi for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 17:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1q9BhG-0007yU-2z for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 17:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q9BhF-0006o9-NF for bug-gnu-emacs@gnu.org; Tue, 13 Jun 2023 17:37: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: Tue, 13 Jun 2023 21:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63967 X-GNU-PR-Package: emacs Original-Received: via spool by 63967-submit@debbugs.gnu.org id=B63967.168669220926147 (code B ref 63967); Tue, 13 Jun 2023 21:37:01 +0000 Original-Received: (at 63967) by debbugs.gnu.org; 13 Jun 2023 21:36:49 +0000 Original-Received: from localhost ([127.0.0.1]:43204 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9Bh2-0006ne-E6 for submit@debbugs.gnu.org; Tue, 13 Jun 2023 17:36:48 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:40374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q9Bgz-0006nO-C7 for 63967@debbugs.gnu.org; Tue, 13 Jun 2023 17:36:46 -0400 Original-Received: (qmail 16247 invoked by uid 3782); 13 Jun 2023 23:36:39 +0200 Original-Received: from acm.muc.de (p4fe1589c.dip0.t-ipconnect.de [79.225.88.156]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 13 Jun 2023 23:36:39 +0200 Original-Received: (qmail 11069 invoked by uid 1000); 13 Jun 2023 21:36:37 -0000 Content-Disposition: inline In-Reply-To: <83v8frursu.fsf@gnu.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:263349 Archived-At: Hello, Eli. On Tue, Jun 13, 2023 at 21:43:13 +0300, Eli Zaretskii wrote: > > Cc: al@petrofsky.org, rudalics@gmx.at, monnier@iro.umontreal.ca, > > 63967@debbugs.gnu.org > > Date: Sun, 11 Jun 2023 16:53:48 +0300 > > From: Eli Zaretskii > > > > > Do you want me to fix this bug? It seems there are quite a lot of people > > > who've made observations about it in the last couple of days. > > > > I want to fix the bug whose recipe is in > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63967#5 and other > > similar ones, yes. Basically, if Emacs reads from a recursive > > minibuffer when the selected window before that was not a mini-window, > > we now signal a user-error, which is a regression since Emacs 28, and > > I'd like that to be solved. But please begin by looking at the > > solution proposed by Martin in > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63967#38 and tell if it > > looks good to you, and if not, why not. > Ping! Any progress there? Sorry. I've had a few very busy days in real life. Firstly, I'm reasonably sure that the Fset_frame_selected_window I put into minibuf_unwind was a mistake based on the misconception that after reading the minibuffer recursively, we always wanted to go back to the next outer minibuffer. I think Martin's patch (from 2023-06-10 08:52 +0200) is along the right lines, i.e. go back to the invoking window rather than the minibuffer window. But I'm not sure whether it might be better, from the point of view of preserving maintainability of read_minibuf, to try to get the restore_window_buffer_configuration call to go back to the calling window, rather than adding the extra parameter to minibuffer_unwind. It would be somewhat complicated by the need to go to some other window if that calling window no longer exists. We need to decide which window. This dilemma might have been what moved me to put that Fset_frame_selected_window in in the first place. :-( So I see the fix somewhat along the lines of removing the offending Fset_frame_selected_window from minibuffer_unwind, and maybe rearranging the calls to record_unwind_protect* in read_minibuf to arrange for the window configuration call to do the job of restoring the "current" window. It seems to me you might want to put the fix into Emacs 29. Am I right? -- Alan Mackenzie (Nuremberg, Germany).