[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: highlight regular expression in grep window

From: Kevin Rodgers
Subject: Re: highlight regular expression in grep window
Date: Thu, 05 Sep 2013 00:47:17 -0600
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv: Gecko/20120306 Thunderbird/3.1.20

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

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]