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 05:35:54 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000847591061ba99199" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31058"; 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 Mon Jun 24 23:37: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 1sLrNL-0007qf-LE for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 24 Jun 2024 23:37:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLrN0-0005TI-L5; Mon, 24 Jun 2024 17:37:02 -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 1sLrMy-0005Sw-Tu for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 17:37:00 -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 1sLrMy-0008SE-M3 for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 17:37:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sLrMz-0006yy-So for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 17:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Siyuan Chen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 24 Jun 2024 21:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71762 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.171926497526785 (code B ref -1); Mon, 24 Jun 2024 21:37:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Jun 2024 21:36:15 +0000 Original-Received: from localhost ([127.0.0.1]:35739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLrME-0006xx-NS for submit@debbugs.gnu.org; Mon, 24 Jun 2024 17:36:15 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:52416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sLrMC-0006xp-EC for submit@debbugs.gnu.org; Mon, 24 Jun 2024 17:36:12 -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 1sLrM9-0005JN-Nq for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 17:36:09 -0400 Original-Received: from mail-yb1-xb2d.google.com ([2607:f8b0:4864:20::b2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sLrM7-0008HE-Tu for bug-gnu-emacs@gnu.org; Mon, 24 Jun 2024 17:36:09 -0400 Original-Received: by mail-yb1-xb2d.google.com with SMTP id 3f1490d57ef6-dff26b612a9so4170258276.1 for ; Mon, 24 Jun 2024 14:36:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719264965; x=1719869765; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=q+Cv7fGa0/yDjQQieH7C53qTB3yh9x7ALLUQK2mPum8=; b=LR9340XAVXIrBRRFvgnsq35eaV5XwsEdeyM4oFusjKJ7MCoM9jWzIeU93D8bbz1RxW KZrsJnrreL3i1Zk9vOa+PsUkx6vd1zMDMoul1ljn7pwFa3hlhJ9FCHcbWp8FLppMDj1k 3M/wqq6glpYINwKyGgeAGXIVDVXQ6n66ygBfFo1R/Sk4WShDi06wThuOA98SV9yd5c2d 765jC0YKaG3w+4M3b8qKpVEKwf1mTUcK8cFMo01neSPAwulb2g5p7XY2SYfAR0jMC+jY t7kspYgHLVZykgeVAjiK/mHofRMtT7stPR1KfOMkZ4RrUl3j6J6g1hGdTnTCrR7aTn4C Nq/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719264965; x=1719869765; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=q+Cv7fGa0/yDjQQieH7C53qTB3yh9x7ALLUQK2mPum8=; b=NPPL6D1LgTfZ35+Lxl1L83EBoBGFmtEVruNe30p+wFWwVQMurzzaLTxXlxh94GzEQ9 f52z4ayXAa9RoRX5UjwyCJOVXATbIt8WjXXk1EAu8lZIarRQR0lGZP+QojmPyjlTnJje 4e9yDTQLTIO7qrRZQAws8ne5o8wihXmmaE38gdzYC4CUlH50qWALX/2LltnzfxrcDhY8 jW13wPKtOZeU3AZEhKAhXeXbMdkErZ+ViB5l3sQtwoWv52OuGVKQlLz0TNdzv9vBuurH BRaGVhk+zBJlPF/Ay6wIJzY58tpxRedVe4hoj1On8bf4vE5f/aVW4zGrGHvxDJzIowEt l42g== X-Gm-Message-State: AOJu0Ywm6OI0EJnKIz59/OfWfwCzDKPd0KXa4BgrL0v5ltORwiNmKVRo mjPPx3CGHlgKLXG2gPx4ozAZSe1ULpe6L2pv1OIlRQ4PcTLS2PH63QKOy031yKZc3NM07ozaE15 qqIaYKp78wkY4j/M7750zu7GdScbnCLolBHIlgw== X-Google-Smtp-Source: AGHT+IHouyXHNZCPaJVHJY6i1sr4ftxafehqyFERrdN9rWnYTnsoTJHc477YyiBuYO6Fjr8LJ51E8OjzhhJqkoenA6s= X-Received: by 2002:a5b:852:0:b0:e02:4af1:de12 with SMTP id 3f1490d57ef6-e0303eb354cmr5206272276.11.1719264965061; Mon, 24 Jun 2024 14:36:05 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::b2d; envelope-from=chansey97@gmail.com; helo=mail-yb1-xb2d.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:287860 Archived-At: --000000000000847591061ba99199 Content-Type: text/plain; charset="UTF-8" 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 --000000000000847591061ba99199 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
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

<= div>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 examp= le above, the=20 `project-files` also works well.

Emacs 29.3 on= Windows 10.

Thanks.

Best= Regards,
Siyuan Chen

--000000000000847591061ba99199--