GNU bug report logs - #44210
28.0.50; project.el failed to work after customizing find-program to fd

Previous Next

Package: emacs;

Reported by: Zhiwei Chen <condy0919 <at> gmail.com>

Date: Sun, 25 Oct 2020 11:27:01 UTC

Severity: normal

Found in version 28.0.50

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Zhiwei Chen <chenzhiwei03 <at> kuaishou.com>, "44210 <at> debbugs.gnu.org" <44210 <at> debbugs.gnu.org>
Cc: "condy0919 <at> gmail.com" <condy0919 <at> gmail.com>
Subject: bug#44210: 28.0.50; project.el failed to work after customizing find-program to fd
Date: Sun, 10 Jan 2021 19:48:32 +0200
Hi!

On 10.01.2021 05:37, Zhiwei Chen wrote:
> (defun project--files-in-directory-fd (dir ignores &optional files)
>    (require 'find-dired)
>    (require 'xref)
>    (defvar find-name-arg)
>    (let* ((default-directory dir)
>           ;; Make sure ~/ etc. in local directory name is
>           ;; expanded and not left for the shell command
>           ;; to interpret.
>           (localdir (file-local-name (expand-file-name dir)))
>           (command (format "%s . %s %s --type f %s --print0"
>                            "fd"
>                            ;; In case DIR is a symlink.
>                            (file-name-as-directory localdir)
>                            ""
>                            (if files
>                                (concat (shell-quote-argument "(")
>                                        " " find-name-arg " "
>                                        (mapconcat
>                                         #'shell-quote-argument
>                                         (split-string files)
>                                         (concat " -o " find-name-arg " "))
>                                        " "
>                                        (shell-quote-argument ")"))
>                              ""))))
>      (message command)
>      (project--remote-file-names
>       (sort (split-string (shell-command-to-string command) "\0" t)
>             #'string<))))

That code doesn't seem to handle the IGNORES argument at all. Which 
could lead to an imbalanced comparison, though I don't know if it does, 
in this example (with just one ignored dir). But you could try passing 
no ignores to both of them.

It's weird, though. I have just tried both functions, and there was no 
perceptible performance difference (in a different project, though; in 
gecko-dev).

What are the versions of said programs on your machine? Mine:

$ find --version
find (GNU findutils) 4.7.0

$ fdfind --version
fd 7.4.0




This bug report was last modified 4 years and 151 days ago.

Previous Next


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