compile-mode

emacs compile buffer auto close?

我只是一个虾纸丫 提交于 2019-11-28 21:27:51
I want to auto close the compile buffer when there is no error and no warning,but i want to show it when there is warnings. Anyone can help me? This code from emacswiki only do the first requirement. How to change it? ;; Helper for compilation. Close the compilation window if ;; there was no error at all. (defun compilation-exit-autoclose (status code msg) ;; If M-x compile exists with a 0 (when (and (eq status 'exit) (zerop code)) ;; then bury the *compilation* buffer, so that C-x b doesn't go there (bury-buffer) ;; and delete the *compilation* window (delete-window (get-buffer-window (get