emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Add file-dwim.


From: Artur Malabarba
Subject: Re: [PATCH] Add file-dwim.
Date: Mon, 19 Oct 2015 08:49:31 +0100

2015-10-18 23:39 GMT+01:00 Random832 <address@hidden>:
> Artur Malabarba <address@hidden> writes:
>
>> Actually, people shouldn't use shell-command unless they specifically
>> need a shell.
>> If you want an external program, use start-process; if you want it
>> synchronous, use call-process.
>
> Can call-process return the stdout of the process in a string, as
> shell-command-to-string does?

Yep (like Eli latter suggests):

(with-temp-buffer
  (call-process "ls" nil t)
  (buffer-string))

Sure, it's ok to use shell-process-to-string if you're just hacking
something together for yourself. But in proper distributed code it's
best to start processes directly, which is safer and more robust than
spawning useless shells.



reply via email to

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