From mboxrd@z Thu Jan 1 00:00:00 1970 From: Achim Gratz Subject: [PATCH] ob-python Date: Mon, 12 Aug 2013 21:12:16 +0200 Message-ID: <87siyeu3jj.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59570) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8xXg-0003jx-BH for emacs-orgmode@gnu.org; Mon, 12 Aug 2013 15:12:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V8xXa-0006qz-IZ for emacs-orgmode@gnu.org; Mon, 12 Aug 2013 15:12:36 -0400 Received: from plane.gmane.org ([80.91.229.3]:47757) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V8xXa-0006qo-By for emacs-orgmode@gnu.org; Mon, 12 Aug 2013 15:12:30 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1V8xXZ-0007W6-Ht for emacs-orgmode@gnu.org; Mon, 12 Aug 2013 21:12:29 +0200 Received: from pd9eb11c5.dip0.t-ipconnect.de ([217.235.17.197]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Aug 2013 21:12:29 +0200 Received: from Stromeko by pd9eb11c5.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Aug 2013 21:12:29 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ob-python-run-python-requires-argument-cmd.patch >From 8f3c510f43e458a1bbb58b126fc4e402007e6cfe Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Mon, 12 Aug 2013 21:10:27 +0200 Subject: [PATCH] ob-python: run-python requires argument cmd * lisp/ob-python.el: Supply non-optional argument `cmd' to all invocations of `run-python'. Invert a condition of to remove an expendable progn form. 46d05e4d08 corrected the signatore in the declaration of run-python, but the call without an argument was left in. --- lisp/ob-python.el | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lisp/ob-python.el b/lisp/ob-python.el index ec24177..17da109 100644 --- a/lisp/ob-python.el +++ b/lisp/ob-python.el @@ -179,21 +179,20 @@ (defun org-babel-python-initiate-session-by-key (&optional 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 -- 1.8.3.4 --=-=-= Content-Type: text/plain Regards, Achim. -- +<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+ SD adaptation for Waldorf microQ V2.22R2: http://Synth.Stromeko.net/Downloads.html#WaldorfSDada --=-=-=--