all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Function needed to save a certain buffer every x seconds automatically
Date: Thu, 26 Sep 2013 19:01:58 +0200	[thread overview]
Message-ID: <87ioxncy9l.fsf@web.de> (raw)
In-Reply-To: 6906143.LRjCqdsP7e@linux-ik7b.site

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.




  reply	other threads:[~2013-09-26 17:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-26 15:38 Function needed to save a certain buffer every x seconds automatically AW
2013-09-26 17:01 ` Michael Heerdegen [this message]
2013-09-26 17:14 ` Andreas Röhler
2013-09-26 18:14   ` AW
2013-09-26 18:39     ` Andreas Röhler
2013-10-02  3:18     ` Kevin Rodgers
  -- strict thread matches above, loose matches on Subject: below --
2013-09-26 17:30 AW

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ioxncy9l.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.