aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Rotter2019-05-30 10:13:00 +0200
committerEli Zaretskii2019-06-08 11:29:34 +0300
commit8a75bde4a6c7bfd87ad3265195cffb2a3a29c662 (patch)
tree764f6c34bb3f8d8f1c4297266568afd4c7d3932f
parent1cc90d21d6e1aa21ab99d163796b41920b413ac7 (diff)
downloademacs-8a75bde4a6c7bfd87ad3265195cffb2a3a29c662.tar.gz
emacs-8a75bde4a6c7bfd87ad3265195cffb2a3a29c662.zip
Fix path for current directory in eshell on MS-Windows
On MS-Windows, PATH implicitly includes the current directory. Do it right for Eshell by adding "./" instead of ".", to avoid finding .FOO instead of ./FOO. * lisp/eshell/esh-util.el (eshell-get-path): New function. * lisp/eshell/em-cmpl.el (eshell-complete-commands-list): * lisp/eshell/esh-ext.el (eshell-search-path): Use eshell-get-path.
-rw-r--r--lisp/eshell/em-cmpl.el4
-rw-r--r--lisp/eshell/esh-ext.el4
-rw-r--r--lisp/eshell/esh-util.el8
3 files changed, 10 insertions, 6 deletions
diff --git a/lisp/eshell/em-cmpl.el b/lisp/eshell/em-cmpl.el
index e3bfd8d9d48..8f6c6781b9c 100644
--- a/lisp/eshell/em-cmpl.el
+++ b/lisp/eshell/em-cmpl.el
@@ -409,13 +409,11 @@ to writing a completion function."
409 (setq filename (substring filename 1) 409 (setq filename (substring filename 1)
410 pcomplete-stub filename 410 pcomplete-stub filename
411 glob-name t)) 411 glob-name t))
412 (let* ((paths (eshell-parse-colon-path eshell-path-env)) 412 (let* ((paths (eshell-get-path))
413 (cwd (file-name-as-directory 413 (cwd (file-name-as-directory
414 (expand-file-name default-directory))) 414 (expand-file-name default-directory)))
415 (path "") (comps-in-path ()) 415 (path "") (comps-in-path ())
416 (file "") (filepath "") (completions ())) 416 (file "") (filepath "") (completions ()))
417 (if (eshell-under-windows-p)
418 (push "." paths))
419 ;; Go thru each path in the search path, finding completions. 417 ;; Go thru each path in the search path, finding completions.
420 (while paths 418 (while paths
421 (setq path (file-name-as-directory 419 (setq path (file-name-as-directory
diff --git a/lisp/eshell/esh-ext.el b/lisp/eshell/esh-ext.el
index 978fc55c4de..1856d2bd190 100644
--- a/lisp/eshell/esh-ext.el
+++ b/lisp/eshell/esh-ext.el
@@ -74,10 +74,8 @@ but Eshell will be able to understand
74 "Search the environment path for NAME." 74 "Search the environment path for NAME."
75 (if (file-name-absolute-p name) 75 (if (file-name-absolute-p name)
76 name 76 name
77 (let ((list (eshell-parse-colon-path eshell-path-env)) 77 (let ((list (eshell-get-path))
78 suffixes n1 n2 file) 78 suffixes n1 n2 file)
79 (if (eshell-under-windows-p)
80 (push "." list))
81 (while list 79 (while list
82 (setq n1 (concat (car list) name)) 80 (setq n1 (concat (car list) name))
83 (setq suffixes eshell-binary-suffixes) 81 (setq suffixes eshell-binary-suffixes)
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 6f355c70a42..633bd02d2d2 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -232,6 +232,14 @@ It might be different from \(getenv \"PATH\"), when
232`default-directory' points to a remote host.") 232`default-directory' points to a remote host.")
233(make-variable-buffer-local 'eshell-path-env) 233(make-variable-buffer-local 'eshell-path-env)
234 234
235(defun eshell-get-path ()
236 "Return $PATH as list.
237Add the current directory on windows."
238 (eshell-parse-colon-path
239 (if (eshell-under-windows-p)
240 (concat "." path-separator eshell-path-env)
241 eshell-path-env)))
242
235(defun eshell-parse-colon-path (path-env) 243(defun eshell-parse-colon-path (path-env)
236 "Split string with `parse-colon-path'. 244 "Split string with `parse-colon-path'.
237Prepend remote identification of `default-directory', if any." 245Prepend remote identification of `default-directory', if any."