emacs-devel
[Top][All Lists]
Advanced

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

Re: Question about start-process and argument list


From: Eric Abrahamsen
Subject: Re: Question about start-process and argument list
Date: Fri, 03 Feb 2023 13:23:00 -0800
User-agent: Gnus/5.13 (Gnus v5.13)

Bruno Barbier <brubar.cs@gmail.com> writes:

> Jean Louis <bugs@gnu.support> writes:

Thanks to both of you for the responses.

>> * Eric Abrahamsen <eric@ericabrahamsen.net> [2023-02-03 09:37]:
>>> 
>>> 1. What does the program actually see, in this case? Is the first
>>>    example above, is it the equivalent of (on the command line) wrapping
>>>    the query in double quotes?
>>
>> It has same effect.
>
> Maybe I didn't understand the question, but I don't think it has the
> same effect nor that it should.

[...]

Right, and experience demonstrates that it doesn't have the same effect,
because one version works (with mairix) and the other doesn't.

>>> 2. Should I be using `start-process-shell-command' instead? The docs
>>>    mention that the main difference is that it will use shell features,
>>>    which aren't really relevant here, but maybe it's the right thing to
>>>    do, semantically.
>>
>> Rather no, as that becomes unsafe. Yes, it would invoke shell and
>> some environment and the program line. But for programing purposes is
>> unsafe. 
>
> Right, I would advise you, like Jean, to stay with `start-process'.

Thanks, I will do that.

> And, the search query should probably be only one argument (except if
> you accept to restrict you query syntax to something that's compatible
> with any possible way to quote and parse arguments on a command line on
> any possible OS, including sign like '-', '"', ')',  etc.).

Well, as noted above, it doesn't work when it's all one argument. At
least with one of the possible commands -- I can "fix it" for mairix in
particular, my main question is if I should be "fixing it" for all
search commands.

Not to be contrarian, but this:

> compatible with any possible way to quote and parse arguments on a
> command line on any possible OS

Kind of sounds like I should be using `start-process-shell-command'
again! As I understand it, this is its main selling point.



reply via email to

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