From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#67993: Selecting buffer automatically Date: Wed, 10 Jan 2024 19:12:50 +0200 Organization: LINKOV.NET Message-ID: <867ckhqgqp.fsf@mail.linkov.net> References: <86zfy0g641.fsf@mail.linkov.net> <865y09nmp0.fsf@mail.linkov.net> <4659812e-c023-492a-b810-d9d3cada1ade@gmx.at> <861qauxswd.fsf@mail.linkov.net> <86cyudjdmb.fsf@mail.linkov.net> <1ea06837-0d7e-46ba-849c-a4bf42929c40@gmx.at> <86frz6o832.fsf@mail.linkov.net> <942ced7b-53f8-4b33-9280-6cdba4b6ed6b@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8132"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 67993@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jan 10 18:22:58 2024 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 1rNcI6-0001uU-4N for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Jan 2024 18:22:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rNcHQ-0002IS-Cw; Wed, 10 Jan 2024 12:22:16 -0500 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 1rNcHG-00028d-JN for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 12:22:07 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rNcHE-0006J5-3K for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 12:22:05 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rNcHC-0004uB-Oy for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2024 12:22:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jan 2024 17:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67993 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 67993-submit@debbugs.gnu.org id=B67993.170490731118787 (code B ref 67993); Wed, 10 Jan 2024 17:22:02 +0000 Original-Received: (at 67993) by debbugs.gnu.org; 10 Jan 2024 17:21:51 +0000 Original-Received: from localhost ([127.0.0.1]:42720 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNcH0-0004sx-Mu for submit@debbugs.gnu.org; Wed, 10 Jan 2024 12:21:50 -0500 Original-Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]:40293) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rNcGy-0004sG-A8 for 67993@debbugs.gnu.org; Wed, 10 Jan 2024 12:21:48 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 070691BF206; Wed, 10 Jan 2024 17:21:41 +0000 (UTC) In-Reply-To: <942ced7b-53f8-4b33-9280-6cdba4b6ed6b@gmx.at> (martin rudalics's message of "Wed, 10 Jan 2024 09:37:26 +0100") X-GND-Sasl: juri@linkov.net 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:277787 Archived-At: >>> That's why any such 'select-window' call (or its avoidance) you >>> propose would be better handled within 'display-buffer' and not later >>> in a 'post-command-hook'. >> >> No way to call 'select-window' immediately, because this will >> break too many functions that expect a window to be selected >> from the previous call of pop-to-buffer until the command >> is finished. > > Do you mean that if I have two 'pop-to-buffer' calls within one and the > same command, the first one has a (select-window . nil) entry and the > second one no such entry, then the entry from the first call will cause > the window from the second call to get deselected? If so, then this > deserves a special explanation in the manual. This is what I see with the current patch: 1. (let ((display-buffer-alist '(("1" nil (select-window . nil))))) (delete-other-windows) (split-window) (split-window) (balance-windows) (pop-to-buffer (get-buffer-create "1")) (pop-to-buffer (get-buffer-create "2"))) then the original window remains selected. 2. (let ((display-buffer-alist '(("2" nil (select-window . nil))))) (delete-other-windows) (split-window) (split-window) (balance-windows) (pop-to-buffer (get-buffer-create "1")) (pop-to-buffer (get-buffer-create "2"))) then the window with "1" is selected after the command finishes.