]> git.eshelyaron.com Git - emacs.git/commitdiff
* progmodes/python.el (inferior-python-mode)
authorFabián Ezequiel Gallina <fgallina@gnu.org>
Sun, 7 Oct 2012 19:37:37 +0000 (16:37 -0300)
committerFabián Ezequiel Gallina <fgallina@gnu.org>
Sun, 7 Oct 2012 19:37:37 +0000 (16:37 -0300)
(python-shell-make-comint): Fixed initialization of local
variables copied from parent buffer.

lisp/ChangeLog
lisp/progmodes/python.el

index 718a9417cef041d04613c40bd7f6c728b9ba40f9..d873fbbc65661e6ba4171590ca4acdb6ddc329c4 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-07  Fabián Ezequiel Gallina  <fgallina@cuca>
+
+       * progmodes/python.el (inferior-python-mode)
+       (python-shell-make-comint): Fixed initialization of local
+       variables copied from parent buffer.
+
 2012-10-07  Jan Djärv  <jan.h.d@swipnet.se>
 
        * term/ns-win.el (ns-read-file-name): Update declaration to match
index 3ac871981e4325446c795db42b132c27c4f79aba..ffb2e66ca9d024855b690f633935ca76f7355de9 100644 (file)
@@ -1652,6 +1652,8 @@ uniqueness for different types of configurations."
 OUTPUT is a string with the contents of the buffer."
   (ansi-color-filter-apply output))
 
+(defvar python-shell--parent-buffer nil)
+
 (define-derived-mode inferior-python-mode comint-mode "Inferior Python"
   "Major mode for Python inferior process.
 Runs a Python interpreter as a subprocess of Emacs, with Python
@@ -1674,6 +1676,12 @@ initialization of the interpreter via `python-shell-setup-codes'
 variable.
 
 \(Type \\[describe-mode] in the process buffer for a list of commands.)"
+  (and python-shell--parent-buffer
+       (python-util-clone-local-variables python-shell--parent-buffer))
+  (setq comint-prompt-regexp (format "^\\(?:%s\\|%s\\|%s\\)"
+                                     python-shell-prompt-regexp
+                                     python-shell-prompt-block-regexp
+                                     python-shell-prompt-pdb-regexp))
   (set-syntax-table python-mode-syntax-table)
   (setq mode-line-process '(":%s"))
   (make-local-variable 'comint-output-filter-functions)
@@ -1721,15 +1729,10 @@ killed."
         (let* ((cmdlist (split-string-and-unquote cmd))
                (buffer (apply #'make-comint-in-buffer proc-name proc-buffer-name
                               (car cmdlist) nil (cdr cmdlist)))
-               (current-buffer (current-buffer))
+               (python-shell--parent-buffer (current-buffer))
                (process (get-buffer-process buffer)))
           (with-current-buffer buffer
-            (inferior-python-mode)
-            (python-util-clone-local-variables current-buffer)
-            (setq comint-prompt-regexp (format "^\\(?:%s\\|%s\\|%s\\)"
-                                               python-shell-prompt-regexp
-                                               python-shell-prompt-block-regexp
-                                               python-shell-prompt-pdb-regexp)))
+            (inferior-python-mode))
           (accept-process-output process)
           (and pop (pop-to-buffer buffer t))
           (and internal (set-process-query-on-exit-flag process nil))))