From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emilio Lopes Newsgroups: gmane.emacs.devel Subject: grep-use-null-device Date: Mon, 15 Aug 2005 17:41:39 +0200 Organization: private Message-ID: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=latin-iso8859-1 Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1124121973 6572 80.91.229.2 (15 Aug 2005 16:06:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 15 Aug 2005 16:06:13 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 15 18:06:11 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E4hTX-00024W-1l for ged-emacs-devel@m.gmane.org; Mon, 15 Aug 2005 18:06:11 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E4hWt-0005rH-Lr for ged-emacs-devel@m.gmane.org; Mon, 15 Aug 2005 12:09:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E4hTT-0003Qu-D3 for emacs-devel@gnu.org; Mon, 15 Aug 2005 12:06:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E4hTQ-0003Pf-WB for emacs-devel@gnu.org; Mon, 15 Aug 2005 12:06:05 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E4hTQ-0003Ol-Fz for emacs-devel@gnu.org; Mon, 15 Aug 2005 12:06:04 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1E4hey-0002dM-Ps for emacs-devel@gnu.org; Mon, 15 Aug 2005 12:18:01 -0400 Original-Received: from root by ciao.gmane.org with local (Exim 4.43) id 1E4hNn-0000ot-Gv for emacs-devel@gnu.org; Mon, 15 Aug 2005 18:00:15 +0200 Original-Received: from p62.246.49.240.tisdip.tiscali.de ([62.246.49.240]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Aug 2005 18:00:15 +0200 Original-Received: from eclig by p62.246.49.240.tisdip.tiscali.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 15 Aug 2005 18:00:15 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 42 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: p62.246.49.240.tisdip.tiscali.de User-Agent: Emacs Gnus Cancel-Lock: sha1:X3eALPGBbtJygBELjdbkT+pUi6U= 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:42072 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:42072 The documentation of this variable says: grep-use-null-device's value is nil If t, append the value of `null-device' to `grep' commands. This is done to ensure that the output of grep includes the filename of any match in the case where only a single file is searched, and is not necessary if the grep program used supports the `-H' option. The default value of this variable is set up by `grep-compute-defaults'; call that function before using this variable in your program. You can customize this variable. Defined in `grep'. If I understood it right, it says that I don't need a "/dev/null" appended to my grep commands if my grep program supports the option "-H". Let's see: ~% grep --version grep (GNU grep) 2.5.1 Copyright 1988, 1992-1999, 2000, 2001 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ~% grep --help | grep -- -H -H, --with-filename print the filename for each match So, my grep program supports "-H" but it apparently has not the expected semantics. As a result, if I forget to provide a filename to "M-x grep" it will run forever, waiting for me to kill it. Do I have the "wrong" grep? Is there a case where having a `null-device' too much will hurt?