Mercurial > emacs
comparison lisp/find-dired.el @ 43644:6046fb03f1af
(find-grep-dired): Rename arg to `regexp'.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 03 Mar 2002 00:35:59 +0000 |
parents | 54f8be735591 |
children | cc5a0eac67cf |
comparison
equal
deleted
inserted
replaced
43643:54f8be735591 | 43644:6046fb03f1af |
---|---|
167 ;; Date: 10 May 91 17:50:00 GMT | 167 ;; Date: 10 May 91 17:50:00 GMT |
168 ;; Organization: University of Waterloo | 168 ;; Organization: University of Waterloo |
169 | 169 |
170 (defalias 'lookfor-dired 'find-grep-dired) | 170 (defalias 'lookfor-dired 'find-grep-dired) |
171 ;;;###autoload | 171 ;;;###autoload |
172 (defun find-grep-dired (dir args) | 172 (defun find-grep-dired (dir regexp) |
173 "Find files in DIR containing a regexp ARG and start Dired on output. | 173 "Find files in DIR containing a regexp REGEXP and start Dired on output. |
174 The command run (after changing into DIR) is | 174 The command run (after changing into DIR) is |
175 | 175 |
176 find . -exec grep -s ARG {} \\\; -ls | 176 find . -exec grep -s -e REGEXP {} \\\; -ls |
177 | 177 |
178 Thus ARG can also contain additional grep options." | 178 Thus ARG can also contain additional grep options." |
179 (interactive "DFind-grep (directory): \nsFind-grep (grep regexp): ") | 179 (interactive "DFind-grep (directory): \nsFind-grep (grep regexp): ") |
180 ;; find -exec doesn't allow shell i/o redirections in the command, | 180 ;; find -exec doesn't allow shell i/o redirections in the command, |
181 ;; or we could use `grep -l >/dev/null' | 181 ;; or we could use `grep -l >/dev/null' |
182 ;; We use -type f, not ! -type d, to avoid getting screwed | 182 ;; We use -type f, not ! -type d, to avoid getting screwed |
183 ;; by FIFOs and devices. I'm not sure what's best to do | 183 ;; by FIFOs and devices. I'm not sure what's best to do |
184 ;; about symlinks, so as far as I know this is not wrong. | 184 ;; about symlinks, so as far as I know this is not wrong. |
185 (find-dired dir | 185 (find-dired dir |
186 (concat "-type f -exec grep " find-grep-options " -e " | 186 (concat "-type f -exec grep " find-grep-options " -e " |
187 (shell-quote-argument args) | 187 (shell-quote-argument regexp) |
188 args " {} \\\; "))) | 188 args " {} \\\; "))) |
189 | 189 |
190 (defun find-dired-filter (proc string) | 190 (defun find-dired-filter (proc string) |
191 ;; Filter for \\[find-dired] processes. | 191 ;; Filter for \\[find-dired] processes. |
192 (let ((buf (process-buffer proc))) | 192 (let ((buf (process-buffer proc))) |