 <p>If you want to run asynchronous process programmatically go for it. That is, use the lower level functions.</p> <pre><code>(set-process-sentinel (start-process "pdflatex" "*async pdflatex*" "pdflatex" filename) (lambda (process event) (cond ((string-match-p "finished" event) (kill-buffer "*async pdflatex*")) ((string-match-p "\\(exited\\|dumped\\)" event) (message "Something wrong happened while running pdflatex") (when (yes-or-no-p "Something wrong happened while running pdflatex, see the errors?") (switch-to-buffer "*async pdflatex*")))))) </code></pre> <p><code>start-process</code> starts a process asynchronously and <code>set-process-sentinel</code> defines the function triggered when the process status changes.</p>