diff options
Diffstat (limited to 'lisp/org/ob-python.el')
| -rw-r--r-- | lisp/org/ob-python.el | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lisp/org/ob-python.el b/lisp/org/ob-python.el index b8f8a6daafa..99c35ce2863 100644 --- a/lisp/org/ob-python.el +++ b/lisp/org/ob-python.el | |||
| @@ -156,14 +156,14 @@ Emacs-lisp table, otherwise return the results as a string." | |||
| 156 | "Return the buffer associated with SESSION." | 156 | "Return the buffer associated with SESSION." |
| 157 | (cdr (assoc session org-babel-python-buffers))) | 157 | (cdr (assoc session org-babel-python-buffers))) |
| 158 | 158 | ||
| 159 | (defun org-babel-python-with-earmufs (session) | 159 | (defun org-babel-python-with-earmuffs (session) |
| 160 | (let ((name (if (stringp session) session (format "%s" session)))) | 160 | (let ((name (if (stringp session) session (format "%s" session)))) |
| 161 | (if (and (string= "*" (substring name 0 1)) | 161 | (if (and (string= "*" (substring name 0 1)) |
| 162 | (string= "*" (substring name (- (length name) 1)))) | 162 | (string= "*" (substring name (- (length name) 1)))) |
| 163 | name | 163 | name |
| 164 | (format "*%s*" name)))) | 164 | (format "*%s*" name)))) |
| 165 | 165 | ||
| 166 | (defun org-babel-python-without-earmufs (session) | 166 | (defun org-babel-python-without-earmuffs (session) |
| 167 | (let ((name (if (stringp session) session (format "%s" session)))) | 167 | (let ((name (if (stringp session) session (format "%s" session)))) |
| 168 | (if (and (string= "*" (substring name 0 1)) | 168 | (if (and (string= "*" (substring name 0 1)) |
| 169 | (string= "*" (substring name (- (length name) 1)))) | 169 | (string= "*" (substring name (- (length name) 1)))) |
| @@ -190,9 +190,9 @@ then create. Return the initialized session." | |||
| 190 | (if (not (version< "24.1" emacs-version)) | 190 | (if (not (version< "24.1" emacs-version)) |
| 191 | (run-python cmd) | 191 | (run-python cmd) |
| 192 | (unless python-buffer | 192 | (unless python-buffer |
| 193 | (setq python-buffer (org-babel-python-with-earmufs session))) | 193 | (setq python-buffer (org-babel-python-with-earmuffs session))) |
| 194 | (let ((python-shell-buffer-name | 194 | (let ((python-shell-buffer-name |
| 195 | (org-babel-python-without-earmufs python-buffer))) | 195 | (org-babel-python-without-earmuffs python-buffer))) |
| 196 | (run-python cmd)))) | 196 | (run-python cmd)))) |
| 197 | ((and (eq 'python-mode org-babel-python-mode) | 197 | ((and (eq 'python-mode org-babel-python-mode) |
| 198 | (fboundp 'py-shell)) ; python-mode.el | 198 | (fboundp 'py-shell)) ; python-mode.el |
| @@ -208,7 +208,7 @@ then create. Return the initialized session." | |||
| 208 | (concat "Python-" (symbol-name session)))) | 208 | (concat "Python-" (symbol-name session)))) |
| 209 | (py-which-bufname bufname)) | 209 | (py-which-bufname bufname)) |
| 210 | (py-shell) | 210 | (py-shell) |
| 211 | (setq python-buffer (org-babel-python-with-earmufs bufname)))) | 211 | (setq python-buffer (org-babel-python-with-earmuffs bufname)))) |
| 212 | (t | 212 | (t |
| 213 | (error "No function available for running an inferior Python"))) | 213 | (error "No function available for running an inferior Python"))) |
| 214 | (setq org-babel-python-buffers | 214 | (setq org-babel-python-buffers |