2017-08-04 16:49 GMT+02:00 Tino Calancha : > > > On Fri, 4 Aug 2017, Fabrice Popineau wrote: > > >> >> 2017-08-04 16:23 GMT+02:00 Fabrice Popineau : >> >> >> Actually, the problem seems to be in the `insert-directory-wildcard-in-dir-p' >> function >> which wrongly splits "c:/tmp/dir*/*.txt" in ("c:/tmp/" . "dir*/*.txt") >> instead of >> ("c:/tmp/dir*/" . "*.txt") >> >> Forget this (wrong) diagnostic. >> >> The culprit is actually >> >> (let ((default-directory "c:/tmp/")) >> (eshell-extended-glob "dir*/*.txt")) >> "dir*/*.txt" >> >> which fails to expand the wildcards (when `file-expand-wildcards' >> succeeds). >> > Thank you Fabrice, > that's interesing. I am just wondering if `eshell-extended-glob' gets > confused with the Windows path, i mean, the disk name 'c:' in front. > > Could you check if the following works? > M-x eshell RET > cd "c:/tmp" > ls -l dir*/*.txt > > It says : c:/tmp $ ls -l dir*/*.txt dir*/*.txt: No such file or directory I am also curious if: > M-: (equal temporary-file-directory "c:/tmp/") RET > => t > > Nope, my temp dir in this case is the Windows temp dir. ("c:/Users/Fabrice/AppData/Roaming/Local/Temp/") And out of curiosity: what does em-glob that file-expand-wildcards doesn't? Because replacing the former by the latter would withdraw a depency on eshell parts in ls-lisp : diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index 9a4fc19744..7fe2803271 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -486,7 +486,7 @@ ls-lisp-insert-directory ;; before eshell is compiled. ;; So instead we add an autoload call here. ;; (https://lists.gnu.org/archive/html/emacs-devel/2017-07/msg01083.html). -(autoload 'eshell-extended-glob "em-glob") +;; (autoload 'eshell-extended-glob "em-glob") (declare-function dired-read-dir-and-switches "dired" (str)) (declare-function dired-goto-next-file "dired" ()) @@ -499,7 +499,8 @@ ls-lisp--dired (if (not dir-wildcard) (funcall orig-fun dir-or-list switches) (let* ((default-directory (car dir-wildcard)) - (files (eshell-extended-glob (cdr dir-wildcard))) + ;; (files (eshell-extended-glob (cdr dir-wildcard))) + (files (file-expand-wildcards (cdr dir-wildcard))) (dir (car dir-wildcard))) (if files (let ((inhibit-read-only t) (Obviously: the problem in em-glob as to be fixed in any case) Fabrice