summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.config/emacs/init.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/.config/emacs/init.el b/.config/emacs/init.el
index 34a4634..4326bed 100644
--- a/.config/emacs/init.el
+++ b/.config/emacs/init.el
@@ -551,13 +551,14 @@ related hooks."
(setq x--compilation-number-of-windows (length (window-list))))
(advice-add #'compile :before #'x--compilation-count-number-of-windows)
-(defun x-kill-compilation-buffer-on-success (buffer string)
+(defun x--kill-compilation-buffer-on-success (buffer string)
(when (string= string "finished\n")
- (when (> (length (window-list)) x--compilation-number-of-windows)
- (delete-window (get-buffer-window buffer)))
- (kill-buffer buffer)))
-
-(add-hook 'compilation-finish-functions #'x-kill-compilation-buffer-on-success)
+ (with-current-buffer buffer
+ (when (> (length (window-list))
+ x--compilation-number-of-windows)
+ (delete-window (get-buffer-window)))
+ (kill-buffer))))
+(add-hook 'compilation-finish-functions #'x--kill-compilation-buffer-on-success)
;;; User Interface Themeing
(load-theme 'mango :no-confirm)