From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: problem using call-process with grep Date: Fri, 23 Dec 2005 17:51:04 -0800 Message-ID: References: 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 1135389094 31715 80.91.229.2 (24 Dec 2005 01:51:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 24 Dec 2005 01:51:34 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 24 02:51:33 2005 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 1EpyZE-0002G2-QW for ged-emacs-devel@m.gmane.org; Sat, 24 Dec 2005 02:51:29 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EpyaJ-0007g5-EU for ged-emacs-devel@m.gmane.org; Fri, 23 Dec 2005 20:52:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Epya4-0007eS-LR for emacs-devel@gnu.org; Fri, 23 Dec 2005 20:52:20 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Epya0-0007cV-My for emacs-devel@gnu.org; Fri, 23 Dec 2005 20:52:20 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Epya0-0007cO-Is for emacs-devel@gnu.org; Fri, 23 Dec 2005 20:52:16 -0500 Original-Received: from [148.87.122.30] (helo=rgminet01.oracle.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1EpyZO-0006Uw-He for emacs-devel@gnu.org; Fri, 23 Dec 2005 20:51:38 -0500 Original-Received: from rgmsgw301.us.oracle.com (rgmsgw301.us.oracle.com [138.1.186.50]) by rgminet01.oracle.com (Switch-3.1.6/Switch-3.1.6) with ESMTP id jBO1p6VK013428 for ; Fri, 23 Dec 2005 18:51:06 -0700 Original-Received: from rgmsgw301.us.oracle.com (localhost [127.0.0.1]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with ESMTP id jBO1p6Hl018960 for ; Fri, 23 Dec 2005 18:51:06 -0700 Original-Received: from dradamslap (dhcp-amer-rmdc-csvpn-gw4-141-144-96-235.vpn.oracle.com [141.144.96.235]) by rgmsgw301.us.oracle.com (Switch-3.1.7/Switch-3.1.7) with SMTP id jBO1p5Sg018952 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Fri, 23 Dec 2005 18:51:05 -0700 Original-To: "Emacs-Devel" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) In-Reply-To: Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE 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:48282 Archived-At: To figure out whether this is specific to Cygwin `grep' or a property of `call-process', could someone else (e.g. on GNU/Linux) please try these: (call-process "/path/to/your/echo" nil t nil "foo\\\\(bar\\\\)") (call-process "/path/to/your/echo" nil t nil "foo\\(bar\\)") In my case, the first gives: foo\(bar\); the second gives foo(bar). Feedback from someone on GNU/Linux: system-configuration => "i386-pc-linux-gnu" (call-process "/bin/echo" nil t nil "\\x \\\\x \\(x\\) \\\\(x\\\\)") => 0 =| \x \\x \(x\) \\(x\\) (call-process "/bin/sh" nil t nil "-c" "echo '\\x \\\\x \\(x\\) \\\\(x\\\\)'") => 0 =| \x \\x \(x\) \\(x\\) identical results for buffers in text and emacs lisp modes. I misstated the test, above. This doesn't tell us anything about `grep', obviously. Do the tests mean that there is a problem in the native Windows implementation of `call-process'? Could they mean that there is a problem in all Cygwin processes? IIUC, `call-process' doesn't spawn a shell, so if this were a problem on the Cygwin end, then it would have to be a problem for each of `grep', `echo', and `sh' (commands tested so far) that doesn't manifest itself from the command line. Or am I missing something else? Could someone who works on the Windows port perhaps take a look to see if `call-process' is doing the right thing? It would seem surprising for this to turn out to be a bug in that code, since this behavior is old (at least since Emacs 20) and it occurs in such a prominent place. I'd think that this would have already been pounded on enough to expose any problem of this kind.