From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?b?QW5kcsOhcw==?= Major Subject: Re: Bug: babel: results switch (output vs. value) has no or wrong effect for sh source block [7.7 (release_7.7.107.g7a82)] Date: Fri, 19 Aug 2011 18:52:48 +0000 (UTC) Message-ID: References: <87pqk1o39w.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:37307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuUBh-00005r-B6 for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 14:53:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QuUBf-0000sy-Ub for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 14:53:01 -0400 Received: from lo.gmane.org ([80.91.229.12]:35233) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QuUBf-0000sl-MM for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 14:52:59 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QuUBe-0005nn-S5 for emacs-orgmode@gnu.org; Fri, 19 Aug 2011 20:52:58 +0200 Received: from dslb-092-074-177-167.pools.arcor-ip.net ([92.74.177.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 19 Aug 2011 20:52:58 +0200 Received: from andras.g.major by dslb-092-074-177-167.pools.arcor-ip.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 19 Aug 2011 20:52:58 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi Eric, > If we did return the value of shell scripts then ":results value" would > almost always simply return 0 (or possibly an error message). For this > reason shell code blocks do not implement value returns, but rather will > always collect results from STDOUT. I think that this unnecessarily throws away potentially useful functionality. Example: I want to fill a table with data such that the value of a cell depends on whether a file (whose path is specified by another cell, for instance) exists or not. This would be most easily done using an sh block which returns a numeric exit code. I don't see a reason for making clandestine exceptions to the rules in the manual and strongly suggest that the output and value options be honoured for every language. In order not to break existing Org files, I would suggest that the default choice between value and output (when not explicitly specified) depend on the language. With this functionality, sh code blocks that don't specify ":results output" will still work as they did before. AndrĂ¡s