Julian Scheid <[email protected]> writes:
> +2009-08-16 Julian Scheid <[email protected]>
> +
> + * tramp-cache.el (tramp-get-modified-by-process): New defun.
> + (tramp-process-modification-list): New defvar.
> +
> + * tramp.el (tramp-handle-process-file): Use them. Also, merge
> + three remote ops into one.
I believe your patch is too complicate. It parses the arguments of
process-file, and tries to understand what happens. Too much details
must be known (is git called as "git", "/usr/bin/git", "/usr/local/bin/git")?
Furthermore, tramp-process-modification-list must be kept up-to-date;
either by Tramp (it will always loose), or by the caller (too
complicate).
A possible approach could be to have a variable
tramp-process-file-modification-list. The value of this list could be
either `t' (unknown files are modified, the default value), `nil' (no
file is modified at all), or a list of file names (just these files are
modified). tramp-handle-process-file could flush the file cache
accordingly.
An application could do then (example taken from vc-git.el)
(defun vc-git-registered (file)
"Check whether FILE is registered with git."
(when (vc-git-root file)
(with-temp-buffer
(let* ((tramp-process-file-modification-list nil)
(dir (file-name-directory file))
...
Best regards, Michael.
_______________________________________________
Tramp-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/tramp-devel