emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Added basic file system watching support.


From: Michael Albinus
Subject: Re: [PATCH] Added basic file system watching support.
Date: Tue, 11 Dec 2012 09:44:55 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

> Then Tramp could maintain its own data structure for watched files,
> and give each watch a unique identifier, like (FILENAME . NUMBER), or
> just NUMBER, or whatever.

That I do already in my inotify-add-watch handler. Of course.

> IOW, the DESCRIPTOR is an opaque data type, which the implementation
> back-end, and the back-end alone, can and should interpret.

The point is, that something must trigger Tramp. In inotify-add-watch, I
have added the following code (shortened, there's more):

--8<---------------cut here---------------start------------->8---
  /* If the file name has special constructs in it,
     call the corresponding file handler.  */
  handler = Ffind_file_name_handler (file_name, Qinotify_add_watch);
  if (!NILP (handler))
    {
      return call4 (handler, Qinotify_add_watch, file_name, aspect,
     callback);
    }
--8<---------------cut here---------------end--------------->8---

In inotify-rm-watch I couldn't add similar lines, because file_name is
unknown. My proposal is either to add file_name as first argument of
inotify-rm-watch, or to declare WATCH-DESCRIPTOR as a cons cell, which
car is always the file name.

Best regards, Michael.



reply via email to

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