(global-auto-revert-mode t)
in your .emacs.
Here is an alternative if you are using Emacs GUI (Mine is GNU Emacs 25.1.1 on Windows 7):
If you already have a few files opened, you should see this taken effect instantly. Good luck!
Thanks to @Ashwin for pointing out (global-auto-revert-mode t)
. I found that Emacs won't automatically update buffers whose files have changed on disk with this change alone. From https://www.gnu.org/software/emacs/manual/html_node/emacs/Reverting.html:
By default, Auto-Revert mode works using file notifications, whereby changes in the filesystem are reported to Emacs by the OS. You can disable use of file notifications by customizing the variable auto-revert-use-notify to a nil value, then Emacs will check for file changes by polling every five seconds. You can change the polling interval through the variable auto-revert-interval.
After I set (setq auto-revert-use-notify nil)
, Emacs did indeed refresh all buffers every 5 seconds.
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