aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net
diff options
context:
space:
mode:
authorMichael Albinus <[email protected]>2009-11-24 10:25:54 +0000
committerMichael Albinus <[email protected]>2009-11-24 10:25:54 +0000
commit605a20a98823768578d6faed5f04cb00e57da2bb (patch)
tree525322a2fc9fbabb9d8bebc014e51d061aeff7c2 /lisp/net
parent937e60c88bfbbc44d44806a7cf43d5f982a8026f (diff)
Improve handling of processes on remote hosts.
* eshell/esh-util.el (eshell-path-env): New defvar. (eshell-parse-colon-path): New defun. (eshell-file-attributes): Use `eshell-parse-colon-path'. * eshell/esh-ext.el (eshell-search-path): Use `eshell-parse-colon-path'. (eshell-remote-command): Remove argument HANDLER. (eshell-external-command): Check for FTP remote connection. * eshell/esh-proc.el (eshell-gather-process-output): Use `file-truename', in order to start also symlinked files. Apply `start-file-process' instead of `start-process'. Shorten `command' to the local file name part. * eshell/em-cmpl.el (eshell-complete-commands-list): Use `eshell-parse-colon-path'. * eshell/em-unix.el (eshell/du): Check for FTP remote connection. * net/tramp.el (tramp-eshell-directory-change): New defun. Add it to `eshell-directory-change-hook'.
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/tramp.el29
1 files changed, 29 insertions, 0 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index d6b5934177..795c7eefc3 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2383,6 +2383,35 @@ been set up by `rfn-eshadow-setup-minibuffer'."
'tramp-rfn-eshadow-update-overlay))))
+;;; Integration of eshell.el:
+
+(eval-when-compile
+ (defvar eshell-path-env))
+
+;; eshell.el keeps the path in `eshell-path-env'. We must change it
+;; when `default-directory' points to another host.
+(defun tramp-eshell-directory-change ()
+ "Set `eshell-path-env' to $PATH of the host related to `default-directory'."
+ (setq eshell-path-env
+ (if (file-remote-p default-directory)
+ (with-parsed-tramp-file-name default-directory nil
+ (mapconcat
+ 'identity
+ (tramp-get-remote-path v)
+ ":"))
+ (getenv "PATH"))))
+
+(eval-after-load "esh-util"
+ '(progn
+ (tramp-eshell-directory-change)
+ (add-hook 'eshell-directory-change-hook
+ 'tramp-eshell-directory-change)
+ (add-hook 'tramp-unload-hook
+ (lambda ()
+ (remove-hook 'eshell-directory-change-hook
+ 'tramp-eshell-directory-change)))))
+
+
;;; File Name Handler Functions:
(defun tramp-handle-make-symbolic-link