all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Re: [ find-grep-dired ] Regexp input and other remarks
       [not found] <E16hEmQ-0006E7-00@noon.dnsalias.net>
@ 2002-03-03 14:39 ` Richard Stallman
  0 siblings, 0 replies; only message in thread
From: Richard Stallman @ 2002-03-03 14:39 UTC (permalink / raw)
  Cc: emacs-devel

Does this version work better?

(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

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)
		      " {} \\\; ")))

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-03-03 14:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E16hEmQ-0006E7-00@noon.dnsalias.net>
2002-03-03 14:39 ` [ find-grep-dired ] Regexp input and other remarks Richard Stallman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.