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.bugs Subject: bug#67249: 30.0.50; `same-frame` equivalent for `display-buffer-alist` Date: Mon, 20 Nov 2023 10:15:55 +0100 Message-ID: <69e6899b-9e93-9a97-a8bc-4ce9a9f0ae4c@gmx.at> References: <159cd3c2-a0c4-63e2-ebb2-ce0f5f8c343e@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="6433"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67249@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 20 10:17:25 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 1r50PF-0001RL-7s for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Nov 2023 10:17:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r50Ot-000844-6j; Mon, 20 Nov 2023 04:17:03 -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 1r50Oq-00082r-QW for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2023 04:17:01 -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 1r50Oq-0007UW-Gr for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2023 04:17:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r50Os-0003Qy-3K for bug-gnu-emacs@gnu.org; Mon, 20 Nov 2023 04:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Nov 2023 09:17:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67249 X-GNU-PR-Package: emacs Original-Received: via spool by 67249-submit@debbugs.gnu.org id=B67249.170047177413141 (code B ref 67249); Mon, 20 Nov 2023 09:17:02 +0000 Original-Received: (at 67249) by debbugs.gnu.org; 20 Nov 2023 09:16:14 +0000 Original-Received: from localhost ([127.0.0.1]:52463 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r50O5-0003Pt-PZ for submit@debbugs.gnu.org; Mon, 20 Nov 2023 04:16:14 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:47949) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r50O0-0003PS-GR for 67249@debbugs.gnu.org; Mon, 20 Nov 2023 04:16:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1700471757; x=1701076557; i=rudalics@gmx.at; bh=i5gnJRg14wKqOZrJHjuRRaEgn/lCK9crFdvFg36iNeo=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From: In-Reply-To; b=VkOBg/GzbwJpIui84eXcaUHw++RLCh8hLcu7aSDZ9RZ7rAIWbbj6TNZWnZ5E8zp7 ojWpm/ueupufDGKfHu530+d2KQhQ6m3iLZRyss5XpOO5/liXDgmd81JvReDOyjAqP CNVXv6yMV5TTlrIrjAwlW8c/w42X97jeIXULQoEkSUBnJuI9MNYhuXBj8EjRsmkDk SqiuvpI2gYqbLiEi9hPG4LBSAIKZ/a2KvaPUkYK9J+sM8my1Bp01hZ7HSuETPCMys 3gM9CYeDJg0Z/2ucnW8vEqLmrptP36aFKAQMSBOczCUVxALC7gP8MVw03UkEVxCgP Fm7sKJG6C6M76eoj1w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.1.100] ([212.95.5.38]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mkpex-1rlBpb3r3v-00mJm2; Mon, 20 Nov 2023 10:15:57 +0100 Content-Language: en-US In-Reply-To: X-Provags-ID: V03:K1:BZArRhUgYfJoj1Ozbxd6HoM3RAY8XrGgEG8m4QHR1miMS/BreAL 44NQpA44lHHcdBrbBjs7OPKYd4xRTUifqRkH4cigb0lMHGMAEE7TelXzTlxcrghb5f7JvzR LtyvS2NFTLSlgX5PFYzWjP82jGRcZmOazl1iyrPnzw8E32UkCXVnz2TlJo76XXsbnCJfFJ3 m6IRRA9LBdl8PXXGC1cZg== UI-OutboundReport: notjunk:1;M01:P0:Do6nb6dB2V0=;24DH8+Lx5KQkvyzsvPK0BvkKT1x ON/NXBHBgFA/C+gcwRYwMThtDV6IabMsrxB8M7NZcxNNT9dyMrxpQo+rf8lEPvHjEV/L/jH6e h7aqGgKbH4J7odG8L/TIcOFiBjZ/0v99AjHdUGQq0nz7Ky3x+tH778tFp0kqcM+jJTPvVyhNJ XAK73b2XlyZOEHHbOpDCzljyB2h8wEzw/QKzdu/snEE7aa/p1vQ18YSzZg4k+zgfH9jZNvtTM +2lfjCBO+8/QtvwiNV67xX3yMv3XpbU6MTUZr1j7vtn5h5WgNUbocNsz+UHmMCwhExpTVqxig rB74q545aUo0w6CBxZUh48H99QPfH4ZUydZXwNiD0u9oLI+8h++J76oEvIr6o7+uFcRTb+AXd G/JyplprLnfhGO8yuE25maNvSiXtwnZkNEdPuDGJJCIdEFgjMTZQNc3IpNqesEC04GCKn0dvO A7A59EcHJIAbqVRoOLO0/zgf0nv6qasmjQAPoT7g4lh33jGL4kIP3sfj+6sK+I3Fjja6nLb8W sz06tsCMXL2NRd7zql//bFI5809unIHfTBzmZtyINfaAEltfCOvjq2DS1xCjX+00y2fB3CJ2K b5ZUnkOXlS+833//YdvEuEsb4AOlJkW9XEac6ucx3AesBwYYea5Y1ou1ALmrmNwY+cmCgGBmy kOjn26dPLR+9+K8JS9/Cgo8b+hIjWT8iYIdEHhkWH/ntfuQDd0b9a8JmdH8+c/zOdD9Fh2W7X Tl/Fuc6PDtveBpgnhPu+RrBB0iw+6ZNM2npLMO1typ3LSNKy/Pr8kiGzvoLbiJOALyiUhLyj 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:274652 Archived-At: > Right, so it should probably have been called something like "no new > frame". We should prominently mention that in the manual then. BTW creating a new frame is always one last resort of 'display-buffer'. > I don't see a big problem here: we could choose `same-frame` to imply > that `reusable-frames` is nil, or we could choose to ignore > `same-frame`. Since the code that adds `(same-frame . t)` could just as well > also add `(reusable-frames)`, the first choice is less flexible > than the second (tho it allows overriding a higher-precedence > `reusable-frames` setting), so I'd go with the first choice, which also > has the advantage of not requiring any code modification :-) So a (same-frame . t) entry would simply auto-translate to a pair of (reusable-frames . nil) (lru-frames . nil) entries? > I don't necessarily want a particular behavior. I want to provide > a similar functionality, within the constraints of what we can define > and implement sanely. > > So no, I don't necessarily want it to prevail over those other entries. With the conclusion above it would prevail. >> mean that it should only inhibit popping up a new frame via >> 'display-buffer-pop-up-frame'. > > That was my conclusion when I looked at the code (concretized in > my PoC patch). OK. > Another approach is to provide a new action. > This could be a `display-buffer-same-frame` action which tries its best > to use the selected frame. > I suspect in many cases the actual intention of `same-frame` was to keep > the buffer nearby, so I suspect we could also replace `same-frame` with > a `display-buffer-nearby` action. > > The advantage of an action is that we don't need to decide how existing > actions interact with it. We could add a 'display-buffer--same-frame-action' variable. >> Again applications that want to pop up a new frame would then have to >> provide a (same-frame . nil) entry. > > That would seem fair game, IMO. It means a change in existing code. Till now, applications were on the safe side in this regard since they could always blame others for using an obsolete feature. > I suspect the main exception would be minibuffer-only frames, but we > could get fancier if we feel like it (like when the selected frame can't > accommodate the `window-min-width` and `window-min-height`, or when we > set `inhibit-same-window` (or the selected window is dedicated) and the > frame's sole window can't be split). Do you anywhere see 'display-buffer' choose a minibuffer-only frame? I'm aware of the fact that the (window--frame-usable-p (last-nonminibuffer-frame)) is broken when a minibuffer-only frame is the only frame left but so far nobody complained ... martin