From: Drew Adams <drew.adams@oracle.com>
To: Eric Abrahamsen <eric@ericabrahamsen.net>, emacs-devel@gnu.org
Subject: RE: Question about dired-do-find-regexp and xref-collect-matches
Date: Tue, 9 Jul 2019 16:33:35 -0700 (PDT) [thread overview]
Message-ID: <ca73054c-29f3-475c-ba95-b421203b3e33@default> (raw)
In-Reply-To: <87a7dm6blt.fsf@ericabrahamsen.net>
> I noticed that marking files in Dired and using "A"
> (dired-do-find-regexp) to search them was extraordinarily slow. Going up
> a level to the parent directory and only marking the child directory,
> the search was nearly instantaneous. But that meant I had to search all
> the files in the child directory.
>
> I suspected it was something to do with fish, and indeed setting
> shell-file-name to "/usr/bin/bash" sped it up a little -- but that's a
> bug report for another day.
>
> 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.
>
> 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?
Meanwhile (fortunately), you can still use
`dired-do-search' (which used to be bound to `A').
If that wasn't "extraordinarily slow" for you
before, it still might not be. Maybe try it.
next prev parent reply other threads:[~2019-07-09 23:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-09 23:18 Question about dired-do-find-regexp and xref-collect-matches Eric Abrahamsen
2019-07-09 23:33 ` Drew Adams [this message]
2019-07-10 0:30 ` Eric Abrahamsen
2019-07-30 14:50 ` Dmitry Gutov
2019-07-30 17:22 ` Eric Abrahamsen
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=ca73054c-29f3-475c-ba95-b421203b3e33@default \
--to=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
--cc=eric@ericabrahamsen.net \
/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).