[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Function needed to save a certain buffer every x seconds automatical
Re: Function needed to save a certain buffer every x seconds automatically
Thu, 26 Sep 2013 20:39:09 +0200
Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
Am 26.09.2013 20:14, schrieb AW:
Am Donnerstag, 26. September 2013, 19:14:06 schrieb Andreas Röhler:
Am 26.09.2013 17:38, schrieb AW:
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
It runs just once, as timers not to switch off might turn nasty.
Gives some messages when saving.
Edit the my-tex parts.
Would it be possible to take the current buffer instead of manually inserting
the file name?
Yes. Didn't write it as the current-buffer changes quit often, than it writes
whatever-what-buffer into the file-name specified, etc.
Would expect trouble from that.
BTW reflecting your task, what about an after-change, resp. after-save hook,
producing the pdf after every save?
It's up to you.
And besides that: thank you for your help!