From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: [PATCH] session with python-mode.el complains of void py-toggle-shells Date: Wed, 23 Jan 2013 14:04:17 +0100 Message-ID: <87pq0w2gq6.fsf@bzg.ath.cx> References: <87ham8y5rw.fsf@gmail.com> <3314.1358914289@alphaville> <87fw1sxe15.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:38901) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ty00C-0000mU-Ev for Emacs-orgmode@gnu.org; Wed, 23 Jan 2013 08:04:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ty006-0004xb-70 for Emacs-orgmode@gnu.org; Wed, 23 Jan 2013 08:04:27 -0500 Received: from wi-in-x0229.1e100.net ([2a00:1450:400c:c05::229]:50769 helo=mail-wi0-x229.google.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ty005-0004xA-V2 for Emacs-orgmode@gnu.org; Wed, 23 Jan 2013 08:04:22 -0500 Received: by mail-wi0-f169.google.com with SMTP id hq12so4372170wib.0 for ; Wed, 23 Jan 2013 05:04:19 -0800 (PST) In-Reply-To: <87fw1sxe15.fsf@gmail.com> (Myles English's message of "Wed, 23 Jan 2013 12:46:46 +0000") 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: Myles English Cc: andreas , nicholas.dokos@hp.com, Emacs-orgmode Hi Myles, thanks for digging into this. I'm copying Andreas as the maintainer of python-mode.el. Myles English 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)) If this function's name changed, there should be an alias in python-mode.el. > (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, -- Bastien