aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2007-10-30 20:27:22 +0000
committerMichael Albinus2007-10-30 20:27:22 +0000
commita7580c1c8f1265e4da94603b1418e26e2cac24c4 (patch)
tree1cff0412ec8434c1e7121ca7a9f38d5ef7f32858
parentf4c7549775c23260166c294289e6a2c61beab760 (diff)
downloademacs-a7580c1c8f1265e4da94603b1418e26e2cac24c4.tar.gz
emacs-a7580c1c8f1265e4da94603b1418e26e2cac24c4.zip
* net/tramp.el (tramp-maybe-open-connection): Set $LC_ALL to "C".
* net/tramp-cache.el (tramp-flush-file-function): Check also `default-directory' if `buffer-file-name' does not return a string. Added to `eshell-pre-command-hook'.
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/net/tramp-cache.el13
-rw-r--r--lisp/net/tramp.el1
3 files changed, 19 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 26a166c3489..125ae99ba06 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12007-10-30 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-maybe-open-connection): Set $LC_ALL to "C".
4
5 * net/tramp-cache.el (tramp-flush-file-function): Check also
6 `default-directory' if `buffer-file-name' does not return a
7 string. Added to `eshell-pre-command-hook'.
8
12007-10-30 Stefan Monnier <monnier@iro.umontreal.ca> 92007-10-30 Stefan Monnier <monnier@iro.umontreal.ca>
2 10
3 * doc-view.el (doc-view-current-doc): Remove. 11 * doc-view.el (doc-view-current-doc): Remove.
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 35147e7907c..fcf7685e91b 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -159,21 +159,28 @@ Remove also properties of all files in subdirectories."
159 result))) 159 result)))
160 160
161;; Reverting or killing a buffer should also flush file properties. 161;; Reverting or killing a buffer should also flush file properties.
162;; They could have been changed outside Tramp. 162;; They could have been changed outside Tramp. In eshell, "ls" would
163;; not show proper directory contents when a file has been copied or
164;; deleted before.
163(defun tramp-flush-file-function () 165(defun tramp-flush-file-function ()
164 "Flush all Tramp cache properties from buffer-file-name." 166 "Flush all Tramp cache properties from buffer-file-name."
165 (let ((bfn (buffer-file-name))) 167 (let ((bfn (if (stringp (buffer-file-name))
166 (when (and (stringp bfn) (tramp-tramp-file-p bfn)) 168 (buffer-file-name)
169 default-directory)))
170 (when (tramp-tramp-file-p bfn)
167 (let* ((v (tramp-dissect-file-name bfn)) 171 (let* ((v (tramp-dissect-file-name bfn))
168 (localname (tramp-file-name-localname v))) 172 (localname (tramp-file-name-localname v)))
169 (tramp-flush-file-property v localname))))) 173 (tramp-flush-file-property v localname)))))
170 174
171(add-hook 'before-revert-hook 'tramp-flush-file-function) 175(add-hook 'before-revert-hook 'tramp-flush-file-function)
176(add-hook 'eshell-pre-command-hook 'tramp-flush-file-function)
172(add-hook 'kill-buffer-hook 'tramp-flush-file-function) 177(add-hook 'kill-buffer-hook 'tramp-flush-file-function)
173(add-hook 'tramp-cache-unload-hook 178(add-hook 'tramp-cache-unload-hook
174 '(lambda () 179 '(lambda ()
175 (remove-hook 'before-revert-hook 180 (remove-hook 'before-revert-hook
176 'tramp-flush-file-function) 181 'tramp-flush-file-function)
182 (remove-hook 'eshell-pre-command-hook
183 'tramp-flush-file-function)
177 (remove-hook 'kill-buffer-hook 184 (remove-hook 'kill-buffer-hook
178 'tramp-flush-file-function))) 185 'tramp-flush-file-function)))
179 186
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 4886c1917aa..6008a591e68 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -6066,6 +6066,7 @@ connection if a previous connection has died for some reason."
6066 (when (and p (processp p)) 6066 (when (and p (processp p))
6067 (delete-process p)) 6067 (delete-process p))
6068 (setenv "TERM" tramp-terminal-type) 6068 (setenv "TERM" tramp-terminal-type)
6069 (setenv "LC_ALL" "C")
6069 (setenv "PROMPT_COMMAND") 6070 (setenv "PROMPT_COMMAND")
6070 (setenv "PS1" "$ ") 6071 (setenv "PS1" "$ ")
6071 (let* ((target-alist (tramp-compute-multi-hops vec)) 6072 (let* ((target-alist (tramp-compute-multi-hops vec))