emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: File watch support in autorevert.el


From: Michael Albinus
Subject: Re: File watch support in autorevert.el
Date: Thu, 10 Jan 2013 21:38:21 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> As a proof of concept, I have installed a patch in autorevert.el
>> implementing file watches.  This shall work for `auto-revert-mode' and
>> `global-auto-revert-mode' for buffers visiting files.
>> `auto-revert-tail-mode' is not supported (yet).
>
> Thanks, that sounds like a very good start.  But please make it
> optional, for those users who want to use auto-revert-mode on files
> accessed over NFS and other protocols where inotify doesn't work.

Done. There's a now user option `auto-revert-use-notify', which can be
set to nil in order to suppress file watches. Maybe it would be more
useful, if autorevert would decide per file, whether to trust on file
watches, or not. For example, one could check whether *-add-watch
returns a nil watch descriptor. In this case, there shall be a fallback
to the current implementation. Will see.

After that, I will check what to do with `auto-revert-tail-mode'.

And there is still the open point what to do with the timer. The current
implementation uses the file watches to mark buffers which need to be
reverted. The revert operation itself is triggered by the timer.

One could invoke the revert operation directly when the file watch event
arrives. But the timer would still be needed. For example for these
files which do not support file watches (see above), or for buffers
which are not linked with a visiting file. Therefore, it might not be
necessary to invoke the revert operation directly from the incoming
event.

>         Stefan

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]