[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Running process with grep-find interface is very slow
From: |
Tom |
Subject: |
Re: Running process with grep-find interface is very slow |
Date: |
Wed, 31 Aug 2011 08:18:02 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
Tom <adatgyujto <at> gmail.com> writes:
>
> Why is it so much slower to run the same command via grep than
> via the command line?
>
Turns out it was the way I ran the command.
I created a small convenience function which always started the
search from the root directory of the project
(let ((default-directory rootdir))
(grep-find (concat "c:/xampp/perl/bin/perl.exe c:/bin/ack -i " pattern)))
Looks like default-directory caused the problem, because if I change it
to this:
(with-current-buffer (find-file-noselect rootdir)
(grep-find (concat "c:/xampp/perl/bin/perl.exe c:/bin/ack -i " pattern)))
then it's not slow anymore.
It fixed the problem, though I don't really get the difference. Isn't
setting default-directory temporarily a usual way to make a directory
current for the duration of a function?