Subject: [sr #105945] Add C compiler like output to grep so
that emacs 'next-error function works on grep
output




URL:
<http://savannah.gnu.org/support/?105945>

Summary: Add C compiler like output to grep so that emacs
'next-error function works on grep output
Project: grep
Submitted by: None
Submitted on: Thursday 07/19/2007 at 23:10 UTC
Category: None
Priority: 5 - Normal
Severity: 1 - Wish
Status: None
Privacy: Public
Assigned to: None
Originator Email: shr_62@xxxxxxxxx
Open/Closed: Open
Discussion Lock: Any
Operating System: None

_______________________________________________________

Details:

Suggested functionality: output the grep|fgrep|egrep output in a format
similar to warnings or error messages from the C compiler so that emacs can
parse.

This lets you do fun stuff like:
find . -type -f -print | xargs grep --EMACSOUT PATTERN
Such a grep would show all the file and the corresponding lines
that match PATTERN. (You would obviously want a better switch name.) I'm
betting this is reasonably simple modification.

If you run this from the 'compile command under emacs, you can then use the
'next-error function to hop from pattern match to pattern match. Emacs loads
the files and jumps to each line as required. Combined with keyboard macros,
you can do powerful, interactive edits quickly. Great for essentially any
kind of text grep'ing and editing.

I built a shell wrapper to do this about 20 years ago (and I still use it).
Exceedingly useful for emacs users.

-Scott




_______________________________________________________

Reply to this item at:

<http://savannah...

.gnu.org/support/?105945
>





Privacy