From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Quote file name args to start-process-shell-command? Date: Thu, 12 Oct 2006 13:01:29 +0200 Message-ID: <85mz81ol12.fsf@lola.goethe.zz> References: <452D54D8.7060705@student.lu.se> <452DDBC8.2060606@student.lu.se> <85y7rmou5t.fsf@lola.goethe.zz> <85d58xq3xd.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1160651000 8234 80.91.229.2 (12 Oct 2006 11:03:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2006 11:03:20 +0000 (UTC) Cc: schwab@suse.de, emacs-devel@gnu.org, lennart.borgman.073@student.lu.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 12 13:03:18 2006 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 1GXyL5-00029g-T0 for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 13:03:00 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GXyL5-0005VI-FB for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 07:02:59 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GXyKN-0005CI-51 for emacs-devel@gnu.org; Thu, 12 Oct 2006 07:02:15 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GXyKM-0005C6-MU for emacs-devel@gnu.org; Thu, 12 Oct 2006 07:02:14 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GXyKM-0005C3-JH for emacs-devel@gnu.org; Thu, 12 Oct 2006 07:02:14 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GXySZ-0004JL-5q for emacs-devel@gnu.org; Thu, 12 Oct 2006 07:10:43 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1GXyKL-0002oj-9n; Thu, 12 Oct 2006 07:02:13 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 9F3581CE169B; Thu, 12 Oct 2006 13:01:29 +0200 (CEST) Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "Thu\, 12 Oct 2006 06\:54\:57 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:60647 Archived-At: Eli Zaretskii writes: >> Cc: Eli Zaretskii , >> Lennart Borgman , >> emacs-devel@gnu.org >> From: David Kastrup >> Date: Thu, 12 Oct 2006 11:27:58 +0200 >> >> However, I agree that `shell-quote-argument' would be inappropriate to >> apply on the arguments of `call-process-shell-command'. Only those >> characters responsible for splitting arguments into words should get >> quoted. > > What about < and | and ` and ' and ~ and ! etc.? Some, if not all of > them also split arguments into words, and have other effects. We > should leave this to the shell. > > Let's put it another way: an interface to invoking a shell eventually > boils down to calling `system' or its equivalent. A call to `system' > accepts a single string that is the command line to pass to the shell. > So any API wrapped around `system' eventually concatenates all the > portions of the command-line args into a single string, and that is > how applications should use such an API. > > If one needs to pass several strings as separate arguments to a > subprogram (including a shell), one should use an appropriate API, > such as call-process. But the current documentation string and the availability of multiple arguments that are _documented_ as multiple arguments is quite misleading. If we decide that those arguments are not intended to be multiple arguments but rather something that is merely spliced together with spaces into one single string, then the documentation should reflect this. And it would seem like this function has a different behavior under VMS, too. The current situation is an incoherent mess. The implementation under VMS, the implementation under other systems, and the documentation are not consistent. If the documentation documents something which we can't reasonably provide, the solution is to change the documentation, not to stick one's head into the sand. And then the behavior should be consistent between operating systems. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum