[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 57354bc: Use display-buffer with re-builder (bug#49069)

From: Juri Linkov
Subject: master 57354bc: Use display-buffer with re-builder (bug#49069)
Date: Thu, 8 Jul 2021 13:40:24 -0400 (EDT)

branch: master
commit 57354bc64bdec4cfc70908c80325f665ad7fbc20
Author: pillule <pillule@riseup.net>
Commit: Juri Linkov <juri@linkov.net>

    Use display-buffer with re-builder (bug#49069)
    * 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 it on not splitables windows.
    Add a dedication to its window so killing this buffer quit the window.
 lisp/emacs-lisp/re-builder.el | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el
index 7d042a9..396949d 100644
--- a/lisp/emacs-lisp/re-builder.el
+++ b/lisp/emacs-lisp/re-builder.el
@@ -355,11 +355,16 @@ provided in the Commentary section of this library."
     (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) 
-    (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)))
+           (setq reb-window-config (current-window-configuration))
+           (display-buffer
+            (get-buffer-create reb-buffer)
+            `((display-buffer-in-direction)
+              (direction . ,dir)
+              (dedicated . t))))))
     (font-lock-mode 1)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]