help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Program working with shell-command but not call-process


From: Michael Heerdegen
Subject: Re: Program working with shell-command but not call-process
Date: Fri, 04 Jul 2014 17:21:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.92 (gnu/linux)

Joost Kremers <address@hidden> writes:

> >     (with-output-to-string
> >       (call-process "git" nil standard-output nil "--version"))
> >       ;=> it returns ""
> >       ;=> `call-process' alone returns 53
>
> `with-output-to-string' takes whatever is sent to `standard-output',
> converts it to a string and returns it. `call-process' sends its output
> to a buffer, or optionally to a file, but not to stdout. So you won't
> get any output from this construct unless `standard-output' is set to a
> buffer.

I don't think this is true.  `with-output-to-string` binds
`standard-output` to a temporary buffer and returns its content, so the
above should work (and actually does work here).

Michael.




reply via email to

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