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: Sun, 11 Jun 2023 13:40:52 +0000 Message-ID: References: <83o7lo28e6.fsf@gnu.org> <83fs701uts.fsf@gnu.org> <83a5x81m33.fsf@gnu.org> <83a5x6zj38.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="11992"; mail-complaints-to="usenet@ciao.gmane.io" Cc: al@petrofsky.org, rudalics@gmx.at, 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 Sun Jun 11 15:42: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 1q8LKl-0002ul-EN for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Jun 2023 15:42:19 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q8LKV-0002Qe-5Y; Sun, 11 Jun 2023 09:42:03 -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 1q8LKT-0002QN-WF for bug-gnu-emacs@gnu.org; Sun, 11 Jun 2023 09:42: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 1q8LKT-0000EQ-NN for bug-gnu-emacs@gnu.org; Sun, 11 Jun 2023 09:42:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q8LKT-0003XM-JL for bug-gnu-emacs@gnu.org; Sun, 11 Jun 2023 09:42: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, 11 Jun 2023 13:42: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.168649086213509 (code B ref 63967); Sun, 11 Jun 2023 13:42:01 +0000 Original-Received: (at 63967) by debbugs.gnu.org; 11 Jun 2023 13:41:02 +0000 Original-Received: from localhost ([127.0.0.1]:36855 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8LJV-0003Vm-JH for submit@debbugs.gnu.org; Sun, 11 Jun 2023 09:41:02 -0400 Original-Received: from mx3.muc.de ([193.149.48.5]:52873) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q8LJT-0003VD-Iw for 63967@debbugs.gnu.org; Sun, 11 Jun 2023 09:41:00 -0400 Original-Received: (qmail 15621 invoked by uid 3782); 11 Jun 2023 15:40:53 +0200 Original-Received: from acm.muc.de (pd953a4c0.dip0.t-ipconnect.de [217.83.164.192]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 11 Jun 2023 15:40:53 +0200 Original-Received: (qmail 10752 invoked by uid 1000); 11 Jun 2023 13:40:52 -0000 Content-Disposition: inline In-Reply-To: <83a5x6zj38.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:263246 Archived-At: Hello, Eli. On Sun, Jun 11, 2023 at 08:03:23 +0300, Eli Zaretskii wrote: > > Date: Sat, 10 Jun 2023 19:42:04 +0000 > > Cc: Eli Zaretskii , al@petrofsky.org, rudalics@gmx.at, > > 63967@debbugs.gnu.org > > From: Alan Mackenzie > > > I understand why we do the `set_window_buffer` and set its start and > > > point, but I can't see why we'd need to select the mini-window: > > > presumably if it needed to be (re)selected that should have been handled > > > by the window-config save&restore, no? > > There was a problem with the restoring of the window configuration > > selecting a window other than the minibuffer; that is in circumstances > > where the minibuffer window should have ended up being selected. > > Fset_window_configuration seems to be the troublesome function in this > > scenario. As well as setting the window configuration, it also selects > > a window. > Where is that problem and its circumstances described? Is there some > bug number or a discussion on emacs-devel that you could point to? I remember such a discussion vaguely, but after much searching, haven't been able to find it again. Sorry. > > Perhaps we should modify the minibuffer code to note which window should > > be current after the completion or abortion of the minibuffer read > > action. > Isn't that simply "the window which was selected before entering the > minibuffer"? Most of the time, yes. If that window no longer exists on termination of the minibuffer, or we've moved to a different frame, things aren't so simple. In read_minibuf (the meat of the minibuffer processing), there is a variable calling_window which records that window. It gets pushed onto the binding stack (along with a lot of other variables) around the recursive edit, and then possibly restored in the unwind_protect function read_minibuf_unwind. However, restore_window_configuration overrides it, because of the order these things are pushed onto the binding stack by read_minibuf. 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. -- Alan Mackenzie (Nuremberg, Germany).