emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Juan Reyero <joanmg@gmail.com>
To: Dan Davison <davison@stats.ox.ac.uk>
Cc: emacs-orgmode@gnu.org
Subject: Re: Buffer-wide definitions in org-babel
Date: Fri, 9 Oct 2009 16:53:26 +0200	[thread overview]
Message-ID: <55bd243d0910090753k1050a7dfod762d91c9a386be1@mail.gmail.com> (raw)
In-Reply-To: <87fx9u7z7t.fsf@stats.ox.ac.uk>

Hi Dan,

On Thu, Oct 8, 2009 at 4:11 PM, Dan Davison <davison@stats.ox.ac.uk> wrote:
> Juan Reyero <joanmg@gmail.com> 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	other threads:[~2009-10-09 14:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-07 14:20 Buffer-wide definitions in org-babel Juan Reyero
2009-10-07 18:48 ` Eric Schulte
2009-10-07 19:17   ` Eric Schulte
2009-10-08 11:16     ` Juan Reyero
2009-10-08  9:22   ` Juan Reyero
2009-10-08 14:11     ` Dan Davison
2009-10-09 14:53       ` Juan Reyero [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55bd243d0910090753k1050a7dfod762d91c9a386be1@mail.gmail.com \
    --to=joanmg@gmail.com \
    --cc=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).