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 13:01:29 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Eli Zaretskii <address@hidden> writes:

>> Cc: Eli Zaretskii <address@hidden>,
>>        Lennart Borgman <address@hidden>,
>>        address@hidden
>> From: David Kastrup <address@hidden>
>> Date: Thu, 12 Oct 2006 11:27:58 +0200
>> 
>> However, I agree that `shell-quote-argument' would be inappropriate to
>> apply on the arguments of `call-process-shell-command'.  Only those
>> characters responsible for splitting arguments into words should get
>> quoted.
>
> What about < and | and ` and ' and ~ and ! etc.?  Some, if not all of
> them also split arguments into words, and have other effects.  We
> should leave this to the shell.
>
> Let's put it another way: an interface to invoking a shell eventually
> boils down to calling `system' or its equivalent.  A call to `system'
> accepts a single string that is the command line to pass to the shell.
> So any API wrapped around `system' eventually concatenates all the
> portions of the command-line args into a single string, and that is
> how applications should use such an API.
>
> If one needs to pass several strings as separate arguments to a
> subprogram (including a shell), one should use an appropriate API,
> such as call-process.

But the current documentation string and the availability of multiple
arguments that are _documented_ as multiple arguments is quite
misleading.  If we decide that those arguments are not intended to be
multiple arguments but rather something that is merely spliced
together with spaces into one single string, then the documentation
should reflect this.

And it would seem like this function has a different behavior under
VMS, too.

The current situation is an incoherent mess.  The implementation under
VMS, the implementation under other systems, and the documentation are
not consistent.

If the documentation documents something which we can't reasonably
provide, the solution is to change the documentation, not to stick
one's head into the sand.  And then the behavior should be consistent
between operating systems.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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