I am using following full-auto-save ()
(https://www.emacswiki.org/emacs/AutoSave) to save all buffers on Auto-Save.
(defun full-auto-save ()
(interactive)
(save-excursion
(dolist (buf (buffer-list))
(set-buffer buf)
(if (and (buffer-file-name) (buffer-modified-p))
(basic-save-buffer)))))
(add-hook 'auto-save-hook 'full-auto-save)
I have a ~2000 lines of a tex
file, where after each save I run pdflatex
to compile my latex file in combination with emac's auto-backup feature. Hence in the backup auto-saving causes pdflatex
to run every few second along with writing the large file as backup while I am typing, which leads Emacs to freeze.
Is it possible to prevent auto-save for specific modes disable it for a specific mode, such as LaTeX-mode
, but keep it enabled for other modes?
pdflatex
when a PDF buffer is is autosaved, but only on a manual save? Possibly by checking that target file for '#' or checking the buffer-modified-p flag (which isn't cleared by autosaves, only manual saves, IIRC)after-save-hook
. I like to see changes right away on the pdf