How can I set AucTex to either (a) not pop up that annoying compilation buffer every time I C-c C-c
or (b) only pop it up if compilation is not successful? (b) is preferable, but if it's too hard then I'm fine with (a).
-
(a) is not the default behavior, no compilation buffer is shown by default. You activated it somehow.– giordanoSep 1, 2016 at 12:11
Add a comment
|
2 Answers
I have this in my latex config, but I forget where it come from ...it does (b)
(defadvice TeX-LaTeX-sentinel
(around mg-TeX-LaTeX-sentinel-open-output activate)
"Open output when there are errors."
;; Run `TeX-LaTeX-sentinel' as usual.
ad-do-it
;; Check for the presence of errors.
(when
(with-current-buffer TeX-command-buffer
(plist-get TeX-error-report-switches (intern (TeX-master-file))))
;; If there are errors, open the output buffer.
(TeX-recenter-output-buffer nil)))
-
I guess it's my answer here: tex.stackexchange.com/a/185763 But really, compilation buffer is not shown by default, my guess is that the OP activated it with
(setq TeX-show-compilation t)
.– giordanoDec 30, 2016 at 15:23 -
@giordano Actually, I eventually figured out it was because I was using emac's latex-mode (I think). Anyway, I don't have the problem now. Dec 30, 2016 at 20:48
When I was looking for to avoid this, I didn't found. But I finnaly found a solution to get around the problem by using latexmk
. The following code may help you :
(defun run-latexmk ()
"It compiles the current document"
(interactive)
(let ((TeX-save-query nil)
(TeX-process-asynchronous nil)
(master-file (TeX-master-file)))
(TeX-save-document "")
(TeX-run-TeX "latexmk"
(TeX-command-expand "latexmk -pdf %t" 'TeX-master-file)
master-file)
(minibuffer-message "latexmk done")))
This was inspired by this page about how to make latexmk
run the appropriate amount of times.
Then you can rebind C-c C-c
with something like (local-set-key (kbd "C-c C-c") #'run-latexmk)
.