unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#49069: 28.0.50; [PATCH] Use display-buffer for re-builder
@ 2021-06-17  1:16 pillule
  2021-06-17  4:10 ` pillule
  0 siblings, 1 reply; 12+ messages in thread
From: pillule @ 2021-06-17  1:16 UTC (permalink / raw)
  To: 49069

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]


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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: re-builder with display-buffer --]
[-- Type: text/x-diff, Size: 1589 bytes --]

From 388e4e63646af79b537e25fc92f3c3933819a18c Mon Sep 17 00:00:00 2001
From: Trust me I am a doctor <pillule@riseup.net>
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


[-- Attachment #3: Type: text/plain, Size: 4 bytes --]


--

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-07-09  9:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-17  1:16 bug#49069: 28.0.50; [PATCH] Use display-buffer for re-builder pillule
2021-06-17  4:10 ` pillule
2021-06-17 14:50   ` pillule
2021-06-29 15:51     ` Trust me I am a Doctor
2021-06-29 20:47       ` Juri Linkov
2021-06-29 21:50         ` Trust me I am a Doctor
2021-06-30 19:49           ` Juri Linkov
2021-07-08 15:18             ` Trust me I am a Doctor
2021-07-08 17:40               ` Juri Linkov
2021-07-08 21:12                 ` Trust me I am a Doctor
     [not found]                   ` <87bl7c5wgl.fsf@riseup.net>
     [not found]                     ` <7355eaf3-5ae2-46e7-80f5-d3d23ffff7d8@Spark>
2021-07-09  9:00                       ` bug#49069: Fwd: " Trust me I am a Doctor
2021-07-08 18:38               ` Constantine Vetoshev

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).