From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Siyuan Chen Newsgroups: gmane.emacs.bugs Subject: bug#71762: `(project-files (project-current))` with `project-vc-extra-root-markers` doesn't work on Windows. Date: Tue, 25 Jun 2024 08:04:48 +0800 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="00000000000014418b061baba615" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3242"; mail-complaints-to="usenet@ciao.gmane.io" To: 71762@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 25 02:07:24 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sLtiW-0000jI-6p for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 25 Jun 2024 02:07:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLtiD-0003uZ-G3; Mon, 24 Jun 2024 20:07:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sLtiA-0003u3-9G for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 20:07:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLti9-0008As-4P for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 20:07:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLtiA-0002KV-Cb for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 20:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Siyuan Chen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Jun 2024 00:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71762 X-GNU-PR-Package: emacs Original-Received: via spool by 71762-submit@debbugs.gnu.org id=B71762.17192739718894 (code B ref 71762); Tue, 25 Jun 2024 00:07:02 +0000 Original-Received: (at 71762) by debbugs.gnu.org; 25 Jun 2024 00:06:11 +0000 Original-Received: from localhost ([127.0.0.1]:35828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLthL-0002JO-7I for submit@debbugs.gnu.org; Mon, 24 Jun 2024 20:06:11 -0400 Original-Received: from mail-yb1-f176.google.com ([209.85.219.176]:49273) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLthH-0002Iz-MQ for 71762@debbugs.gnu.org; Mon, 24 Jun 2024 20:06:10 -0400 Original-Received: by mail-yb1-f176.google.com with SMTP id 3f1490d57ef6-dfe81d54db9so4549187276.2 for <71762@debbugs.gnu.org>; Mon, 24 Jun 2024 17:06:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719273900; x=1719878700; darn=debbugs.gnu.org; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :from:to:cc:subject:date:message-id:reply-to; bh=Cma+f39MvxLNG89+b2ABWYwH3Rh6deU+9qazN0nx8L0=; b=OFKacC1zemlsGUhAxSIf+Jnm+Y7rofwxyXxEWuQwLsk6QwUlpFpIA7AlYJ2Vsmkt8+ DrbkOv7XAYbaNHRp52pcqnLl1d87vG1tWXAoTBvgMwtht+ColoX8GYRIljcWCb7xg+Tc wVCDDFRG8Zy6u1x0wpEE0o98TjW2NHKrj0Xawirz371aXVdKAW7635tSwNtoC+9SgDlC T0vpUtC4V8vzwuLAoMNXEXSmnZNbuznGcYszeDOyKlSgORd4oZiBFfMz50uOJMrKtI+4 R5Rz6km6xlrY2V8udXup++wTo2jFgEw6YX78D5lL64MWxXfcluuXN7T0rPNbafvu3Nbu E/bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719273900; x=1719878700; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Cma+f39MvxLNG89+b2ABWYwH3Rh6deU+9qazN0nx8L0=; b=LlVLCP2aHprwGHVEtr9rQagv3aaza+F9r0VTnXn71K22F9fK0Fh3sa6kR4eZbXOdhs 1oio+GdLB8X4uKpHKf7CrPmD9BAtW14Q4l5wf4//h9XNL70yN5mTKv3yV7gxORrPdlNc DQK6OrVFlglr17hGwpev0WhP6hMB5g54eUjQxvYPbSiaRZqkTinmdu1Ujb8f0iKXXub6 Ny4rRzi9ETDaFs2mip44SR8XSlL3Tc7OjusttY7nEXkA00AfQkWyvKiAlLmJGNOm3Fr2 NMzgiLll3kqxEBn0JdnewypZCewwY+poCMmHCDATozPKSg2HVnvA/nRrKG/ho/ZinzbI CYDw== X-Gm-Message-State: AOJu0YzG/B54IZ+SPUY5WveDpVaaD86dZaeLbQjEQjlNmLvrwOfcLfgV 1kaCxTGwIoH3H6y9z6QGpS/MbA0gDqbr/caFurhCOPnLF6AbCjBkmqIkwNlfDneDGk6gGVvbAsd lEJu06Bla5yn1gXIW9w30EAvvBAnRyMPcaqQyXw== X-Google-Smtp-Source: AGHT+IETDNz+q7FFz2EjRLjENXo76wi88nuVFgWaLEjtSNvHqiG5M/IytlWCwLC2tkQYqN1+phUGaFV+oP8NVY74+BU= X-Received: by 2002:a5b:78a:0:b0:dff:320f:edca with SMTP id 3f1490d57ef6-e0300f8828cmr5438818276.18.1719273899963; Mon, 24 Jun 2024 17:04:59 -0700 (PDT) In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:287864 Archived-At: --00000000000014418b061baba615 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Anyway, setting `(setq find-program (purecopy "C:/msys64/usr/bin/find.exe"))` makes the above example work at the moment. Perhaps all NTEmacs users should set the 3 options: grep-program, find-program, xargs-program. My only concern now is the potential issue with backslashes and encoding. Hence, I have to keep Projectile as the fallback solution because it has a native implementation. Best Regards, Siyuan Chen On Tue, Jun 25, 2024 at 5:37=E2=80=AFAM Siyuan Chen w= rote: > Reproduces steps: > > I have the following directory > > ``` > > \---myproject > | .project > | > +---subproject1 > | \---.git > | | Makefile > | > \---subproject2 > \---.git > | Makefile > > ``` > > 1. Open Emacs -Q > > 2. M-x eval-expression `(setq debug-on-error t)` > > 3. M-x eval-expression `(setq project-vc-extra-root-markers > '(".project"))` > > 4. Open the .project file in Emacs > > 5. M-x eval-expression `(project-current)` > > Result: `(vc nil "e:/work/myproject/")` OK > > 6. M-x eval-expression `(project-files (project-current))` > > Result: Debugger entered--Lisp error: (error "File listing failed: > FIND: Parameter format not co...") > error("File listing failed: %s" "FIND: Parameter format not correct\n") > > The root cause is that `project--files-in-directory` in project.el is > using `find-program` ("find") which does not exist on Windows. > > Is it possible to use more portable code? For example, > `directory-files-recursively`? Otherwise NTEmacs users will have to > install CYGWIN or MSYS2. > > P.s. I have used Projectile before, which allows you to place a > .projectile file in `myproject` and everything was OK on Windows. Also if= I > focus on a git folder e.g. `subproject1` in the example above, the > `project-files` also works well. > > Emacs 29.3 on Windows 10. > > Thanks. > > Best Regards, > Siyuan Chen > > --00000000000014418b061baba615 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Anyway, setting `(setq find-program (purecopy "C:/msy= s64/usr/bin/find.exe"))` makes the above example work at the moment.= =C2=A0

Perhaps all NTEmacs users should set the 3 option= s: grep-program, find-program, xargs-program. My only concern now is the po= tential issue with backslashes and encoding. Hence, I have to keep Projecti= le as the fallback solution because it has a native implementation.

Best Regards,
Siyuan Chen


On Tue, Jun 25, 2024 at 5:37=E2=80=AFAM Siyuan Chen &l= t;chansey97@gmail.com> wrote:=
Reproduces steps:

I have the following = directory

```
\---myproject
    |  .project
    | =20
    +---subproject1
    |   \---.git
    |   |   Makefile
    | =20
    \---subproject2
        \---.git
        |   Makefile
```

1. Open Emacs -Q

2. M-x eval-expression `(setq debug-on-error t)`

3. M-x eval-expression `(setq project-vc-extra-root-markers '(".pr= oject"))`

4. Open the .project file in E= macs

5.=20 M-x eval-expression `(project-current)`=C2=A0

=C2= =A0=C2=A0=C2=A0 Result: `(vc nil "e:/work/myproject/")` OK
<= div>
6. M-x eval-expression `(project-files (project-current)= )`

=C2=A0=C2=A0=C2=A0 Result: Debugger entered--Li= sp error: (error "File listing failed: FIND: Parameter format not co..= .")
=C2=A0 error("File listing failed: %s" "FIND: Pa= rameter format not correct\n")

The root cause= is that `project--files-in-directory` in project.el is using `find-program= ` ("find") which does not exist on = Windows.=C2=A0

Is it possible= to use more portable code? For example, `directory-files-recursively`? Oth= erwise NTEmacs users will have to install CYG= WIN or MSYS2.

P.s. I have used Projectile before, which allows you to place a .projectile file= in `myproject` and everything was OK on Windows. Also if I focus on a git folder e.g. `subproject1` in the examp= le above, the=20 `project-files` also works well.

Emacs 29.3 on= Windows 10.

Thanks.

Best= Regards,
Siyuan Chen

--00000000000014418b061baba615--