[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question about dired-do-find-regexp and xref-collect-matches
From: |
Dmitry Gutov |
Subject: |
Re: Question about dired-do-find-regexp and xref-collect-matches |
Date: |
Tue, 30 Jul 2019 17:50:49 +0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
Hi Eric,
On 10.07.2019 2:18, Eric Abrahamsen wrote:
A while ago I switched to the fish shell, which I generally like better
than bash.
I also like fish, a lot. I don't use it inside Emacs, though.
While poking around I also noticed that dired-do-find-regexp calls
xref-collect-matches once per marked file. That means a full find+grep
call for each file, when a single find+grep call (or even just a single
grep call!) would do the trick.
That sounds like a bug report material. Up until now I figured a few
extra shell process calls wouldn't matter, but maybe they can.
Just how many files are you marking in the given example?
The search hits are collected as:
(mapcan
(lambda (file)
(xref-collect-matches regexp "*" file
(and (file-directory-p file)
ignores)))
files)
But the second argument to `xref-collect-matches' can be a
space-separated string of file names -- wouldn't it be easier just to
call `xref-collect-matches' once?
Not exactly. That FILES argument is something different (a list of globs).
Overall, this shouldn't be too hard to fix. Could you send your response
to the bug tracker as a new report?