From mboxrd@z Thu Jan 1 00:00:00 1970 From: Juan Reyero Subject: Re: Buffer-wide definitions in org-babel Date: Fri, 9 Oct 2009 16:53:26 +0200 Message-ID: <55bd243d0910090753k1050a7dfod762d91c9a386be1@mail.gmail.com> References: <55bd243d0910070720i3085af58xc30cf14011d6375a@mail.gmail.com> <55bd243d0910080222q34a7ac79g26a7f9358d806e62@mail.gmail.com> <87fx9u7z7t.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MwGqb-0001wX-M5 for emacs-orgmode@gnu.org; Fri, 09 Oct 2009 10:53:33 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MwGqX-0001oR-6o for emacs-orgmode@gnu.org; Fri, 09 Oct 2009 10:53:33 -0400 Received: from [199.232.76.173] (port=44080 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MwGqW-0001oI-Tw for emacs-orgmode@gnu.org; Fri, 09 Oct 2009 10:53:28 -0400 Received: from mail-bw0-f220.google.com ([209.85.218.220]:48042) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MwGqW-0001B8-Aa for emacs-orgmode@gnu.org; Fri, 09 Oct 2009 10:53:28 -0400 Received: by bwz20 with SMTP id 20so6723327bwz.42 for ; Fri, 09 Oct 2009 07:53:26 -0700 (PDT) In-Reply-To: <87fx9u7z7t.fsf@stats.ox.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Dan Davison Cc: emacs-orgmode@gnu.org Hi Dan, On Thu, Oct 8, 2009 at 4:11 PM, Dan Davison wrote: > Juan Reyero writes: >> #+begin_src python :session :results output >> =A02 >> #+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 --=20 http://juanreyero.com/blog