unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: Le Wang <l26wang@gmail.com>, Emacs-Devel <emacs-devel@gnu.org>
Subject: Re: grep command doc - point out that you can chain now
Date: Mon, 17 Jul 2006 09:26:57 +0200	[thread overview]
Message-ID: <85sll0wv26.fsf@lola.goethe.zz> (raw)
In-Reply-To: <MEEKKIABFKKDFJMPIOEBEEGADDAA.drew.adams@oracle.com> (Drew Adams's message of "Sun, 16 Jul 2006 20:39:07 -0700")

"Drew Adams" <drew.adams@oracle.com> writes:

> 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.

Why wouldn't it have been possible before?

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2006-07-17  7:26 UTC|newest]

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=85sll0wv26.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@gnu.org \
    --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 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).