From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Artur Malabarba Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Add file-dwim. Date: Mon, 19 Oct 2015 08:49:31 +0100 Message-ID: References: <87d1wcrzuu.fsf@T420.taylan> <87lhb0ot7m.fsf@T420.taylan> <87h9lnyf5y.fsf@fastmail.com> Reply-To: bruce.connor.am@gmail.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1445240979 28491 80.91.229.3 (19 Oct 2015 07:49:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Oct 2015 07:49:39 +0000 (UTC) Cc: emacs-devel To: Random832 Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 19 09:49:39 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Zo5CL-0006rt-To for ged-emacs-devel@m.gmane.org; Mon, 19 Oct 2015 09:49:38 +0200 Original-Received: from localhost ([::1]:37067 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zo5CL-0004tV-28 for ged-emacs-devel@m.gmane.org; Mon, 19 Oct 2015 03:49:37 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35425) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zo5CH-0004tI-Md for emacs-devel@gnu.org; Mon, 19 Oct 2015 03:49:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zo5CG-0000BV-Tj for emacs-devel@gnu.org; Mon, 19 Oct 2015 03:49:33 -0400 Original-Received: from mail-lf0-x233.google.com ([2a00:1450:4010:c07::233]:33399) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zo5CG-0000BJ-Nd for emacs-devel@gnu.org; Mon, 19 Oct 2015 03:49:32 -0400 Original-Received: by lffv3 with SMTP id v3so102717706lff.0 for ; Mon, 19 Oct 2015 00:49:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=xsZywyTh5qkqq4fYl/YdkkeYNurBBsWdwDlgcLEc8Ok=; b=zt7JiMQFl+BMc2ThUcSNzKRGNe9Uceas4TDKpFlgt5lTKLGUA5FuQjo3AYE7rbAQnL i+fJFRQADypdsgQ/jqU9ji3X7mEhdRkv4nhXEAzmTLHCWQBGWqwcCMEaznSqcBNyCjKe PWN2zhxkPMSnbXDTlhU7zwgVAutdy0CA7H0bCperVGaDAwmFLE9qAW04yQ2f8+8wjpN9 hbPF6COoNlHpueO94pKIAdqxgd7wC8T18/9Gvt8/xeWLQi9wb6EmSckIOm4lkHkjtMrc 9JpTHvKg6LVHVGt1zh45O9WE3I0+itrw5taFuodXfaRcVPnE4Y6AFtndZgJZguRQAGmU XnrA== X-Received: by 10.25.210.206 with SMTP id j197mr9083593lfg.86.1445240971951; Mon, 19 Oct 2015 00:49:31 -0700 (PDT) Original-Received: by 10.25.22.197 with HTTP; Mon, 19 Oct 2015 00:49:31 -0700 (PDT) In-Reply-To: <87h9lnyf5y.fsf@fastmail.com> X-Google-Sender-Auth: v4OsLw_lUl6_KKqOWCPGVbYXM_0 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c07::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192042 Archived-At: 2015-10-18 23:39 GMT+01:00 Random832 : > Artur Malabarba 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.