From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" 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 21:20:34 +0200 Message-ID: <807h69p5rx.fsf@somewhere.org> References: <87pqk1o39w.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Andr=C3=A1s and Eric, Andr=C3=A1s Major wrote: > >> 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 va= lue > 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 maki= ng > clandestine exceptions to the rules in the manual and strongly suggest th= at > the output and value options be honoured for every language. I must admit that I was not aware of this peculiarity for sh blocks. And I guess there must be a reason for not honoring value vs output here. If not, I'd prefer it to exist -- even if Achim showed that both are always possibl= e. > 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. That possibility already exist. It can be done like this: #+begin_src emacs-lisp (add-to-list 'org-babel-default-header-args:sh '((:results . "value"))) #+end_src Best regards, Seb --=20 Sebastien Vauban