If I compile my latex document in auctex, an overview window of the errors pops up where I can select specific errors and jump to that source code position. However after fixing the errors and compiling successfully the windows containing error messages remain open but showing another buffer, i.e. the initial window remains splitted. How can I make emacs to close those windows automatically after fixing the errors and recompiling successfully?
I am not aware of any Auctex-option that lets the TeX-error buffer window close. But, adding the following stuff to your init file should do the job.
It deletes the window of the buffer in
TeX-error-overview-mode when it is killed.
EDIT: Delete also the window showing the
"*TeX Help*" buffer.
(defun TeX-error-delete-window () "Delete TeX error window when there are no errors to show." (let ((w (get-buffer-window)) (b (get-buffer "*TeX Help*"))) (when w (delete-window w)) (when b (setq w (get-buffer-window b)) (when w (delete-window w))))) (defun TeX-error-install-delete-window-hook () "Install `TeX-error-delete-window' in buffer-local `kill-buffer-hook'." (add-hook 'kill-buffer-hook #'TeX-error-delete-window nil t)) (add-hook 'TeX-error-overview-mode-hook #'TeX-error-install-delete-window-hook)