From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#63967: 28.2; switch-to-buffer in normal window fails if minibuffer window is active Date: Sat, 10 Jun 2023 11:49:43 -0400 Message-ID: References: <83o7lo28e6.fsf@gnu.org> <83fs701uts.fsf@gnu.org> <83a5x81m33.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15283"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: al@petrofsky.org, rudalics@gmx.at, Eli Zaretskii , 63967@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jun 10 17:50:14 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 1q80qy-0003il-T5 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 10 Jun 2023 17:50:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1q80qq-0004wj-OU; Sat, 10 Jun 2023 11:50: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 1q80qo-0004wS-JP for bug-gnu-emacs@gnu.org; Sat, 10 Jun 2023 11:50: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 1q80qo-0002TV-Ab for bug-gnu-emacs@gnu.org; Sat, 10 Jun 2023 11:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1q80qo-0008HA-77 for bug-gnu-emacs@gnu.org; Sat, 10 Jun 2023 11:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Jun 2023 15:50:02 +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.168641219931798 (code B ref 63967); Sat, 10 Jun 2023 15:50:02 +0000 Original-Received: (at 63967) by debbugs.gnu.org; 10 Jun 2023 15:49:59 +0000 Original-Received: from localhost ([127.0.0.1]:36129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q80ql-0008Gl-22 for submit@debbugs.gnu.org; Sat, 10 Jun 2023 11:49:59 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:51735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q80qi-0008GV-9R for 63967@debbugs.gnu.org; Sat, 10 Jun 2023 11:49:57 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id E3073801D6; Sat, 10 Jun 2023 11:49:50 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 439D980443; Sat, 10 Jun 2023 11:49:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1686412185; bh=B19BO6jDgDh2Cl1VRyxcuMCJAavHC3PbpVPTrsDFFTA=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=DMnZPzfH/T1nnkTAdCLmYC2a5Qv4o/sangP/znEW+C45JhrVzR5fDrBK3t5nLCtcu 5EKf6PghK4E/IYr385CbhExrfKlPHcbalU10MgPBExVoBu3hD7U5UowJ00hUK8ynL+ Qe5LGuNu1Jt7/q9mHjjWqmKkZXSAA58AP6qxFydr60S2Ldi/TUAMjswnWoa5S21xbT zg3oJ6Wt6aosqIH4AE3MQwNNGMO15fVL7X4zKQS6dLoXkNunHAd+VdZV2+eynehmE8 W2am0k/V3gHzbuZsf+VBhXoMk5rpkB6NWzphWhYcvUeJCVv2GnTPvbbHA0xZ2hQNWA jEMRb8CcRDLoA== Original-Received: from pastel (76-10-180-239.dsl.teksavvy.com [76.10.180.239]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C6423120804; Sat, 10 Jun 2023 11:49:44 -0400 (EDT) In-Reply-To: <83a5x81m33.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 09 Jun 2023 22:18:08 +0300") 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:263222 Archived-At: Hi Alan, Could you explain why/when we need to call `Fset_frame_selected_window` in the code below: > static void > minibuffer_unwind (void) > { > struct frame *f; > struct window *w; > Lisp_Object window; > Lisp_Object entry; > > if (NILP (exp_MB_frame)) return; /* "Can't happen." */ > f = XFRAME (exp_MB_frame); > window = f->minibuffer_window; > w = XWINDOW (window); > if (FRAME_LIVE_P (f)) > { > /* minibuf_window = sf->minibuffer_window; */ > if (!NILP (w->prev_buffers)) > { > entry = Fcar (w->prev_buffers); > w->prev_buffers = Fcdr (w->prev_buffers); > set_window_buffer (window, Fcar (entry), 0, 0); > Fset_window_start (window, Fcar (Fcdr (entry)), Qnil); > Fset_window_point (window, Fcar (Fcdr (Fcdr (entry)))); > /* set-window-configuration may/will have unselected the > mini-window as the selected window. Restore it. */ > Fset_frame_selected_window (exp_MB_frame, window, Qnil); <<<<<<<<< > } > else > set_window_buffer (window, nth_minibuffer (0), 0, 0); > } > } 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? Stefan