From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Using `call-process-shell-command' in `process-lines' Date: Mon, 26 Nov 2007 22:38:10 +0200 Message-ID: References: <474B022C.8040508@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1196109511 27274 80.91.229.12 (26 Nov 2007 20:38:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 26 Nov 2007 20:38:31 +0000 (UTC) Cc: lekktu@gmail.com, monnier@iro.umontreal.ca, emacs-devel@gnu.org To: "Lennart Borgman (gmail)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 26 21:38:39 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Iwkis-0004fy-77 for ged-emacs-devel@m.gmane.org; Mon, 26 Nov 2007 21:38:30 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Iwkid-0001b5-9b for ged-emacs-devel@m.gmane.org; Mon, 26 Nov 2007 15:38:15 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Iwkia-0001aJ-7n for emacs-devel@gnu.org; Mon, 26 Nov 2007 15:38:12 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IwkiY-0001Ze-C0 for emacs-devel@gnu.org; Mon, 26 Nov 2007 15:38:11 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IwkiY-0001ZX-6B for emacs-devel@gnu.org; Mon, 26 Nov 2007 15:38:10 -0500 Original-Received: from romy.inter.net.il ([213.8.233.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IwkiX-0003gU-IJ for emacs-devel@gnu.org; Mon, 26 Nov 2007 15:38:09 -0500 Original-Received: from HOME-C4E4A596F7 ([81.5.42.135]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id JMK97051 (AUTH halo1); Mon, 26 Nov 2007 22:37:53 +0200 (IST) In-reply-to: <474B022C.8040508@gmail.com> (lennart.borgman@gmail.com) X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) 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:84174 Archived-At: > Date: Mon, 26 Nov 2007 18:28:12 +0100 > From: "Lennart Borgman (gmail)" > Cc: Stefan Monnier , > Emacs Devel > > In a cmd.exe shell I can execute > > find -name "*.el" > > with desired result (using gnuwin32 find.exe), but > > find -name *.el > > fails with > > find: paths must precede expression > Usage: find [path...] [expression] > > Doesn't it look like arg passing in find.exe is a bit strange? No, it's not a problem with find.exe, it's a problem with the function spawnve (called by call-process) in the Windows runtime library. Unlike on Posix platforms, where the sibling function execve passes the separate command-line arguments directly to the child process (in this case, find), the Windows implementation first constructs a single command-line string from all the separate arguments, and then passes the result to the Windows API CreateProcess. The concatenation of the arguments is mandatory, since CreateProcess requires a single string command, but the misfeature of spawnve is that it does not quote the separate arguments as appropriate while concatenating them, and thus the semantics of some of the arguments changes. We could fix that by wrapping spawnve with code that quotes arguments which need quoting. I have working code somewhere that I can dust off (bumped into this problem while porting RCS to Windows). Then the application Lisp code could be left intact.