8

I have just upgraded to AUCTeX 11.89.1 in emacs and find the new command (TeX-command-run-all) quite convenient. One problem is that after modifying the file and typing C-c C-a, confirmation is needed to save the file first.

I suspect that I kind of only need to set something to nil to deactivate this confirmation step, but I have not found a way. Any suggestions? Many thanks!

  • The file has to be saved. Do you mean to automatically save before running TeX-command-run-all? – jon Feb 4 '16 at 6:50
  • @jon, yes, I want to save automatically on compiling. I think a short sequential lisp function would do, but i hope there is more direct way. – davyjones Feb 4 '16 at 6:59
  • Related, possibly a duplicate. TeX-save-query is news to me, though :) How to omit comfirmation when I compile the files in emacs? – Sean Allred Feb 4 '16 at 12:57
11

The variable TeX-save-query controls this behavior:

User Option: TeX-save-query

If non-nil, then query the user before saving each file with TeX-save-document.

Add the following line to your init file

(setq TeX-save-query nil)
  • Is this a trap? If Emacs does not ask, the users will not save the file and TeX will run on the saved, old version? – Keks Dose Feb 4 '16 at 9:47
  • 1
    It'll always save without asking, that's exactly what davyjones is looking after. – giordano Feb 4 '16 at 9:48
  • OK, »my« solution works with all Emacs buffers, while this here is AUCTeX specific. – Keks Dose Feb 4 '16 at 10:13
  • 5
    @KeksDose Which is exactly why it scares me :-) – Sean Allred Feb 4 '16 at 12:58
1

There is a lisp package, auto-save-buffers.el

Put into your .emacs:

(require 'auto-save-buffers)
(run-with-idle-timer 2 t 'auto-save-buffers)
(global-set-key [f8] 'auto-save-buffers-toggle)

»2«: seconds between stop typing and saving

»f8« toggle the function.

  • 4
    Unless you're always on some version control system, actually saving all the time seems like it could backfire on you pretty badly. – Sean Allred Feb 4 '16 at 12:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.