all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Drew Adams" <drew.adams@oracle.com>
Cc: Le Wang <l26wang@gmail.com>
Subject: grep command doc - point out that you can chain now
Date: Sun, 16 Jul 2006 20:39:07 -0700	[thread overview]
Message-ID: <MEEKKIABFKKDFJMPIOEBEEGADDAA.drew.adams@oracle.com> (raw)

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	other threads:[~2006-07-17  3:39 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-17  3:39 Drew Adams [this message]
2006-07-17  7:26 ` grep command doc - point out that you can chain now 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MEEKKIABFKKDFJMPIOEBEEGADDAA.drew.adams@oracle.com \
    --to=drew.adams@oracle.com \
    --cc=l26wang@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.