The problem with the compilation step is that the next buffer is extremely large. I typically do this:
"Shrink window height to certain height."
(interactive "nNew window height: ")
(if (> (window-height) height)
(shrink-window (- (window-height) height))
(enlarge-window (- height (window-height)))
(add-to-list 'TeX-command-list '("pdfLaTeX" "pdflatex -shell-escape %t" TeX-run-interactive nil t))
(defun do-pdflatex ()
"pdflatex with shell escape."
(let ((process (TeX-active-process)))
(TeX-command "pdfLaTeX" 'TeX-master-file)
(global-set-key [f3] 'do-pdflatex)
It does this:
- Kills any active compilation steps
- Starts a new compilation step
- Switch buffer to the compiling window (not exactly, but if 2 buffers are open this will happen)
- Shrink the window to height 7
- Switch back to original buffer
As it takes up so little space it usually doesn't bother me when it compiles fine. I have never looked into this, but it probably means hacking into the process to check it its done, which I suspect is not that easy.