comparison 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
comparison
equal deleted inserted replaced
110701:af844b79b99f 110702:4e901a2d3669
946 `file-remote-p' will never open a connection on its own." 946 `file-remote-p' will never open a connection on its own."
947 (let ((handler (find-file-name-handler file 'file-remote-p))) 947 (let ((handler (find-file-name-handler file 'file-remote-p)))
948 (if handler 948 (if handler
949 (funcall handler 'file-remote-p file identification connected) 949 (funcall handler 'file-remote-p file identification connected)
950 nil))) 950 nil)))
951
952 (defcustom remote-file-name-inhibit-cache 10
953 "Whether to use the remote file-name cache for read access.
954
955 When `nil', always use the cached values.
956 When `t', never use them.
957 A number means use them for that amount of seconds since they were
958 cached.
959
960 File attributes of remote files are cached for better performance.
961 If they are changed out of Emacs' control, the cached values
962 become invalid, and must be invalidated.
963
964 In case a remote file is checked regularly, it might be
965 reasonable to let-bind this variable to a value less then the
966 time period between two checks.
967 Example:
968
969 \(defun display-time-file-nonempty-p \(file)
970 \(let \(\(remote-file-name-inhibit-cache \(- display-time-interval 5)))
971 \(and \(file-exists-p file)
972 \(< 0 \(nth 7 \(file-attributes \(file-chase-links file)))))))"
973 :group 'files
974 :version "24.1"
975 :type `(choice
976 (const :tag "Do not inhibit file name cache" nil)
977 (const :tag "Do not use file name cache" t)
978 (integer :tag "Do not use file name cache"
979 :format "Do not use file name cache older then %v seconds"
980 :value 10)))
951 981
952 (defun file-local-copy (file) 982 (defun file-local-copy (file)
953 "Copy the file FILE into a temporary file on this machine. 983 "Copy the file FILE into a temporary file on this machine.
954 Returns the name of the local copy, or nil, if FILE is directly 984 Returns the name of the local copy, or nil, if FILE is directly
955 accessible." 985 accessible."