emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/beardbolt 27f10327f3 308/323: Rework window management.


From: ELPA Syncer
Subject: [elpa] externals/beardbolt 27f10327f3 308/323: Rework window management. Not a bad alternative.
Date: Thu, 9 Mar 2023 10:58:59 -0500 (EST)

branch: externals/beardbolt
commit 27f10327f35828a1aca0f5ac73290a7d053bd80c
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Rework window management.  Not a bad alternative.
    
    * beardbolt.el (bb--handle-finish-compile): Simplify.
---
 beardbolt.el | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/beardbolt.el b/beardbolt.el
index 57ced236ed..c045f614fb 100644
--- a/beardbolt.el
+++ b/beardbolt.el
@@ -497,11 +497,16 @@ Argument STR compilation finish status."
       (bb--asm-mode)
       (setq bb--source-buffer src-buffer)
       (let* ((inhibit-modification-hooks t)
-             (inhibit-read-only t))
+             (inhibit-read-only t)
+             (cwindow (get-buffer-window compilation-buffer))
+             window)
         (erase-buffer)
         (cond
          ((string-match "^finished" str)
-          (display-buffer (current-buffer) 
`((display-buffer-use-least-recent-window)))
+          (when (and cwindow (bb--get bb-execute))
+            (set-window-dedicated-p cwindow 'soft))
+          (setq window
+                (display-buffer (current-buffer) 
`((display-buffer-use-least-recent-window))))
           (mapc #'delete-overlay (overlays-in (point-min) (point-max)))
           (insert-file-contents declared-output)
           (setq bb--line-mappings nil)
@@ -510,7 +515,13 @@ Argument STR compilation finish status."
           (when (bb--get bb-demangle)
             (shell-command-on-region (point-min) (point-max) "c++filt"
                                      (current-buffer) 'no-mark))
-          (bb--rainbowize src-buffer))
+          (bb--rainbowize src-buffer)
+          (when (and (bb--get bb-execute) (null cwindow))
+            (setq cwindow
+                  (with-selected-window window
+                    (display-buffer compilation-buffer
+                                    `((display-buffer-below-selected)))))
+            (set-window-dedicated-p cwindow 'soft)))
          (t
           (insert "<Compilation failed>")
           (unless (or (string-match "^interrupt" str)



reply via email to

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