From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Trust me I am a Doctor Newsgroups: gmane.emacs.bugs Subject: bug#49069: 28.0.50; [PATCH] Use display-buffer for re-builder Date: Tue, 29 Jun 2021 17:51:43 +0200 Message-ID: <87o8boy8cd.fsf@riseup.net> References: <87r1h1jnf2.fsf@riseup.net> <87a6npf7pr.fsf@riseup.net> <871r90fsoq.fsf@riseup.net> 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="4679"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 49069@debbugs.gnu.org To: pillule Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 29 17:55:14 2021 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 1lyG4v-0000xx-FL for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Jun 2021 17:55:13 +0200 Original-Received: from localhost ([::1]:46736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lyG4u-0003jK-D3 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Jun 2021 11:55:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49120) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyG4k-0003hC-NN for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 11:55:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lyG4k-0006Da-BC for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 11:55:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lyG4k-0000ku-1I for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 11:55:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Trust me I am a Doctor Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Jun 2021 15:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49069 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-Cc: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16249820992892 (code B ref -1); Tue, 29 Jun 2021 15:55:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Jun 2021 15:54:59 +0000 Original-Received: from localhost ([127.0.0.1]:55167 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyG4h-0000ka-IM for submit@debbugs.gnu.org; Tue, 29 Jun 2021 11:54:59 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lyG4g-0000kT-Pz for submit@debbugs.gnu.org; Tue, 29 Jun 2021 11:54:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49094) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyG4g-0003eD-G1 for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 11:54:58 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:53972) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lyG4e-00067y-6F for bug-gnu-emacs@gnu.org; Tue, 29 Jun 2021 11:54:58 -0400 Original-Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4GDpvd3BdxzDrvx for ; Tue, 29 Jun 2021 08:54:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1624982093; bh=f5QDd3QL/3T8ZnRDDHlPeiy69J2Osz1zqyu1sBv5cdU=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=JzrduO8kajoHvmhA7IOG3IesZO2lzY7a7vS0/5P3JK0qDuIpUKIivToIYqc7UVhzg dE9dyAzMg7BwfKYz//v4gf97lLuCu+tmMQ/HO7TB2UEFf2CiUBEYyY0y++FBdpbVwm /LcQw8ZhURlZ3NR3XwqUugPAjlSsv+S20TS4G5Os= X-Riseup-User-ID: 12FF8E1A7317D75445DF8236E9D7240FE30FE0EC284E4A08DD34FC3D4898F83D Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4GDpvc35SMz20c1; Tue, 29 Jun 2021 08:54:52 -0700 (PDT) In-reply-to: <871r90fsoq.fsf@riseup.net> Received-SPF: pass client-ip=198.252.153.129; envelope-from=pillule@riseup.net; helo=mx1.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:209108 Archived-At: --=-=-= Content-Type: text/plain But maybe we don't care at all about user customizations, the point being rather to stop the re-builder window to be stealed by other buffers, and to clean it on kill-buffer, then we could use 'display-buffer-overriding-actions'. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Pop-re-buffer-in-a-dedicated-window.patch Content-Description: pop re-buffer in a dedicated window >From b4630049c6b1c4b1704fb463edfa8140ed4df729 Mon Sep 17 00:00:00 2001 From: Trust me I am a doctor Date: Tue, 29 Jun 2021 17:46:07 +0200 Subject: [PATCH] Pop re-buffer in a dedicated window * lisp/emacs-lisp/re-builder.el (re-builder): Uses 'display-buffer-overriding-action' to pop 're-buffer' in a dedicated window, also make possible to call it from a side window. --- lisp/emacs-lisp/re-builder.el | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 7d042a9102..331f17cb5e 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -355,11 +355,15 @@ re-builder (reb-delete-overlays)) (setq reb-target-buffer (current-buffer) reb-target-window (selected-window)) - (select-window (or (get-buffer-window reb-buffer) - (progn - (setq reb-window-config (current-window-configuration)) - (split-window (selected-window) (- (window-height) 4))))) - (switch-to-buffer (get-buffer-create reb-buffer)) + (select-window + (or (get-buffer-window reb-buffer) + (let* ((dir (if (window-parameter nil 'window-side) + 'bottom 'down)) + (display-buffer-overriding-action `((display-buffer-in-direction) + (direction . ,dir) + (dedicated . t)))) + (setq reb-window-config (current-window-configuration)) + (pop-to-buffer (get-buffer-create reb-buffer))))) (font-lock-mode 1) (reb-initialize-buffer))) -- 2.20.1 --=-=-=--