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: Fixing Windows and DOS command line argument quoting Date: Mon, 25 Apr 2011 21:47:08 +0300 Message-ID: <837hai9nir.fsf@gnu.org> References: <4DB4D7DB.50101@gmail.com> <83y62yal3o.fsf@gnu.org> <4DB53599.8040703@gmail.com> <4DB537BB.1090205@gnu.org> <4DB53D57.9030606@gmail.com> <4DB5B5B7.3070801@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1303757252 642 80.91.229.12 (25 Apr 2011 18:47:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 25 Apr 2011 18:47:32 +0000 (UTC) Cc: emacs-devel@gnu.org, jasonr@gnu.org To: Daniel Colascione Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 25 20:47:28 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QEQoc-0003BO-Ra for ged-emacs-devel@m.gmane.org; Mon, 25 Apr 2011 20:47:22 +0200 Original-Received: from localhost ([::1]:33463 helo=lists2.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEQoc-00021M-D5 for ged-emacs-devel@m.gmane.org; Mon, 25 Apr 2011 14:47:22 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36618) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEQoZ-00021G-66 for emacs-devel@gnu.org; Mon, 25 Apr 2011 14:47:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QEQoY-0003ez-4Q for emacs-devel@gnu.org; Mon, 25 Apr 2011 14:47:19 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:37171) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QEQoX-0003eq-Qp; Mon, 25 Apr 2011 14:47:18 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LK8006001BSSR00@a-mtaout22.012.net.il>; Mon, 25 Apr 2011 21:47:05 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.228.156.238]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LK8006ZW1IF8570@a-mtaout22.012.net.il>; Mon, 25 Apr 2011 21:47:05 +0300 (IDT) In-reply-to: <4DB5B5B7.3070801@gmail.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:138758 Archived-At: > Date: Mon, 25 Apr 2011 10:56:07 -0700 > From: Daniel Colascione > Cc: emacs-devel@gnu.org > > After another reading of cmdproxy.c, I also see that the CreateProcess > path also doesn't expand environment %variable% references, and that > doesn't fall back to cmd if the command to be executed contains them. > While we could expand these variables, doing so would move us even > closer to reimplementing half of cmd.exe. We don't want to reimplement cmd.exe, that's for sure. I would say, if it's easy to detect that case, just make that another condition for going through the shell. If it isn't easy to detect, we can always say that these commands must be explicitly run through "cmd /c" by the application. After all, that's not a frequent use case in Emacs, because Emacs always expands environment variables before running the command, and if it doesn't, it surely won't use the %foo% syntax. So about the only use case for this is a Lisp application that directly targets Windows -- and those could be told to go through cmd explicitly. > I'd like to remove this path in the trunk and see whether the new > 8192-character length limitation is a problem in practice. No, I don't think it's a good idea. 8K is too low by any measure; we already hit the shell limitations once or twice when related problems were discussed. What are the disadvantages of detecting quoted command lines and sending only those through the shell?