emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [PATCH] session with python-mode.el complains of void py-toggle-


From: Andreas Röhler
Subject: Re: [O] [PATCH] session with python-mode.el complains of void py-toggle-shells
Date: Wed, 23 Jan 2013 19:02:01 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121025 Thunderbird/16.0.2

Am 23.01.2013 14:04, schrieb Bastien:
Hi Myles,

thanks for digging into this.

I'm copying Andreas as the maintainer of python-mode.el.

Myles English <address@hidden> writes:

--- lisp/ob-python.el
+++ lisp/ob-python.el
@@ -32,7 +32,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 py-toggle-shell "ext:python-mode" (arg))


Hi Bastien,

If this function's name changed, there should be an alias in
python-mode.el.


right

  (declare-function run-python "ext:python" (&optional cmd noshow new))

  (defvar org-babel-tangle-lang-exts)
@@ -162,16 +162,17 @@ then create.  Return the initialized session."
         ;; Make sure that py-which-bufname is initialized, as otherwise
         ;; it will be overwritten the first time a Python buffer is
         ;; created.
-       (py-toggle-shells py-default-interpreter)
+       (py-toggle-shell py-default-interpreter)
         ;; `py-shell' creates a buffer whose name is the value of
         ;; `py-which-bufname' with '*'s at the beginning and end
         (let* ((bufname (if (and python-buffer (buffer-live-p python-buffer))
                             (replace-regexp-in-string ;; zap surrounding *
                              "^\\*\\([^*]+\\)\\*$" "\\1" python-buffer)
                           (concat "Python-" (symbol-name session))))
-              (py-which-bufname bufname))
-         (py-shell)
-         (setq python-buffer (concat "*" bufname "*"))))
+              (py-buffer-name bufname))
+         (setq python-buffer (concat "*" bufname "*"))
+         (py-shell nil nil nil nil nil python-buffer)
+         ))

The docstring of py-shell doesn't say much about why python-buffer
would be needed as an argument here.  Is it so?

If yes, we need to make this compatible with previous versions of
python-mode.el.

(The argument PY-BUFFER-NAME is not documented in latest
python-mode.el)

Andreas, can you help sorting this out?

Thanks,


Okay, I'll dig into.

For the moment: assume this code should not be needed, python-mode.el should 
act that all.
But let me have a closer look,

Cheers,

Andreas






reply via email to

[Prev in Thread] Current Thread [Next in Thread]