From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#33258: inhibit-select-window Date: Tue, 06 Nov 2018 09:45:48 +0100 Message-ID: <5BE154BC.4080707@gmx.at> References: <87muqpj8ib.fsf@mail.linkov.net> <5BE00E99.1020003@gmx.at> <87bm731abq.fsf@mail.linkov.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1541494204 30489 195.159.176.226 (6 Nov 2018 08:50:04 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Nov 2018 08:50:04 +0000 (UTC) Cc: 33258@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Nov 06 09:49:59 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJx3f-0007oo-DI for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Nov 2018 09:49:59 +0100 Original-Received: from localhost ([::1]:39673 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJx5l-0002xF-RT for geb-bug-gnu-emacs@m.gmane.org; Tue, 06 Nov 2018 03:52:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37049) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJx5Q-0002lI-Cv for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 03:51:52 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJx0p-0007ss-Jz for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 03:47:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59948) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJx0p-0007sd-G9 for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 03:47:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gJx0p-0005ZK-DW for bug-gnu-emacs@gnu.org; Tue, 06 Nov 2018 03:47:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 06 Nov 2018 08:47:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33258 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 33258-submit@debbugs.gnu.org id=B33258.154149396721303 (code B ref 33258); Tue, 06 Nov 2018 08:47:03 +0000 Original-Received: (at 33258) by debbugs.gnu.org; 6 Nov 2018 08:46:07 +0000 Original-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 Original-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 Original-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 Original-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 In-Re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OWHOBvHzW3Y/fPXUcINSKL+ZxCeOqJXB0tDwwA249lhnsFgVi8MH/M1 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:152093 Archived-At: > 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