emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: find-grep-dired can't use zgrep


From: Kevin Rodgers
Subject: Re: find-grep-dired can't use zgrep
Date: Mon, 18 Sep 2006 10:05:41 -0600
User-agent: Thunderbird 1.5.0.7 (Windows/20060909)

Dan Jacobson wrote:
Today we discuss
    |(defun find-grep-dired (dir regexp)
    |  "Find files in DIR containing a regexp REGEXP and start Dired on output.
    |The command run (after changing into DIR) is
    |
    |    find . -exec grep -s -e REGEXP {} \\\; -ls
No it isn't, see the -f below
    |Thus ARG can also contain additional grep options."
    |  (interactive "DFind-grep (directory): \nsFind-grep (grep regexp): ")
    |  ;; find -exec doesn't allow shell i/o redirections in the command,
    |  ;; or we could use `grep -l >/dev/null'
    |  ;; We use -type f, not ! -type d, to avoid getting screwed
    |  ;; by FIFOs and devices.  I'm not sure what's best to do
    |  ;; about symlinks, so as far as I know this is not wrong.
    |  (find-dired dir
    |              (concat "-type f -exec grep " find-grep-options " -e "
    |                      (shell-quote-argument regexp)
    |                      " {} \\\; ")))
What "really burns me" is that there is no way to tell it I want to
use zgrep or pcregrep instead of grep.

Is there a reason find-grep-dired uses "grep" instead of grep-program?

--
Kevin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]