diff options
author | David Robillard <d@drobilla.net> | 2025-05-28 15:23:21 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-05-28 15:23:21 -0400 |
commit | a962ee4d14445688e34165598e351b2afe39f5fb (patch) | |
tree | c885b78bbb2870ec55af54a2db98086ccaf9a00b | |
parent | b35cdb490c0e632e6a8590206dfe47bbe500e369 (diff) | |
download | dotfiles-a962ee4d14445688e34165598e351b2afe39f5fb.tar.gz dotfiles-a962ee4d14445688e34165598e351b2afe39f5fb.tar.bz2 dotfiles-a962ee4d14445688e34165598e351b2afe39f5fb.zip |
Fix compilation window auto-close function
-rw-r--r-- | emacs/.emacs.d/init.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index f16d1ea..ed1a017 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -299,12 +299,13 @@ (defun compile-autoclose (buffer string) "Close compilation window on success" - (cond ((and (string-match "compilation" (buffer-name buffer)) - (string-match "finished" string)) - (bury-buffer "*compilation*") - (message "Build successful.")) - (t - (message "Compilation exited abnormally: %s" string)))) + (if (and (string-match "compilation" (buffer-name buffer)) + (string-match "finished" string)) + (progn + (switch-to-prev-buffer (get-buffer-window buffer) 'bury) + (bury-buffer buffer) + (message "Compilation successful")) + (message "Compilation exited abnormally: %s" string))) (defun rotate-windows () "Rotate windows" |