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:16:53 +0100 Message-ID: <878vymbpqy.fsf@gmail.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1295075875 17016 80.91.229.12 (15 Jan 2011 07:17:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 15 Jan 2011 07:17:55 +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:17:51 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 1Pe0OU-0000ka-H5 for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Jan 2011 08:17:50 +0100 Original-Received: from localhost ([127.0.0.1]:49506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pe0OR-0005g0-1o for geh-help-gnu-emacs@m.gmane.org; Sat, 15 Jan 2011 02:17:47 -0500 Original-Received: from [140.186.70.92] (port=43051 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pe0Nt-0005fv-VN for help-gnu-emacs@gnu.org; Sat, 15 Jan 2011 02:17:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pe0Ns-0003jF-Dl for help-gnu-emacs@gnu.org; Sat, 15 Jan 2011 02:17:13 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:37636) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pe0Ns-0003j3-6Y for help-gnu-emacs@gnu.org; Sat, 15 Jan 2011 02:17:12 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pe0Nq-0000RN-H7 for help-gnu-emacs@gnu.org; Sat, 15 Jan 2011 08:17:10 +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:17:10 +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:17:10 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 47 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:gWxkjuVWgZ3HyhslhixVTz62MHQ= 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:78467 Archived-At: 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