diff options
| author | Fabián Ezequiel Gallina | 2012-05-17 00:03:41 -0300 |
|---|---|---|
| committer | Fabián Ezequiel Gallina | 2012-05-17 00:03:41 -0300 |
| commit | 035c45e336a3ef831bfdb3bbfcfa1bb925c9783b (patch) | |
| tree | 082ded5c053f94f082d0892584b0c1ced4f082f0 | |
| parent | 8f1eba8b5e51ddaf4f9779271be20a8a75b4d7a0 (diff) | |
| download | emacs-035c45e336a3ef831bfdb3bbfcfa1bb925c9783b.tar.gz emacs-035c45e336a3ef831bfdb3bbfcfa1bb925c9783b.zip | |
Do not call `switch-to-buffer' in `python-shell-get-or-create-process'
For this to work properly `run-python' now calls
`python-shell-make-comint' with the POP argument set to nil.
| -rw-r--r-- | lisp/progmodes/python.el | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 7cfbb34aea3..1b98a046b6a 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1473,7 +1473,7 @@ run). | |||
| 1473 | (y-or-n-p "Make dedicated process? ") | 1473 | (y-or-n-p "Make dedicated process? ") |
| 1474 | (read-string "Run Python: " (python-shell-parse-command))) | 1474 | (read-string "Run Python: " (python-shell-parse-command))) |
| 1475 | (list nil (python-shell-parse-command)))) | 1475 | (list nil (python-shell-parse-command)))) |
| 1476 | (python-shell-make-comint cmd (python-shell-get-process-name dedicated) t) | 1476 | (python-shell-make-comint cmd (python-shell-get-process-name dedicated)) |
| 1477 | dedicated) | 1477 | dedicated) |
| 1478 | 1478 | ||
| 1479 | (defun run-python-internal () | 1479 | (defun run-python-internal () |
| @@ -1511,8 +1511,7 @@ of commands.)" | |||
| 1511 | 1511 | ||
| 1512 | (defun python-shell-get-or-create-process () | 1512 | (defun python-shell-get-or-create-process () |
| 1513 | "Get or create an inferior Python process for current buffer and return it." | 1513 | "Get or create an inferior Python process for current buffer and return it." |
| 1514 | (let* ((old-buffer (current-buffer)) | 1514 | (let* ((dedicated-proc-name (python-shell-get-process-name t)) |
| 1515 | (dedicated-proc-name (python-shell-get-process-name t)) | ||
| 1516 | (dedicated-proc-buffer-name (format "*%s*" dedicated-proc-name)) | 1515 | (dedicated-proc-buffer-name (format "*%s*" dedicated-proc-name)) |
| 1517 | (global-proc-name (python-shell-get-process-name nil)) | 1516 | (global-proc-name (python-shell-get-process-name nil)) |
| 1518 | (global-proc-buffer-name (format "*%s*" global-proc-name)) | 1517 | (global-proc-buffer-name (format "*%s*" global-proc-name)) |
| @@ -1524,7 +1523,6 @@ of commands.)" | |||
| 1524 | (setq dedicated-running t) | 1523 | (setq dedicated-running t) |
| 1525 | (setq global-running t))) | 1524 | (setq global-running t))) |
| 1526 | ;; Always prefer dedicated | 1525 | ;; Always prefer dedicated |
| 1527 | (switch-to-buffer old-buffer) | ||
| 1528 | (get-buffer-process (if dedicated-running | 1526 | (get-buffer-process (if dedicated-running |
| 1529 | dedicated-proc-buffer-name | 1527 | dedicated-proc-buffer-name |
| 1530 | global-proc-buffer-name)))) | 1528 | global-proc-buffer-name)))) |