From 9e9edd4830c2ade7a1570c6f301932dca250fe8d Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Fri, 29 Mar 2013 10:31:37 -0600 Subject: [PATCH] change the default python buffer name Working to fix a bug introduced by recent upstream changes in python.el in Emacs. * lisp/ob-python.el (org-babel-python-buffers): Change the default python buffer name. (org-babel-python-initiate-session-by-key): Pass Python buffer names to the new `run-python' command. --- lisp/ob-python.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/ob-python.el b/lisp/ob-python.el index 7bc9a1f6b..a604c20b9 100644 --- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -151,7 +151,7 @@ Emacs-lisp table, otherwise return the results as a string." res)) (org-babel-script-escape results))) -(defvar org-babel-python-buffers '((:default . nil))) +(defvar org-babel-python-buffers '((:default . "*Python*"))) (defun org-babel-python-session-buffer (session) "Return the buffer associated with SESSION." @@ -170,7 +170,8 @@ then create. Return the initialized session." ((and (eq 'python org-babel-python-mode) (fboundp 'run-python)) ; python.el (if (version< "24.1" emacs-version) - (run-python org-babel-python-command) + (let ((python-shell-buffer-name python-buffer)) + (run-python org-babel-python-command)) (run-python))) ((and (eq 'python-mode org-babel-python-mode) (fboundp 'py-shell)) ; python-mode.el