From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Fabrice Popineau Newsgroups: gmane.emacs.devel Subject: Re: dired-tests.el fails on MS-Windows Date: Fri, 4 Aug 2017 16:58:53 +0200 Message-ID: References: <83zibjz519.fsf@gnu.org> <87d18fw79z.fsf@calancha-pc> <83pocfyurp.fsf@gnu.org> <831sorxyol.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="089e08225dac87e09e0555eebd49" X-Trace: blaine.gmane.org 1501862367 15327 195.159.176.226 (4 Aug 2017 15:59:27 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 4 Aug 2017 15:59:27 +0000 (UTC) Cc: John Wiegley , Eli Zaretskii , Emacs developers To: Tino Calancha Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 04 17:59:22 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ddf0S-0003au-G4 for ged-emacs-devel@m.gmane.org; Fri, 04 Aug 2017 17:59:20 +0200 Original-Received: from localhost ([::1]:50187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddf0Y-0003z3-JB for ged-emacs-devel@m.gmane.org; Fri, 04 Aug 2017 11:59:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41514) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dde4L-0000gI-Lb for emacs-devel@gnu.org; Fri, 04 Aug 2017 10:59:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dde4K-0001VP-EY for emacs-devel@gnu.org; Fri, 04 Aug 2017 10:59:17 -0400 Original-Received: from mail-qt0-x231.google.com ([2607:f8b0:400d:c0d::231]:38582) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dde4I-0001UK-Mx; Fri, 04 Aug 2017 10:59:14 -0400 Original-Received: by mail-qt0-x231.google.com with SMTP id t37so10372278qtg.5; Fri, 04 Aug 2017 07:59:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=II57o7Buc4FRl9YOSsHDFG6g/C+r7BvTcQv9HeEZf+g=; b=hYNQhpag2x0T2QfDCPllOa+NTjdNAT+SpTpFEYEngzncje33Yi5K20QfH68YGKGuMI smmtqPstYr9bFMYdboQHvf8X+g3KMwSrpcrZ78Cy6bGUucw52pE0P/4CGFaoUqe/kzbd u4XEdFh5YIU4mQIi/EgCklSaCcPIpHSodqx0785Yi8KNQlcBHjtB8cnZMpP+A1PutxP8 v9ep5QVdFzWXb0Rh7bzVqoRkM6g/rgWzlOLe6nlFVqzdLpU4jZJFewSZKNBdOLHzvl30 3HLHhcUpIp3Dc3pNr6OPTIAGdjfVTDvhbZbyoY6HiQr2x0qvnmY+ujsUfqI2r9lrXywn zY1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=II57o7Buc4FRl9YOSsHDFG6g/C+r7BvTcQv9HeEZf+g=; b=g8m9WM++6NDPvaXGTsFe0KL3IKxewKiNqGOQAE2pR+L/5sqivWBmfoe0hX90W7hA1v wKT9ArDGESTTk4b6iZpNXSYNjWuausYbBodMW6KiulOOzIqjbOZp4IEy8uCmYiX88QVA 4C9vX46YHuJcI3qA8oIAKxxWUO5toGoFqYgkCVF0Pjug4Br5pEjQnUoEkDq3E0fhN1CT bS84+qQzKW41cq3enyx8Vz6t/GmTXAbXcyBLQxNlLuZqhJIMAD8USMLlnLYX34VCxq4m PMGGgkB6NQy7VbLO6uWf0jUzS2Oqhm/zFZOeQADUnit6ZJ5HOrIOmNYSk59EH7Ekh89s UggQ== X-Gm-Message-State: AHYfb5hY79ZLrtQuHDWlgAHngwqdPUKJHZ7QtZemKk4lnZ9nX0FCCDLD guvQrKT3WCxXh2zOEGoDiQkl3KhIAw== X-Received: by 10.200.14.72 with SMTP id j8mr3539568qti.124.1501858753927; Fri, 04 Aug 2017 07:59:13 -0700 (PDT) Original-Received: by 10.140.82.21 with HTTP; Fri, 4 Aug 2017 07:58:53 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::231 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217301 Archived-At: --089e08225dac87e09e0555eebd49 Content-Type: text/plain; charset="UTF-8" 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 --089e08225dac87e09e0555eebd49 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


2017-08-04 16:49 GMT+02:00 Tino Calancha <tino.calancha@gmail.c= om>:


On Fri, 4 Aug 2017, Fabrice Popineau wrote:



2017-08-04 16:23 GMT+02:00 Fabrice Popineau <fabrice.popineau@gmail.com>:

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=C2=A0

(let ((default-directory "c:/tmp/"))
=C2=A0 (eshell-extended-glob "dir*/*.txt"))
"dir*/*.txt"=C2=A0

which fails to expand the wildcards (when `file-expand-wildcards' succe= eds).
Thank you Fabrice,
that's interesing.=C2=A0 I am just wondering if `eshell-extended-glob&#= 39; 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 :=C2=A0

c:/tmp $ ls = -l dir*/*.txt
dir*/*.txt: No such file or directory=C2=A0


I am also curious if:
M-: (equal temporary-file-directory "c:/tmp/") RET
=3D> t

Nope, my temp dir in this case is the Windows temp di= r.
("c:/Users/Fabrice/AppData/Roaming/Local/Temp/")=C2= =A0

And out of curiosity: what does em-glob that f= ile-expand-wildcards doesn't?=C2=A0
Because replacing the for= mer 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.e= l
+++ b/lisp/ls-lisp.el
@@ -486,7 +486,7 @@ ls-lisp-ins= ert-directory
=C2=A0;; before eshell is compiled.
=C2= =A0;; So instead we add an autoload call here.
=C2=A0;; (h= ttps://lists.gnu.org/archive/html/emacs-devel/2017-07/msg01083.html).
-(autoload 'eshell-extended-glob "em-glob")
+;; (autoload 'eshell-extended-glob "em-glob")
= =C2=A0(declare-function dired-read-dir-and-switches "dired" (str)= )
=C2=A0(declare-function dired-goto-next-file "dired" = ())

@@ -499,7 +499,8 @@ ls-lisp--dired
= =C2=A0 =C2=A0 =C2=A0 =C2=A0(if (not dir-wildcard)
=C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0(funcall orig-fun dir-or-list switches)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let* ((default-directory (car dir-wild= card))
- =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (files = (eshell-extended-glob (cdr dir-wildcard)))
+ =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; (files (eshell-extended-glob (cdr dir-wildc= ard)))
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (files = (file-expand-wildcards (cdr dir-wildcard)))
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (dir (car dir-wildcard)))
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(if files
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(let ((inhibit-read-only t)

(Obviously: the problem in em-glob as to be fixed in = any case)

Fabrice

=
--089e08225dac87e09e0555eebd49--