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 06:10:53 +0200 Message-ID: <87a6npf7pr.fsf@riseup.net> References: <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="17508"; 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 Thu Jun 17 06:15:13 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 1ltjQt-0004Hc-K0 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Jun 2021 06:15:11 +0200 Original-Received: from localhost ([::1]:55122 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ltjQs-00083E-8k for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 17 Jun 2021 00:15:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltjQk-000831-BI for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 00:15:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ltjQk-0004hj-3T for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 00:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ltjQj-00076G-Un for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 00:15:01 -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 04:15: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.162390329527264 (code B ref -1); Thu, 17 Jun 2021 04:15:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 17 Jun 2021 04:14:55 +0000 Original-Received: from localhost ([127.0.0.1]:53594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltjQd-00075g-7t for submit@debbugs.gnu.org; Thu, 17 Jun 2021 00:14:55 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:42622) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ltjQa-00075Y-Gu for submit@debbugs.gnu.org; Thu, 17 Jun 2021 00:14:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltjQa-00082V-9L for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 00:14:52 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:46002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ltjQX-0004Ur-PL for bug-gnu-emacs@gnu.org; Thu, 17 Jun 2021 00:14:51 -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 4G57xN0jfMzDs9T for ; Wed, 16 Jun 2021 21:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1623903288; bh=G0DkkrpT1A0qRRsTKwamVq6PhWTTJB0yhVRl9hAPYeg=; h=References:From:To:Cc:Subject:Date:In-reply-to:From; b=j4WcJlAg5D1wlOy3rCRMx7ep2RrZ9rd3qNPQk/kgNRqag75q1qmO6Qgc4ByziGs5A H4BGJDMoz8wDMJmh3xu6EfyEmuweZwfVl/HS5Pus06q58y3ZU/RIIcdKdsn2e3YRdd Desz2N3dEnSQcEWCCi4aq/dkRGLIjxpWZzcgll0s= X-Riseup-User-ID: 9700E7D83EAC01689921387382437C2CFC1E2122D75E24092F85D18D6397A280 Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4G57xL72syz1yk6; Wed, 16 Jun 2021 21:14:46 -0700 (PDT) In-reply-to: <87r1h1jnf2.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:208654 Archived-At: --=-=-= Content-Type: text/plain pillule writes: > 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. This second one is more reliable when it comes to call re-builder from a side window. (the original version simply prevented that case since a side window is not splittable) --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Use-display-buffer-with-re-builder.patch Content-Description: Use display-buffer for re-builder >From a52953ef8ef146cd105ad6dee7882e0dc298512d Mon Sep 17 00:00:00 2001 From: Trust me I am a doctor Date: Thu, 17 Jun 2021 05:56:34 +0200 Subject: [PATCH] Use display-buffer with 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 and using windows usually not splitables. Add a dedication to its window so killing this buffer actually quit its 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..747f741091 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) + (progn (setq reb-window-config (current-window-configuration)) + (display-buffer + (get-buffer-create reb-buffer) + `((display-buffer-in-direction) + (direction . ,(if (eq (window-dedicated-p nil) 'side) + 'bottom 'down)) + (dedicated . t)))))) (font-lock-mode 1) (reb-initialize-buffer))) -- 2.20.1 --=-=-= Content-Type: text/plain I also tested it against the atomic windows showcased in the manual and it seems ok, but I am not familiar with them. --=-=-=--