Implementation of a continuous "reverse buffer" aka Textpad

One of my colleagues uses TextPad, and one of the features that I find very useful is Auto-Reload. (The function is described in this SO-quiesion: Alternative to requesting TextPad to reload the file ). In principle, it continues to reload the file without any prompts from the user, which is very useful when monitoring log files that are updated in real time. Is there something similar for Emacs? If not, can anyone crack the required magic?

+7
emacs elisp
source share
3 answers

Mx auto return mode

I have to add that for log tails there is a more specific auto-revert-tail-mode, and if you like this as a generic function (in my case), you can enable global auto-return mode to return all buffers. Beware of deleted files in this case.

+20
source share

If you want the auto-return feature to be used everywhere, you can also use the global-auto-revert mode. Add

(global-auto-revert-mode 1)

to your .emacs

+4
source share

Here are my preferences, FWIW: I do not use auto-revert. Instead, I bind f5 to this command:

     (defun revert-buffer-no-confirm ()
       "Revert buffer without confirmation."
       (interactive) (revert-buffer tt))

That sounds silly, but this simple change makes all the difference. This is what f5 does anyway on MS Windows, so this habit works in all applications (on Windows).

Please note that I do not change (e.g. reassign) any bindings for revert-buffer . I use this only when I clearly want to return without confirmation (which is pretty common in practice).

NTN.

+1
source share

All Articles