diff options
author | Eric Schulte <schulte.eric@gmail.com> | 2011-06-20 12:18:09 -0700 |
---|---|---|
committer | Eric Schulte <schulte.eric@gmail.com> | 2011-06-20 19:18:59 -0700 |
commit | 56de599c0054c6eb485ce0e4dfa68ab62853fee2 (patch) | |
tree | c447101742a3c5d8d6ba3dca659fab3b6525ecf4 | |
parent | a0bc3bdebc3a48937332b96de11bd6470018c047 (diff) | |
download | org-mode-56de599c0054c6eb485ce0e4dfa68ab62853fee2.tar.gz |
ob-python: Send RET after every line w/session evaluation
* lisp/ob-python.el (org-babel-python-evaluate-session): Send
comint-send-input after every line when interacting with an
interactive python process.
-rw-r--r-- | lisp/ob-python.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/ob-python.el b/lisp/ob-python.el index f3f4a03..6cb2c44 100644 --- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -267,9 +267,11 @@ last statement in BODY, as elisp." (org-babel-comint-with-output (session org-babel-python-eoe-indicator t body) (let ((comint-process-echoes nil)) - (input-body body) - (insert org-babel-python-eoe-indicator) - (comint-send-input))) 2) "\n")) + (mapc + (lambda (line) + (insert line) (comint-send-input nil t)) + (append (split-string body "[\n\r]") (list org-babel-python-eoe-indicator))))) + 2) "\n")) (value (let ((tmp-file (org-babel-temp-file "python-"))) (org-babel-comint-with-output |