From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Stefan Monnier via "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
Newsgroups: gmane.emacs.bugs
Subject: bug#67249: 30.0.50; `same-frame` equivalent for `display-buffer-alist`
Date: Fri, 24 Nov 2023 11:25:46 -0500
Message-ID: <jwv8r6njf5k.fsf-monnier+emacs@gnu.org>
References: <jwv34x4m50o.fsf@iro.umontreal.ca>
 <159cd3c2-a0c4-63e2-ebb2-ce0f5f8c343e@gmx.at>
 <jwv1qcmfm22.fsf-monnier+emacs@gnu.org>
 <cbc6a073-2718-7809-c85e-cf338341c712@gmx.at>
 <jwvv89xesho.fsf-monnier+emacs@gnu.org>
 <69e6899b-9e93-9a97-a8bc-4ce9a9f0ae4c@gmx.at>
 <jwvwmucd0mq.fsf-monnier+emacs@gnu.org>
 <69387717-1eaa-6019-0000-4c95c61e1bc3@gmx.at>
 <jwvwmubrkx7.fsf-monnier+emacs@gnu.org>
 <1f026837-af56-435f-9d4e-048a18af07eb@gmx.at>
 <jwv8r6pssbu.fsf-monnier+emacs@gnu.org>
 <a3b664a2-bb53-2f84-edb1-ab4d9d3567bd@gmx.at>
 <jwvlean7ulh.fsf-monnier+emacs@gnu.org>
 <488b181f-c74e-d97b-b168-a602158c3e7b@gmx.at>
 <jwv8r6n6z8t.fsf-monnier+emacs@gnu.org>
Reply-To: Stefan Monnier <monnier@iro.umontreal.ca>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="501"; mail-complaints-to="usenet@ciao.gmane.io"
User-Agent: Gnus/5.13 (Gnus v5.13)
Cc: 67249@debbugs.gnu.org
To: martin rudalics <rudalics@gmx.at>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 24 17:27:21 2023
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1r6Z1U-000AQB-Lo
	for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Nov 2023 17:27:20 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1r6Z1C-0006Jr-Mq; Fri, 24 Nov 2023 11:27:02 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1r6Z18-0006J1-Hw
 for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 11:26:58 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1r6Z18-0004Sl-4J
 for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 11:26:58 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1r6Z1C-0000wS-B3
 for bug-gnu-emacs@gnu.org; Fri, 24 Nov 2023 11:27:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Stefan Monnier <monnier@iro.umontreal.ca>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Fri, 24 Nov 2023 16:27:02 +0000
Resent-Message-ID: <handler.67249.B67249.17008431683557@debbugs.gnu.org>
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.17008431683557
 (code B ref 67249); Fri, 24 Nov 2023 16:27:02 +0000
Original-Received: (at 67249) by debbugs.gnu.org; 24 Nov 2023 16:26:08 +0000
Original-Received: from localhost ([127.0.0.1]:37045 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1r6Z0K-0000vI-Da
 for submit@debbugs.gnu.org; Fri, 24 Nov 2023 11:26:08 -0500
Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:48430)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@iro.umontreal.ca>) id 1r6Z0F-0000uh-Kp
 for 67249@debbugs.gnu.org; Fri, 24 Nov 2023 11:26:07 -0500
Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4A99A4412C9;
 Fri, 24 Nov 2023 11:25:53 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1700843147;
 bh=yG9qZw4r3ybk7J6bek0jljqyvE58rstl9c0C4WPK7qE=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=CUUObKBzsnlAdW3Y2xoGYL43GB29hmHOuHsbgoDXrlHY0oiX44eY8OKPnOppQ9Ept
 +/JvBb74UZPHBNXKZA60GvpvpQJGor3uoXfRzdOF/8PpCBMKFTwdaahpK1EKGNq0PR
 5RmdavSaxwSTVGxaTsURpSPhRtAnIB9OpFHnJGOGYgQs/LDhDn4mE0Y3tstXB+uD7z
 LyAGtk+q4fyy2lS38Hhh/kLBGfRj6D6wqrEWzSaDu7YMlTBqCePiFGIhWtAGZ2Vqxq
 ER9vDDAR1aF4Y2RPTOV7PyZriEN/Qc+OELIbUD9zOlS2OmYUxmxxyBr4f9F7bAKahe
 7zT+BSQTbg4zQ==
Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A548E4412A2;
 Fri, 24 Nov 2023 11:25:47 -0500 (EST)
Original-Received: from alfajor (unknown [23.233.149.155])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8B5631202E5;
 Fri, 24 Nov 2023 11:25:47 -0500 (EST)
In-Reply-To: <jwv8r6n6z8t.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message
 of "Fri, 24 Nov 2023 08:51:54 -0500")
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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:274870
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/274870>

--=-=-=
Content-Type: text/plain

BTW, I just noticed another way to attack the problem, which is to add
a `pop-up-frames` argument which works just like the variable but takes
precedence over it, as in the PoC patch below (a real patch would
adjust other places where we use that variable, among other things).

WDYT?


        Stefan

--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=same-frame.patch

diff --git a/lisp/window.el b/lisp/window.el
index 0c5ccf167dc..2b8c6483fe5 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -8180,9 +8181,11 @@ display-buffer--maybe-pop-up-frame
 ALIST is an association list of action symbols and values.  See
 Info node `(elisp) Buffer Display Action Alists' for details of
 such alists."
-  (and (if (eq pop-up-frames 'graphic-only)
+  (let* ((override (assq 'pop-up-frames alist))
+         (pop-up (if override (cdr override) pop-up-frames)))
+  (and (if (eq pop-up 'graphic-only)
 	   (display-graphic-p)
-	 pop-up-frames)
+	 pop-up)
        (display-buffer-pop-up-frame buffer alist)))
 
 (defun display-buffer--maybe-pop-up-window (buffer alist)

--=-=-=--