[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Function needed to save a certain buffer every x seconds automatical
From: |
Michael Heerdegen |
Subject: |
Re: Function needed to save a certain buffer every x seconds automatically |
Date: |
Thu, 26 Sep 2013 19:01:58 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Hi AW,
> Hello!
>
> To get a fast refreshing PDF of my LaTeX file, I use latexmk, which
> renders a PDF every time the LaTeX file changed on the hard disk.
>
> I'd like to have a mechanism to save the LaTeX file every x seconds.
>
> I found this solution:
>
> (require 'auto-save-buffers)
> (run-with-idle-timer 1 t 'auto-save-buffers)
>
> If I put that into my .emacs, Emacs saves every buffer immediately after a
> change of the buffer.
>
> But it is cumbersome to switch that off in the .emacs file, if not
> needed, and
> on, if needed. Could someone write a function to switch this line
>
> (run-with-idle-timer 1 t 'auto-save-buffers)
>
> on and off?
For the short I only found "auto-save-buffers-enhanced.el", which seems
to solve your problem - there is a function
`auto-save-buffers-enhanced-toggle-activity' which seems to do exactly
what you want.
Mmh, wait, the original package also has a toggle function,
`auto-save-buffers-toggle'. Isn't that what you want?
In both cases, you must have started the timer before toggling does
anything.
Regards,
Michael.