aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabián Ezequiel Gallina2012-10-07 16:37:37 -0300
committerFabián Ezequiel Gallina2012-10-07 16:37:37 -0300
commitf27c99dc7ef8f19e7a378001d8b3d906ca907dae (patch)
treeb2bfe65218946d549e190068f7016af470fa8cba
parent98daa89356f6523c2c6663110d0c715f018b1a8b (diff)
downloademacs-f27c99dc7ef8f19e7a378001d8b3d906ca907dae.tar.gz
emacs-f27c99dc7ef8f19e7a378001d8b3d906ca907dae.zip
* progmodes/python.el (inferior-python-mode)
(python-shell-make-comint): Fixed initialization of local variables copied from parent buffer.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/python.el17
2 files changed, 16 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 718a9417cef..d873fbbc656 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12012-10-07 Fabián Ezequiel Gallina <fgallina@cuca>
2
3 * progmodes/python.el (inferior-python-mode)
4 (python-shell-make-comint): Fixed initialization of local
5 variables copied from parent buffer.
6
12012-10-07 Jan Djärv <jan.h.d@swipnet.se> 72012-10-07 Jan Djärv <jan.h.d@swipnet.se>
2 8
3 * term/ns-win.el (ns-read-file-name): Update declaration to match 9 * term/ns-win.el (ns-read-file-name): Update declaration to match
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."
1652OUTPUT is a string with the contents of the buffer." 1652OUTPUT is a string with the contents of the buffer."
1653 (ansi-color-filter-apply output)) 1653 (ansi-color-filter-apply output))
1654 1654
1655(defvar python-shell--parent-buffer nil)
1656
1655(define-derived-mode inferior-python-mode comint-mode "Inferior Python" 1657(define-derived-mode inferior-python-mode comint-mode "Inferior Python"
1656 "Major mode for Python inferior process. 1658 "Major mode for Python inferior process.
1657Runs a Python interpreter as a subprocess of Emacs, with Python 1659Runs a Python interpreter as a subprocess of Emacs, with Python
@@ -1674,6 +1676,12 @@ initialization of the interpreter via `python-shell-setup-codes'
1674variable. 1676variable.
1675 1677
1676\(Type \\[describe-mode] in the process buffer for a list of commands.)" 1678\(Type \\[describe-mode] in the process buffer for a list of commands.)"
1679 (and python-shell--parent-buffer
1680 (python-util-clone-local-variables python-shell--parent-buffer))
1681 (setq comint-prompt-regexp (format "^\\(?:%s\\|%s\\|%s\\)"
1682 python-shell-prompt-regexp
1683 python-shell-prompt-block-regexp
1684 python-shell-prompt-pdb-regexp))
1677 (set-syntax-table python-mode-syntax-table) 1685 (set-syntax-table python-mode-syntax-table)
1678 (setq mode-line-process '(":%s")) 1686 (setq mode-line-process '(":%s"))
1679 (make-local-variable 'comint-output-filter-functions) 1687 (make-local-variable 'comint-output-filter-functions)
@@ -1721,15 +1729,10 @@ killed."
1721 (let* ((cmdlist (split-string-and-unquote cmd)) 1729 (let* ((cmdlist (split-string-and-unquote cmd))
1722 (buffer (apply #'make-comint-in-buffer proc-name proc-buffer-name 1730 (buffer (apply #'make-comint-in-buffer proc-name proc-buffer-name
1723 (car cmdlist) nil (cdr cmdlist))) 1731 (car cmdlist) nil (cdr cmdlist)))
1724 (current-buffer (current-buffer)) 1732 (python-shell--parent-buffer (current-buffer))
1725 (process (get-buffer-process buffer))) 1733 (process (get-buffer-process buffer)))
1726 (with-current-buffer buffer 1734 (with-current-buffer buffer
1727 (inferior-python-mode) 1735 (inferior-python-mode))
1728 (python-util-clone-local-variables current-buffer)
1729 (setq comint-prompt-regexp (format "^\\(?:%s\\|%s\\|%s\\)"
1730 python-shell-prompt-regexp
1731 python-shell-prompt-block-regexp
1732 python-shell-prompt-pdb-regexp)))
1733 (accept-process-output process) 1736 (accept-process-output process)
1734 (and pop (pop-to-buffer buffer t)) 1737 (and pop (pop-to-buffer buffer t))
1735 (and internal (set-process-query-on-exit-flag process nil)))) 1738 (and internal (set-process-query-on-exit-flag process nil))))