help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: rgrep with (some) fixed parameters


From: Kevin Rodgers
Subject: Re: rgrep with (some) fixed parameters
Date: Sat, 07 Jun 2008 08:23:46 -0600
User-agent: Thunderbird 2.0.0.14 (Macintosh/20080421)

Stefan Vollmar wrote:
If I do the equivalent of a

(setq grep-find-command "find somepath \\( -path \*/.svn \\) -prune -o -type f \\( -iname \\*.cpp \\) -exec grep -nH -e {} /dev/null \\;")

in my .emacs file,
C-u C-u M-x rgrep
does indeed use this pattern (and does not ask about anything else, and I could use a keyboard shortcut for this) - so far so good. However, I feel that having to look at that long-ish command every time I use it, is not elegant - in particular, as I need to navigate to the correct position when the find command is being displayed in the minibuffer (point should be between "-e" and "{}" to insert the pattern to search for). Could you help me improve on this?

(defun project-rgrep (regexp)
  "Run `rgrep' with REGEXP, \"*.cpp\" FILES, and \"somepath\" DIR."
  (interactive
   (progn
     (grep-compute-defaults)
     (list (grep-read-regexp))))
  (rgrep regexp "*.cpp" "somepath"))

--
Kevin Rodgers
Denver, Colorado, USA





reply via email to

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