unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Artur Malabarba <bruce.connor.am@gmail.com>
To: Random832 <random832@fastmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [PATCH] Add file-dwim.
Date: Mon, 19 Oct 2015 08:49:31 +0100	[thread overview]
Message-ID: <CAAdUY-JSKVaW6yK6Dk1Ciex8PkeD8BgfOE9mpmMokfwW7J-8Sw@mail.gmail.com> (raw)
In-Reply-To: <87h9lnyf5y.fsf@fastmail.com>

2015-10-18 23:39 GMT+01:00 Random832 <random832@fastmail.com>:
> Artur Malabarba <bruce.connor.am@gmail.com> 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.



  parent reply	other threads:[~2015-10-19  7:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-18 14:54 [PATCH] Add file-dwim Taylan Ulrich Bayırlı/Kammer
2015-10-18 19:12 ` Artur Malabarba
2015-10-18 19:46   ` Taylan Ulrich Bayırlı/Kammer
2015-10-18 22:22     ` Artur Malabarba
2015-10-18 22:39       ` Random832
2015-10-19  4:44         ` Eli Zaretskii
2015-10-19  6:00           ` Random832
2015-10-19  6:08             ` Eli Zaretskii
2015-10-19  7:49         ` Artur Malabarba [this message]
2015-10-19  8:39       ` Taylan Ulrich Bayırlı/Kammer
2015-10-19  9:30         ` Artur Malabarba
2015-10-19 13:32 ` Wolfgang Jenkner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAdUY-JSKVaW6yK6Dk1Ciex8PkeD8BgfOE9mpmMokfwW7J-8Sw@mail.gmail.com \
    --to=bruce.connor.am@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=random832@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).