From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: highlight regular expression in grep window Date: Thu, 05 Sep 2013 00:47:17 -0600 Message-ID: References: <84ab5187-0def-45b6-bdb2-87693a1d77e5@googlegroups.com> <2d2fe767-9f72-422c-beb9-5dbed1ec89f8@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1378363621 24713 80.91.229.3 (5 Sep 2013 06:47:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Sep 2013 06:47:01 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Sep 05 08:47:03 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VHTLK-0001zp-NM for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Sep 2013 08:47:02 +0200 Original-Received: from localhost ([::1]:57161 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHTLK-000321-CV for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Sep 2013 02:47:02 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHTL2-00031f-6c for help-gnu-emacs@gnu.org; Thu, 05 Sep 2013 02:46:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VHTKu-0006jF-K7 for help-gnu-emacs@gnu.org; Thu, 05 Sep 2013 02:46:44 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:40189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VHTKu-0006j5-DF for help-gnu-emacs@gnu.org; Thu, 05 Sep 2013 02:46:36 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VHTKs-0001mb-LS for help-gnu-emacs@gnu.org; Thu, 05 Sep 2013 08:46:34 +0200 Original-Received: from 70-59-17-50.hlrn.qwest.net ([70.59.17.50]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Sep 2013 08:46:34 +0200 Original-Received: from kevin.d.rodgers by 70-59-17-50.hlrn.qwest.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 05 Sep 2013 08:46:34 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 70-59-17-50.hlrn.qwest.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.28) Gecko/20120306 Thunderbird/3.1.20 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:93261 Archived-At: On 9/4/13 2:33 PM, Drew Adams wrote: >> My customized grep function is something like: >> >> find . -type d \( -name unix -o -name "*_sim" -o -name RCS -o -name CVS -o - >> name SCCS \) -prune -o -type f \! -name \*\~ \! -name \*\,v \! -name s.\* \! >> -name .\#\* -name \*.\[sch\] -print | xargs -e grep -n -i mem_test >> /dev/null > > Ah, so this is not about `M-x grep'. I guess it's about `grep-find'. > Still, repeating the command and using `M-p' should show you the previous > command used, including its regexp. ... > The regexp you typed was not seen as such by Emacs. All that was seen was > the entire input command, including that regexp. To extract the regexp I > think you would need to add code that matches that input against the template > `grep-find-command', which has the hole into which you inserted the regexp. > > Maybe someone else can help more; sorry. rgrep is an interactive autoloaded Lisp function in `grep.el'. (rgrep REGEXP &optional FILES DIR CONFIRM) Recursively grep for REGEXP in FILES in directory tree rooted at DIR. The search is limited to file names matching shell pattern FILES. FILES may use abbreviations defined in `grep-files-aliases', e.g. entering `ch' is equivalent to `*.[ch]'. With C-u prefix, you can edit the constructed shell command line before it is executed. With two C-u prefixes, directly edit and run `grep-find-command'. Collect output in a buffer. While find runs asynchronously, you can use C-x ` (M-x next-error), or Uses keymap "grep-mode-map", which is not currently defined. M-x compile-goto-error in the grep output buffer, to go to the lines where grep found matches. This command shares argument histories with M-x lgrep and M-x grep-find. -- Kevin Rodgers Denver, Colorado, USA