diff lisp/files.el @ 110702:4e901a2d3669

* files.el (remote-file-name-inhibit-cache): New defcustom. * time.el (display-time-file-nonempty-p): Use `remote-file-name-inhibit-cache'. * net/tramp.el (tramp-completion-reread-directory-timeout): Fix docstring. * net/tramp-cache.el (tramp-cache-inhibit-cache): Remove. (tramp-get-file-property): Replace `tramp-cache-inhibit-cache' by `remote-file-name-inhibit-cache'. Check also for an integer value. Add/increase counter when `tramp-verbose' >= 10. (tramp-set-file-property): Add/increase counter when `tramp-verbose' >= 10. * net/tramp-cmds.el (tramp-cleanup-all-connections) (tramp-cleanup-all-buffers): Set tramp-autoload cookie. (tramp-bug): Set tramp-autoload cookie. Report all interned tramp-* variables. Report also `remote-file-name-inhibit-cache'. (tramp-reporter-dump-variable): Fix docstring. Mask non-7bit characters only in strings. * net/tramp-compat.el (remote-file-name-inhibit-cache): Define due to backward compatibility. * net/tramp-sh.el (tramp-handle-verify-visited-file-modtime) (tramp-handle-file-name-all-completions) (tramp-handle-vc-registered): Use `remote-file-name-inhibit-cache'. (tramp-open-connection-setup-interactive-shell): Call `tramp-cleanup-connection' directly.
author Michael Albinus <michael.albinus@gmx.de>
date Sat, 02 Oct 2010 15:21:43 +0200
parents 1ec34887255d
children 40219338786d
line wrap: on
line diff
--- a/lisp/files.el	Sat Oct 02 14:34:02 2010 +0200
+++ b/lisp/files.el	Sat Oct 02 15:21:43 2010 +0200
@@ -949,6 +949,36 @@
 	(funcall handler 'file-remote-p file identification connected)
       nil)))
 
+(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)))))))"
+  :group 'files
+  :version "24.1"
+  :type `(choice
+	  (const   :tag "Do not inhibit file name cache" nil)
+	  (const   :tag "Do not use file name cache" t)
+	  (integer :tag "Do not use file name cache"
+		   :format "Do not use file name cache older then %v seconds"
+		   :value 10)))
+
 (defun file-local-copy (file)
   "Copy the file FILE into a temporary file on this machine.
 Returns the name of the local copy, or nil, if FILE is directly