Quiero cerrar automáticamente el búfer de compilación cuando no haya ningún error ni advertencia, pero quiero mostrarlo cuando haya advertencias. ¿Alguien puede ayudarme? Este código de emacswiki solo hace el primer requisito. Cómo 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)
¿Qué estás compilando? – Thomas
@Thomas este no es el problema clave – Iceman
Puede ser útil saber qué compilador se está ejecutando porque es posible que pueda usar el parámetro 'msg' para comprobar si hay errores o advertencias. – Thomas