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

Previous Next

Package: emacs;

Reported by: Siyuan Chen <chansey97 <at> gmail.com>

Date: Mon, 24 Jun 2024 21:37:01 UTC

Severity: normal

Tags: notabug

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Siyuan Chen <chansey97 <at> gmail.com>
Subject: bug#71762: closed (Re: bug#71762: `(project-files (project-current))`
 with `project-vc-extra-root-markers` doesn't work on Windows.)
Date: Sun, 30 Jun 2024 06:11:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 71762 <at> debbugs.gnu.org.

-- 
71762: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71762
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Stefan Kangas <stefankangas <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 71762-done <at> debbugs.gnu.org, Siyuan Chen <chansey97 <at> gmail.com>
Subject: Re: bug#71762: `(project-files (project-current))` with
 `project-vc-extra-root-markers` doesn't work on Windows.
Date: Sat, 29 Jun 2024 23:09:12 -0700
Eli Zaretskii <eliz <at> gnu.org> writes:

> tags 71762 notabug
> thanks
>
>> From: Siyuan Chen <chansey97 <at> gmail.com>
>> 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.
>
> That's one possible solution.  Another is to rearrange your system's
> PATH so that the directory C:\msys64\usr\bin comes _before_ the
> C:\WINDOWS\system32, where you have the stock Windows find.exe (which
> is a program for a completely different purpose and with completely
> different command-line syntax).
>
> Byw, the "msys64" part of the directory where you have find.exe seems
> to hint that it is an MSYS port, not a native Windows/MinGW port.  If
> that is indeed so, my recommendation is to install a native find.exe
> and use that instead, as MSYS ports could have subtle
> incompatibilities with a native Windows Emacs.
>
>> Perhaps all NTEmacs users should set the 3 options: grep-program, find-program, xargs-program.
>
> These variables already exist, so I'm not sure what you are suggesting
> here.
>
> In general, the only "problematic" program is find.exe, because
> Windows comes only with that.  The other two programs must be
> installed, and so there's no danger of Emacs invoking the wrong one.
>
> I see no Emacs bug here, just an issue of configuring your system
> and/or Emacs correctly.

I'm therefore closing this bug report.

[Message part 3 (message/rfc822, inline)]
From: Siyuan Chen <chansey97 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: `(project-files (project-current))` with
 `project-vc-extra-root-markers` doesn't work on Windows.
Date: Tue, 25 Jun 2024 05:35:54 +0800
[Message part 4 (text/plain, inline)]
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
[Message part 5 (text/html, inline)]

This bug report was last modified 1 year and 22 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.