all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Kevin Rodgers <kevin.d.rodgers@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: rgrep with (some) fixed parameters
Date: Sat, 07 Jun 2008 08:23:46 -0600	[thread overview]
Message-ID: <g2e5lg$oco$1@ger.gmane.org> (raw)
In-Reply-To: <2FCE9852-1D8D-4465-80E6-D8AB8E3A52FF@nf.mpg.de>

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	other threads:[~2008-06-07 14:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-06 19:26 rgrep with (some) fixed parameters Stefan Vollmar
2008-06-06 20:40 ` Peter Jones
2008-06-06 21:43   ` Stefan Vollmar
2008-06-07 14:23     ` Kevin Rodgers [this message]
2008-06-07 16:37       ` Stefan Vollmar
2008-06-06 20:54 ` Thierry Volpiatto

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='g2e5lg$oco$1@ger.gmane.org' \
    --to=kevin.d.rodgers@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.