emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs inotify support?


From: Eli Zaretskii
Subject: Re: Emacs inotify support?
Date: Mon, 14 Sep 2009 21:08:35 +0300

> From: address@hidden
> Cc: address@hidden, address@hidden, address@hidden,
>         address@hidden
> Date: Mon, 14 Sep 2009 07:47:35 +0200
> 
> I meant that a portable emacs interface can be built on the various
> plattform specific interfaces, such as inotify.

Actually, I suspect that the portability could be only on the Lisp
level; the guts of the interface to the notifications will probably be
quite different for Linux inotify and native Windows calls, either
FindFirst/NextChangeNotification or ReadDirectoryChangesW.

That's not to say that this is not a viable possibility.

> Looking at the directory timestamp could be one such implementation,
> but that would require polling in Emacs right? That would make Emacs
> slow with a large number of open dired buffers.

If we do that from an idle timer, and never test too many directories
before returning to the command loop (similar to what JIT lock does),
I don't think the slowdown will be visible.  At least on Posix
platforms, `stat' is very fast and efficient, and the OS caches its
results.  On non-Posix platforms, `stat' could be expensive, but we
don't need the full `stat' just to check the time stamp of a
directory, we only need a single system call that is much faster than
the full emulation of `stat'.




reply via email to

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