From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenneth Goldman Newsgroups: gmane.emacs.help Subject: Re: grep options Date: Sun, 16 Jan 2011 15:32:17 -0500 Message-ID: References: <878vymbpqy.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=_alternative 006EE90F8525781A_=" X-Trace: dough.gmane.org 1295209994 10518 80.91.229.12 (16 Jan 2011 20:33:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 16 Jan 2011 20:33:14 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 16 21:33:09 2011 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.69) (envelope-from ) id 1PeZHh-0006ex-6L for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Jan 2011 21:33:09 +0100 Original-Received: from localhost ([127.0.0.1]:35605 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PeZHg-0007NB-Jv for geh-help-gnu-emacs@m.gmane.org; Sun, 16 Jan 2011 15:33:08 -0500 Original-Received: from [140.186.70.92] (port=49814 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PeZHF-0007Lz-Hb for help-gnu-emacs@gnu.org; Sun, 16 Jan 2011 15:32:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PeZHE-0001zS-35 for help-gnu-emacs@gnu.org; Sun, 16 Jan 2011 15:32:41 -0500 Original-Received: from e1.ny.us.ibm.com ([32.97.182.141]:42877) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PeZHE-0001xd-04 for help-gnu-emacs@gnu.org; Sun, 16 Jan 2011 15:32:40 -0500 Original-Received: from d01dlp02.pok.ibm.com (d01dlp02.pok.ibm.com [9.56.224.85]) by e1.ny.us.ibm.com (8.14.4/8.13.1) with ESMTP id p0GKNNxb027575 for ; Sun, 16 Jan 2011 15:23:26 -0500 Original-Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id C2A474DE8026 for ; Sun, 16 Jan 2011 15:29:07 -0500 (EST) Original-Received: from d01av04.pok.ibm.com (d01av04.pok.ibm.com [9.56.224.64]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p0GKWJ7Z1343706 for ; Sun, 16 Jan 2011 15:32:19 -0500 Original-Received: from d01av04.pok.ibm.com (loopback [127.0.0.1]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p0GKWIAZ026813 for ; Sun, 16 Jan 2011 15:32:18 -0500 Original-Received: from d01ml604.pok.ibm.com (d01ml604.pok.ibm.com [9.56.227.90]) by d01av04.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p0GKWI9C026810 for ; Sun, 16 Jan 2011 15:32:18 -0500 In-Reply-To: <878vymbpqy.fsf@gmail.com> X-KeepSent: 2A593A0A:61E3C88D-8525781A:006E91C6; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.2 August 10, 2010 X-MIMETrack: S/MIME Sign by Notes Client on Kenneth Goldman/Watson/IBM(Release 8.5.2|August 10, 2010) at 01/16/2011 03:11:26 PM, Serialize by Notes Client on Kenneth Goldman/Watson/IBM(Release 8.5.2|August 10, 2010) at 01/16/2011 03:11:26 PM, Serialize complete at 01/16/2011 03:11:26 PM, S/MIME Sign failed at 01/16/2011 03:11:26 PM: The cryptographic key was not found, Serialize by Router on D01ML604/01/M/IBM(Release 8.5.2HF19 | August 31, 2010) at 01/16/2011 15:32:18, Serialize complete at 01/16/2011 15:32:18 X-Content-Scanned: Fidelis XPS MAILER X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) 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:78486 Archived-At: This is a multipart message in MIME format. --=_alternative 006EE90F8525781A_= Content-Type: text/plain; charset="US-ASCII" This looks like a lot more work than igrep. I didn't have to select files and manually enter the extensions. igrep just knew that, if the file was c-mode, it should search *.[ch] *.cpp --- by default. In combination for "search for the string under point", I could grep with a single keystroke. help-gnu-emacs-bounces+kgold=watson.ibm.com@gnu.org wrote on 01/15/2011 02:16:53 AM: > From: Thierry Volpiatto > To: help-gnu-emacs@gnu.org > Date: 01/15/2011 02:18 AM > Subject: Re: grep options > Sent by: help-gnu-emacs-bounces+kgold=watson.ibm.com@gnu.org > > Ken Goldman writes: > > > When I use grep on C source, I'd like it to search all C source (.c, > > .h, .cpp), not just the files with the same extension. > > > > I could do that with the (obsolete) igrep like this. Can I reproduce > > it with emacs 23 / grep? > > > > (put 'igrep-files-default 'c-mode > > (lambda () "*.[ch] *.cpp")) > > Anything grep that come with anything-config.el allow you to do that in > two ways: > > 1) If you want to do a recursive search from your directory, access grep > with C-u, you will be prompted with "OnlyExt: ", add all the ext you > want like: > *.c *.h *.cpp > (separated with space) > > 2) if you don't want to recurse, from anything-find-files, narrow dow > the list in your directory by adding a space followed by c$\|h$\|cpp$ at > end of prompt e.g > Pattern: /home/you/work/ c$\|h$\|cpp$ > > then select grep (no prefix arg this time) and start writting your > pattern. > > FYI, this grep is incremental, results changes as you write in minibuffer. > > NOTE: You DON'T need the file anything-grep.el that is in anything repo, > this work out of the box with the files: > > anything.el > anything-config.el > anything-match-plugin.el > > Here is the anything repo: > http://repo.or.cz/w/anything-config.git > > For more info on anything, use the mailing-list at: > https://groups.google.com/group/emacs-anything?hl=en > > -- > A+ Thierry > Get my Gnupg key: > gpg --keyserver pgp.mit.edu --recv-keys 59F29997 > > --=_alternative 006EE90F8525781A_= Content-Type: text/html; charset="US-ASCII" This looks like a lot more work than igrep.  I didn't have to select files and manually
enter the extensions.  igrep just knew that, if the file was c-mode, it should search
*.[ch] *.cpp --- by default.

In combination for "search for the string under point", I could grep with a single keystroke.


help-gnu-emacs-bounces+kgold=watson.ibm.com@gnu.org wrote on 01/15/2011 02:16:53 AM:

> From: Thierry Volpiatto <thierry.volpiatto@gmail.com>

> To: help-gnu-emacs@gnu.org
> Date: 01/15/2011 02:18 AM
> Subject: Re: grep options
> Sent by: help-gnu-emacs-bounces+kgold=watson.ibm.com@gnu.org
>
> Ken Goldman <kgold@watson.ibm.com> writes:
>
> > When I use grep on C source, I'd like it to search all C source (.c,
> > .h, .cpp), not just the files with the same extension.
> >
> > I could do that with the (obsolete) igrep like this.  Can I reproduce
> > it with emacs 23 / grep?
> >
> > (put 'igrep-files-default 'c-mode
> >      (lambda () "*.[ch] *.cpp"))
>
> Anything grep that come with anything-config.el allow you to do that in
> two ways:
>
> 1) If you want to do a recursive search from your directory, access grep
> with C-u, you will be prompted with "OnlyExt: ", add all the ext you
> want like:
> *.c *.h *.cpp
> (separated with space)
>
> 2) if you don't want to recurse, from anything-find-files, narrow dow
> the list in your directory by adding a space followed by c$\|h$\|cpp$ at
> end of prompt e.g
> Pattern: /home/you/work/ c$\|h$\|cpp$
>
> then select grep (no prefix arg this time) and start writting your
> pattern.
>
> FYI, this grep is incremental, results changes as you write in minibuffer.
>
> NOTE: You DON'T need the file anything-grep.el that is in anything repo,
> this work out of the box with the files:
>
> anything.el
> anything-config.el
> anything-match-plugin.el
>
> Here is the anything repo:
>
http://repo.or.cz/w/anything-config.git
>
> For more info on anything, use the mailing-list at:
>
https://groups.google.com/group/emacs-anything?hl=en
>
> --
> A+ Thierry
> Get my Gnupg key:
> gpg --keyserver pgp.mit.edu --recv-keys 59F29997
>
>
--=_alternative 006EE90F8525781A_=--