diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-09-10 22:47:56 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-09-10 22:47:56 +0200 |
commit | 5e02514a54cb407d51dace48b6f9cb326039ff99 (patch) | |
tree | 90f40290bc2d0c3d07a8ed8fb1c203390cf76d67 /.config/emacs/init.el | |
parent | a0cf49ee1b9f516af516f3dec6d5b8c8a1fc6b98 (diff) |
emacs: Refactor
Diffstat (limited to '.config/emacs/init.el')
-rw-r--r-- | .config/emacs/init.el | 13 |
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) |