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

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

Re: Maybe we can improve this function call-process-to-string?


From: Michael Albinus
Subject: Re: Maybe we can improve this function call-process-to-string?
Date: Thu, 08 Apr 2021 15:08:49 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Jean Louis <bugs@gnu.support> writes:

> Hello,

Hi Jean,

> There is function `shell-command-to-string' which is very handy. But
> when there are problems with quoting it is better to use
> `call-process'. Yet there is no function `call-process-to-string',
> which I have made as below.
>
> Maybe people can tell me how to improve this function?

`process-lines' is closed to what you want. Try, for example

(process-lines "ls" "-al" ".")

It returns a list of strings (lines), which you could use in loops like
`while', `dolist' etc.

> Jean

Best regards, Michael.



reply via email to

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