emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Added inotify support.


From: Óscar Fuentes
Subject: Re: [PATCH] Added inotify support.
Date: Wed, 03 Oct 2012 01:46:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> Btw, what are Emacs use cases for using this kind of feature?

Apart from those mentioned on the original message (dired or magit's (or
vc-dir) status view) I'll like to mention auto-revert-mode.

Currently auto-revert is a bit of a hack, in the sense that Emacs
implements a poor man's method for being aware of file changes. Checking
the timestamps every N seconds is cumbersome and has annoying
side-effects compared to the Right Thing.

> Watching a directory or even a single file can easily flood Emacs with
> many events,

There are users that turn on auto-revert-mode on all file buffers. When
you accumulated quite a few buffers, checking all the associated
timestamps can be a bit lengthy and disruptive, so
auto-revert-stop-on-user-input was introduced (another hack). Plus,
waiting 5 seconds for checking for changes is, sometimes, annoyingly
long, and decreasing that value may end on too much workload for Emacs.

> and in some extreme cases (like watching /tmp, especially
> using IN_ACCESS) so many that it will probably make Emacs unusable.
> (The equivalent Windows APIs give you an even longer rope, in that you
> can watch a directory and all its subdirectories, recursively, with a
> single watch handle.)  Also, a typical file operation can be presented
> as a series of notifications that are not easy to make sense of,
> unless you are a filesystem expert and know exactly what to expect.
>
> Maybe we should think a little more, before we expose all the guts of
> inotify to the Lisp level.  It's not like anyone will write an OS in
> Emacs Lisp any time soon, is it?

You are leaving this case to extremes. Emacs already allows you to do
very silly things. Let's not throw out useful features simply because
they might be abused.




reply via email to

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