summaryrefslogtreecommitdiff
path: root/modules/prog-general.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-03 17:39:10 -0500
committerCraig Jennings <c@cjennings.net>2026-05-03 17:39:10 -0500
commit2a60405ac28c12ec63fac2032b8f87599ebfc6b6 (patch)
tree7852b1a8a9ba9e66ecb3aa41928e4f390c763bcc /modules/prog-general.el
parent0c085f2935418f365f6abd39ce008909dc13ed3c (diff)
downloaddotemacs-2a60405ac28c12ec63fac2032b8f87599ebfc6b6.tar.gz
dotemacs-2a60405ac28c12ec63fac2032b8f87599ebfc6b6.zip
chore(prog-general): disable auto-close of *compilation* window
I commented out the global `compilation-finish-functions' hook that closed the *compilation* window 1.5 seconds after a successful compile. With the F6 test runner now landing test output in *compilation*, I want the buffer to stay open afterward so I can read the results, not have it slide out from under me. The block stays in the file as a commented-out reference so I can flip it back on later if I want. A prog-mode-only variant is noted in the comment for the day I want the auto-close back for non-prog compiles (org-export, etc.) — that needs advice on `compile' to capture the originating buffer's `major-mode' at compile-start, since the hook fires after `compilation-mode' has already taken over the current buffer. Skipped for now per the simpler path.
Diffstat (limited to 'modules/prog-general.el')
-rw-r--r--modules/prog-general.el25
1 files changed, 15 insertions, 10 deletions
diff --git a/modules/prog-general.el b/modules/prog-general.el
index 46599cc9..45b83ca7 100644
--- a/modules/prog-general.el
+++ b/modules/prog-general.el
@@ -376,16 +376,21 @@ If no such file exists there, display a message."
(lsp-ui-peek-show-directory t))
;; ----------------- Auto-Close Successful Compilation Windows -----------------
-;; close compilation windows when successful. from 'enberg' on #emacs
-
-(add-hook 'compilation-finish-functions
- (lambda (_buf str)
- (if (null (string-match ".*exited abnormally.*" str))
- ;;no errors, make the compilation window go away in a few seconds
- (progn
- (run-at-time
- "1.5 sec" nil 'delete-windows-on
- (get-buffer-create "*compilation*"))))))
+;; Disabled: when test results land in *compilation* (F6 / projectile-test-
+;; project), I want to read the output afterward, not have the window close
+;; under me 1.5 s later. To re-enable globally, uncomment the block below.
+;; A prog-mode-only variant would need to capture the originating buffer's
+;; major-mode at compile-start (via advice on `compile') and gate the hook
+;; on it — left out for now per the simpler comment-out path.
+;;
+;; (add-hook 'compilation-finish-functions
+;; (lambda (_buf str)
+;; (if (null (string-match ".*exited abnormally.*" str))
+;; ;;no errors, make the compilation window go away in a few seconds
+;; (progn
+;; (run-at-time
+;; "1.5 sec" nil 'delete-windows-on
+;; (get-buffer-create "*compilation*"))))))
;; which-key labels
(with-eval-after-load 'which-key