From unknown Thu Sep 11 14:10:12 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#33258 <33258@debbugs.gnu.org> To: bug#33258 <33258@debbugs.gnu.org> Subject: Status: inhibit-select-window Reply-To: bug#33258 <33258@debbugs.gnu.org> Date: Thu, 11 Sep 2025 21:10:12 +0000 retitle 33258 inhibit-select-window reassign 33258 emacs submitter 33258 Juri Linkov severity 33258 wishlist tag 33258 wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 04 16:25:24 2018 Received: (at submit) by debbugs.gnu.org; 4 Nov 2018 21:25:24 +0000 Received: from localhost ([127.0.0.1]:34314 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJPtc-0000UU-9h for submit@debbugs.gnu.org; Sun, 04 Nov 2018 16:25:24 -0500 Received: from eggs.gnu.org ([208.118.235.92]:42983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJPta-0000UI-OH for submit@debbugs.gnu.org; Sun, 04 Nov 2018 16:25:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJPtS-0002Kt-BG for submit@debbugs.gnu.org; Sun, 04 Nov 2018 16:25:17 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34485) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gJPtN-0002D6-B8 for submit@debbugs.gnu.org; Sun, 04 Nov 2018 16:25:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJPtM-0008Fu-DF for bug-gnu-emacs@gnu.org; Sun, 04 Nov 2018 16:25:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJPtJ-00024N-5x for bug-gnu-emacs@gnu.org; Sun, 04 Nov 2018 16:25:08 -0500 Received: from quail.birch.relay.mailchannels.net ([23.83.209.151]:51895) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gJPtG-0001wO-R4 for bug-gnu-emacs@gnu.org; Sun, 04 Nov 2018 16:25:04 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 982DF123B7E for ; Sun, 4 Nov 2018 21:24:59 +0000 (UTC) Received: from pdx1-sub0-mail-a60.g.dreamhost.com (unknown [100.96.35.77]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 5D6E91239C0 for ; Sun, 4 Nov 2018 21:24:59 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a60.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Sun, 04 Nov 2018 21:24:59 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Macabre-Arithmetic: 01d95d6649cc26ba_1541366699443_3447404550 X-MC-Loop-Signature: 1541366699443:913420427 X-MC-Ingress-Time: 1541366699443 Received: from pdx1-sub0-mail-a60.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a60.g.dreamhost.com (Postfix) with ESMTP id 2956280272 for ; Sun, 4 Nov 2018 13:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to :subject:date:message-id:mime-version:content-type; s= linkov.net; bh=b5K6MfU02CIceCYgsg2cnVqCHlA=; b=ObfQ/ubPB5mSgPCRJ 4WzNlJeGxJznHR+S45wfaQrnrmWxy1HCe0CnYQXe5tCnbEpHHmDgq0DJRIzDgM1G huLuMqr/zgbz/2nsyeEmOYUsB3gHdVNGcfNEmBgii9aIj+ZQXVTeMErVNH3Qk/j8 4ama+S9rG7nhLInJbVvl/Rlu+8= Received: from mail.jurta.org (m91-129-101-157.cust.tele2.ee [91.129.101.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a60.g.dreamhost.com (Postfix) with ESMTPSA id 08126801A5 for ; Sun, 4 Nov 2018 13:24:57 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a60 From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: inhibit-select-window Organization: LINKOV.NET Date: Sun, 04 Nov 2018 23:17:56 +0200 Message-ID: <87muqpj8ib.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrjeefgdduheduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvffuohffkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecukfhppeeluddruddvledruddtuddrudehjeenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepmhgrihhlrdhjuhhrthgrrdhorhhgpdhinhgvthepledurdduvdelrddutddurdduheejpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepsghughdqghhnuhdqvghmrggtshesghhnuhdrohhrghenucevlhhushhtvghrufhiiigvpedt X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -6.0 (------) Many commands use pop-to-buffer to display a buffer and select its window by default. Sometimes it's not desirable to select the displayed window. One of the many examples is 'C-x v =' (vc-diff) where the need is only to look at the diffs, but not to operate on the *vc-diff* buffer in its window. Currently there is no configurable way for the user to override the default window selection. I propose a new alist entry to support such feature. An example of usage in user's customization: (push '("\\*vc-diff\\*" nil (inhibit-select-window . t)) display-buffer-alist) then pop-to-buffer could check for the alist entry 'inhibit-select-window' and to not select the window if it's non-nil. OTOH, when a command uses display-buffer that doesn't select a window, then the same alist entry with a different value or a new entry e.g. '(select-window . t)' could be used to force selecting the window. This could be implemented by using the same code from pop-to-buffer and adding it to display-buffer functions. From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 05 04:34:28 2018 Received: (at 33258) by debbugs.gnu.org; 5 Nov 2018 09:34:28 +0000 Received: from localhost ([127.0.0.1]:34582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJbHA-0001CS-E6 for submit@debbugs.gnu.org; Mon, 05 Nov 2018 04:34:28 -0500 Received: from mout.gmx.net ([212.227.17.20]:49577) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJbH9-0001CG-2d for 33258@debbugs.gnu.org; Mon, 05 Nov 2018 04:34:27 -0500 Received: from [192.168.1.101] ([46.125.250.97]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MN604-1gQCyQ1O7E-006hPb; Mon, 05 Nov 2018 10:34:18 +0100 Received: from [192.168.1.101] ([46.125.250.97]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MN604-1gQCyQ1O7E-006hPb; Mon, 05 Nov 2018 10:34:18 +0100 Message-ID: <5BE00E99.1020003@gmx.at> Date: Mon, 05 Nov 2018 10:34:17 +0100 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov , 33258@debbugs.gnu.org Subject: Re: bug#33258: inhibit-select-window References: <87muqpj8ib.fsf@mail.linkov.net> In-Reply-To: <87muqpj8ib.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:QcRgEM83j1V8CxfBXaQgdRfT8+ZoxElc8KJXptFm5Vjx6PfspsF chXG2bP+7AzoekLHj7NrbKZ4lsmxpF1H3hriVxD7rFHpJWHaAtppBRFV6acrvjG+/v0eqEq QZMBW85/BEv0ufsHYYPC/NH5kQRQCrQCDZGAiNdkiaJqW0pktfcfwF5XCCTsn0E8L0R7eOI kp1JY0NpRXetBd4TBEP/w== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V01:K0:eD5eMYQ2iwA=:rWKOSfQ4u52ZTcx0XoGwLv sruPUEHO4ELi0feWFwmtIQcLEOxiC9wer7i7ChPyU9gYHgX4fjY6jYlFYvriSITbRy/1dZ4Ul AYV/b0YrJuFeuciTFwW/1eN0TUOPPW2oiM2f02I7V3rUQ2NWQC2qy4jCLqBCrGWwa8OrPGf4u X9WKJOQbqjaRZt+JYf/tI66pGT7bIK1I7EBwRdeejaNpW7g2i2yeCTYUcL6ObTyF8/t8MK1be /Egm2i7Zu+6HVpOprEHKs9ARAx4l9HWxhdhsCXZ3tqEWL3mmHi8HpjwPqHwtsGN4U3ptQalb3 GnolHS05NJmjZUNenc1NCF/aJ3gFNAQ90/GCWoviNlvbUTbozJyAwFprrCoCXxywAFAsQZ/7x wY6ETH9lh1ZGs86GbStWa/CKChacg/nOBHXqKpRmAIhyGJxFCu2IpBj/mo0l8e4bt5wS7ndxO py0Ku/MOpGr5T7dhn0QPJ7LO6tUs6SqJO0KCVIPVdEDsirlk3ceQiGRxGiz30GhsokjayarYD 8hZJirUXRgD4w8Pai9tZWRZQmdaQN9DpB/b3Z7R3FYYQvSChh2/f/U/iD7yEhmaDRP+TX/9GN Xq4Jrjur52LQ0zyTwgVvAhouXL5gvZbE5XbmcWhdi1qBckckJXSCL1aj3FfCmy6hI9pVAkMrw WEpd8LUjP85dythf6ffoCGaaCoZEuofp48BaFg1DxV6ORO/oYX7imHZGL83udO04auQ5CdBaq /9BJwxot6HIS2/m62vSMBoKRA6hutaQ8YUYF1voa0hLt8+xztSl24vBXSlq7SqfFXmf+3gahz 8thpncp/xSWohZOX/tmGj0YKXx8pwrKszOJtGc9EnTl2+6SgFNqj7fjd8HHBkEROXOfnDno66 uYm33WVF3JO/aecbakwqYyyXIUNCPhrSVBXCO/eWHjjDgH0kiozOj39BFtWvaE X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 33258 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Many commands use pop-to-buffer to display a buffer and > select its window by default. > > Sometimes it's not desirable to select the displayed window. > > One of the many examples is 'C-x v =' (vc-diff) where > the need is only to look at the diffs, but not to operate > on the *vc-diff* buffer in its window. Is this particular behavior caused by the ;; Display the buffer, but at the end because it can change point. (pop-to-buffer (current-buffer)) in 'vc-diff-internal'? > Currently there is no configurable way for the user > to override the default window selection. > > I propose a new alist entry to support such feature. > An example of usage in user's customization: > > (push '("\\*vc-diff\\*" nil > (inhibit-select-window . t)) > display-buffer-alist) > > then pop-to-buffer could check for the alist entry > 'inhibit-select-window' and to not select the window > if it's non-nil. I understand what you want but I doubt we can put that into practice. While not selecting the window might not be a great issue, not making its buffer current is. We would have to check each and every call of 'pop-to-buffer' as to whether subsequent code relies on the fact that it made the buffer current. This is not fathomable IMO. One could argue that 'display-buffer' may fail to produce a window and so the buffer would not be made current in that case either but as we know it is really hard to make 'display-buffer' fail. > OTOH, when a command uses display-buffer that doesn't select a window, > then the same alist entry with a different value or a new entry e.g. > '(select-window . t)' could be used to force selecting the window. > This could be implemented by using the same code from pop-to-buffer > and adding it to display-buffer functions. This would be possible. Such an entry would have to be called something like 'force-select-window' and could be applied by both users and programs for one soberingly simple reason: A Lisp program can never rely upon 'display-buffer' to _not_ select the chosen window - popping up a new frame may implicitly select the window at any time. martin From debbugs-submit-bounces@debbugs.gnu.org Mon Nov 05 16:39:07 2018 Received: (at 33258) by debbugs.gnu.org; 5 Nov 2018 21:39:07 +0000 Received: from localhost ([127.0.0.1]:35784 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJmaR-00047e-Ff for submit@debbugs.gnu.org; Mon, 05 Nov 2018 16:39:07 -0500 Received: from quail.birch.relay.mailchannels.net ([23.83.209.151]:28437) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJmaP-00047V-GD for 33258@debbugs.gnu.org; Mon, 05 Nov 2018 16:39:06 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id ECB452836E5; Mon, 5 Nov 2018 21:39:03 +0000 (UTC) Received: from pdx1-sub0-mail-a31.g.dreamhost.com (unknown [100.96.30.62]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id AA384283A03; Mon, 5 Nov 2018 21:39:03 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a31.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Mon, 05 Nov 2018 21:39:03 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Blushing-Lettuce: 2266001b133cd725_1541453943836_686526481 X-MC-Loop-Signature: 1541453943836:2281991188 X-MC-Ingress-Time: 1541453943836 Received: from pdx1-sub0-mail-a31.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTP id 6C47D804CD; Mon, 5 Nov 2018 13:39:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=PDzMR989QnxPeoI9n0aHuGefkHg=; b= Q1GDT+9NPcLMu/IrnilQNeEFWtanqjiAUvzAprJwbD1Th8uvdjHCUCvIPohLZYf2 7oO+qhO8rlqPu8EWmunTVba4CXGEj17NLoWPme9Emy9mFQPY4mRURwZ7XJ7NdqUE lSr+aB2MirKxAnvRNqqKDSzprGuWx2IPnpJ0bK4sZ5E= Received: from mail.jurta.org (m91-129-107-244.cust.tele2.ee [91.129.107.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a31.g.dreamhost.com (Postfix) with ESMTPSA id F373E804D7; Mon, 5 Nov 2018 13:39:01 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a31 From: Juri Linkov To: martin rudalics Subject: Re: bug#33258: inhibit-select-window Organization: LINKOV.NET References: <87muqpj8ib.fsf@mail.linkov.net> <5BE00E99.1020003@gmx.at> Date: Mon, 05 Nov 2018 23:30:33 +0200 In-Reply-To: <5BE00E99.1020003@gmx.at> (martin rudalics's message of "Mon, 05 Nov 2018 10:34:17 +0100") Message-ID: <87bm731abq.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrjeehgdduheefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrddvgeegnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrvdeggedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: >> One of the many examples is 'C-x v =' (vc-diff) where >> the need is only to look at the diffs, but not to operate >> on the *vc-diff* buffer in its window. > > Is this particular behavior caused by the > > ;; Display the buffer, but at the end because it can change point. > (pop-to-buffer (current-buffer)) [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RCVD_IN_RP_RNBL RBL: Relay in RNBL, https://senderscore.org/blacklistlookup/ [23.83.209.151 listed in bl.score.senderscore.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [23.83.209.151 listed in list.dnswl.org] X-Debbugs-Envelope-To: 33258 Cc: 33258@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) >> One of the many examples is 'C-x v =' (vc-diff) where >> the need is only to look at the diffs, but not to operate >> on the *vc-diff* buffer in its window. > > Is this particular behavior caused by the > > ;; Display the buffer, but at the end because it can change point. > (pop-to-buffer (current-buffer)) Yes, and rightfully so. > While not selecting the window might not be a great issue, not making > its buffer current is. We would have to check each and every call of > 'pop-to-buffer' as to whether subsequent code relies on the fact that > it made the buffer current. This is not fathomable IMO. This feature is intended only for user customization in display-buffer-alist, not in the args of pop-to-buffer. It makes no sense for a programmer to use (inhibit-select-window . t) in the args of pop-to-buffer when a programmer can simply replace pop-to-buffer with a display-buffer call. However, if an user is annoyed by always selecting a window of a displayed buffer by default, and such customization doesn't cause a bad side effect by not making the displayed buffer the current, and this is true in 99% cases, then we should be proud to make the users happier. >> OTOH, when a command uses display-buffer that doesn't select a window, >> then the same alist entry with a different value or a new entry e.g. >> '(select-window . t)' could be used to force selecting the window. >> This could be implemented by using the same code from pop-to-buffer >> and adding it to display-buffer functions. > > This would be possible. Such an entry would have to be called > something like 'force-select-window' and could be applied by both > users and programs for one soberingly simple reason: A Lisp program > can never rely upon 'display-buffer' to _not_ select the chosen window > - popping up a new frame may implicitly select the window at any time. force-select-window looks good, also possible is one of these names: (pop-to-buffer . t) or (pop-up-window . t) as a reference to the related feature. From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 06 03:46:06 2018 Received: (at 33258) by debbugs.gnu.org; 6 Nov 2018 08:46:07 +0000 Received: from localhost ([127.0.0.1]:35965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJwzu-0005XW-2E for submit@debbugs.gnu.org; Tue, 06 Nov 2018 03:46:06 -0500 Received: from mout.gmx.net ([212.227.17.20]:41519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJwzq-0005Wq-Pu for 33258@debbugs.gnu.org; Tue, 06 Nov 2018 03:46:03 -0500 Received: from [192.168.1.101] ([213.162.68.231]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Me5Q2-1gAWOU2vy2-00PyvA; Tue, 06 Nov 2018 09:45:52 +0100 Received: from [192.168.1.101] ([213.162.68.231]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0Me5Q2-1gAWOU2vy2-00PyvA; Tue, 06 Nov 2018 09:45:52 +0100 Message-ID: <5BE154BC.4080707@gmx.at> Date: Tue, 06 Nov 2018 09:45:48 +0100 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#33258: inhibit-select-window References: <87muqpj8ib.fsf@mail.linkov.net> <5BE00E99.1020003@gmx.at> <87bm731abq.fsf@mail.linkov.net> In-Reply-To: <87bm731abq.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:omah+0z+PmJZtNeLmWQsB1OjMUGKj6XG2uPHFSusYbGcwfVJftO jEcxKZB6+7FgINzKo3oR0U0/176iZFvDZi7YD8tgtDczV2SSxRYNTQJ4VHPNGVoOLR15y7v T6uFAIkuz/lNdrKiQWx8Yrj8ADTS2T3WjdMRKYSd25sSqwUyTXTOxeMiRiMIlQ9B6Hfo73Q 3m26v+jAZdUPD6qfJDpcw== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V01:K0:bViRiaKpS9M=:D+kW5xUxYfwaXaRHcWonG1 4I9hHUsz3qyJjq/WRfV/csDRIUwF2btyPJi0UGTdIb6fk8W/sBKbf0uxl5nY2rUDeTXaCNjdg zaJ+/PzMnXyBXhpTlrKerlFTjY1ECkXkCiMhN1JOf7wTOdNZkfX+/e0tLb4SkqItBXAipKF5i r5UQG3EogK8KzEDumQW+WtRz9sKCNxukzVbIuXguLAg/44Fc9ApIochwUMOYrvKdwZsXJsvH3 yaKNSaoKTJosI69gvkGDJJAF48aqkSlTmsh1h2CONdQ/58HxNmXYEiIGUc3YQJBwbV5N26CBw vxF44d+B/jbh6I4ZEkVBv/07eL2qLY64N+NoDedpLXAJevSCMwY/5mnWYJrX+9+iNt60rIMVF eKt2jxjRv1yTc/GseylQttIvjN+EzgI8af6QI1Q5ntFx4sv9NezjG47e7IGKxO0M+Q4ynP0Z4 THbNpO8FKkX8oeKA3e2WvowwKOd8p8bL8ChIzyPmX/0DpnOXRbb6P+uzLuwckAzkmR633y250 18FkLThTie74E4bwh5Uu1HF92pTtUi3ir2eu4rJ7z/QlEMqZf3TFf/3GkyILq3rB8IlrhXwh0 2+nollLCCRNBUrpnBGqDLyaYYaVzWdYfrKvvdCKWqtPhVS62tIXN4M9e4RlbQUBXm8eK/bag6 +VTQzzJ8Cqz4zfmEXNUOOozMWFxAheQKqwPv+d4bCBKcJ4hP4nGflmrbWLnB1SVAnZ5V7NU5d Fz24OcP07gwKi3mPwOWHOBvHzW3Y/fPXUcINSKL+ZxCeOqJXB0tDwwA249lhnsFgVi8MH/M1w kxxQMKVA+5dnY583QgT4BT/Ttlq2vd9NxFU1es9+gqspJbAMCDe1FuK10u3byjmWO13UZ0liZ Q0s5/C80M9aLMnmAApgVlM/5aFMV2E/o1wQ/3ZDXmI3VPBzy4MBjnQR8BqhdRH X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 33258 Cc: 33258@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) > This feature is intended only for user customization in display-buffer-alist, > not in the args of pop-to-buffer. It makes no sense for a programmer > to use (inhibit-select-window . t) in the args of pop-to-buffer when > a programmer can simply replace pop-to-buffer with a display-buffer call. Sure. I nowhere assumed that the caller would add such an entry. > However, if an user is annoyed by always selecting a window of > a displayed buffer by default, and such customization doesn't > cause a bad side effect by not making the displayed buffer the current, > and this is true in 99% cases, then we should be proud to make > the users happier. By providing 'pop-to-buffer' we signed a contract that if a program calls it, it does "Display buffer specified by BUFFER-OR-NAME and select its window". This means that when 'pop-to-buffer' returns the buffer, the calling program can be sure that a window showing that buffer is selected and the buffer is current. If a user is allowed to override that behavior by keeping, for example, the previously selected window selected and its buffer current, then 'pop-to-buffer' would have violated the contract and we will get into troubles in due time. I think there's a simple way out. The user provides an 'inhibit-select-window' request via a 'display-buffer-alist' (or 'display-buffer-base-action') entry as you suggested. 'display-buffer', by itself, honors that request iff the caller, in the ACTION argument, has provided an 'allow-inhibit-select-window' alist entry (much like your earlier 'allow-no-window' entries) indicating its willingness to live with the fact that the window does not get selected. This way, any caller like 'vc-diff' can make provisions for the case that the window is not selected. If, as you say, 99% of the callers are prepared for that case, there should not be any problems converting most callers of 'pop-to-buffer' to include such an entry in their action alists. But we have more than 99 'pop-to-buffer' calls in our sources and there are still more in the rest of this world. > force-select-window looks good, also possible is one of these names: > > (pop-to-buffer . t) > or > (pop-up-window . t) > > as a reference to the related feature. We could convert 'pop-to-buffer' calls to 'display-buffer' calls with a 'force-select-window' t alist entry. Users could override that with a 'force-select-window' nil entry. This would be the contrapositive of the 'inhibit-select-window' approach. martin From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 06 17:29:00 2018 Received: (at 33258) by debbugs.gnu.org; 6 Nov 2018 22:29:00 +0000 Received: from localhost ([127.0.0.1]:37918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gK9qG-0002ey-Is for submit@debbugs.gnu.org; Tue, 06 Nov 2018 17:29:00 -0500 Received: from purple.birch.relay.mailchannels.net ([23.83.209.150]:16128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gK9qE-0002en-FD for 33258@debbugs.gnu.org; Tue, 06 Nov 2018 17:28:59 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C49FF5E3569; Tue, 6 Nov 2018 22:28:56 +0000 (UTC) Received: from pdx1-sub0-mail-a56.g.dreamhost.com (unknown [100.96.19.78]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 8500A5E3244; Tue, 6 Nov 2018 22:28:56 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a56.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Tue, 06 Nov 2018 22:28:56 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Wipe-Abaft: 5b9839540809c926_1541543336674_1538435629 X-MC-Loop-Signature: 1541543336674:2907585537 X-MC-Ingress-Time: 1541543336674 Received: from pdx1-sub0-mail-a56.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a56.g.dreamhost.com (Postfix) with ESMTP id 4D3FD80611; Tue, 6 Nov 2018 14:28:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=V8WEMJabIjlTBU2IVsKtd7Quygk=; b= SR7QZkvmPm186sp/snQCmNbZTgnVk6rNOj8jcf0n+5870e/6vf5p4qLAtek0/dmB R3URjATRdGeE1afO1ljW6opoXbRpcSPUYtzDfqf3l0Fu9SsjxK2rdhZajNq7fYQM nKjyFKfynykbsBQWlYCzqwZ3y/cxr7xIpLSTtugcQYM= Received: from mail.jurta.org (m91-129-107-244.cust.tele2.ee [91.129.107.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a56.g.dreamhost.com (Postfix) with ESMTPSA id E52608060D; Tue, 6 Nov 2018 14:28:54 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a56 From: Juri Linkov To: martin rudalics Subject: Re: bug#33258: inhibit-select-window Organization: LINKOV.NET References: <87muqpj8ib.fsf@mail.linkov.net> <5BE00E99.1020003@gmx.at> <87bm731abq.fsf@mail.linkov.net> <5BE154BC.4080707@gmx.at> Date: Tue, 06 Nov 2018 23:59:48 +0200 In-Reply-To: <5BE154BC.4080707@gmx.at> (martin rudalics's message of "Tue, 06 Nov 2018 09:45:48 +0100") Message-ID: <878t25vpd7.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrjeejgdduieduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrddvgeegnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrvdeggedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33258 Cc: 33258@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > By providing 'pop-to-buffer' we signed a contract that if a program > calls it, it does "Display buffer specified by BUFFER-OR-NAME and > select its window". This means that when 'pop-to-buffer' returns the > buffer, the calling program can be sure that a window showing that > buffer is selected and the buffer is current. If a user is allowed to > override that behavior by keeping, for example, the previously > selected window selected and its buffer current, then 'pop-to-buffer' > would have violated the contract and we will get into troubles in due > time. You are right. I think we can reliably restore an originally selected window only at the end of the command, somewhere at the time when the post-command-hook is called. A prototype that demonstrates a problem-free implementation is: (advice-add 'vc-diff :around (lambda (orig-fun &rest args) (save-selected-window (apply orig-fun args))) '((name . inhibit-select-window))) A question is how to do something like this using 'display-buffer-alist' with 'inhibit-select-window'. > I think there's a simple way out. The user provides an > 'inhibit-select-window' request via a 'display-buffer-alist' (or > 'display-buffer-base-action') entry as you suggested. > 'display-buffer', by itself, honors that request iff the caller, in > the ACTION argument, has provided an 'allow-inhibit-select-window' > alist entry (much like your earlier 'allow-no-window' entries) > indicating its willingness to live with the fact that the window does > not get selected. > > This way, any caller like 'vc-diff' can make provisions for the case > that the window is not selected. If, as you say, 99% of the callers > are prepared for that case, there should not be any problems > converting most callers of 'pop-to-buffer' to include such an entry in > their action alists. But we have more than 99 'pop-to-buffer' calls > in our sources and there are still more in the rest of this world. This is a huge task to inspect all existing pop-to-buffer calls and to add 'allow-inhibit-select-window' where it's safe, or to change the existing code to be safe (if this is possible at all). >> force-select-window looks good, also possible is one of these names: >> >> (pop-to-buffer . t) >> or >> (pop-up-window . t) >> >> as a reference to the related feature. > > We could convert 'pop-to-buffer' calls to 'display-buffer' calls with > a 'force-select-window' t alist entry. Users could override that with > a 'force-select-window' nil entry. This would be the contrapositive > of the 'inhibit-select-window' approach. Does this have the same problem of not making the displayed buffer current? From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 07 04:22:54 2018 Received: (at 33258) by debbugs.gnu.org; 7 Nov 2018 09:22:54 +0000 Received: from localhost ([127.0.0.1]:38130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKK34-0003l6-ES for submit@debbugs.gnu.org; Wed, 07 Nov 2018 04:22:54 -0500 Received: from mout.gmx.net ([212.227.17.21]:37641) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKK32-0003kq-30 for 33258@debbugs.gnu.org; Wed, 07 Nov 2018 04:22:52 -0500 Received: from [192.168.1.101] ([212.95.5.136]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MI5rO-1gN3bY3aRC-003t6k; Wed, 07 Nov 2018 10:22:42 +0100 Received: from [192.168.1.101] ([212.95.5.136]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MI5rO-1gN3bY3aRC-003t6k; Wed, 07 Nov 2018 10:22:42 +0100 Message-ID: <5BE2AEDE.1090109@gmx.at> Date: Wed, 07 Nov 2018 10:22:38 +0100 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#33258: inhibit-select-window References: <87muqpj8ib.fsf@mail.linkov.net> <5BE00E99.1020003@gmx.at> <87bm731abq.fsf@mail.linkov.net> <5BE154BC.4080707@gmx.at> <878t25vpd7.fsf@mail.linkov.net> In-Reply-To: <878t25vpd7.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:hHjfp9ahm4JOHFo3U37wbX7ZEPgYMMb02+3grc88EKtXzrzZMkL DLwE/stvwA7msmhOxAgUskM3BOGeIt5Wu0FreSdFZr9UBN2fgsT5XedY4Q7ddIYOT/V7rqK Mj0IqmYab43wE9E3CJfS59CYKJMMdxg8BDJukhcy4rmZX/x8uW2PB6XJr+/hBQ9jyTfhFQs wib2+8+KXn4IyM2DT/diA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V01:K0:IBrryEqRHBk=:wXmhRolJc8OcC7GWFhh2ma FltpH4/HGBpG/M2HHWJIRuP9zKgFbWlI+pI5BXKPKT45HlLIGa5heD6GaqZGuhx/69RbzvQGT A/fPAKUSpMLje1u3fyNp7U8z1Zp5o9jS7/aXgDNWTHCS3gWW+SgrYXSmnlyxTWE/xxMOGBdvT TJXCs/XF+g+KYSCDzi3WPniPgXf1scxBQ74K41TjlJ31JCHzKML1pZLaHaqIZiF6Olo9ZzwcA Y4l62zsomqIOEnYbhkmHJ0Mym+p5XNJ7lCMbQ6JJOeqn0aX2VRCgfU2w6dtnWtfO/F2YppTTi 00Jq3Fhu4+zWD2M3jW3bvs8H5BOW78DHoFFpNbosHAHHKYh4286HoKrL2BZA4ku4uyjR8+VIW a3KWXUQpJKLl85nvIczRKaN8tUOXvyh1MgKU213EhssTgXO+8Ay+vXArOkRjsT8BCJB3fiImX EPNfZ8mSrerrG5j4rFssrlluZrCMb92biImcF8sjyAjt+JzP7fI5Ejg1v4GZOirgwxgN5K3v8 6TpnGbVhARVeJJl1h16ypirWfiPRzNOvzrPGcjkpU2ckFMJ4mEjsQPqwap2ckWWfFOLbDJA+Y V5p3jpWOkA4/FIUfWXljkSEz2Nkm7HYPbfACJSK8ACpECUuQDGsrS6+KFVM7vsa8GQqmpJB0G wYOcffhykL2xH8WEptfAp5k5arAWfq9/fsPP3cDyKWL0bOvYSrWo3zn0zeC3F4L3OZXJneKpp cbyt5EtkliYoP+nmliZwKc3p5lMBALnh3WepuVQEV6TcZFWI+7JXmxmAB5Vv8BPx2wEfWMMIe vf4A8GEYDqybHM/qcNZa2Dh9S+IenU5g7AU/AkiRH++rkTmtBo= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 33258 Cc: 33258@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > A prototype that demonstrates a problem-free implementation is: > > (advice-add 'vc-diff :around > (lambda (orig-fun &rest args) > (save-selected-window > (apply orig-fun args))) > '((name . inhibit-select-window))) > > A question is how to do something like this using 'display-buffer-alist' > with 'inhibit-select-window'. You cannot do that in a systematical way - 'display-buffer-alist' is agnostic of its clients. And don't forget clients of 'vc-diff' who might rely on the fact that the latter selects the window chosen. Ironically, they might do that for exactly the same reason as yours - they don't want the diffs window to get selected. Now suppose they do that by selecting the window preceding or following the diffs window in the cyclic order of windows right after the 'vc-diff' call ... So even your advice is not problem-free. > This is a huge task to inspect all existing pop-to-buffer calls > and to add 'allow-inhibit-select-window' where it's safe, or to change > the existing code to be safe (if this is possible at all). Nobody will ever acquire enough knowledge to do that. >> We could convert 'pop-to-buffer' calls to 'display-buffer' calls with >> a 'force-select-window' t alist entry. Users could override that with >> a 'force-select-window' nil entry. This would be the contrapositive >> of the 'inhibit-select-window' approach. > > Does this have the same problem of not making the displayed buffer > current? The task would remain the same: Inspect all 'pop-to-buffer' calls, possibly their callers and decide whether converting them is safe. In the 'vc-diff' case the following stretch already looks hairy: ;; Display the buffer, but at the end because it can change point. (pop-to-buffer (current-buffer)) ;; The diff process may finish early, so call `vc-diff-finish' ;; after `pop-to-buffer'; the former assumes the diff buffer is ;; shown in some window. (let ((buf (current-buffer))) (vc-run-delayed (vc-diff-finish buf (when verbose messages)))) I suppose the 'buf' binding is superfluous because 'pop-to-buffer' cannot "pop away" from the current buffer even if a user inhibits selecting the window chosen. But if that binding had a real purpose, then using 'inhibit-select-window' would probably affect it and 'vc-diff-finish' would work on the wrong buffer. Worse even. The brutal 'set-buffer' call in 'vc-diff' (right before entering 'diff-mode') already suggests that eventually selecting the diffs window becomes unavoidable. Otherwise, returning from 'vc-diff' would leave you with the diffs buffer current and a window not showing the diffs buffer selected - a very unpleasing configuration. Replacing the 'set-buffer' with 'with-current-buffer' is not devoid of its problems either: You cannot reliably nest a 'display-buffer' call in 'with-current-buffer' because 'display-buffer' might select a window on another frame at any time. martin From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 07 16:58:56 2018 Received: (at 33258) by debbugs.gnu.org; 7 Nov 2018 21:58:56 +0000 Received: from localhost ([127.0.0.1]:40014 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKVqi-0007Ye-2u for submit@debbugs.gnu.org; Wed, 07 Nov 2018 16:58:56 -0500 Received: from ostrich.birch.relay.mailchannels.net ([23.83.209.138]:19752) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKVqf-0007YV-Jt for 33258@debbugs.gnu.org; Wed, 07 Nov 2018 16:58:55 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 69DBE5E2CCB; Wed, 7 Nov 2018 21:58:52 +0000 (UTC) Received: from pdx1-sub0-mail-a61.g.dreamhost.com (unknown [100.96.20.98]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 36F375E2EF4; Wed, 7 Nov 2018 21:58:52 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a61.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Wed, 07 Nov 2018 21:58:52 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Print-Reaction: 2889d67a791610e4_1541627932294_83899659 X-MC-Loop-Signature: 1541627932294:2158146398 X-MC-Ingress-Time: 1541627932293 Received: from pdx1-sub0-mail-a61.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a61.g.dreamhost.com (Postfix) with ESMTP id 07C6A806C4; Wed, 7 Nov 2018 13:58:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=cFAcM4E9XeZLeOo21bKqBaa56YE=; b= ConWrh3yvNmOuFSzPnXpan5p9g0Vk6sflU4zlk08AzEWvx5kOZ7HbDIXAmR+cfBr 8teqWY0qCVac8EEgYniO89xc6BoF+9WOnjU9ei0beJvyjc2FbX6A4m9j7ScS6ZV0 AJdX0XPzK/KrMSE0ht0ZLJ/gkUPWBImuhi0EdpNvMW8= Received: from mail.jurta.org (m91-129-107-244.cust.tele2.ee [91.129.107.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a61.g.dreamhost.com (Postfix) with ESMTPSA id 382D1806C3; Wed, 7 Nov 2018 13:58:49 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a61 From: Juri Linkov To: martin rudalics Subject: Re: bug#33258: inhibit-select-window Organization: LINKOV.NET References: <87muqpj8ib.fsf@mail.linkov.net> <5BE00E99.1020003@gmx.at> <87bm731abq.fsf@mail.linkov.net> <5BE154BC.4080707@gmx.at> <878t25vpd7.fsf@mail.linkov.net> <5BE2AEDE.1090109@gmx.at> Date: Wed, 07 Nov 2018 23:32:07 +0200 In-Reply-To: <5BE2AEDE.1090109@gmx.at> (martin rudalics's message of "Wed, 07 Nov 2018 10:22:38 +0100") Message-ID: <871s7wzips.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrjeelgddugeduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrddvgeegnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrvdeggedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 33258 Cc: 33258@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > You cannot do that in a systematical way - 'display-buffer-alist' is > agnostic of its clients. And don't forget clients of 'vc-diff' who > might rely on the fact that the latter selects the window chosen. So to rule out non-interactive callers of vc-diff we need to check for (eq this-command 'vc-diff)? But there is a simpler and safer solution that I already mentioned: to restore an original window in post-command-hook. Or even better using your new window-state-change-functions: when inhibit-select-window was found in an alist from display-buffer-alist then check whether the selected window was changed in an alist of changes provided by window-state-change-functions and restore an old selected window. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 08 03:52:49 2018 Received: (at 33258) by debbugs.gnu.org; 8 Nov 2018 08:52:50 +0000 Received: from localhost ([127.0.0.1]:40249 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKg3V-0000J2-LI for submit@debbugs.gnu.org; Thu, 08 Nov 2018 03:52:49 -0500 Received: from mout.gmx.net ([212.227.17.22]:53599) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKg3U-0000Ik-D8 for 33258@debbugs.gnu.org; Thu, 08 Nov 2018 03:52:48 -0500 Received: from [192.168.1.101] ([212.95.5.129]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MA9FV-1gDl6t0PeL-00BLyQ; Thu, 08 Nov 2018 09:52:38 +0100 Message-ID: <5BE3F950.1040103@gmx.at> Date: Thu, 08 Nov 2018 09:52:32 +0100 From: martin rudalics MIME-Version: 1.0 To: Juri Linkov Subject: Re: bug#33258: inhibit-select-window References: <87muqpj8ib.fsf@mail.linkov.net> <5BE00E99.1020003@gmx.at> <87bm731abq.fsf@mail.linkov.net> <5BE154BC.4080707@gmx.at> <878t25vpd7.fsf@mail.linkov.net> <5BE2AEDE.1090109@gmx.at> <871s7wzips.fsf@mail.linkov.net> In-Reply-To: <871s7wzips.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:3KVp7Wzn3yot5DF2eJxIrw4qqd2NAezoTNlDqFaWEPMU8XJk2/Q rorbQ4RTZR1293fP95LkYolNbiZUeUnuGQTldg448Bm34m0GHBAWE8YHWGbKsQdpc4khmSu 3GuKVY/8Lr2eTeoyReeAcmR9PfUuNnzItkgA0iHK8eDNRCaP+/JUPr8CZxMjw0d75Ga9LrY OCTtW3Lj5O468MWuTU9CA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V01:K0:tD0Uaa1s4Is=:RhAit/NjlJLCk5dT6Wvpgj jC6yYGrOU0gOkwtGnfG1cpRTlsa9tZZW3fjGZfvPoJ5FA7vL0bdjze2YSYgb82PiIiDWylsx2 qw5fglISydCt8CdRmXfnZ2Z12g8jz35cttqFPN5C+zpv2mCPXnZwOlsLXXTxZiBU49cxHO7TW bQpnx0KBmCOpudiWkJRZni/JpWl3ecDzvQbqmdmV2O84QXUOL9s4dqQ2qPaPjP+djuErIMBky MzClPtha/c6XPLPfcUEHu1yIwbG4bJLq/ShCeldgOUlQyVNBRXkPCdPF2T7LvHMH9EASV6E8R XVWAuk1bUetvJfInRvEomJgS4G3S/Gcx1mPxcqK73+so0bgwPg2Dwhe4DWPPTc9aAk4jd2vOU DKMl8pV/1VExjP75dQLfLcM3humWszE70jPx7qkTDIMerrlAOLLGlrAFuWaJlibUSgSnFBSQb fuz5eg9uuNH1bv1toOXbwsg+kNFqQHatI0M24cKrEIuqXmRVJ7tT7T2MN2IyfwdR5qgtJgHuL 6AiU+9xMiNLBs8DmMECUiFNd2cWMqW8f2XuEVQQ0/FXlLEmVeXe/6xqd3ypPOs3+btfMzReWC HqlvZFo2CD00W0vChURsdT4hbcPNBwz5a7DT++wz/i8GPSqQhpf9QCqNa+uvhBSZ3dCvK6nLA nQGiVWI+QAgKHUsqGer5wtJBxKmWFOMjvw8sD02XkDD7SNn01TWltZcKUPSTqwi5dCIjnIRqh k5sL15ymXNz7QuLCnLFS0IQ3YNefd/o+yuf2hbe0tJCllH+5XqprEiCN1364qa8TThqoAFDSw KMMWWHuKPHA8/TK1EjVFfUnSlAPC0A75rlLUbcLFCPFHgtbstvzaEtq/o+B76RMlbj/MUnXLX WpPsR0DI3szYg2NaG2VfWrybEJjxHeeBGALeZbqHV4tSo1Zs5841VTFdrhQtYn X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 33258 Cc: 33258@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > So to rule out non-interactive callers of vc-diff we need to check > for (eq this-command 'vc-diff)? For example. > But there is a simpler and safer solution that I already mentioned: > to restore an original window in post-command-hook. Or even better > using your new window-state-change-functions: when inhibit-select-window > was found in an alist from display-buffer-alist then check whether > the selected window was changed in an alist of changes provided by > window-state-change-functions and restore an old selected window. In either case let's get 'display-buffer' out of this. After all, its doc-string says "Display BUFFER-OR-NAME in some window, without selecting it." so we'd be preaching to the choir here. We might call it 'pop-to-buffer-no-select'. martin From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 08 16:57:49 2018 Received: (at control) by debbugs.gnu.org; 8 Nov 2018 21:57:49 +0000 Received: from localhost ([127.0.0.1]:41948 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKsJB-0001F6-B6 for submit@debbugs.gnu.org; Thu, 08 Nov 2018 16:57:49 -0500 Received: from bonobo.maple.relay.mailchannels.net ([23.83.214.22]:11606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gKsJ8-0001Er-Tg; Thu, 08 Nov 2018 16:57:47 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 2775D5E29DF; Thu, 8 Nov 2018 21:57:45 +0000 (UTC) Received: from pdx1-sub0-mail-a66.g.dreamhost.com (unknown [100.96.19.78]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id DAAA15E2ABE; Thu, 8 Nov 2018 21:57:44 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Received: from pdx1-sub0-mail-a66.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.16.2); Thu, 08 Nov 2018 21:57:45 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Shade-Ruddy: 5662dab62f6f11b7_1541714265016_2860528342 X-MC-Loop-Signature: 1541714265016:2244166263 X-MC-Ingress-Time: 1541714265015 Received: from pdx1-sub0-mail-a66.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a66.g.dreamhost.com (Postfix) with ESMTP id A4EDD806E3; Thu, 8 Nov 2018 13:57:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=linkov.net; bh=HQsDvUkgRvLVAd2L4UGLnUsqHAw=; b= lXrzn3CcRFLAJzaWIExCnz5n0fcfcmhV7UjKBY3zIcXld1NVxkoc2GMQteAFk1+v tnm9r/sFWJypjerqFefTcsoH/wsML9r5r+Gv25DtedQWtzWa1M+kJn8r3Ni413yM stiHzOlDB/7hOodQOL0lpAb5mxSkzsi4i1tI2xTxJXs= Received: from mail.jurta.org (m91-129-107-244.cust.tele2.ee [91.129.107.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a66.g.dreamhost.com (Postfix) with ESMTPSA id 885E6806E1; Thu, 8 Nov 2018 13:57:41 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a66 From: Juri Linkov To: martin rudalics Subject: Re: bug#33258: inhibit-select-window Organization: LINKOV.NET References: <87muqpj8ib.fsf@mail.linkov.net> <5BE00E99.1020003@gmx.at> <87bm731abq.fsf@mail.linkov.net> <5BE154BC.4080707@gmx.at> <878t25vpd7.fsf@mail.linkov.net> <5BE2AEDE.1090109@gmx.at> <871s7wzips.fsf@mail.linkov.net> <5BE3F950.1040103@gmx.at> Date: Thu, 08 Nov 2018 23:56:36 +0200 In-Reply-To: <5BE3F950.1040103@gmx.at> (martin rudalics's message of "Thu, 08 Nov 2018 09:52:32 +0100") Message-ID: <87a7mjmdwr.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedtkedrkedugdduheejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufhofhffjgfkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdejrddvgeegnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehmrghilhdrjhhurhhtrgdrohhrghdpihhnvghtpeeluddruddvledruddtjedrvdeggedprhgvthhurhhnqdhprghthheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqedpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnrhgtphhtthhopehruhgurghlihgtshesghhmgidrrghtnecuvehluhhsthgvrhfuihiivgeptd X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: 33258-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 33258 wontfix close 33258 stop >> But there is a simpler and safer solution that I already mentioned: >> to restore an original window in post-command-hook. Or even better >> using your new window-state-change-functions: when inhibit-select-window >> was found in an alist from display-buffer-alist then check whether >> the selected window was changed in an alist of changes provided by >> window-state-change-functions and restore an old selected window. > > In either case let's get 'display-buffer' out of this. After all, its > doc-string says > > "Display BUFFER-OR-NAME in some window, without selecting it." I see now that it's impossible to implement inhibit-select-window, so I'm closing this feature request. For bug#32790 I thought about adding inhibit-select-window to display-buffer-overriding-action in windmove-display-in-direction, but it was easier to do the same in post-command-hook. From unknown Thu Sep 11 14:10:12 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 07 Dec 2018 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator