In ~/.emacs file make following changes.
(require 'auto-save-buffers)
(run-with-idle-timer 5 t 'auto-save-buffers)
Question
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 ~
Solution
In ~/.emacs file make following changes.
(require 'auto-save-buffers)
(run-with-idle-timer 5 t 'auto-save-buffers)
OTHER TIPS
change the auto-save-timeout's value affects the number of seconds idle time before auto-save.
using (setq auto-save-timeout 5) may solve your problem