From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: grep-use-null-device Date: Tue, 16 Aug 2005 11:26:22 +0200 Message-ID: <85vf26dygx.fsf@lola.goethe.zz> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1124186267 13909 80.91.229.2 (16 Aug 2005 09:57:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 16 Aug 2005 09:57:47 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 16 11:57:44 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E4yBm-000554-Ui for ged-emacs-devel@m.gmane.org; Tue, 16 Aug 2005 11:56:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E4yFC-0000Eg-Eb for ged-emacs-devel@m.gmane.org; Tue, 16 Aug 2005 06:00:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E4yEV-0000Cd-Ud for emacs-devel@gnu.org; Tue, 16 Aug 2005 05:59:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E4yEU-0000CN-Vj for emacs-devel@gnu.org; Tue, 16 Aug 2005 05:59:47 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E4yCm-00089B-SL for emacs-devel@gnu.org; Tue, 16 Aug 2005 05:58:00 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E4xxk-0006S5-SX for emacs-devel@gnu.org; Tue, 16 Aug 2005 05:42:28 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1E4xfU-0000Tn-48; Tue, 16 Aug 2005 05:23:36 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 4F84B1C4CE29; Tue, 16 Aug 2005 11:26:22 +0200 (CEST) Original-To: Emilio Lopes In-Reply-To: (Emilio Lopes's message of "Tue, 16 Aug 2005 09:15:07 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:42110 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:42110 Emilio Lopes writes: > Emilio Lopes writes: > >> As a result, if I forget to provide a filename to "M-x grep" it will >> run forever, waiting for me to kill it. > > Richard M Stallman writes: > >> So, my grep program supports "-H" but it apparently has not the >> expected semantics. > >> That is a very vague statement. It tells us nothing. > > No, no. It's very concrete if you consider the rest of the message, > which you didn't quote. Anyway, I understand the problem better now. > > If the user forgets to provide a filename to "M-x grep" (as in > "grep.-nH.foo") it will run indefinitely waiting for input from > stdin until killed. In such cases it's useful to have `null-device' > appended, even if the grep program supports the option "-H" (which > has an other purpose anyway). > > One could even argue if Emacs should not append *two* instances of > `null-device', in the case the use just press enter at the grep prompt > without even typing a regexp. I think what rather should be done is that standard input on the grep process gets closed. That requires no special options, and it will lead to a sensible result without obscure extra options. grep-use-null-device is just for getting file names on matches, not for dealing with bad commands. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum