emacs-devel
[Top][All Lists]
Advanced

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

grep command doc - point out that you can chain now


From: Drew Adams
Subject: grep command doc - point out that you can chain now
Date: Sun, 16 Jul 2006 20:39:07 -0700

I just found out from Le Wang that you can now chain grep commands within
the Emacs `grep' command. I mean that you can now do `M-x grep foo *.el |
grep bar | grep toto'.

This is absolutely wonderful. I don't know when it was added (I suspect
Emacs 22) - it wasn't available in Emacs 20, in any case. (In Emacs 20, I've
been using `M-!' to chain greps, or doing it outside Emacs. BTW,
`flush-lines' doesn't work in *grep*, because it throws off the `next-error'
index.)

Chaining this way, in my experience, represents how most programmers use
grep. Instead of trying to come up with a complex regexp, they just use two
or three chained greps. The technique is so useful that I've applied it to
the use of regexps generally (e.g. regexp searching) in my own libraries.

So, I'm disappointed to see that this is not pointed out in the Emacs manual
presentation of `grep'. I really think this is worth pointing out
explicitly, with a simple example, especially since it was not possible
before.





reply via email to

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