emacs-devel
[Top][All Lists]
Advanced

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

Re: Remote display-time-mail-file


From: Eli Zaretskii
Subject: Re: Remote display-time-mail-file
Date: Thu, 30 Sep 2010 15:29:38 +0200

> From: Michael Albinus <address@hidden>
> Cc: Stefan Monnier <address@hidden>,  address@hidden
> Date: Thu, 30 Sep 2010 15:07:34 +0200
> 
> I did some tests. It is hard to predict, which primitive functions are
> called where, and in majority thes are file-attributes, file-exists-p,
> file-readable-p, file-writable-p. Other primitive functions do profit
> from those cached values, or they aren't called as much that it is worth
> to spend extra handling for caching.
> 
> Therefore, I propose the following patch:

Looks good, thanks.  One suggestion for a more clear doc string:

(defcustom remote-file-name-inhibit-cache 10
  "Whether to use the remote file-name cache for read access.

When `nil', always use the cached values.
When `t', never use them.
A number means use them for that amount of seconds since they were
cached.

File attributes of remote files are cached for better performance.
If they are changed out of Emacs' control, the cached values
become invalid, and must be invalidated.

In case a remote file is checked regularly, it might be
reasonable to let-bind this variable to a value less then the
time period between two checks.
Example:

  \(defun display-time-file-nonempty-p \(file)
    \(let \(\(remote-file-name-inhibit-cache \(- display-time-interval 5)))
      \(and \(file-exists-p file)
           \(< 0 \(nth 7 \(file-attributes \(file-chase-links file)))))))"



reply via email to

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