From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rami A Newsgroups: gmane.emacs.help Subject: Re: highlight regular expression in grep window Date: Sat, 8 Feb 2014 11:46:32 -0800 (PST) Message-ID: <0cd4f26f-2ba8-48b0-a839-6e3e169ee56f@googlegroups.com> 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 X-Trace: ger.gmane.org 1391889024 19874 80.91.229.3 (8 Feb 2014 19:50:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 8 Feb 2014 19:50:24 +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 Feb 08 20:50:31 2014 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 1WCDv4-0005gu-GG for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Feb 2014 20:50:30 +0100 Original-Received: from localhost ([::1]:47791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WCDv4-0000hm-1s for geh-help-gnu-emacs@m.gmane.org; Sat, 08 Feb 2014 14:50:30 -0500 X-Received: by 10.66.146.65 with SMTP id ta1mr5655329pab.19.1391888793032; Sat, 08 Feb 2014 11:46:33 -0800 (PST) X-Received: by 10.50.29.41 with SMTP id g9mr112376igh.4.1391888792723; Sat, 08 Feb 2014 11:46:32 -0800 (PST) Original-Path: usenet.stanford.edu!c10no12365748igq.0!news-out.google.com!vg8ni20igb.0!nntp.google.com!c10no12365736igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=148.87.19.206; posting-account=HZ4YzgoAAABkTSCruZ7Bs4hufjlOUmBF Original-NNTP-Posting-Host: 148.87.19.206 User-Agent: G2/1.0 Injection-Date: Sat, 08 Feb 2014 19:46:32 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:203712 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:95982 Archived-At: On Wednesday, September 4, 2013 1:33:24 PM UTC-7, Drew Adams wrote: > > I am not even worried about "highlighting" the regexp, I just want a way to > > > find out what the expression that I grepped for once I switch to that > > > window. > > > > `g' in that window, then `M-p' should show you the last `grep' command, with > > its regexp. Does that help? > > > > > 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. > > > > > So the token "mem_test" which I am looking for would be invisible because it > > > is at the end of that string. I just want something like: > > > > > > The token I am grepping on is: mem_test > > ... > > > or, as I mentioned earlier to include that token at the bottom along with > > > the title of the buffer "*grep* mem_test > > > > > > I am sure there should be a way to modify the grep.el functions to achieve > > > that somehow. > > Drew, I went back and tried using your grep+.el library. I have a couple of questions: 1. Is it possible to tweak it so it would remove/toggle comments in the grep window for a C language based file or assembly? 2. Is there an option to highlight the match in the grep window? "this is different than my question asked in this thread." I am really looking to highlight each match in a busy grep window. > > 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.