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 12:45:43 +0200 Message-ID: <85vempolrc.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 1160650069 4158 80.91.229.2 (12 Oct 2006 10:47:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 12 Oct 2006 10:47:49 +0000 (UTC) Cc: lennart.borgman.073@student.lu.se, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 12 12:47:48 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 1GXy64-00059i-7X for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 12:47:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GXy63-0008Jk-Qo for ged-emacs-devel@m.gmane.org; Thu, 12 Oct 2006 06:47:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GXy57-0007Q3-PA for emacs-devel@gnu.org; Thu, 12 Oct 2006 06:46:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GXy57-0007Oq-0e for emacs-devel@gnu.org; Thu, 12 Oct 2006 06:46:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GXy56-0007Ob-QR for emacs-devel@gnu.org; Thu, 12 Oct 2006 06:46:28 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GXyDJ-0001on-JZ for emacs-devel@gnu.org; Thu, 12 Oct 2006 06:54:57 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1GXy55-0001Q4-SV; Thu, 12 Oct 2006 06:46:28 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id DC11C1CE169B; Thu, 12 Oct 2006 12:45:43 +0200 (CEST) Original-To: Eli Zaretskii In-Reply-To: (Eli Zaretskii's message of "Thu\, 12 Oct 2006 06\:35\:37 -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:60643 Archived-At: Eli Zaretskii writes: >> Cc: Lennart Borgman , emacs-devel@gnu.org >> From: David Kastrup >> Date: Thu, 12 Oct 2006 09:44:14 +0200 >> >> > Remaining arguments are strings passed as additional arguments >> > for COMMAND. >> > >> > There's no requirement here that each one of the "&rest ARGS" be a >> > separate command-line argument, is there? >> >> Then it would be completely pointless to allow several ARGS. > > It's not pointless, it can be useful if the command line is > generated piecewise. start-process-shell-command is not system(3). Then the question is why it should behave like it. The code says: (defun start-process-shell-command (name buffer &rest args) "Start a program in a subprocess. Return the process object for it. [...] Remaining arguments are the arguments for the command. Wildcards and redirection are handled as usual in the shell. [...]" (cond ((eq system-type 'vax-vms) (apply 'start-process name buffer args)) ;; We used to use `exec' to replace the shell with the command, ;; but that failed to handle (...) and semicolon, etc. (t (start-process name buffer shell-file-name shell-command-switch (mapconcat 'identity args " "))))) Clearly, ARGS is (except on VMS) _not_ a list of separate arguments, but rather strings pasted together with spaces. So I don't understand how to apply your remark "start-process-shell-command is not system(3).". `start-process-shell-command' certainly is coded in a manner that _strongly_ suggests it to be quite close to system(3) which is documented as SYNOPSIS #include int system(const char *command); DESCRIPTION system() executes a command specified in command by calling /bin/sh -c command, and returns after the command has been completed. During execution of the command, SIGCHLD will be blocked, and SIGINT and SIGQUIT will be ignored. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum