all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Rami A <rami.ammari@gmail.com>, help-gnu-emacs@gnu.org
Subject: RE: highlight regular expression in grep window
Date: Wed, 4 Sep 2013 13:33:24 -0700 (PDT)	[thread overview]
Message-ID: <cdae1429-678d-48dc-a7b1-a2a5dfc39c2f@default> (raw)
In-Reply-To: <2d2fe767-9f72-422c-beb9-5dbed1ec89f8@googlegroups.com>

> 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.

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.



  reply	other threads:[~2013-09-04 20:33 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 [this message]
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
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=cdae1429-678d-48dc-a7b1-a2a5dfc39c2f@default \
    --to=drew.adams@oracle.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=rami.ammari@gmail.com \
    /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.