aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2010-10-02 15:21:43 +0200
committerMichael Albinus2010-10-02 15:21:43 +0200
commit4bc3c53d1d9d5b0533c2bbe06693660c8abf1f4a (patch)
treefe8c7483b447abfa52e415279c0f78e977edf7f5
parent573a83b80263cf151982e069fe98a941c893e249 (diff)
downloademacs-4bc3c53d1d9d5b0533c2bbe06693660c8abf1f4a.tar.gz
emacs-4bc3c53d1d9d5b0533c2bbe06693660c8abf1f4a.zip
* 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.
-rw-r--r--lisp/ChangeLog34
-rw-r--r--lisp/files.el30
-rw-r--r--lisp/net/tramp-cache.el29
-rw-r--r--lisp/net/tramp-cmds.el93
-rw-r--r--lisp/net/tramp-compat.el5
-rw-r--r--lisp/net/tramp-gvfs.el1
-rw-r--r--lisp/net/tramp-sh.el68
-rw-r--r--lisp/net/tramp.el4
-rw-r--r--lisp/time.el5
9 files changed, 146 insertions, 123 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 91374cab45c..044db17a44c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,37 @@
12010-10-02 Michael Albinus <michael.albinus@gmx.de>
2
3 * files.el (remote-file-name-inhibit-cache): New defcustom.
4
5 * time.el (display-time-file-nonempty-p): Use
6 `remote-file-name-inhibit-cache'.
7
8 * net/tramp.el (tramp-completion-reread-directory-timeout): Fix
9 docstring.
10
11 * net/tramp-cache.el (tramp-cache-inhibit-cache): Remove.
12 (tramp-get-file-property): Replace `tramp-cache-inhibit-cache' by
13 `remote-file-name-inhibit-cache'. Check also for an integer
14 value. Add/increase counter when `tramp-verbose' >= 10.
15 (tramp-set-file-property): Add/increase counter when
16 `tramp-verbose' >= 10.
17
18 * net/tramp-cmds.el (tramp-cleanup-all-connections)
19 (tramp-cleanup-all-buffers): Set tramp-autoload cookie.
20 (tramp-bug): Set tramp-autoload cookie. Report all interned
21 tramp-* variables. Report also `remote-file-name-inhibit-cache'.
22 (tramp-reporter-dump-variable): Fix docstring. Mask non-7bit
23 characters only in strings.
24
25 * net/tramp-compat.el (remote-file-name-inhibit-cache): Define due
26 to backward compatibility.
27
28 * net/tramp-sh.el (tramp-handle-verify-visited-file-modtime)
29 (tramp-handle-file-name-all-completions)
30 (tramp-handle-vc-registered): Use
31 `remote-file-name-inhibit-cache'.
32 (tramp-open-connection-setup-interactive-shell): Call
33 `tramp-cleanup-connection' directly.
34
12010-10-02 Glenn Morris <rgm@gnu.org> 352010-10-02 Glenn Morris <rgm@gnu.org>
2 36
3 * emacs-lisp/checkdoc.el (checkdoc-minor-keymap): Remove obsolete alias. 37 * emacs-lisp/checkdoc.el (checkdoc-minor-keymap): Remove obsolete alias.
diff --git a/lisp/files.el b/lisp/files.el
index 92574283dd7..bb49f44fda5 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -949,6 +949,36 @@ to that remote system.
949 (funcall handler 'file-remote-p file identification connected) 949 (funcall handler 'file-remote-p file identification connected)
950 nil))) 950 nil)))
951 951
952(defcustom remote-file-name-inhibit-cache 10
953 "Whether to use the remote file-name cache for read access.
954
955When `nil', always use the cached values.
956When `t', never use them.
957A number means use them for that amount of seconds since they were
958cached.
959
960File attributes of remote files are cached for better performance.
961If they are changed out of Emacs' control, the cached values
962become invalid, and must be invalidated.
963
964In case a remote file is checked regularly, it might be
965reasonable to let-bind this variable to a value less then the
966time period between two checks.
967Example:
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)))
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.
954Returns the name of the local copy, or nil, if FILE is directly 984Returns the name of the local copy, or nil, if FILE is directly
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 5745546e3e8..7885d143cc2 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -59,13 +59,6 @@
59(defvar tramp-cache-data (make-hash-table :test 'equal) 59(defvar tramp-cache-data (make-hash-table :test 'equal)
60 "Hash table for remote files properties.") 60 "Hash table for remote files properties.")
61 61
62(defvar tramp-cache-inhibit-cache nil
63 "Inhibit cache read access, when `t'.
64`nil' means to accept cache entries unconditionally. If the
65value is a timestamp (as returned by `current-time'), cache
66entries are not used when they have been written before this
67time.")
68
69(defcustom tramp-persistency-file-name 62(defcustom tramp-persistency-file-name
70 (cond 63 (cond
71 ;; GNU Emacs. 64 ;; GNU Emacs.
@@ -104,19 +97,25 @@ Returns DEFAULT if not set."
104 (value (when (hash-table-p hash) (gethash property hash)))) 97 (value (when (hash-table-p hash) (gethash property hash))))
105 (if 98 (if
106 ;; We take the value only if there is any, and 99 ;; We take the value only if there is any, and
107 ;; `tramp-cache-inhibit-cache' indicates that it is still 100 ;; `remote-file-name-inhibit-cache' indicates that it is still
108 ;; valid. Otherwise, DEFAULT is set. 101 ;; valid. Otherwise, DEFAULT is set.
109 (and (consp value) 102 (and (consp value)
110 (or (null tramp-cache-inhibit-cache) 103 (or (null remote-file-name-inhibit-cache)
111 (and (consp tramp-cache-inhibit-cache) 104 (and (integerp remote-file-name-inhibit-cache)
105 (<=
106 (tramp-time-diff (current-time) (car value))
107 remote-file-name-inhibit-cache))
108 (and (consp remote-file-name-inhibit-cache)
112 (tramp-time-less-p 109 (tramp-time-less-p
113 tramp-cache-inhibit-cache (car value))))) 110 remote-file-name-inhibit-cache (car value)))))
114 (setq value (cdr value)) 111 (setq value (cdr value))
115 (setq value default)) 112 (setq value default))
116 113
117 (if (consp tramp-cache-inhibit-cache)
118 (tramp-message vec 1 "%s %s %s" file property value))
119 (tramp-message vec 8 "%s %s %s" file property value) 114 (tramp-message vec 8 "%s %s %s" file property value)
115 (when (>= tramp-verbose 10)
116 (let* ((var (intern (concat "tramp-cache-get-count-" property)))
117 (val (or (ignore-errors (symbol-value var)) 0)))
118 (set var (1+ val))))
120 value)) 119 value))
121 120
122;;;###tramp-autoload 121;;;###tramp-autoload
@@ -132,6 +131,10 @@ Returns VALUE."
132 ;; We put the timestamp there. 131 ;; We put the timestamp there.
133 (puthash property (cons (current-time) value) hash) 132 (puthash property (cons (current-time) value) hash)
134 (tramp-message vec 8 "%s %s %s" file property value) 133 (tramp-message vec 8 "%s %s %s" file property value)
134 (when (>= tramp-verbose 10)
135 (let* ((var (intern (concat "tramp-cache-set-count-" property)))
136 (val (or (ignore-errors (symbol-value var)) 0)))
137 (set var (1+ val))))
135 value)) 138 value))
136 139
137;;;###tramp-autoload 140;;;###tramp-autoload
diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
index 5937a737b96..e6e1bc671e7 100644
--- a/lisp/net/tramp-cmds.el
+++ b/lisp/net/tramp-cmds.el
@@ -99,6 +99,7 @@ When called interactively, a Tramp connection has to be selected."
99 (tramp-get-connection-property vec "process-buffer" nil))) 99 (tramp-get-connection-property vec "process-buffer" nil)))
100 (when (bufferp buf) (kill-buffer buf))))) 100 (when (bufferp buf) (kill-buffer buf)))))
101 101
102;;;###tramp-autoload
102(defun tramp-cleanup-all-connections () 103(defun tramp-cleanup-all-connections ()
103 "Flush all Tramp internal objects. 104 "Flush all Tramp internal objects.
104This includes password cache, file cache, connection cache, buffers." 105This includes password cache, file cache, connection cache, buffers."
@@ -117,6 +118,7 @@ This includes password cache, file cache, connection cache, buffers."
117 (dolist (name (tramp-list-tramp-buffers)) 118 (dolist (name (tramp-list-tramp-buffers))
118 (when (bufferp (get-buffer name)) (kill-buffer name)))) 119 (when (bufferp (get-buffer name)) (kill-buffer name))))
119 120
121;;;###tramp-autoload
120(defun tramp-cleanup-all-buffers () 122(defun tramp-cleanup-all-buffers ()
121 "Kill all remote buffers." 123 "Kill all remote buffers."
122 (interactive) 124 (interactive)
@@ -141,6 +143,7 @@ This includes password cache, file cache, connection cache, buffers."
141 143
142(autoload 'reporter-submit-bug-report "reporter") 144(autoload 'reporter-submit-bug-report "reporter")
143 145
146;;;###tramp-autoload
144(defun tramp-bug () 147(defun tramp-bug ()
145 "Submit a bug report to the Tramp developers." 148 "Submit a bug report to the Tramp developers."
146 (interactive) 149 (interactive)
@@ -150,65 +153,25 @@ This includes password cache, file cache, connection cache, buffers."
150 (reporter-submit-bug-report 153 (reporter-submit-bug-report
151 tramp-bug-report-address ; to-address 154 tramp-bug-report-address ; to-address
152 (format "tramp (%s)" tramp-version) ; package name and version 155 (format "tramp (%s)" tramp-version) ; package name and version
153 (delq nil 156 (sort
154 `(;; Current state 157 (delq nil (mapcar
155 tramp-current-method 158 (lambda (x)
156 tramp-current-user 159 (and x (boundp x) (cons x 'tramp-reporter-dump-variable)))
157 tramp-current-host 160 (append
158 161 (mapcar 'intern (all-completions "tramp-" obarray 'boundp))
159 ;; System defaults 162 ;; Non-tramp variables of interest.
160 tramp-auto-save-directory ; vars to dump 163 '(shell-prompt-pattern
161 tramp-default-method 164 backup-by-copying
162 tramp-default-method-alist 165 backup-by-copying-when-linked
163 tramp-default-host 166 backup-by-copying-when-mismatch
164 tramp-default-proxies-alist 167 backup-by-copying-when-privileged-mismatch
165 tramp-default-user 168 backup-directory-alist
166 tramp-default-user-alist 169 bkup-backup-directory-info
167 tramp-rsh-end-of-line 170 password-cache
168 tramp-default-password-end-of-line 171 password-cache-expiry
169 tramp-login-prompt-regexp 172 remote-file-name-inhibit-cache
170 ;; Mask non-7bit characters 173 file-name-handler-alist))))
171 (tramp-password-prompt-regexp . tramp-reporter-dump-variable) 174 (lambda (x y) (string< (symbol-name (car x)) (symbol-name (car y)))))
172 tramp-wrong-passwd-regexp
173 tramp-yesno-prompt-regexp
174 tramp-yn-prompt-regexp
175 tramp-terminal-prompt-regexp
176 tramp-temp-name-prefix
177 tramp-file-name-structure
178 tramp-file-name-regexp
179 tramp-methods
180 tramp-end-of-output
181 tramp-local-coding-commands
182 tramp-remote-coding-commands
183 tramp-actions-before-shell
184 tramp-actions-copy-out-of-band
185 tramp-terminal-type
186 ;; Mask non-7bit characters
187 (tramp-shell-prompt-pattern . tramp-reporter-dump-variable)
188 ,(when (boundp 'tramp-backup-directory-alist)
189 'tramp-backup-directory-alist)
190 ,(when (boundp 'tramp-bkup-backup-directory-info)
191 'tramp-bkup-backup-directory-info)
192 ;; Dump cache.
193 (tramp-cache-data . tramp-reporter-dump-variable)
194
195 ;; Non-tramp variables of interest
196 ;; Mask non-7bit characters
197 (shell-prompt-pattern . tramp-reporter-dump-variable)
198 backup-by-copying
199 backup-by-copying-when-linked
200 backup-by-copying-when-mismatch
201 ,(when (boundp 'backup-by-copying-when-privileged-mismatch)
202 'backup-by-copying-when-privileged-mismatch)
203 ,(when (boundp 'password-cache)
204 'password-cache)
205 ,(when (boundp 'password-cache-expiry)
206 'password-cache-expiry)
207 ,(when (boundp 'backup-directory-alist)
208 'backup-directory-alist)
209 ,(when (boundp 'bkup-backup-directory-info)
210 'bkup-backup-directory-info)
211 file-name-handler-alist))
212 175
213 'tramp-load-report-modules ; pre-hook 176 'tramp-load-report-modules ; pre-hook
214 'tramp-append-tramp-buffers ; post-hook 177 'tramp-append-tramp-buffers ; post-hook
@@ -238,8 +201,7 @@ buffer in your bug report.
238")))) 201"))))
239 202
240(defun tramp-reporter-dump-variable (varsym mailbuf) 203(defun tramp-reporter-dump-variable (varsym mailbuf)
241 "Pretty-print the value of the variable in symbol VARSYM. 204 "Pretty-print the value of the variable in symbol VARSYM."
242Used for non-7bit chars in strings."
243 (let* ((reporter-eval-buffer (symbol-value 'reporter-eval-buffer)) 205 (let* ((reporter-eval-buffer (symbol-value 'reporter-eval-buffer))
244 (val (with-current-buffer reporter-eval-buffer 206 (val (with-current-buffer reporter-eval-buffer
245 (symbol-value varsym)))) 207 (symbol-value varsym))))
@@ -247,12 +209,13 @@ Used for non-7bit chars in strings."
247 (if (hash-table-p val) 209 (if (hash-table-p val)
248 ;; Pretty print the cache. 210 ;; Pretty print the cache.
249 (set varsym (read (format "(%s)" (tramp-cache-print val)))) 211 (set varsym (read (format "(%s)" (tramp-cache-print val))))
250 ;; There are characters to be masked. 212 ;; There are non-7bit characters to be masked.
251 (when (and (boundp 'mm-7bit-chars) 213 (when (and (boundp 'mm-7bit-chars)
214 (stringp val)
252 (string-match 215 (string-match
253 (concat "[^" (symbol-value 'mm-7bit-chars) "]") val)) 216 (concat "[^" (symbol-value 'mm-7bit-chars) "]") val))
254 (with-current-buffer reporter-eval-buffer 217 (with-current-buffer reporter-eval-buffer
255 (set varsym (format "(base64-decode-string \"%s\"" 218 (set varsym (format "(base64-decode-string \"%s\")"
256 (base64-encode-string val)))))) 219 (base64-encode-string val))))))
257 220
258 ;; Dump variable. 221 ;; Dump variable.
@@ -268,7 +231,7 @@ Used for non-7bit chars in strings."
268 "\\(\")\\)" "\"$")) ;; \4 " 231 "\\(\")\\)" "\"$")) ;; \4 "
269 (replace-match "\\1\\2\\3\\4") 232 (replace-match "\\1\\2\\3\\4")
270 (beginning-of-line) 233 (beginning-of-line)
271 (insert " ;; variable encoded due to non-printable characters\n")) 234 (insert " ;; Variable encoded due to non-printable characters.\n"))
272 (forward-line 1)) 235 (forward-line 1))
273 236
274 ;; Reset VARSYM to old value. 237 ;; Reset VARSYM to old value.
@@ -277,7 +240,6 @@ Used for non-7bit chars in strings."
277 240
278(defun tramp-load-report-modules () 241(defun tramp-load-report-modules ()
279 "Load needed modules for reporting." 242 "Load needed modules for reporting."
280
281 ;; We load message.el and mml.el from Gnus. 243 ;; We load message.el and mml.el from Gnus.
282 (if (featurep 'xemacs) 244 (if (featurep 'xemacs)
283 (progn 245 (progn
@@ -290,7 +252,6 @@ Used for non-7bit chars in strings."
290 252
291(defun tramp-append-tramp-buffers () 253(defun tramp-append-tramp-buffers ()
292 "Append Tramp buffers and buffer local variables into the bug report." 254 "Append Tramp buffers and buffer local variables into the bug report."
293
294 (goto-char (point-max)) 255 (goto-char (point-max))
295 256
296 ;; Dump buffer local variables. 257 ;; Dump buffer local variables.
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index 5156711fa47..afbaa8064dc 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -96,6 +96,11 @@
96 (defvar byte-compile-not-obsolete-vars nil)) 96 (defvar byte-compile-not-obsolete-vars nil))
97 (setq byte-compile-not-obsolete-vars '(directory-sep-char)) 97 (setq byte-compile-not-obsolete-vars '(directory-sep-char))
98 98
99 ;; `remote-file-name-inhibit-cache' has been introduced with Emacs 24.1.
100 ;; Besides `t', `nil', and integer, we use also timestamps (as
101 ;; returned by `current-time') internally.
102 (defvar remote-file-name-inhibit-cache nil)
103
99 ;; For not existing functions, or functions with a changed argument 104 ;; For not existing functions, or functions with a changed argument
100 ;; list, there are compiler warnings. We want to avoid them in 105 ;; list, there are compiler warnings. We want to avoid them in
101 ;; cases we know what we do. 106 ;; cases we know what we do.
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index cd2bab26f47..151e03e88ab 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -531,7 +531,6 @@ is no information where to trace the message.")
531(defun tramp-gvfs-dbus-event-error (event err) 531(defun tramp-gvfs-dbus-event-error (event err)
532 "Called when a D-Bus error message arrives, see `dbus-event-error-hooks'." 532 "Called when a D-Bus error message arrives, see `dbus-event-error-hooks'."
533 (when tramp-gvfs-dbus-event-vector 533 (when tramp-gvfs-dbus-event-vector
534 ;(tramp-cleanup-connection tramp-gvfs-dbus-event-vector)
535 (tramp-message tramp-gvfs-dbus-event-vector 10 "%S" event) 534 (tramp-message tramp-gvfs-dbus-event-vector 10 "%S" event)
536 (tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err)))) 535 (tramp-error tramp-gvfs-dbus-event-vector 'file-error "%s" (cadr err))))
537 536
diff --git a/lisp/net/tramp-sh.el b/lisp/net/tramp-sh.el
index 423b4fcbd5e..e31e2e23745 100644
--- a/lisp/net/tramp-sh.el
+++ b/lisp/net/tramp-sh.el
@@ -1366,8 +1366,8 @@ of."
1366 (not (tramp-file-name-handler 'file-remote-p f nil 'connected))) 1366 (not (tramp-file-name-handler 'file-remote-p f nil 'connected)))
1367 t 1367 t
1368 (with-parsed-tramp-file-name f nil 1368 (with-parsed-tramp-file-name f nil
1369 (tramp-flush-file-property v localname) 1369 (let* ((remote-file-name-inhibit-cache t)
1370 (let* ((attr (file-attributes f)) 1370 (attr (file-attributes f))
1371 (modtime (nth 5 attr)) 1371 (modtime (nth 5 attr))
1372 (mt (visited-file-modtime))) 1372 (mt (visited-file-modtime)))
1373 1373
@@ -1770,46 +1770,39 @@ and gid of the corresponding user is taken. Both parameters must be integers."
1770 (mapcar 1770 (mapcar
1771 'list 1771 'list
1772 (or 1772 (or
1773 ;; Try cache first 1773 ;; Try cache entries for filename, filename with last
1774 (and 1774 ;; character removed, filename with last two characters
1775 ;; Ignore if expired 1775 ;; removed, ..., and finally the empty string - all
1776 (or (not (integerp tramp-completion-reread-directory-timeout)) 1776 ;; concatenated to the local directory name.
1777 (<= (tramp-time-diff 1777 (let ((remote-file-name-inhibit-cache
1778 (current-time) 1778 (or remote-file-name-inhibit-cache
1779 (tramp-get-file-property 1779 tramp-completion-reread-directory-timeout)))
1780 v localname "last-completion" '(0 0 0))) 1780
1781 tramp-completion-reread-directory-timeout)) 1781 ;; This is inefficient for very long filenames, pity
1782 1782 ;; `reduce' is not available...
1783 ;; Try cache entries for filename, filename with last 1783 (car
1784 ;; character removed, filename with last two characters 1784 (apply
1785 ;; removed, ..., and finally the empty string - all 1785 'append
1786 ;; concatenated to the local directory name 1786 (mapcar
1787 1787 (lambda (x)
1788 ;; This is inefficient for very long filenames, pity 1788 (let ((cache-hit
1789 ;; `reduce' is not available... 1789 (tramp-get-file-property
1790 (car 1790 v
1791 (apply 1791 (concat localname (substring filename 0 x))
1792 'append 1792 "file-name-all-completions"
1793 (mapcar 1793 nil)))
1794 (lambda (x) 1794 (when cache-hit (list cache-hit))))
1795 (let ((cache-hit 1795 (tramp-compat-number-sequence (length filename) 0 -1)))))
1796 (tramp-get-file-property
1797 v
1798 (concat localname (substring filename 0 x))
1799 "file-name-all-completions"
1800 nil)))
1801 (when cache-hit (list cache-hit))))
1802 (tramp-compat-number-sequence (length filename) 0 -1)))))
1803 1796
1804 ;; Cache expired or no matching cache entry found so we need 1797 ;; Cache expired or no matching cache entry found so we need
1805 ;; to perform a remote operation 1798 ;; to perform a remote operation.
1806 (let (result) 1799 (let (result)
1807 ;; Get a list of directories and files, including reliably 1800 ;; Get a list of directories and files, including reliably
1808 ;; tagging the directories with a trailing '/'. Because I 1801 ;; tagging the directories with a trailing '/'. Because I
1809 ;; rock. --daniel@danann.net 1802 ;; rock. --daniel@danann.net
1810 1803
1811 ;; Changed to perform `cd' in the same remote op and only 1804 ;; Changed to perform `cd' in the same remote op and only
1812 ;; get entries starting with `filename'. Capture any `cd' 1805 ;; get entries starting with `filename'. Capture any `cd'
1813 ;; error messages. Ensure any `cd' and `echo' aliases are 1806 ;; error messages. Ensure any `cd' and `echo' aliases are
1814 ;; ignored. 1807 ;; ignored.
1815 (tramp-send-command 1808 (tramp-send-command
@@ -1904,9 +1897,6 @@ tramp-handle-file-name-all-completions: internal error accessing `%s': `%s'"
1904 v (concat localname entry) "file-exists-p" t)) 1897 v (concat localname entry) "file-exists-p" t))
1905 result) 1898 result)
1906 1899
1907 (tramp-set-file-property
1908 v localname "last-completion" (current-time))
1909
1910 ;; Store result in the cache 1900 ;; Store result in the cache
1911 (tramp-set-file-property 1901 (tramp-set-file-property
1912 v (concat localname filename) 1902 v (concat localname filename)
@@ -3669,7 +3659,7 @@ Returns a file name in `tramp-auto-save-directory' for autosaving this file."
3669 ;; There could be new files, created by the vc backend. We 3659 ;; There could be new files, created by the vc backend. We
3670 ;; cannot reuse the old cache entries, therefore. 3660 ;; cannot reuse the old cache entries, therefore.
3671 (let (tramp-vc-registered-file-names 3661 (let (tramp-vc-registered-file-names
3672 (tramp-cache-inhibit-cache (current-time)) 3662 (remote-file-name-inhibit-cache (current-time))
3673 (file-name-handler-alist 3663 (file-name-handler-alist
3674 `((,tramp-file-name-regexp . tramp-vc-file-name-handler)))) 3664 `((,tramp-file-name-regexp . tramp-vc-file-name-handler))))
3675 3665
@@ -4085,7 +4075,7 @@ process to set up. VEC specifies the connection."
4085 ;; Keep the debug buffer. 4075 ;; Keep the debug buffer.
4086 (rename-buffer 4076 (rename-buffer
4087 (generate-new-buffer-name tramp-temp-buffer-name) 'unique) 4077 (generate-new-buffer-name tramp-temp-buffer-name) 'unique)
4088 (tramp-compat-funcall 'tramp-cleanup-connection vec) 4078 (tramp-cleanup-connection vec)
4089 (if (= (point-min) (point-max)) 4079 (if (= (point-min) (point-max))
4090 (kill-buffer nil) 4080 (kill-buffer nil)
4091 (rename-buffer (tramp-debug-buffer-name vec) 'unique)) 4081 (rename-buffer (tramp-debug-buffer-name vec) 'unique))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 3a3b3ad35e0..fa61aa02d70 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -974,8 +974,8 @@ A remote directory might have changed its contents. In order to
974make it visible during file name completion in the minibuffer, 974make it visible during file name completion in the minibuffer,
975Tramp flushes its cache and rereads the directory contents when 975Tramp flushes its cache and rereads the directory contents when
976more than `tramp-completion-reread-directory-timeout' seconds 976more than `tramp-completion-reread-directory-timeout' seconds
977have been gone since last remote command execution. A value of 0 977have been gone since last remote command execution. A value of `t'
978would require an immediate reread during filename completion, nil 978would require an immediate reread during filename completion, `nil'
979means to use always cached values for the directory contents." 979means to use always cached values for the directory contents."
980 :group 'tramp 980 :group 'tramp
981 :type '(choice (const nil) integer)) 981 :type '(choice (const nil) integer))
diff --git a/lisp/time.el b/lisp/time.el
index d512faefee0..006fd758a7c 100644
--- a/lisp/time.el
+++ b/lisp/time.el
@@ -454,8 +454,9 @@ update which can wait for the next redisplay."
454 (force-mode-line-update)) 454 (force-mode-line-update))
455 455
456(defun display-time-file-nonempty-p (file) 456(defun display-time-file-nonempty-p (file)
457 (and (file-exists-p file) 457 (let ((remote-file-name-inhibit-cache (- display-time-interval 5)))
458 (< 0 (nth 7 (file-attributes (file-chase-links file)))))) 458 (and (file-exists-p file)
459 (< 0 (nth 7 (file-attributes (file-chase-links file)))))))
459 460
460;;;###autoload 461;;;###autoload
461(define-minor-mode display-time-mode 462(define-minor-mode display-time-mode