emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Buffer-wide definitions in org-babel


From: Juan Reyero
Subject: Re: [Orgmode] Buffer-wide definitions in org-babel
Date: Fri, 9 Oct 2009 16:53:26 +0200

Hi Dan,

On Thu, Oct 8, 2009 at 4:11 PM, Dan Davison <address@hidden> wrote:
> Juan Reyero <address@hidden> writes:
>> #+begin_src python :session :results output
>>  2
>> #+end_src
>>
>> #+resname:
>> : 2
>> : 2
>>
>> (expected nothing, which is what I get if I remove the :session).
>
> An understandable expectation. In non-session mode, we collect stdout
> and if the expression "2" is passed to the interpreter nothing is output
> to stdout. However in session mode we collect whatever output appears in
> the comint buffer, and if you give the interpreter "2" the interpreter
> comes back and prints the value of that expression.

Ah, got it.  Thanks a lot.  It's kind of tricky to know what you are
going to get, however.  For example:

#+begin_src python :session :results output
str('10' + 'm/s')
'12'
#+end_src

#+resname:
: 10' + 'm/s')
: '10m/s
: 12'
: '12

I guess the answer to that would be to only use :results value when in
:session mode.

> ... However I can't replicate this
> behaviour under linux. I get
>
> #+resname:
> : 2
>
> for all three examples.
>
> I'm using org-version 6.31trans in emacs-version 23.0.91.1 under ubuntu
> jaunty with python 2.6.2. Is this definitely replicable under OSX?

Yes, definitely.  I am using emacs version 22.3.1, and python 2.6.1.
I have stripped bare my .emacs, and still:

#+begin_src python :session :results value
 2
#+end_src

#+resname:
: 0

jm
-- 
http://juanreyero.com/blog




reply via email to

[Prev in Thread] Current Thread [Next in Thread]