From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Quote file name args to start-process-shell-command? Date: Thu, 12 Oct 2006 10:47:45 -0400 Message-ID: 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 1160664594 2715 80.91.229.2 (12 Oct 2006 14:49:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2006 14:49:54 +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 16:49: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 1GY1qz-0004Mr-1D for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 16:48:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GY1qy-0006FQ-Ex for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 10:48:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GY1qg-0006Ex-Dy for emacs-devel@gnu.org; Thu, 12 Oct 2006 10:47:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GY1qf-0006Ek-Ah for emacs-devel@gnu.org; Thu, 12 Oct 2006 10:47:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GY1qe-0006Ec-Sl for emacs-devel@gnu.org; Thu, 12 Oct 2006 10:47:48 -0400 Original-Received: from [209.226.175.25] (helo=tomts5-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GY1ys-0001Sr-Df; Thu, 12 Oct 2006 10:56:18 -0400 Original-Received: from pastel.home ([70.53.194.21]) by tomts5-srv.bellnexxia.net (InterMail vM.5.01.06.13 201-253-122-130-113-20050324) with ESMTP id <20061012144746.ZMKJ18394.tomts5-srv.bellnexxia.net@pastel.home>; Thu, 12 Oct 2006 10:47:46 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 9554C80F6; Thu, 12 Oct 2006 10:47:45 -0400 (EDT) Original-To: David Kastrup In-Reply-To: <85y7rmou5t.fsf@lola.goethe.zz> (David Kastrup's message of "Thu\, 12 Oct 2006 09\:44\:14 +0200") 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:60667 Archived-At: 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. Stefan * 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))