emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quote file name args to start-process-shell-command?


From: David Kastrup
Subject: Re: Quote file name args to start-process-shell-command?
Date: Thu, 12 Oct 2006 16:53:47 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Stefan Monnier <address@hidden> 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 address@hidden/emacs--monnier--0--patch-405 to greedy revision 
> library /home/monnier/tmp/arch-lib
> * found immediate ancestor revision in library 
> (address@hidden/emacs--monnier--0--patch-404)
> * patching for this revision (address@hidden/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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]