How can I setup Emacs >= 24.4 so that it saves at least the current file I'm working on automatically, say, each 5 seconds, so that I don't have to press C-x C-s
each time to save my changes?
-
Related: Automatically saving the current file after typing a certain number of characters.– Dan ♦Commented May 10, 2016 at 10:44
Add a comment
|
1 Answer
You probably do not want it to save every N sec but to do that only after Emacs has been idle for N sec.
To do that, customize user option auto-save-timeout
to the number of seconds, and turn on auto-save-mode
.
See the Emacs manual (C-h r
), node Auto Save and its children, especially node Auto Save Control.
See also the Elisp manual, node Auto-Saving, which details the user options and functions used for auto-saving.
-
+1 for "you probably don't want to do that."
auto-save
, as @Drew suggests, provides the functionality you probably want.– Dan ♦Commented May 10, 2016 at 10:47