[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
find-grep-dired can't use zgrep
From: |
Dan Jacobson |
Subject: |
find-grep-dired can't use zgrep |
Date: |
Sat, 16 Sep 2006 20:46:12 +0800 |
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.
Naw, need complete freedom like M-x grep...
(Apropos grep shows lots but I didn't try them.)
- find-grep-dired can't use zgrep,
Dan Jacobson <=