Subject: [sr #105945] Add C compiler like output to grep so
that emacs 'next-error function works on grep
Summary: Add C compiler like output to grep so that emacs
'next-error function works on grep output
Submitted by: None
Submitted on: Thursday 07/19/2007 at 23:10 UTC
Priority: 5 - Normal
Severity: 1 - Wish
Assigned to: None
Originator Email: shr_62@xxxxxxxxx
Discussion Lock: Any
Operating System: None
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
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.
Reply to this item at: