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 16:53:47 +0200 Message-ID: <85bqohmvpg.fsf@lola.goethe.zz> References: <452D54D8.7060705@student.lu.se> <452DDBC8.2060606@student.lu.se> <85y7rmou5t.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 1160665313 5898 80.91.229.2 (12 Oct 2006 15:01:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2006 15:01:53 +0000 (UTC) Cc: Lennart Borgman , Eli Zaretskii , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 12 17:01:50 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 1GY1xa-0006Fs-Ux for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 16:54:59 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GY1xa-0005v5-DO for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 10:54:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GY1xC-0005ps-1m for emacs-devel@gnu.org; Thu, 12 Oct 2006 10:54:34 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GY1xB-0005p7-6m for emacs-devel@gnu.org; Thu, 12 Oct 2006 10:54:33 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GY1xB-0005oy-2s for emacs-devel@gnu.org; Thu, 12 Oct 2006 10:54:33 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GY25Q-0002Ro-31 for emacs-devel@gnu.org; Thu, 12 Oct 2006 11:03:04 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1GY1x9-00077X-MD; Thu, 12 Oct 2006 10:54:31 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id D26741CE169B; Thu, 12 Oct 2006 16:53:47 +0200 (CEST) Original-To: Stefan Monnier In-Reply-To: (Stefan Monnier's message of "Thu\, 12 Oct 2006 10\:47\:45 -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:60668 Archived-At: Stefan Monnier writes: > I think the current situation is misleading: the "&rest ARGS" gives > the impression that these are separate args to the command, whereas > they're just arbitrary strings concatenated to COMMAND (which really > can itself be anything rather than a file name). > > Just as obviously, this can't be fixed by quoting the arguments, > because it would defeat the purpose: you may as well use > `start-process' and avoid the whole shell problem. > > I suggest the patch below to fix this problem: let the caller do the > concatenation/quoting, so she gets what she expects. It's really > not that big a deal. > * auto-adding monnier@iro.umontreal.ca--first/emacs--monnier--0--patch-405 to greedy revision library /home/monnier/tmp/arch-lib > * found immediate ancestor revision in library (monnier@iro.umontreal.ca--first/emacs--monnier--0--patch-404) > * patching for this revision (monnier@iro.umontreal.ca--first/emacs--monnier--0--patch-405) > --- orig/lisp/subr.el > +++ mod/lisp/subr.el > @@ -2304,11 +2304,9 @@ > an output stream or filter function to handle the output. > BUFFER may be also nil, meaning that this process is not associated > with any buffer > -COMMAND is the name of a shell command. > -Remaining arguments are the arguments for the command. > -Wildcards and redirection are handled as usual in the shell. > +COMMAND is the shell command to run. > > -\(fn NAME BUFFER COMMAND &rest COMMAND-ARGS)" > +\(fn NAME BUFFER COMMAND)" > (cond > ((eq system-type 'vax-vms) > (apply 'start-process name buffer args)) I agree with the gist of your patch which removes the confusion about the args. But it does this only in the doc string, not the code itself. This gives the function "hidden" backwards compatibility. I don't think that is really a good idea: I think the code should follow suit. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum