Saving files automatically every few seconds
Hi I am new to emacs. I am only using it for org-mode. I use it on multiple computers and I am syncing my .org files with dropbox. I have 26.2
I would like the behavior of emacs to be like workflowy or google drive (everything is saved). So I would like an auto-save with the existing file name at minimum every 5-10 seconds, regardless of keystrokes, large deletes, etc...
I tried real-auto-save and I don't see that it saves files using the same name, it is still using #filename#.
Then I tried auto-save-visited-mode. That seems to work.
Questions:
-
Do I need both auto-save-visited-mode and real-auto-save? Whats the difference? I read that auto-save-visited-mode is a global save for all buffers.
-
Can I enable auto-save-visited-mode in the .emacs file? I tried
(setq auto-save-visited-mode t)Is that correct? -
How can I verify that the mode is enabled? I tried M-x auto-save-visited-mode and it toggles. I just want to check the value.
-
Can I have a save regardless of idle time?
Posted Aug 21, 2019, 2:44 PM UTC · edited
I use
(add-hook 'focus-out-hook (lambda () (save-some-buffers t)))which saves the buffers whenever emacs loses the window focus.