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: tomas
Subject: Re: Question about start-process and argument list
Date: Sat, 4 Feb 2023 07:40:12 +0100

On Sat, Feb 04, 2023 at 12:02:35AM +0100, Bruno Barbier wrote:
> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> 
> > chad <yandros@gmail.com> writes:
> >
> >> On Fri, Feb 3, 2023 at 4:23 PM Eric Abrahamsen <eric@ericabrahamsen.net>
> >> wrote:
> >>
> >>>
> >>> Kind of sounds like I should be using `start-process-shell-command'
> >>> again! As I understand it, this is its main selling point.
> >>>
> >>
> >> Have you by chance looked at shell-quote-argument or
> >> split-string-shell-command?  It's been a while since I had to deal with
> >> this, but I recall the former being helpful then, and it looks like it may
> >> be meant to handle your situation.
> >
> > But, to be clear, my problem doesn't seem to be escaping/unescaping
> > shell-specific characters, as far as I can see that isn't causing the
> > trouble. It's passing in the search query as a single argument, when it
> > contains spaces. It works fine when it's a single string with no spaces
> > in it.
> 
> But, if you go the `start-process-shell-command' way, shell escaping is
> going to be *your* problem (for any possible meaning of shell).
> 
> And, in this case, you should really consider using
> `shell-quote-argument'.

It /does/ help with whitespaces:

  (shell-quote-argument "foo bar baz")
  => "foo\\ bar\\ baz"

Cheers
-- 
t

Attachment: signature.asc
Description: PGP signature


reply via email to

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