=== modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-06-06 13:05:11 +0000 +++ lisp/progmodes/python.el 2012-06-17 13:00:00 +0000 @@ -541,6 +541,15 @@ :group 'python :version "24.1") +(defcustom python-show-process-buffer-on-send nil + "Whether or not to show the Python process buffer after sending +a region to the Python process." + :type '(choice (const :tag "No" nil) + (const :tag "In current window" current) + (const :tag "In another window" other)) + :group 'python + :version "24.1") + (defvar python-pdbtrack-is-tracking-p nil) (defconst python-pdbtrack-stack-entry-regexp @@ -1628,7 +1637,11 @@ ;; Tell compile.el to redirect error locations in file `f' to ;; positions past marker `orig-start'. It has to be done *after* ;; `python-send-command''s call to `compilation-forget-errors'. - (compilation-fake-loc orig-start f)))) + (compilation-fake-loc orig-start f) + (cond ((eq python-show-process-buffer-on-send 'other) + (switch-to-buffer-other-window (current-buffer))) + ((eq python-show-process-buffer-on-send 'current) + (switch-to-buffer (current-buffer))))))) (defun python-send-string (string) "Evaluate STRING in inferior Python process."