emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ob-python
@ 2013-08-12 19:12 Achim Gratz
  2013-08-12 19:19 ` Eric Schulte
  0 siblings, 1 reply; 2+ messages in thread
From: Achim Gratz @ 2013-08-12 19:12 UTC (permalink / raw)
  To: emacs-orgmode

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-ob-python-run-python-requires-argument-cmd.patch --]
[-- Type: text/x-patch, Size: 2191 bytes --]

From 8f3c510f43e458a1bbb58b126fc4e402007e6cfe Mon Sep 17 00:00:00 2001
From: Achim Gratz <Stromeko@Stromeko.DE>
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


[-- Attachment #2: Type: text/plain, Size: 188 bytes --]



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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ob-python
  2013-08-12 19:12 [PATCH] ob-python Achim Gratz
@ 2013-08-12 19:19 ` Eric Schulte
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2013-08-12 19:19 UTC (permalink / raw)
  To: Achim Gratz; +Cc: emacs-orgmode

Applied.  Thanks,

Achim Gratz <Stromeko@nexgo.de> writes:

> From 8f3c510f43e458a1bbb58b126fc4e402007e6cfe Mon Sep 17 00:00:00 2001
> From: Achim Gratz <Stromeko@Stromeko.DE>
> 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
>
>
>
> Regards,
> Achim.

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-08-12 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-12 19:12 [PATCH] ob-python Achim Gratz
2013-08-12 19:19 ` Eric Schulte

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).