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

Re: [O] python sessions

2013-03-27 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

Re: [O] python sessions

2013-03-26 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-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 John Hendy
On Tue, Mar 26, 2013 at 4:41 PM, Gary Oberbrunner ga...@oberbrunner.com 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

Re: [O] python sessions

2013-03-25 Thread Andreas Röhler
Am 25.03.2013 03:59, schrieb John Hendy: On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos nicholas.do...@hp.com wrote: Eric Schulte schulte.e...@gmail.com wrote: From participating in evaluating code throughout the discussion and catching the comments throughout, I'd say yes, at least in terms

Re: [O] python sessions

2013-03-25 Thread Eric Schulte
John Hendy jw.he...@gmail.com writes: On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos nicholas.do...@hp.com wrote: Eric Schulte schulte.e...@gmail.com wrote: From participating in evaluating code throughout the discussion and catching the comments throughout, I'd say yes, at least in terms

Re: [O] python sessions

2013-03-25 Thread John Hendy
On Mon, Mar 25, 2013 at 10:40 AM, Eric Schulte schulte.e...@gmail.com wrote: John Hendy jw.he...@gmail.com writes: On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos nicholas.do...@hp.com wrote: Eric Schulte schulte.e...@gmail.com wrote: From participating in evaluating code throughout the

Re: [O] python sessions

2013-03-25 Thread Ista Zahn
On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte schulte.e...@gmail.com wrote: John Hendy jw.he...@gmail.com writes: On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos nicholas.do...@hp.com wrote: Eric Schulte schulte.e...@gmail.com wrote: From participating in evaluating code throughout the

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 a

Re: [O] python sessions

2013-03-25 Thread John Hendy
On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn istaz...@gmail.com wrote: On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte schulte.e...@gmail.com wrote: John Hendy jw.he...@gmail.com writes: On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos nicholas.do...@hp.com wrote: Eric Schulte schulte.e...@gmail.com

Re: [O] python sessions

2013-03-25 Thread Nick Dokos
Eric Schulte schulte.e...@gmail.com 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

Re: [O] python sessions

2013-03-25 Thread Eric Schulte
John Hendy jw.he...@gmail.com writes: On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn istaz...@gmail.com wrote: On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte schulte.e...@gmail.com wrote: John Hendy jw.he...@gmail.com writes: On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos nicholas.do...@hp.com

Re: [O] python sessions

2013-03-25 Thread Andreas Röhler
Am 25.03.2013 17:43, schrieb Eric Schulte: John Hendy jw.he...@gmail.com writes: On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn istaz...@gmail.com wrote: On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte schulte.e...@gmail.com wrote: John Hendy jw.he...@gmail.com writes: On Sun, Mar 24, 2013 at

Re: [O] python sessions

2013-03-25 Thread John Hendy
On Mon, Mar 25, 2013 at 12:27 PM, Andreas Röhler andreas.roeh...@easy-emacs.de wrote: Am 25.03.2013 17:43, schrieb Eric Schulte: John Hendy jw.he...@gmail.com writes: On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn istaz...@gmail.com wrote: On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte

Re: [O] python sessions

2013-03-25 Thread Ista Zahn
On Mon, Mar 25, 2013 at 1:41 PM, John Hendy jw.he...@gmail.com wrote: On Mon, Mar 25, 2013 at 12:27 PM, Andreas Röhler andreas.roeh...@easy-emacs.de wrote: Am 25.03.2013 17:43, schrieb Eric Schulte: John Hendy jw.he...@gmail.com writes: On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn

Re: [O] python sessions

2013-03-25 Thread Ivan Andrus
On Mar 25, 2013, at 11:27 AM, Andreas Röhler andreas.roeh...@easy-emacs.de wrote: Am 25.03.2013 17:43, schrieb Eric Schulte: John Hendy jw.he...@gmail.com writes: On Mon, Mar 25, 2013 at 11:01 AM, Ista Zahn istaz...@gmail.com wrote: On Mon, Mar 25, 2013 at 11:40 AM, Eric Schulte

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

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

Re: [O] python sessions

2013-03-24 Thread Andreas Röhler
Am 23.03.2013 23:07, schrieb Eric Schulte: Andreas Röhler andreas.roeh...@easy-emacs.de writes: Am 21.03.2013 08:43, schrieb Bastien: Hi Andreas, Andreas Röhler andreas.roeh...@easy-emacs.de writes: Nonetheless, still thinking let-var session in org-babel-execute:python needs the fix.

Re: [O] python sessions

2013-03-24 Thread John Hendy
On Sun, Mar 24, 2013 at 2:47 AM, Andreas Röhler andreas.roeh...@easy-emacs.de wrote: Am 23.03.2013 23:07, schrieb Eric Schulte: Andreas Röhler andreas.roeh...@easy-emacs.de writes: Am 21.03.2013 08:43, schrieb Bastien: Hi Andreas, Andreas Röhler andreas.roeh...@easy-emacs.de writes:

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 andreas.roeh...@easy-emacs.de wrote: Am 23.03.2013 23:07, schrieb Eric Schulte: Andreas Röhler andreas.roeh...@easy-emacs.de writes: Am 21.03.2013 08:43, schrieb Bastien: Hi Andreas, Andreas Röhler

Re: [O] python sessions

2013-03-24 Thread Nick Dokos
John Hendy jw.he...@gmail.com 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

Re: [O] python sessions

2013-03-24 Thread John Hendy
On Sun, Mar 24, 2013 at 11:58 AM, Nick Dokos nicholas.do...@hp.com wrote: John Hendy jw.he...@gmail.com 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,

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+ Version

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= instead

Re: [O] python sessions

2013-03-24 Thread Nick Dokos
Eric Schulte schulte.e...@gmail.com 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

Re: [O] python sessions

2013-03-24 Thread John Hendy
On Sun, Mar 24, 2013 at 9:38 PM, Nick Dokos nicholas.do...@hp.com wrote: Eric Schulte schulte.e...@gmail.com 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.

Re: [O] python sessions

2013-03-23 Thread Eric Schulte
Andreas Röhler andreas.roeh...@easy-emacs.de writes: Am 21.03.2013 08:43, schrieb Bastien: Hi Andreas, Andreas Röhler andreas.roeh...@easy-emacs.de writes: Nonetheless, still thinking let-var session in org-babel-execute:python needs the fix. I've not been following this thread, can

Re: [O] python sessions

2013-03-23 Thread John Hendy
On Sat, Mar 23, 2013 at 5:07 PM, Eric Schulte schulte.e...@gmail.com wrote: Andreas Röhler andreas.roeh...@easy-emacs.de writes: Am 21.03.2013 08:43, schrieb Bastien: Hi Andreas, Andreas Röhler andreas.roeh...@easy-emacs.de writes: Nonetheless, still thinking let-var session in

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-21 Thread Bastien
Hi Andreas, Andreas Röhler andreas.roeh...@easy-emacs.de 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 08:43, schrieb Bastien: Hi Andreas, Andreas Röhler andreas.roeh...@easy-emacs.de 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?

Re: [O] python sessions

2013-03-20 Thread Andreas Röhler
Am 20.03.2013 04:07, schrieb Nick Dokos: John Hendy jw.he...@gmail.com wrote: On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner ga...@oberbrunner.com 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

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 ga...@oberbrunner.com 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

Re: [O] python sessions

2013-03-20 Thread Ista Zahn
On Wed, Mar 20, 2013 at 2:44 AM, Andreas Röhler andreas.roeh...@easy-emacs.de wrote: Am 20.03.2013 04:07, schrieb Nick Dokos: John Hendy jw.he...@gmail.com wrote: On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner ga...@oberbrunner.com wrote: I must be failing to understand something. I'm

Re: [O] python sessions

2013-03-20 Thread Nick Dokos
Ista Zahn istaz...@gmail.com 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

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 John Hendy
On Wed, Mar 20, 2013 at 2:08 AM, Andreas Röhler andreas.roeh...@easy-emacs.de wrote: Am 20.03.2013 01:04, schrieb John Hendy: On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner ga...@oberbrunner.com wrote: I must be failing to understand something. I'm running Emacs 24.3 on Windows, with

Re: [O] python sessions

2013-03-20 Thread John Hendy
On Wed, Mar 20, 2013 at 10:38 AM, John Hendy jw.he...@gmail.com wrote: snip 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: [O] python sessions

2013-03-20 Thread Nick Dokos
John Hendy jw.he...@gmail.com 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

Re: [O] python sessions

2013-03-20 Thread Andreas Röhler
Am 20.03.2013 17:06, schrieb Nick Dokos: John Hendy jw.he...@gmail.com 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

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.

Re: [O] python sessions

2013-03-20 Thread Nick Dokos
Andreas Röhler andreas.roeh...@easy-emacs.de 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 .

Re: [O] python sessions

2013-03-20 Thread John Hendy
On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos nicholas.do...@hp.com wrote: Andreas Röhler andreas.roeh...@easy-emacs.de 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 Nick Dokos
John Hendy jw.he...@gmail.com wrote: On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos nicholas.do...@hp.com wrote: Andreas Röhler andreas.roeh...@easy-emacs.de wrote: Seems `org-babel-execute':python doesn't get the session flag. Edebug: org-babel-execute:python org-babel-execute:python

Re: [O] python sessions

2013-03-20 Thread Ista Zahn
On Wed, Mar 20, 2013 at 2:15 PM, Nick Dokos nicholas.do...@hp.com wrote: John Hendy jw.he...@gmail.com wrote: On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos nicholas.do...@hp.com wrote: Andreas Röhler andreas.roeh...@easy-emacs.de wrote: Seems `org-babel-execute':python doesn't get the

Re: [O] python sessions

2013-03-20 Thread Nick Dokos
Ista Zahn istaz...@gmail.com 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

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 Andreas Röhler
Am 20.03.2013 19:15, schrieb Nick Dokos: John Hendy jw.he...@gmail.com wrote: On Wed, Mar 20, 2013 at 12:25 PM, Nick Dokos nicholas.do...@hp.com wrote: Andreas Röhler andreas.roeh...@easy-emacs.de wrote: Seems `org-babel-execute':python doesn't get the session flag. Edebug:

Re: [O] python sessions

2013-03-20 Thread Andreas Röhler
Am 20.03.2013 18:25, schrieb Nick Dokos: Andreas Röhler andreas.roeh...@easy-emacs.de 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

Re: [O] python sessions

2013-03-20 Thread Ista Zahn
On Wed, Mar 20, 2013 at 2:43 PM, Andreas Röhler andreas.roeh...@easy-emacs.de 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

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 andreas.roeh...@easy-emacs.de 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

Re: [O] python sessions

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

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 istaz...@gmail.com wrote: On Wed, Mar 20, 2013 at 3:53 PM, Andreas Röhler andreas.roeh...@easy-emacs.de wrote: Am 20.03.2013 20:42, schrieb Ista Zahn: On

Re: [O] python sessions

2013-03-20 Thread Ista Zahn
On Wed, Mar 20, 2013 at 4:25 PM, Gary Oberbrunner ga...@oberbrunner.com 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 istaz...@gmail.com wrote: On Wed, Mar 20, 2013 at

Re: [O] python sessions

2013-03-20 Thread John Hendy
On Wed, Mar 20, 2013 at 8:22 PM, Gary Oberbrunner ga...@oberbrunner.com 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

[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

Re: [O] python sessions

2013-03-19 Thread John Hendy
On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner ga...@oberbrunner.com 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 Nick Dokos
John Hendy jw.he...@gmail.com wrote: On Tue, Mar 19, 2013 at 4:40 PM, Gary Oberbrunner ga...@oberbrunner.com 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