From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames Date: Tue, 31 Jan 2023 09:46:50 +0100 Message-ID: <115a6020-2b86-2653-844e-d19eb03cf62c@gmx.at> References: <834jsccepb.fsf@gnu.org> <30c3d810-ed96-a9bd-c622-1761a138515c@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21878"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org, larsi@gnus.org To: Tom Gillespie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 31 09:47:47 2023 Return-path: Envelope-to: ged-emacs-devel@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 1pMmIs-0005VP-D5 for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Jan 2023 09:47:46 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMmIH-0003AV-2i; Tue, 31 Jan 2023 03:47:09 -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 1pMmI3-00037G-Km for emacs-devel@gnu.org; Tue, 31 Jan 2023 03:47:00 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMmI1-0003pg-QX; Tue, 31 Jan 2023 03:46:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1675154811; bh=1Ne5H1a0wdMdZBSdRkqpPC0aXm2DA2xBRiSFeqijUsY=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=YwjGZJAykv3/UIGGo5oaVdxvxg1SOlg8do4aFHhc559aBkjMn69QQRe7qpdyP9P6k Uionm8DPmMTaV0I4gOQSn/qOwWkFN5reHlgc/asivd9fwvyYiAESasbSIRLukgrP9e kKr7IcROGMX8lJCZDg9c9ppGOe7RiUs0lBHPHSjT/25caTX6v7KJWojCpEzxsR8zcD O8OUPFvyX5/rjY3Kw/FbcUMMykpObVu2ot+BrRc+RHBa5EaGTn7JBsjV68gravVCF4 3o+zH0/lChRJDcR3VHuDPNf5quECVym8DT5BeVFa4c4AOEYZS9p4hKEfTlPHB735qX 0Y2Yv76GqpeYQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.1.100] ([46.125.249.64]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M6lpG-1pHojl0ZVG-008GU1; Tue, 31 Jan 2023 09:46:51 +0100 Content-Language: en-US In-Reply-To: X-Provags-ID: V03:K1:k0uTGzWyT1BMCx8iKIS1lGFA4+rRxDN/7frD/DTfGl2oc2wrnmf /x6+DqHxie4S2vn/X1oZc4uEqS3aqWwYu7dmV3EXRo1iju+gl05b8fuk+baZV6LEz+F7OmA GXZuVveOCjqeWFqBk9qqvNiq0dznOobFtrIZniRViE0z5o8Ot34VmUUxwimz1cJJTbvLN6m dPCbG5/TNS7yyklpv70Kw== UI-OutboundReport: notjunk:1;M01:P0:S4b5u8cOuls=;fZIapoEQtmYU26amxRU5L+tYSKL hWT8HbyaToYlJjaWff5KYo7yXdeqhA+FY6vyYPDfssP2svajgX1NAEvFKY9YqI35lM8pdsaSV /2HK7SpLflLO5k4fZNxyh+beQhCF8PrNd8ya5b9B9zVpnSKYWYGIQQ+CPvZeBaXnROZ/tjMhL +YMyGHDlVGWJ2oWcWFTi1RTt4OSBo0azOfk/CadP6qsWwDGw6+w+23QEx49iaa6aXFdZSWdgF 7QSXOi2EBDloSsKLi1lzNYmmBclRnl4w+FX6S3f7HpR5pa3IQscBs7cd+K7P9XZDlE//3sUYt 23W9GMHo/DOvhKVyWIbGrCPz2qA5jaZwTHDsH6OPRl6B6pe45pfNa+yCuqQzxCQv38TLTGIrP RFyx7X4OsvUmxLkZ9Rl5+2HiZUh8lAZYFnbjSYvWwmNFEePYLH8d0Qz4qcjBMiwD3hcu2bJ83 RmIeJ5DWAT4nLBT8yzpmPbzbyGJHWIVXJKY/9/ts1d8yHepmioqPzXqs8vbwjIL77lXhMy+6u X63SOL0JjJLn9OFmCPzn9PpL4W0ONBsUB7d00pqNtba8ED+lVJBfUmKmTdRCBQ8F/hCwSFuEl 4qvXeh7WsKqzB7DbXe0lTZRaPK0fVabfYYVEBH4t9EwzaKcVOluATUPpzfOgNGed+HIMJyGB3 3nJtZo0BFpub+etRiWmh2EpJK+E9f46v1hGbPwAAA12oezghUaHBu2MRk+hfBPxBEeFZhvkyM ZX0dy05pDPfCJeOLGupfQHFfPUiUOfNdlMTYs0u8fmH4d7UtFdD9QVZxcQzGF/N+neBOY8cm Received-SPF: pass client-ip=212.227.17.22; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302820 Archived-At: > Here is the updated patch, but it comes with a question. > On review, the reason why I did not include a call to > display-buffer-reuse-window (or get-buffer-window) > internally is because in my config I have the following > > (setq display-buffer-base-action > '((display-buffer-reuse-window display-buffer-use-least-recent-window))) That's why 'display-buffer-use-least-recent-window' will never succeed to become a good citizen in the department of buffer display functions. The former will not bump the use time and if the window used by 'display-buffer-reuse-window' happens to be the LRU one, 'display-buffer-use-least-recent-window' may use it for displaying the next buffer. I tried to convince Lars that this is the basic problem of his approach but he didn't listen. If you try with a 'bump-use-time' action alist entry you will see that it works. > I think it is probably correct to have display-buffer-use-least-recent-window > try to call display-buffer-reuse-window itself (effectively), however it does > seem like it makes display-buffer-use-least-recent-window less composable > because it can no longer be used to compose a base action that did not > reuse existing windows. Or, for example, a window that previously displayed the buffer. > For example I can imagine that someone might want to display a buffer > twice and have the 2nd instance of the buffer pick the least recent window > by default. If we use this version of the patch that is no longer possible. How would the other version handle it? BTW in the version you attached I see + (get-lru-window (or reusable-frames frame) nil t)))) What's the purpose of 'reusable-frames' here? martin