all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rami A <rami.ammari@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: highlight regular expression in grep window
Date: Sat, 8 Feb 2014 11:46:32 -0800 (PST)	[thread overview]
Message-ID: <0cd4f26f-2ba8-48b0-a839-6e3e169ee56f@googlegroups.com> (raw)
In-Reply-To: <mailman.1317.1378326833.10748.help-gnu-emacs@gnu.org>

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.



  parent reply	other threads:[~2014-02-08 19:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-04 17:47 highlight regular expression in grep window Rami A
2013-09-04 18:48 ` Drew Adams
     [not found] ` <mailman.1313.1378320529.10748.help-gnu-emacs@gnu.org>
2013-09-04 19:32   ` Rami A
2013-09-04 20:33     ` Drew Adams
2013-09-05  6:47       ` Kevin Rodgers
     [not found]     ` <mailman.1317.1378326833.10748.help-gnu-emacs@gnu.org>
2014-02-08 19:46       ` Rami A [this message]
2014-02-08 22:19         ` Drew Adams
2014-02-08 22:33 ` Rami A
2014-02-08 22:50   ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0cd4f26f-2ba8-48b0-a839-6e3e169ee56f@googlegroups.com \
    --to=rami.ammari@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.