summaryrefslogtreecommitdiff
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina <fgallina@gnu.org>2012-10-07 16:37:37 -0300
committerFabián Ezequiel Gallina <fgallina@gnu.org>2012-10-07 16:37:37 -0300
commitf27c99dc7ef8f19e7a378001d8b3d906ca907dae (patch)
treeb2bfe65218946d549e190068f7016af470fa8cba /lisp/progmodes/python.el
parent98daa89356f6523c2c6663110d0c715f018b1a8b (diff)
downloademacs-f27c99dc7ef8f19e7a378001d8b3d906ca907dae.tar.gz
* progmodes/python.el (inferior-python-mode)
(python-shell-make-comint): Fixed initialization of local variables copied from parent buffer.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 3ac871981e4..ffb2e66ca9d 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -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))))