help-gnu-emacs
[Top][All Lists]
Advanced

[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: Kevin Rodgers
Subject: Re: Function needed to save a certain buffer every x seconds automatically
Date: Tue, 01 Oct 2013 21:18:50 -0600
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20

On 9/26/13 12:14 PM, AW wrote:
Am Donnerstag, 26. September 2013, 19:14:06 schrieb Andreas Röhler:
Am 26.09.2013 17:38, schrieb 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.

So you want to save a single buffer, not all, as auto-save-buffers does?

In this case here a little step forward

(run-with-idle-timer 1 nil (lambda () (set-buffer "MY-TEX")(write-file
(expand-file-name "~/my.tex"))(message (format-time-string "%Y-%m-%d %a
%H:%M" (current-time)))))

It runs just once, as timers not to switch off might turn nasty.
Gives some messages when saving.

Edit the my-tex parts.

Andreas

Would it be possible to take the current buffer instead of manually inserting
the file name?

Instead: Map over all buffers, and save the LaTex buffers.

--
Kevin Rodgers
Denver, Colorado, USA




reply via email to

[Prev in Thread] Current Thread [Next in Thread]