unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* grep command doc - point out that you can chain now
@ 2006-07-17  3:39 Drew Adams
  2006-07-17  7:26 ` David Kastrup
  0 siblings, 1 reply; 19+ messages in thread
From: Drew Adams @ 2006-07-17  3:39 UTC (permalink / raw)
  Cc: Le Wang

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.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2006-07-19 21:15 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-17  3:39 grep command doc - point out that you can chain now Drew Adams
2006-07-17  7:26 ` David Kastrup
2006-07-17  8:19   ` Nick Roberts
2006-07-17 15:28     ` Drew Adams
2006-07-17 17:59       ` Eli Zaretskii
2006-07-17 18:20         ` Drew Adams
2006-07-18  0:12     ` Richard Stallman
2006-07-18  2:30       ` Nick Roberts
2006-07-18  4:22         ` Drew Adams
2006-07-18  5:02           ` Nick Roberts
2006-07-18  5:53             ` Drew Adams
2006-07-18 15:00               ` Richard Stallman
2006-07-18 14:59         ` Richard Stallman
2006-07-18 21:12           ` Nick Roberts
2006-07-19  6:05             ` Richard Stallman
2006-07-19  7:02               ` Nick Roberts
2006-07-19  8:52                 ` Drew Adams
2006-07-19  9:05                   ` Nick Roberts
2006-07-19 21:15                 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).