From: Dmitry Gutov <dgutov@yandex.ru>
To: Zhiwei Chen <chenzhiwei03@kuaishou.com>,
"44210@debbugs.gnu.org" <44210@debbugs.gnu.org>
Cc: "condy0919@gmail.com" <condy0919@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 [thread overview]
Message-ID: <636aabc5-b636-bc17-9d76-4aff28f4f60a@yandex.ru> (raw)
In-Reply-To: <7AE961A3-205F-4CC4-9634-2D981FF470CC@kuaishou.com>
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
next prev parent reply other threads:[~2021-01-10 17:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-25 11:26 bug#44210: 28.0.50; project.el failed to work after customizing find-program to fd Zhiwei Chen
2020-10-26 22:37 ` Dmitry Gutov
2021-01-10 3:31 ` Zhiwei Chen
2021-01-10 3:37 ` Zhiwei Chen
2021-01-10 17:48 ` Dmitry Gutov [this message]
2021-01-18 1:15 ` Zhiwei Chen
2021-01-18 3:09 ` Dmitry Gutov
2021-01-11 13:04 ` Zhiwei Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=636aabc5-b636-bc17-9d76-4aff28f4f60a@yandex.ru \
--to=dgutov@yandex.ru \
--cc=44210@debbugs.gnu.org \
--cc=chenzhiwei03@kuaishou.com \
--cc=condy0919@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).