How can we configure emacs to automatically save the unsaved changes every 5 seconds? I want the save the buffer and not the temporary file generated with ~
Emacs periodically saves all files that you are visiting; this is called auto-saving. Auto-saving prevents you from losing more than a limited amount of work if the system crashes. By default, auto-saves happen every 300 keystrokes, or after around 30 seconds of idle time.
Buffers in Emacs editing are objects that have distinct names and hold text that can be edited. Buffers appear to Lisp programs as a special data type. You can think of the contents of a buffer as a string that you can extend; insertions and deletions may occur in any part of the buffer. See Text.
In ~/.emacs file make following changes.
(require 'auto-save-buffers)
(run-with-idle-timer 5 t 'auto-save-buffers)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With