From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: grep options Date: Sat, 15 Jan 2011 08:19:17 +0100 Message-ID: <874o9abpmy.fsf@gmail.com> References: <878vymbpqy.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1295076047 17588 80.91.229.12 (15 Jan 2011 07:20:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 15 Jan 2011 07:20:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jan 15 08:20:43 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 1Pe0RB-0001xU-EA for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Jan 2011 08:20:37 +0100 Original-Received: from localhost ([127.0.0.1]:44960 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pe0R3-0006qw-Ri for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Jan 2011 02:20:29 -0500 Original-Received: from [140.186.70.92] (port=43956 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pe0Qg-0006qm-HP for help-gnu-emacs@gnu.org; Sat, 15 Jan 2011 02:20:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pe0Qf-00049Q-Dp for help-gnu-emacs@gnu.org; Sat, 15 Jan 2011 02:20:06 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:38290) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pe0Qf-00049I-4E for help-gnu-emacs@gnu.org; Sat, 15 Jan 2011 02:20:05 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pe0Qe-0001o2-BW for help-gnu-emacs@gnu.org; Sat, 15 Jan 2011 08:20:04 +0100 Original-Received: from 117.211.85-79.rev.gaoland.net ([79.85.211.117]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 15 Jan 2011 08:20:04 +0100 Original-Received: from thierry.volpiatto by 117.211.85-79.rev.gaoland.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 15 Jan 2011 08:20:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 117.211.85-79.rev.gaoland.net User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2.91 (gnu/linux) Cancel-Lock: sha1:VdWnq6DFuw7SKo5NKJHc1qe7x1g= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:78468 Archived-At: Thierry Volpiatto writes: > 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$ Sorry forget to mention you have to mark all with M-m before grepping. > 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