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: Stephen Leake
Subject: Re: Quote file name args to start-process-shell-command?
Date: Thu, 12 Oct 2006 14:50:34 -0400
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt)

David Kastrup <address@hidden> writes:

> Andreas Schwab <address@hidden> writes:
>
>> David Kastrup <address@hidden> writes:
>>
>>> Spaces are neither a wildcard nor a redirection.
>>
>> The function executes a shell command.  Shell commands can include
>> many kinds of meta characters, including wildcards and redirections.
>
> Spaces are neither a wildcard nor a redirection.
>
>>> Straw man.  This never was about "metacharacter handling" but
>>> rather about argument processing.
>>
>> The function is about shell commands.  That includes any kind of
>> meta characters.  This works as documented.
>
> I disagree.  If I call something like
>
> (start-process-shell-command "ls" "*scratch*" "ls"
>  "\"Program" "Files\"")
>
> then "\"Program" and "Files\"" are not become separate arguments to
> the shell.  Rather there is one argument "Program Files".

That is what I would expect, and what I believe the documentation
says:

(start-process-shell-command NAME BUFFER &rest ARGS)
...
    Remaining arguments are the arguments for the command.

Each lisp object in ARGS is one command shell argument.

Not "remaining arguments are split on spaces", which is what you seem
to be expecting.

> The command should either make some attempt to actually pass separate
> arguments 

That is what it does.

> (and that means quoting of word separating entities)

This it does not do. Perhaps it should; I think that is the point of
this discussion.

This matters to me as the maintainer of ada-mode; it builds compiler
commands, that may contain arguments that need to be quoted.

My inclination is that any "automagic" quoting that I don't have
direct control over will be wrong at some point. So I'd prefer to
leave start-process-shell-command as is, but mention that
shell-quote-argument might be useful.

> , or just accept a single string as an argument.

It is often convenient to build the arguments in separate groups; a
single string would be awkward.

I don't have any exact examples handy.

-- 
-- Stephe




reply via email to

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