Voglio chiudere automaticamente il buffer di compilazione quando non ci sono errori e avvisi, ma voglio mostrarlo quando ci sono avvertimenti. Qualcuno può aiutarmi? Questo codice da emacswiki esegue solo il primo requisito. Come cambiarlo?emacs compile buffer auto close?
;; 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-buffer "*compilation*"))))
;; Always return the anticipated result of compilation-exit-message-function
(cons msg code))
;; Specify my function (maybe I should have done a lambda function)
(setq compilation-exit-message-function 'compilation-exit-autoclose)
Che cosa stai compilando? – Thomas
@Thomas questo non è il problema chiave – Iceman
Potrebbe essere utile sapere quale compilatore stai usando perché potresti essere in grado di usare il parametro 'msg' per verificare se ci sono errori o avvertimenti. – Thomas