Re: [O] python sessions

2013-03-30 Thread Andreas Röhler
Am 27.03.2013 07:19, schrieb Andreas Röhler: Am 26.03.2013 22:41, schrieb Gary Oberbrunner: I did some further testing. With my patch, my real org-mode python file is now actually working. There were a few gotchas I didn't understand about session mode and python and matplotlib: 1. In session

Re: [O] python sessions

2013-03-26 Thread Andreas Röhler
Am 26.03.2013 22:41, schrieb Gary Oberbrunner: I did some further testing. With my patch, my real org-mode python file is now actually working. There were a few gotchas I didn't understand about session mode and python and matplotlib: 1. In session mode, you are essentially running an interact

Re: [O] python sessions

2013-03-26 Thread John Hendy
On Tue, Mar 26, 2013 at 4:41 PM, Gary Oberbrunner wrote: > I did some further testing. With my patch, my real org-mode python file is > now actually working. There were a few gotchas I didn't understand about > session mode and python and matplotlib: > > 1. In session mode, you are essentially r

Re: [O] python sessions

2013-03-26 Thread Gary Oberbrunner
I did some further testing. With my patch, my real org-mode python file is now actually working. There were a few gotchas I didn't understand about session mode and python and matplotlib: 1. In session mode, you are essentially running an interactive python. (This is made explicit by my patch,

Re: [O] python sessions

2013-03-26 Thread Eric Schulte
Andreas Röhler writes: > Am 25.03.2013 22:37, schrieb Eric Schulte: >>> running into this, func def seems missing: >>> >>> Debugger entered--Lisp error: (void-function org-babel-result-cond) >> >> My guess is that you have a mixed install. You are mostly running the >> Org-mode which ships with

Re: [O] python sessions

2013-03-25 Thread Andreas Röhler
Am 25.03.2013 22:37, schrieb Eric Schulte: running into this, func def seems missing: Debugger entered--Lisp error: (void-function org-babel-result-cond) My guess is that you have a mixed install. You are mostly running the Org-mode which ships with Emacs (in which `org-babel-result-cond' is

Re: [O] python sessions

2013-03-25 Thread Eric Schulte
> running into this, func def seems missing: > > Debugger entered--Lisp error: (void-function org-babel-result-cond) My guess is that you have a mixed install. You are mostly running the Org-mode which ships with Emacs (in which `org-babel-result-cond' is not defined), but you are running the ver

Re: [O] python sessions

2013-03-25 Thread Andreas Röhler
Am 24.03.2013 19:41, schrieb Nick Dokos: running into this, func def seems missing: Debugger entered--Lisp error: (void-function org-babel-result-cond) (org-babel-result-cond result-params results (org-babel-python-table-or-string results)) (if (string= (substring org-babel-python-eoe

Re: [O] python sessions

2013-03-25 Thread Ivan Andrus
On Mar 25, 2013, at 11:27 AM, Andreas Röhler wrote: > Am 25.03.2013 17:43, schrieb Eric Schulte: >> John Hendy writes: >> >>> On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn wrote: On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte wrote: > John Hendy writes: > >> On Sun, Mar

Re: [O] python sessions

2013-03-25 Thread Ista Zahn
On Mon, Mar 25, 2013 at 1:41 PM, John Hendy wrote: > On Mon, Mar 25, 2013 at 12:27 PM, Andreas Röhler > wrote: >> Am 25.03.2013 17:43, schrieb Eric Schulte: >> >>> John Hendy writes: >>> On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn wrote: > > On Mon, Mar 25, 2013 at 11:40 AM, Eric S

Re: [O] python sessions

2013-03-25 Thread John Hendy
On Mon, Mar 25, 2013 at 12:27 PM, Andreas Röhler wrote: > Am 25.03.2013 17:43, schrieb Eric Schulte: > >> John Hendy writes: >> >>> On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn wrote: On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte wrote: > > John Hendy writes: > >

Re: [O] python sessions

2013-03-25 Thread Andreas Röhler
Am 25.03.2013 17:43, schrieb Eric Schulte: John Hendy writes: On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn wrote: On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte wrote: John Hendy writes: On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos wrote: Eric Schulte wrote: From participating in e

Re: [O] python sessions

2013-03-25 Thread Eric Schulte
John Hendy writes: > On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn wrote: >> On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte >> wrote: >>> John Hendy writes: >>> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos wrote: > Eric Schulte wrote: > >> > >> > From participating in eval

Re: [O] python sessions

2013-03-25 Thread Nick Dokos
Eric Schulte wrote: > >> > >> Currently I'd say session support for python is completely broken. > > > > Have *any* changes been made related to python recently? See my > > mailing list post with reproducible example: > > - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68238.html > > > > T

Re: [O] python sessions

2013-03-25 Thread John Hendy
On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn wrote: > On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte wrote: >> John Hendy writes: >> >>> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos wrote: Eric Schulte wrote: > > > > From participating in evaluating code throughout the discussi

Re: [O] python sessions

2013-03-25 Thread Eric Schulte
>> >> Currently I'd say session support for python is completely broken. > > Have *any* changes been made related to python recently? See my > mailing list post with reproducible example: > - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68238.html > > This was definitely working for me with

Re: [O] python sessions

2013-03-25 Thread Ista Zahn
On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte wrote: > John Hendy writes: > >> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos wrote: >>> Eric Schulte wrote: >>> > > From participating in evaluating code throughout the discussion and > catching the comments throughout, I'd say yes,

Re: [O] python sessions

2013-03-25 Thread John Hendy
On Mon, Mar 25, 2013 at 10:40 AM, Eric Schulte wrote: > John Hendy writes: > >> On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos wrote: >>> Eric Schulte wrote: >>> > > From participating in evaluating code throughout the discussion and > catching the comments throughout, I'd say yes,

Re: [O] python sessions

2013-03-25 Thread Eric Schulte
John Hendy writes: > On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos wrote: >> Eric Schulte wrote: >> >>> > >>> > From participating in evaluating code throughout the discussion and >>> > catching the comments throughout, I'd say yes, at least in terms of >>> > how other babel languages function. I

Re: [O] python sessions

2013-03-24 Thread Andreas Röhler
Am 25.03.2013 03:59, schrieb John Hendy: On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos wrote: Eric Schulte wrote: From participating in evaluating code throughout the discussion and catching the comments throughout, I'd say yes, at least in terms of how other babel languages function. In oth

Re: [O] python sessions

2013-03-24 Thread John Hendy
On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos wrote: > Eric Schulte wrote: > >> > >> > From participating in evaluating code throughout the discussion and >> > catching the comments throughout, I'd say yes, at least in terms of >> > how other babel languages function. In other words =#+begin_src R

Re: [O] python sessions

2013-03-24 Thread Nick Dokos
Eric Schulte wrote: > > > > From participating in evaluating code throughout the discussion and > > catching the comments throughout, I'd say yes, at least in terms of > > how other babel languages function. In other words =#+begin_src R > > :session foo= creates an R session named "foo" whereas

Re: [O] python sessions

2013-03-24 Thread Eric Schulte
> > From participating in evaluating code throughout the discussion and > catching the comments throughout, I'd say yes, at least in terms of > how other babel languages function. In other words =#+begin_src R > :session foo= creates an R session named "foo" whereas doing the same > with =python= i

Re: [O] python sessions

2013-03-24 Thread Nick Dokos
> > > > Whether that's my setup or bugs in ob-python.el, I have no idea at this > > point: I haven't had time to investigate. > > What OS are you using? I have org setup on my dual boot system with > Win7 and just haven't tried on Windows yet. > GNU Emacs 24.3.50.2 (x86_64-unknown-linux-gnu, GTK

Re: [O] python sessions

2013-03-24 Thread John Hendy
On Sun, Mar 24, 2013 at 11:58 AM, Nick Dokos wrote: > John Hendy wrote: > >> ... >> - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68267.html >> >> That only speaks to =:session name= argument <=> resultant python buffer >> names. >> >> As Andreas pointed out, however, there *are* indivi

Re: [O] python sessions

2013-03-24 Thread Nick Dokos
John Hendy wrote: > ... > - http://www.mail-archive.com/emacs-orgmode@gnu.org/msg68267.html > > That only speaks to =:session name= argument <=> resultant python buffer > names. > > As Andreas pointed out, however, there *are* individuals having issues > with the actual code execution, and per

Re: [O] python sessions

2013-03-24 Thread Andreas Röhler
Am 24.03.2013 15:47, schrieb John Hendy: On Sun, Mar 24, 2013 at 2:47 AM, Andreas Röhler wrote: Am 23.03.2013 23:07, schrieb Eric Schulte: Andreas Röhler writes: Am 21.03.2013 08:43, schrieb Bastien: Hi Andreas, Andreas Röhler writes: Nonetheless, still thinking let-var session in

Re: [O] python sessions

2013-03-24 Thread John Hendy
On Sun, Mar 24, 2013 at 2:47 AM, Andreas Röhler wrote: > Am 23.03.2013 23:07, schrieb Eric Schulte: >> >> Andreas Röhler writes: >> >>> Am 21.03.2013 08:43, schrieb Bastien: Hi Andreas, Andreas Röhler writes: > Nonetheless, still thinking > > let-var session

Re: [O] python sessions

2013-03-24 Thread Andreas Röhler
Am 23.03.2013 23:07, schrieb Eric Schulte: Andreas Röhler writes: Am 21.03.2013 08:43, schrieb Bastien: Hi Andreas, Andreas Röhler writes: Nonetheless, still thinking let-var session in org-babel-execute:python needs the fix. I've not been following this thread, can you send a patch

Re: [O] python sessions

2013-03-23 Thread John Hendy
On Sat, Mar 23, 2013 at 5:07 PM, Eric Schulte wrote: > Andreas Röhler writes: > >> Am 21.03.2013 08:43, schrieb Bastien: >>> Hi Andreas, >>> >>> Andreas Röhler writes: >>> Nonetheless, still thinking let-var session in org-babel-execute:python needs the fix. >>

Re: [O] python sessions

2013-03-23 Thread Eric Schulte
Andreas Röhler writes: > Am 21.03.2013 08:43, schrieb Bastien: >> Hi Andreas, >> >> Andreas Röhler writes: >> >>> Nonetheless, still thinking >>> >>> let-var session in >>> >>> org-babel-execute:python >>> >>> needs the fix. >> >> I've not been following this thread, can you send a patch with >>

Re: [O] python sessions

2013-03-21 Thread Andreas Röhler
Am 21.03.2013 08:43, schrieb Bastien: Hi Andreas, Andreas Röhler writes: Nonetheless, still thinking let-var session in org-babel-execute:python needs the fix. I've not been following this thread, can you send a patch with the fix and the reason for it? Thanks in advance! Hi Bastien,

Re: [O] python sessions

2013-03-21 Thread Bastien
Hi Andreas, Andreas Röhler writes: > Nonetheless, still thinking > > let-var session in > > org-babel-execute:python > > needs the fix. I've not been following this thread, can you send a patch with the fix and the reason for it? Thanks in advance! -- Bastien

Re: [O] python sessions

2013-03-21 Thread Andreas Röhler
Am 21.03.2013 02:56, schrieb Gary Oberbrunner: Hi Gary, great if you can make it work for you. Nonetheless, still thinking let-var session in org-babel-execute:python needs the fix. Best, Andreas

Re: [O] python sessions

2013-03-20 Thread Gary Oberbrunner
Both of the issues in my patch were part of it. The buffer naming and using "python -i" in session mode. And I'm still not sure default (nameless) sessions are working, and also in my real testcase it still hangs sometimes. So no, not everything is fine yet. On Wed, Mar 20, 2013 at 9:54 PM, Jo

Re: [O] python sessions

2013-03-20 Thread John Hendy
On Wed, Mar 20, 2013 at 8:22 PM, Gary Oberbrunner wrote: > I've attached a patch which works for me, at least in simple tests. It > should set the buffer name more correctly in session mode. I also added a > new defcustom for the python command to use for session mode specifically; > that is req

Re: [O] python sessions

2013-03-20 Thread Gary Oberbrunner
I've attached a patch which works for me, at least in simple tests. It should set the buffer name more correctly in session mode. I also added a new defcustom for the python command to use for session mode specifically; that is required for Windows, and I don't think it hurts on other OSes. On

Re: [O] python sessions

2013-03-20 Thread Ista Zahn
On Wed, Mar 20, 2013 at 4:25 PM, Gary Oberbrunner wrote: > Ista, what OS are you on? Maybe this (or part of it anyway) is only a > Windows problem? Maybe -- I'm on Arch Linux. > > > On Wed, Mar 20, 2013 at 4:12 PM, Ista Zahn wrote: >> >> On Wed, Mar 20, 2013 at 3:53 PM, Andreas Röhler >> wrot

Re: [O] python sessions

2013-03-20 Thread Gary Oberbrunner
Ista, what OS are you on? Maybe this (or part of it anyway) is only a Windows problem? On Wed, Mar 20, 2013 at 4:12 PM, Ista Zahn wrote: > On Wed, Mar 20, 2013 at 3:53 PM, Andreas Röhler > wrote: > > Am 20.03.2013 20:42, schrieb Ista Zahn: > > > >> On Wed, Mar 20, 2013 at 2:43 PM, Andreas Röh

Re: [O] python sessions

2013-03-20 Thread Ista Zahn
On Wed, Mar 20, 2013 at 3:53 PM, Andreas Röhler wrote: > Am 20.03.2013 20:42, schrieb Ista Zahn: > >> On Wed, Mar 20, 2013 at 2:43 PM, Andreas Röhler >> wrote: >>> >>> I guess it depends on the definition of "works". I don't get python buffers with the name of the :session variable. >>>

Re: [O] python sessions

2013-03-20 Thread Andreas Röhler
Am 20.03.2013 20:42, schrieb Ista Zahn: On Wed, Mar 20, 2013 at 2:43 PM, Andreas Röhler wrote: I guess it depends on the definition of "works". I don't get python buffers with the name of the :session variable. Reads as it works only with named sessions, but fails with unnamed It fails t

Re: [O] python sessions

2013-03-20 Thread Ista Zahn
On Wed, Mar 20, 2013 at 2:43 PM, Andreas Röhler wrote: > >> I guess it depends on the definition of "works". I don't get python >> buffers with the name of the :session variable. > > > Reads as it works only with named sessions, but fails with unnamed It fails to name the python process buffers.

Re: [O] python sessions

2013-03-20 Thread Andreas Röhler
Am 20.03.2013 18:25, schrieb Nick Dokos: Andreas Röhler wrote: Seems `org-babel-execute':python doesn't get the session flag. Edebug: org-babel-execute:python org-babel-execute:python executing Python code block... [4 times] Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no") (:pa

Re: [O] python sessions

2013-03-20 Thread Andreas Röhler
Am 20.03.2013 19:15, schrieb Nick Dokos: John Hendy wrote: On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos wrote: Andreas Röhler wrote: Seems `org-babel-execute':python doesn't get the session flag. Edebug: org-babel-execute:python org-babel-execute:python executing Python code block... [

Re: [O] python sessions

2013-03-20 Thread Andreas Röhler
I guess it depends on the definition of "works". I don't get python buffers with the name of the :session variable. Reads as it works only with named sessions, but fails with unnamed But I do get separate python buffers (.e.g., *Python*, *Python*<2>) for each session, and python blocks get

Re: [O] python sessions

2013-03-20 Thread Nick Dokos
Ista Zahn wrote: > > Yes, I think it's ob-python's problem: but as I said before, I don't > > understand why it works for you (and Ista Zahn). > > I guess it depends on the definition of "works". I don't get python > buffers with the name of the :session variable. But I do get separate > python

Re: [O] python sessions

2013-03-20 Thread Ista Zahn
On Wed, Mar 20, 2013 at 2:15 PM, Nick Dokos wrote: > John Hendy wrote: > >> On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos wrote: >> > Andreas Röhler wrote: >> > >> >> Seems `org-babel-execute':python doesn't get the session flag. >> >> >> >> Edebug: org-babel-execute:python >> >> org-babel-execu

Re: [O] python sessions

2013-03-20 Thread Nick Dokos
John Hendy wrote: > On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos wrote: > > Andreas Röhler wrote: > > > >> Seems `org-babel-execute':python doesn't get the session flag. > >> > >> Edebug: org-babel-execute:python > >> org-babel-execute:python > >> executing Python code block... > >> [4 times]

Re: [O] python sessions

2013-03-20 Thread John Hendy
On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos wrote: > Andreas Röhler wrote: > >> Seems `org-babel-execute':python doesn't get the session flag. >> >> Edebug: org-babel-execute:python >> org-babel-execute:python >> executing Python code block... >> [4 times] >> Result: ((:comments . #1="") (:sheb

Re: [O] python sessions

2013-03-20 Thread Nick Dokos
Andreas Röhler wrote: > Seems `org-babel-execute':python doesn't get the session flag. > > Edebug: org-babel-execute:python > org-babel-execute:python > executing Python code block... > [4 times] > Result: ((:comments . #1="") (:shebang . #1#) (:cache . "no") > (:padline . #1#) (:noweb . "no")

Re: [O] python sessions

2013-03-20 Thread Andreas Röhler
[ ... ] AFAIU :session is broken, because Python shell as opened by run-python or py-shell isn't used by ob-babel. Seems ob-babel sends it's code w/ an own shell command, thus opening a new python shell internally every time. Did :session ever work? Then I might be wrong with this comment. Not

Re: [O] python sessions

2013-03-20 Thread Andreas Röhler
Am 20.03.2013 17:06, schrieb Nick Dokos: John Hendy wrote: - M-x org-version Org-mode version 8.0-pre (release_8.0-pre-146-g73fe0a @ /home/jwhendy/.elisp/org.git/lisp/) That's pretty close to what I'm using. Can you do me a favor: start emacs -Q and evaluate the variable org-babel-python-

Re: [O] python sessions

2013-03-20 Thread Nick Dokos
John Hendy wrote: > > - M-x org-version > Org-mode version 8.0-pre (release_8.0-pre-146-g73fe0a @ > /home/jwhendy/.elisp/org.git/lisp/) > > That's pretty close to what I'm using. Can you do me a favor: start emacs -Q and evaluate the variable org-babel-python-buffers before and after executin

Re: [O] python sessions

2013-03-20 Thread John Hendy
On Wed, Mar 20, 2013 at 10:38 AM, John Hendy wrote: > I've tried to eliminate this and retried today > with the following process (note setting the python command to > "python2"): > > - Start emacs with `emacs -q` > Just caught this... I used -q accidentally instead of -Q. Re-did with -Q and g

Re: [O] python sessions

2013-03-20 Thread John Hendy
On Wed, Mar 20, 2013 at 2:08 AM, Andreas Röhler wrote: > Am 20.03.2013 01:04, schrieb John Hendy: > >> On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner >> wrote: >>> >>> I must be failing to understand something. I'm running Emacs 24.3 on >>> Windows, with latest trunk org-mode. I can't get py

Re: [O] python sessions

2013-03-20 Thread Gary Oberbrunner
I am using a snapshot build of Emacs: emacs-trunk-r112044-20130314-w32-i386.zip, which says it is GNU Emacs 24.3.50.1 (i386-mingw-nt6.1.7601) of 2013-03-14 on VBOX on Windows 7/64. My python-mode comes from the python.el shipped with the above emacs, which says it is Version: 0.24.2. Org-mode is

Re: [O] python sessions

2013-03-20 Thread Nick Dokos
Ista Zahn wrote: > > > > Did :session ever work? Then I might be wrong with this comment. > > Not only did it work, it currently works for me. I seem to remember > bad interaction with python modes other than the one shipped with > emacs. In my .emacs I have > > ... > > All the python-mode and

Re: [O] python sessions

2013-03-20 Thread Ista Zahn
On Wed, Mar 20, 2013 at 2:44 AM, Andreas Röhler wrote: > Am 20.03.2013 04:07, schrieb Nick Dokos: > >> John Hendy wrote: >> >>> On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner >>> wrote: I must be failing to understand something. I'm running Emacs 24.3 on Windows, with latest t

Re: [O] python sessions

2013-03-20 Thread Andreas Röhler
Am 20.03.2013 01:04, schrieb John Hendy: On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner wrote: I must be failing to understand something. I'm running Emacs 24.3 on Windows, with latest trunk org-mode. I can't get python functions to persist across blocks in session mode. Here's my foo.org

Re: [O] python sessions

2013-03-19 Thread Andreas Röhler
Am 20.03.2013 04:07, schrieb Nick Dokos: John Hendy wrote: On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner wrote: I must be failing to understand something. I'm running Emacs 24.3 on Windows, with latest trunk org-mode. I can't get python functions to persist across blocks in session mod

Re: [O] python sessions

2013-03-19 Thread Nick Dokos
John Hendy wrote: > On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner > wrote: > > I must be failing to understand something. I'm running Emacs 24.3 on > > Windows, with latest trunk org-mode. I can't get python functions to > > persist across blocks in session mode. Here's my foo.org: > > >

Re: [O] python sessions

2013-03-19 Thread John Hendy
On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner wrote: > I must be failing to understand something. I'm running Emacs 24.3 on > Windows, with latest trunk org-mode. I can't get python functions to > persist across blocks in session mode. Here's my foo.org: > > === > > * My Documen

[O] python sessions

2013-03-19 Thread Gary Oberbrunner
I must be failing to understand something. I'm running Emacs 24.3 on Windows, with latest trunk org-mode. I can't get python functions to persist across blocks in session mode. Here's my foo.org: === * My Document #+BEGIN_SRC python :exports results :results output :session def foo