From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: RE: grep command doc - point out that you can chain now Date: Tue, 18 Jul 2006 17:02:32 +1200 Message-ID: <17596.27496.792600.13733@kahikatea.snap.net.nz> References: <17596.18378.277549.697431@kahikatea.snap.net.nz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1153199098 23294 80.91.229.2 (18 Jul 2006 05:04:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 18 Jul 2006 05:04:58 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 18 07:04:55 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G2hlL-00061Q-6Z for ged-emacs-devel@m.gmane.org; Tue, 18 Jul 2006 07:04:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G2hlK-0000qe-Q8 for ged-emacs-devel@m.gmane.org; Tue, 18 Jul 2006 01:04:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G2hkR-0000c2-Mj for emacs-devel@gnu.org; Tue, 18 Jul 2006 01:03:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G2hkQ-0000bX-N1 for emacs-devel@gnu.org; Tue, 18 Jul 2006 01:03:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G2hkQ-0000bS-BJ for emacs-devel@gnu.org; Tue, 18 Jul 2006 01:03:54 -0400 Original-Received: from [202.37.101.8] (helo=viper.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G2hnE-0007B5-BH for emacs-devel@gnu.org; Tue, 18 Jul 2006 01:06:49 -0400 Original-Received: from kahikatea.snap.net.nz (p202-124-112-167.snap.net.nz [202.124.112.167]) by viper.snap.net.nz (Postfix) with ESMTP id 656357764DD; Tue, 18 Jul 2006 17:03:50 +1200 (NZST) Original-Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id 232D91D3547; Tue, 18 Jul 2006 17:02:34 +1200 (NZST) Original-To: "Drew Adams" In-Reply-To: X-Mailer: VM 7.19 under Emacs 22.0.50.37 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:57245 Archived-At: Drew Adams writes: > > I don't think it should be pointed out in the manual > > because you would expect it to work. > > > > It never occurred to me, so I think it is worth mentioning in the > > Emacs Manual. I will add it to the manual. > > Probably because you knew it didn't work in the past. > > Yes, I said that myself. You predicted Richard's reponse? > And, I added, also because what you type is apparently not the arguments to > the Unix/GNU-Linux `grep' command, but something possibly much richer. Even > if someone were not used to Emacs 20 `grep' behavior, if s?he were used to > the Unix/GNU-Linux `grep' command, then s?he would expect to be inputting > just the `grep' args, no? Grep uses start-process just like shell-command. You saw it as natural to use the latter with a pipe so I'm surprised that you feel it needs explaining for grep. Grep failed in the past because grep-use-null-device was automatically t (or more accurately "/dev/null" was always appended to the end of the command) By saying that I would expect it to work, I mean I can't see why it wouldn't. Could you see a reason? M-x grep says: Run grep (like this): grep -nH -e not Run grep (with the following arguments): -nH -e > It still doesn't work for users with versions of grep which don't > have the -H option, so they will be confused by your description. > > Do you mean Eli's description? I didn't describe it, beyond mentioning > piping. Eli gave a real description of what's going on, presumably. I mean the person to whom the e-mail was addressed (Richard in this case). Since you only post to the list, I'm often not sure who you're talking to. > I didn't know that either (-H), BTW. That too is worth pointing out. IOW, > what you type is different for different `grep's - in one case it is the > `grep' args; in another case it is "_any_ shell command whose output > resembles that of Grep." > > Those behavior differences are certainly worth pointing out, unless they are > part of the `grep -H' doc. IOW, is what you type the expected arguments for > `grep -H', or is it something special that Emacs (only) allows? Does > `grep -H' _itself_ allow "_any_ shell command whose output resembles that > of Grep."? > > If this is part of the behavior of `grep -H' itself, then I guess it > wouldn't need to be documented in Emacs. It's not clear to me what the story > is. When I do `M-x man RET grep', and look for -H, it says "Print the > filename for each match." That can't be what this is about, can it? Yet, > with that same `grep' (it says "GNU Project 2002/01/22" in the footer), I > get the magical piping. Isn't some explanation necessary? Is this an Emacs > `grep' feature or a Unix/GNU-Linux `grep' feature that Emacs manifests? Behaviour depends on the version of grep and the value of grep-command but ultimately the value of grep-use-null-device. It has to do with the fact that without "-H" grep doesn't output the filename if only one is given in the input (hence the dummy extra: /dev/null). I don't which versions of grep have "-H" or when it was added to GNU/Linux. -- Nick http://www.inet.net.nz/~nickrob