diff options
author | Jim Porter <jporterbugs@gmail.com> | 2022-09-15 12:24:37 -0700 |
---|---|---|
committer | Jim Porter <jporterbugs@gmail.com> | 2022-10-17 18:48:52 -0700 |
commit | cee1cbfd54375cdece23d4741ced6b0c7091f6d9 (patch) | |
tree | 482d4bf98473742958b4ce4f1fba1c3e305aa093 /lisp/net/tramp-integration.el | |
parent | 7c41016fca5ab0638f1e2fed260e2ee41f3400c2 (diff) | |
download | emacs-cee1cbfd54375cdece23d4741ced6b0c7091f6d9.tar.gz |
Improve handling of $PATH in Eshell for remote directories
* lisp/eshell/esh-util.el (eshell-path-env, eshell-parse-colon-path):
Make obsolete.
(eshell-path-env-list): New variable.
(eshell-connection-default-profile): New connection-local profile.
(eshell-get-path): Reimplement using 'eshell-path-env-list'; add
LITERAL-P argument.
(eshell-set-path): New function.
* lisp/eshell/esh-var.el (eshell-variable-aliases-list): Add entry for
$PATH.
(eshell-var-initialize): Add 'eshell-path-env-list' to
'eshell-subcommand-bindings'.
* lisp/eshell/esh-ext.el (eshell-search-path): Use 'file-name-concat'
instead of 'concat'.
(eshell/addpath): Use 'eshell-get-path' and 'eshell-set-path'.
* lisp/net/tramp-integration.el: Only apply Eshell hooks when
'eshell-path-env-list' is unbound.
* test/lisp/eshell/esh-var-tests.el
(esh-var-test/path-var/local-directory)
(esh-var-test/path-var/remote-directory, esh-var-test/path-var/set)
(esh-var-test/path-var/set-locally)
(esh-var-test/path-var-preserve-across-hosts): New tests.
* test/lisp/eshell/esh-ext-tests.el: New file.
* test/lisp/eshell/eshell-tests-helpers.el
(with-temp-eshell): Set 'eshell-last-dir-ring-file-name' to nil.
(eshell-tests-remote-accessible-p, eshell-last-input)
(eshell-last-output): New functions.
(eshell-match-output, eshell-match-output--explainer): Use
'eshell-last-input' and 'eshell-last-output'.
* doc/misc/eshell.texi (Variables): Document $PATH.
* etc/NEWS: Announce this change (bug#57556).
Diffstat (limited to 'lisp/net/tramp-integration.el')
-rw-r--r-- | lisp/net/tramp-integration.el | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index 35c0636b1cc..4be019edd9d 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -136,16 +136,17 @@ been set up by `rfn-eshadow-setup-minibuffer'." (getenv "PATH")))) (with-eval-after-load 'esh-util - (add-hook 'eshell-mode-hook - #'tramp-eshell-directory-change) - (add-hook 'eshell-directory-change-hook - #'tramp-eshell-directory-change) - (add-hook 'tramp-integration-unload-hook - (lambda () - (remove-hook 'eshell-mode-hook - #'tramp-eshell-directory-change) - (remove-hook 'eshell-directory-change-hook - #'tramp-eshell-directory-change)))) + (unless (boundp 'eshell-path-env-list) + (add-hook 'eshell-mode-hook + #'tramp-eshell-directory-change) + (add-hook 'eshell-directory-change-hook + #'tramp-eshell-directory-change) + (add-hook 'tramp-integration-unload-hook + (lambda () + (remove-hook 'eshell-mode-hook + #'tramp-eshell-directory-change) + (remove-hook 'eshell-directory-change-hook + #'tramp-eshell-directory-change))))) ;;; Integration of recentf.el: |