I don't think `save-buffer' is enough here. You want `TeX-save-document' if you have a multi-file document.
In addition, using (TeX-command "LaTeX" 'TeX-master-file -1) will always run LaTeX which I think isn't what is wanted (though I could be wrong). One way to always choose the default action is (defun TeX-default () (interactive) (TeX-save-document "") ;; Or just use `TeX-save-query' (execute-kbd-macro (kbd "C-c C-c RET"))) which requires being bound to a key other than C-c C-c. -Ivan On Dec 11, 2013, at 11:52 AM, Oleh <[email protected]> wrote: > I'm using this code: > > (defun pdflatex-quiet () > (interactive) > (save-buffer) > (TeX-command "LaTeX" 'TeX-master-file -1)) > > (add-hook > 'LaTeX-mode-hook > (lambda() > (define-key LaTeX-mode-map [f5] 'pdflatex-quiet))) > > Oleh > > On Wed, Dec 11, 2013 at 4:14 PM, Denis Bitouzé <[email protected]> wrote: >> Hi, >> >> for compiling a .tex file, C-c C-c needs: >> >> 1. to save the file: C-x C-s (beforehand) or confirm by y (afterwards), >> 2. hit the <Enter> key for confirming the default compiler. >> >> AFAIK, the 1st step can be avoid with: >> >> (setq TeX-save-query nil) >> >> Is there a way to avoid the 2nd step, in order to be able to run the >> compilation just with C-c C-c? >> >> Thanks in anticipation. >> -- >> Denis >> >> _______________________________________________ >> auctex mailing list >> [email protected] >> https://lists.gnu.org/mailman/listinfo/auctex > > _______________________________________________ > auctex mailing list > [email protected] > https://lists.gnu.org/mailman/listinfo/auctex _______________________________________________ auctex mailing list [email protected] https://lists.gnu.org/mailman/listinfo/auctex
