+2007-10-30 Michael Albinus <michael.albinus@gmx.de>
+
+ * 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'.
+
2007-10-30 Stefan Monnier <monnier@iro.umontreal.ca>
* doc-view.el (doc-view-current-doc): Remove.
result)))
;; Reverting or killing a buffer should also flush file properties.
-;; They could have been changed outside Tramp.
+;; They could have been changed outside Tramp. In eshell, "ls" would
+;; not show proper directory contents when a file has been copied or
+;; deleted before.
(defun tramp-flush-file-function ()
"Flush all Tramp cache properties from buffer-file-name."
- (let ((bfn (buffer-file-name)))
- (when (and (stringp bfn) (tramp-tramp-file-p bfn))
+ (let ((bfn (if (stringp (buffer-file-name))
+ (buffer-file-name)
+ default-directory)))
+ (when (tramp-tramp-file-p bfn)
(let* ((v (tramp-dissect-file-name bfn))
(localname (tramp-file-name-localname v)))
(tramp-flush-file-property v localname)))))
(add-hook 'before-revert-hook 'tramp-flush-file-function)
+(add-hook 'eshell-pre-command-hook 'tramp-flush-file-function)
(add-hook 'kill-buffer-hook 'tramp-flush-file-function)
(add-hook 'tramp-cache-unload-hook
'(lambda ()
(remove-hook 'before-revert-hook
'tramp-flush-file-function)
+ (remove-hook 'eshell-pre-command-hook
+ 'tramp-flush-file-function)
(remove-hook 'kill-buffer-hook
'tramp-flush-file-function)))
(when (and p (processp p))
(delete-process p))
(setenv "TERM" tramp-terminal-type)
+ (setenv "LC_ALL" "C")
(setenv "PROMPT_COMMAND")
(setenv "PS1" "$ ")
(let* ((target-alist (tramp-compute-multi-hops vec))