* [PATCH] Honor the :python header argument in python src-blocks
@ 2017-04-28 0:04 Nathaniel Nicandro
2017-04-29 14:28 ` Nicolas Goaziou
0 siblings, 1 reply; 2+ messages in thread
From: Nathaniel Nicandro @ 2017-04-28 0:04 UTC (permalink / raw)
To: org mode
Hello,
This is my first post to the mailing list and I just wanted to say
thank all of you for making such a great piece of code!
Below is a patch that should fix the problem where a python session was
being initiated without first checking the :python header argument.
--- PATCH ---
From a721c97924b5b965179a2dd90e54d63c7de00317 Mon Sep 17 00:00:00 2001
From: Nathaniel Nicandro <nrn12@uic.edu>
Date: Thu, 27 Apr 2017 18:16:41 -0500
Subject: [PATCH] Honor the :python header argument in python src-blocks
* lisp/ob-python.el (org-babel-execute:python):
`org-babel-python-command` should be set before calling
`org-babel-python-initiate-session`.
TINYCHANGE
---
lisp/ob-python.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lisp/ob-python.el b/lisp/ob-python.el
index b838a48..f533658 100644
--- a/lisp/ob-python.el
+++ b/lisp/ob-python.el
@@ -73,15 +73,15 @@ This will typically be either `python' or `python-mode'."
(defun org-babel-execute:python (body params)
"Execute a block of Python code with Babel.
This function is called by `org-babel-execute-src-block'."
- (let* ((session (org-babel-python-initiate-session
+ (let* ((org-babel-python-command
+ (or (cdr (assq :python params)) org-babel-python-command))
+ (session (org-babel-python-initiate-session
(cdr (assq :session params))))
(result-params (cdr (assq :result-params params)))
(result-type (cdr (assq :result-type params)))
(return-val (when (and (eq result-type 'value) (not session))
(cdr (assq :return params))))
(preamble (cdr (assq :preamble params)))
- (org-babel-python-command
- (or (cdr (assq :python params)) org-babel-python-command))
(full-body
(org-babel-expand-body:generic
(concat body (if return-val (format "\nreturn %s" return-val) ""))
--
2.3.8
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Honor the :python header argument in python src-blocks
2017-04-28 0:04 [PATCH] Honor the :python header argument in python src-blocks Nathaniel Nicandro
@ 2017-04-29 14:28 ` Nicolas Goaziou
0 siblings, 0 replies; 2+ messages in thread
From: Nicolas Goaziou @ 2017-04-29 14:28 UTC (permalink / raw)
To: Nathaniel Nicandro; +Cc: org mode
Hello,
Nathaniel Nicandro <nrn12@uic.edu> writes:
> Below is a patch that should fix the problem where a python session was
> being initiated without first checking the :python header argument.
>
> --- PATCH ---
>
> From a721c97924b5b965179a2dd90e54d63c7de00317 Mon Sep 17 00:00:00 2001
> From: Nathaniel Nicandro <nrn12@uic.edu>
> Date: Thu, 27 Apr 2017 18:16:41 -0500
> Subject: [PATCH] Honor the :python header argument in python src-blocks
>
> * lisp/ob-python.el (org-babel-execute:python):
> `org-babel-python-command` should be set before calling
> `org-babel-python-initiate-session`.
>
> TINYCHANGE
Applied. Thank you.
Regards,
--
Nicolas Goaziou
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-04-29 14:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-28 0:04 [PATCH] Honor the :python header argument in python src-blocks Nathaniel Nicandro
2017-04-29 14:28 ` Nicolas Goaziou
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).