From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: [BUG][babel] ":result output table" doesn't work for python code blocks Date: Wed, 20 Apr 2011 21:28:29 +0100 Message-ID: <87aafksm4y.fsf@ucl.ac.uk> References: <87k4ew2vfu.fsf@are.berkeley.edu> <87oc485jy3.fsf@gmail.com> <87hb9zyf79.fsf@ucl.ac.uk> <877hava3d8.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDOZ8-0000iG-OW for emacs-orgmode@gnu.org; Fri, 22 Apr 2011 18:11:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QDOZ7-0005ls-8r for emacs-orgmode@gnu.org; Fri, 22 Apr 2011 18:11:06 -0400 Received: from vscane-b.ucl.ac.uk ([144.82.108.141]:65422) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QDOZ7-0005l6-1H for emacs-orgmode@gnu.org; Fri, 22 Apr 2011 18:11:05 -0400 In-Reply-To: <877hava3d8.fsf@gmail.com> (Eric Schulte's message of "Fri, 15 Apr 2011 10:13:40 -0600") 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: Eric Schulte Cc: emacs-orgmode@gnu.org "Eric Schulte" writes: > Eric S Fraga writes: > >> "Eric Schulte" writes: >> >> [...] >> >>> That said, I agree that in examples like yours above the returned value >>> should be a table given that the ":results table" is explicitly stated. >>> I've just pushed up a patch after which the following is possible. >> >> Eric, >> >> It would appear that this change you've made is only for python)? Is >> there any chance of having the same for octave, please? But only if it >> is easy to do as =:results output raw= with carefully formatted output >> does the job for me for the moment! >> > > Hi Eric, > > I do not have a local copy of octave, so I'm less confident making > changes to that file, but the attached patch attempts to make the same > changes in ob-octave which were made in ob-python. > > Could you please test this patch for both external and session based > evaluation and let me know if it works (I'm more hopeful that the > external evaluation will work as expected than the session > evaluation). Eric, thanks for this. I haven't tried the session based evaluation but the external one, unfortunately, doesn't work as I would expect. In the following, I would expect both source code blocks to give me the same output with the first, value based, being the correct output. --8<---------------cut here---------------start------------->8--- #+srcname: valueresult #+begin_src octave :results value table :cache yes values = []; for i=1:15 values(end+1,:) = [i, i^3]; endfor ans = values #+end_src #+results[7a87a711b7814ecf23ec5d3741a5fec3ffff3e44]: valueresult | 1 | 1 | | 2 | 8 | | 3 | 27 | | 4 | 64 | | 5 | 125 | | 6 | 216 | | 7 | 343 | | 8 | 512 | | 9 | 729 | | 10 | 1000 | | 11 | 1331 | | 12 | 1728 | | 13 | 2197 | | 14 | 2744 | | 15 | 3375 | #+srcname: outputresult #+begin_src octave :results output table :cache yes values = []; for i=1:15 values(end+1,:) = [i, i^3]; endfor disp(values) #+end_src #+results[3104573dcf8ec30de1a26aae7051a9e8fce6a92a]: outputresult | 1 1 | | 2 8 | | 3 27 | | 4 64 | | 5 125 | | 6 216 | | 7 343 | | 8 512 | | 9 729 | | 10 1000 | | 11 1331 | | 12 1728 | | 13 2197 | | 14 2744 | | 15 3375 | --8<---------------cut here---------------end--------------->8--- Thanks, eric -- : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1 : using Org-mode version 7.5 (release_7.5.183.g1997.dirty)