Subject: bug#71762: `(project-files (project-current))` with `project-vc-extra-root-markers` doesn't work on Windows.

From: Siyuan Chen <[email-masked]>
Date: Tue, 25 Jun 2024 08:04:48 +0800

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 AM Siyuan Chen <[email-masked]> wrote:

> 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
>
>