From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: pillule Newsgroups: gmane.emacs.bugs Subject: bug#49069: 28.0.50; [PATCH] Use display-buffer for re-builder Date: Thu, 17 Jun 2021 03:16:43 +0200 Message-ID: <87r1h1jnf2.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="1540"; mail-complaints-to="usenet@ciao.gmane.io" To: 49069@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 17 03:23:10 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 1ltgkQ-0000BR-BP for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Jun 2021 03:23:10 +0200 Original-Received: from localhost ([::1]:33918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltgkO-0000e8-Rk for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 16 Jun 2021 21:23:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltgkI-0000dl-EZ for bug-gnu-emacs@gnu.org; Wed, 16 Jun 2021 21:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42013) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltgkI-0008FK-7G for bug-gnu-emacs@gnu.org; Wed, 16 Jun 2021 21:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ltgkI-0002iS-0x for bug-gnu-emacs@gnu.org; Wed, 16 Jun 2021 21:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: pillule Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 Jun 2021 01:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49069 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162389294110372 (code B ref -1); Thu, 17 Jun 2021 01:23:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Jun 2021 01:22:21 +0000 Original-Received: from localhost ([127.0.0.1]:53559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltgjd-0002hE-C0 for submit@debbugs.gnu.org; Wed, 16 Jun 2021 21:22:21 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:49650) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltgjb-0002h6-68 for submit@debbugs.gnu.org; Wed, 16 Jun 2021 21:22:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltgja-0000bn-Vb for bug-gnu-emacs@gnu.org; Wed, 16 Jun 2021 21:22:18 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:37766) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltgjY-0007n3-Rz for bug-gnu-emacs@gnu.org; Wed, 16 Jun 2021 21:22:18 -0400 Original-Received: from fews1.riseup.net (fews1-pn.riseup.net [10.0.1.83]) (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 4G546G2L2BzDxbJ for ; Wed, 16 Jun 2021 18:22:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1623892934; bh=3ImVnTY+D5UDXw1AxJGskTNuvASaUIJe+AsWE/NIlgw=; h=From:To:Subject:Date:From; b=oYJEUXXNScxjXOlAeC+CIxWwnUAO54RUrIuF81spoafUI+G1UACLosuF52I7vfrJX m9y3cMZnx4AS2V3BDWbO3fNQkuZbctfVrmsh0P6OYcZeY4hZjKVpApz6kLqA8VFJna /h/4ugGKj8Jpg07vuEqS4nJb2715SHwmGF+gau2g= X-Riseup-User-ID: 6A3FCFFCFD339B81ED508C38E1DD11ABFAF33668FBEFE8F51B0DBD109F38C544 Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews1.riseup.net (Postfix) with ESMTPSA id 4G546B2Kdgz5vbR for ; Wed, 16 Jun 2021 18:22:08 -0700 (PDT) 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:208651 Archived-At: --=-=-= Content-Type: text/plain Hi, I wished re-builder was in a dedicated window (otherwise killing its buffer let you with an unwanted buffer in a narrow window), so I wrote a patch about it. It also have the benefit to uses display-buffer and so, to allow user-customization. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Use-display-buffer-for-re-builder.patch Content-Description: re-builder with display-buffer >From 388e4e63646af79b537e25fc92f3c3933819a18c Mon Sep 17 00:00:00 2001 From: Trust me I am a doctor Date: Thu, 17 Jun 2021 03:07:57 +0200 Subject: [PATCH] Use display-buffer for re-builder * lisp/emacs-lisp/re-builder.el (re-builder): Uses 'display-buffer' with 'display-buffer-in-direction' to display the reb-buffer. This allow user-customizations. Add a dedication to its window so killing this buffer actually quit its window. --- lisp/emacs-lisp/re-builder.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 7d042a9102..39bb0b36ba 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -355,11 +355,13 @@ 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) + (progn (setq reb-window-config (current-window-configuration)) + (display-buffer (get-buffer-create reb-buffer) + '((display-buffer-in-direction) + (direction . down) + (dedicated . t)))))) (font-lock-mode 1) (reb-initialize-buffer))) -- 2.20.1 --=-=-= Content-Type: text/plain -- --=-=-=--