From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: David Abrahams Newsgroups: gmane.emacs.devel Subject: Re: grep.el bug? Date: Sat, 15 Jan 2005 23:09:57 -0500 Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1105849130 23569 80.91.229.6 (16 Jan 2005 04:18:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 16 Jan 2005 04:18:50 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 16 05:18:45 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Cq1sC-0004PJ-00 for ; Sun, 16 Jan 2005 05:18:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cq23z-0000Yg-CR for ged-emacs-devel@m.gmane.org; Sat, 15 Jan 2005 23:30:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Cq23V-0000SK-5f for emacs-devel@gnu.org; Sat, 15 Jan 2005 23:30:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Cq23M-0000NU-3r for emacs-devel@gnu.org; Sat, 15 Jan 2005 23:30:17 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Cq23L-0000Mt-TW for emacs-devel@gnu.org; Sat, 15 Jan 2005 23:30:15 -0500 Original-Received: from [80.91.229.2] (helo=main.gmane.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Cq1kk-0003GI-I1 for emacs-devel@gnu.org; Sat, 15 Jan 2005 23:11:02 -0500 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 1Cq1kj-0006UZ-00 for ; Sun, 16 Jan 2005 05:11:01 +0100 Original-Received: from 146-115-127-135.c3-0.smr-ubr2.sbo-smr.ma.cable.rcn.com ([146.115.127.135]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Jan 2005 05:11:01 +0100 Original-Received: from dave by 146-115-127-135.c3-0.smr-ubr2.sbo-smr.ma.cable.rcn.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 16 Jan 2005 05:11:01 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 54 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 146-115-127-135.c3-0.smr-ubr2.sbo-smr.ma.cable.rcn.com User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en In-Reply-To: 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: main.gmane.org gmane.emacs.devel:32259 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32259 David Abrahams wrote: > I just rebuilt emacs from CVS. On line 541 of grep.el, a change was > made about a year ago that seems to be breaking grep-find for me. > > (let ((null-device nil)) ; see grep > (grep command-args)))) > > This always leads to the following backtrace for me: > > Debugger entered--Lisp error: (wrong-type-argument stringp nil) > call-process("find" nil nil nil nil "-print0") > grep-compute-defaults() > grep-process-setup() > compilation-start("find . -type f -not -path \"*/CVS/*\" ...) > grep("find . -type f -not -path \"*/CVS/*\" -not -name \ ...) > grep-find("find . -type f -not -path \"*/CVS/*\" -not ...) > call-interactively(grep-find) > execute-extended-command(nil) > call-interactively(execute-extended-command) > > As far as I can tell, null-device gets passed as the 5th argument to > call-process, which expects only strings after its 4th argument. But > this can't have remained broken for everyone for a whole year, can it? > So I must be missing something. The comment that directs me to "see > grep" leaves me completely in the dark. > > Clues, anyone? Here's one clue: I have customized grep-find-command. I believe that if I hadn't, (unless grep-find-command (grep-compute-defaults)) would cause grep-compute-defaults to be called early enough to make the nil-ness of null-device irrellevant. Hah, yes, that is in fact the case. The grep function has a slightly more sophisticated check: (unless (and grep-command (or (not grep-use-null-device) (eq grep-use-null-device t))) I don't know exactly what the right fix is, but it seems to me these tests ought to be encapsulated, or just incorporated into grep-compute-defaults. Hmm, something like that seems to be there already. Since I don't know what the original authors of this code were thinking, I'm having trouble thinking of a change that preserves what's currently working but doesn't just make more of a mess. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com