Last active
May 8, 2018 10:27
-
-
Save EricCrosson/fa41233f327403ea2a5a to your computer and use it in GitHub Desktop.
Emacs Lisp defun to bury the compilation buffer if everything compiles smoothly. No news is good news!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun bury-compile-buffer-if-successful (buffer string) | |
(when (and | |
(string-match "compilation" (buffer-name buffer)) | |
(string-match "finished" string) | |
(not (search-forward "warning" nil t))) | |
(bury-buffer buffer) | |
(switch-to-prev-buffer (get-buffer-window buffer) 'kill))) | |
(add-hook 'compilation-finish-functions 'bury-compile-buffer-if-successful) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment