From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Emanuel Berg Newsgroups: gmane.emacs.help Subject: Re: problem with call-process function Date: Tue, 01 Dec 2015 01:15:13 +0100 Message-ID: <877fkzvxbi.fsf@debian.uxu> References: <1123318547.39321.1448904524817.JavaMail.help@alum.mit.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1448928326 7205 80.91.229.3 (1 Dec 2015 00:05:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 1 Dec 2015 00:05:26 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Dec 01 01:05:17 2015 Return-path: Envelope-to: geh-help-gnu-emacs@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 1a3YRX-0006Po-2y for geh-help-gnu-emacs@m.gmane.org; Tue, 01 Dec 2015 01:05:15 +0100 Original-Received: from localhost ([::1]:43978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3YRW-0005Lg-Dc for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Nov 2015 19:05:14 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3YRL-0005JZ-7H for help-gnu-emacs@gnu.org; Mon, 30 Nov 2015 19:05:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3YRF-0002FJ-5a for help-gnu-emacs@gnu.org; Mon, 30 Nov 2015 19:05:03 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:34674) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3YRE-0002Ez-VH for help-gnu-emacs@gnu.org; Mon, 30 Nov 2015 19:04:57 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1a3YRC-0005pk-Kp for help-gnu-emacs@gnu.org; Tue, 01 Dec 2015 01:04:54 +0100 Original-Received: from nl106-137-244.student.uu.se ([130.243.137.244]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Dec 2015 01:04:54 +0100 Original-Received: from embe8573 by nl106-137-244.student.uu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 01 Dec 2015 01:04:54 +0100 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: help-gnu-emacs@gnu.org Original-Lines: 58 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: nl106-137-244.student.uu.se Mail-Copies-To: never User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:OjuCzv/j2wvfPtZgw4QrXXLgpEU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:108265 Archived-At: Bostjan Vilfan writes: > Hello, I'm using emacs version 24.5.1 on Windows 10, Mega-gulp! > The simple cases are straightforward enough. > For example, > > (call-process "myprog.exe" nil t nil arguments>) > > will place the output plus error output of > myprog.exe into the current buffer. However, when > I tried to separate the output from the error > output, I ran into problems. According to my reading > of the manual (see above) one should replace > "destination" (1st line of manual text) with > ‘(REAL-DESTINATION ERROR-DESTINATION)’ where > REAL-DESTINATION and ERROR-DESTINATION are one of > the given alternatives; for example: > > (call-process "myprog.exe" nil (t nil) nil > ) Yeah, you need to quote the (t nil) otherwise it is not a list with data but a *form*, i.e. a unary function which named `t' to which you upon invocation send the argument nil! It works with '(t nil) You can try this with this zsh script: #!/bin/zsh echo "This output is so standard, it even goes to stdout." echo "I always do things the opposite way - it is so immature!" >&2 And this Elisp: (call-process "~/chatty-program" ; the program to run nil ; (no INFILE) `(,(get-buffer-create "stdout-buffer") ; create # "~/chatty-errors") ; send errors to this file ) ; evaluate me The backquote (`) creates a list, only it allows for evaluation if something is preceeded by a comma (,). Or, put it like this: (list (get-buffer-create "stdout-buffer") "~/chatty-errors") -- underground experts united http://user.it.uu.se/~embe8573