From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Vollmar Newsgroups: gmane.emacs.help Subject: Re: rgrep with (some) fixed parameters Date: Fri, 06 Jun 2008 23:43:40 +0200 Message-ID: <2FCE9852-1D8D-4465-80E6-D8AB8E3A52FF@nf.mpg.de> References: <0F8F98AB-AC87-4968-8CCE-5EFF06E4B2A2@nf.mpg.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1212788649 10493 80.91.229.12 (6 Jun 2008 21:44:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 6 Jun 2008 21:44:09 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 06 23:44:50 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K4jjt-00029w-Mz for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Jun 2008 23:44:49 +0200 Original-Received: from localhost ([127.0.0.1]:47348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K4jj7-0005ee-1L for geh-help-gnu-emacs@m.gmane.org; Fri, 06 Jun 2008 17:44:01 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K4jir-0005eD-BW for help-gnu-emacs@gnu.org; Fri, 06 Jun 2008 17:43:45 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K4jip-0005dN-13 for help-gnu-emacs@gnu.org; Fri, 06 Jun 2008 17:43:45 -0400 Original-Received: from [199.232.76.173] (port=53391 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K4jio-0005dG-Mj for help-gnu-emacs@gnu.org; Fri, 06 Jun 2008 17:43:42 -0400 Original-Received: from mail.nf.mpg.de ([134.95.44.50]:53445) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K4jio-0000jc-CL for help-gnu-emacs@gnu.org; Fri, 06 Jun 2008 17:43:42 -0400 Original-Received: from [192.168.178.21] (pD9E61CD7.dip.t-dialin.net [217.230.28.215]) by mail.nf.mpg.de (Sun Java(tm) System Messaging Server 6.3-5.02 (built Oct 12 2007; 32bit)) with ESMTPSA id <0K22008BW9QBFZ00@mail.nf.mpg.de> for help-gnu-emacs@gnu.org; Fri, 06 Jun 2008 23:44:35 +0200 (MEST) In-reply-to: X-Mailer: Apple Mail (2.924) X-detected-kernel: by monty-python.gnu.org: Windows XP/2000 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54555 Archived-At: Dear Peter, On 06.06.2008, at 22:40, Peter Jones wrote: > Stefan Vollmar writes: >> I find the M-rgrep command very useful but need it frequently in the >> context of a particular project where all parameters remain constant >> (directory, name pattern of files to search) except the expression to >> look for. How could I create a command my-rgrep that uses some pre-=20= >> set >> parameters and only asks for the search pattern (the project-specific >> parameters have already been assigned to some variables) ? > > You just need to write a few small lines of lisp. Read the > documentation for rgrep: > > C-h f rgrep I did, but I am new to Emacs customization and might have overlooked =20 something. If I do the equivalent of a (setq grep-find-command "find somepath \\( -path \*/.svn \\) -prune -o =20= -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, =20 and I could use a keyboard shortcut for this) - so far so good. =20 However, I feel that having to look at that long-ish command every =20 time I use it, is not elegant - in particular, as I need to navigate =20 to the correct position when the find command is being displayed in =20 the minibuffer (point should be between "-e" and "{}" to insert the =20 pattern to search for). Could you help me improve on this? Many thanks in advance, Stefan --=20 Dr. Stefan Vollmar, Dipl.-Phys. Max-Planck-Institut f=FCr neurologische Forschung Gleuelerstr. 50, 50931 K=F6ln, Germany Tel.: +49-221-4726-213 FAX +49-221-4726-298 Tel.: +49-221-478-5713 Mobile: 0160-93874279 Email: vollmar@nf.mpg.de http://www.nf.mpg.de