diff options
author | Sebastien Delafond <seb@debian.org> | 2013-10-27 17:14:14 +0100 |
---|---|---|
committer | Sébastien Delafond <sdelafond@gmail.com> | 2014-07-13 13:35:29 +0200 |
commit | d3ee0b02baea9e4e066ed16145ba076165d8a696 (patch) | |
tree | fdb3661e3284a5d42637a562216e29ac4edd40d4 /lisp/ob-python.el | |
parent | 44bbf7eace0d917b5deb7a2ee74ef2927e095b3c (diff) | |
parent | 40ce6b75e6245659a3a14622356e32e7dd1125dd (diff) |
Imported Debian patch 8.2.1-1
Diffstat (limited to 'lisp/ob-python.el')
-rw-r--r-- | lisp/ob-python.el | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/lisp/ob-python.el b/lisp/ob-python.el index eca4c82..17da109 100644 --- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -33,7 +33,7 @@ (declare-function org-remove-indentation "org" ) (declare-function py-shell "ext:python-mode" (&optional argprompt)) (declare-function py-toggle-shells "ext:python-mode" (arg)) -(declare-function run-python "ext:python" (&optional cmd noshow new)) +(declare-function run-python "ext:python" (cmd &optional dedicated show)) (defvar org-babel-tangle-lang-exts) (add-to-list 'org-babel-tangle-lang-exts '("python" . "py")) @@ -179,21 +179,20 @@ then create. Return the initialized session." (require org-babel-python-mode) (save-window-excursion (let* ((session (if session (intern session) :default)) - (python-buffer (org-babel-python-session-buffer session))) + (python-buffer (org-babel-python-session-buffer session)) + (cmd (if (member system-type '(cygwin windows-nt ms-dos)) + (concat org-babel-python-command " -i") + org-babel-python-command))) (cond ((and (eq 'python org-babel-python-mode) (fboundp 'run-python)) ; python.el - (if (version< "24.1" emacs-version) - (progn - (unless python-buffer - (setq python-buffer (org-babel-python-with-earmufs session))) - (let ((python-shell-buffer-name - (org-babel-python-without-earmufs python-buffer))) - (run-python - (if (member system-type '(cygwin windows-nt ms-dos)) - (concat org-babel-python-command " -i") - org-babel-python-command)))) - (run-python))) + (if (not (version< "24.1" emacs-version)) + (run-python cmd) + (unless python-buffer + (setq python-buffer (org-babel-python-with-earmufs session))) + (let ((python-shell-buffer-name + (org-babel-python-without-earmufs python-buffer))) + (run-python cmd)))) ((and (eq 'python-mode org-babel-python-mode) (fboundp 'py-shell)) ; python-mode.el ;; Make sure that py-which-bufname is initialized, as otherwise |