emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110431: * progmodes/python.el (infer


From: Fabián Ezequiel Gallina
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110431: * progmodes/python.el (inferior-python-mode)
Date: Sun, 07 Oct 2012 16:37:37 -0300
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110431
committer: Fabián Ezequiel Gallina <address@hidden>
branch nick: trunk
timestamp: Sun 2012-10-07 16:37:37 -0300
message:
  * progmodes/python.el (inferior-python-mode)
  (python-shell-make-comint): Fixed initialization of local
  variables copied from parent buffer.
modified:
  lisp/ChangeLog
  lisp/progmodes/python.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-10-07 17:47:41 +0000
+++ b/lisp/ChangeLog    2012-10-07 19:37:37 +0000
@@ -1,3 +1,9 @@
+2012-10-07  Fabián Ezequiel Gallina  <address@hidden>
+
+       * 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  <address@hidden>
 
        * term/ns-win.el (ns-read-file-name): Update declaration to match

=== modified file 'lisp/progmodes/python.el'
--- a/lisp/progmodes/python.el  2012-10-07 16:13:52 +0000
+++ b/lisp/progmodes/python.el  2012-10-07 19:37:37 +0000
@@ -1652,6 +1652,8 @@
 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 @@
 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 @@
         (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))))


reply via email to

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