From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian Beckman Subject: Bug? Improper interaction with python variable _ ? Date: Sun, 4 Oct 2015 22:12:08 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114043c2126ad10521548e94 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42716) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ziy4I-0002NI-89 for emacs-orgmode@gnu.org; Mon, 05 Oct 2015 01:12:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ziy4G-00044i-Ul for emacs-orgmode@gnu.org; Mon, 05 Oct 2015 01:12:10 -0400 Received: from mail-io0-x22f.google.com ([2607:f8b0:4001:c06::22f]:33749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ziy4G-00044e-OX for emacs-orgmode@gnu.org; Mon, 05 Oct 2015 01:12:08 -0400 Received: by iofh134 with SMTP id h134so174144043iof.0 for ; Sun, 04 Oct 2015 22:12:08 -0700 (PDT) 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: emacs-orgmode@gnu.org --001a114043c2126ad10521548e94 Content-Type: text/plain; charset=UTF-8 Please see the gist below for a self-explaining example copied here for convenience. Emacs 24.5.1 with org-mode 8 something (not sure how to get it to report its exact version)... a very late version, I am sure. Verified with no init.el, that is, with emacs -Q https://gist.github.com/rebcabin/37f800da658f4b23ceaa #+TITLE: Org-Babel Bug? #+AUTHOR: Brian Beckman #+EMAIL: bc.beckman@gmail.com #+BEGIN_SRC emacs-lisp :exports results :results none (setq org-confirm-babel-evaluate nil) (org-babel-map-src-blocks nil (org-babel-remove-result)) #+end_src * Mystery Number 1 The first line of the first block must be blank, or we must =C-c C-c= the block two times. But we want to eval the entire file /via/ =C-c C-v C-b=, and we found that the first line must be empty. If you =C-c C-v C-b= this entire file, the python session buffer, named =*bug-org-babel*=, contains an error message that suggests the variable =_= is implicated in an error. We expect the value of this first block to be 999. Make sure that the python session is clear by typing =quit()=, then evaluate this entire file by =C-c C-v C-b=. #+NAME: probe #+BEGIN_SRC python :session bug-org-babel :exports both :results value 999 #+END_SRC #+RESULTS: probe : 999 * Mystery Number 2 Now, we set the value of the variable =_= to something arbitray. In a real scenario, this variable may be set casually in a loop or some other context. The variable =_= is often recommended for /ad-hoc/ use, as in "don't care." #+NAME: second-probe #+BEGIN_SRC python :session bug-org-babel :exports both :results value _ = 42 _ #+END_SRC #+RESULTS: second-probe : 42 But now, all blocks with =:results value= return the value of =_=. We broke org-babel! #+NAME: third-probe #+BEGIN_SRC python :session bug-org-babel :exports both :results value 999 #+END_SRC #+RESULTS: third-probe : 42 --001a114043c2126ad10521548e94 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Please see the gist below for a self-explaining example
c= opied here for convenience.=C2=A0 Emacs 24.5.1 with org-mode
8 somethi= ng (not sure how to get it to report its exact
version)... a very late= version, I am sure.=C2=A0 Verified with
no init.el, that is, with ema= cs -Q

https://gist.github.com/rebcabin/37f800da658f4b23ceaa

#+TITLE: Org-Babel Bug? #+AUTHOR: Brian Beckman #+EMAIL: bc.beckman@gmail.com #+BEGIN_SRC emacs-lisp :exports results :results none (setq org-confirm-babel-evaluate nil) (org-babel-map-src-blocks nil (org-babel-remove-result)) #+end_src * Mystery Number 1 The first line of the first block must be blank, or we must =3DC-c C-c=3D t= he block two times. But we want to eval the entire file /via/ =3DC-c C-v C-b=3D, and= we found that the first line must be empty. If you =3DC-c C-v C-b=3D this entire file, the python session buffer, named =3D*bug-org-babel*=3D, contains an error message that suggests the variable= =3D_=3D is implicated in an error. We expect the value of this first block to be 999. Make sure that the pyth= on session is clear by typing =3Dquit()=3D, then evaluate this entire file by =3DC-c C-v C-b=3D. #+NAME: probe #+BEGIN_SRC python :session bug-org-babel :exports both :results value 999 #+END_SRC #+RESULTS: probe : 999 * Mystery Number 2 Now, we set the value of the variable =3D_=3D to something arbitray. In a r= eal scenario, this variable may be set casually in a loop or some other context= . The variable =3D_=3D is often recommended for /ad-hoc/ use, as in "don'= ;t care." #+NAME: second-probe #+BEGIN_SRC python :session bug-org-babel :exports both :results value _ =3D 42 _ #+END_SRC #+RESULTS: second-probe : 42 But now, all blocks with =3D:results value=3D return the value of =3D_=3D. = We broke org-babel! =20 #+NAME: third-probe #+BEGIN_SRC python :session bug-org-babel :exports both :results value 999 #+END_SRC #+RESULTS: third-probe : 42
--001a114043c2126ad10521548e94--