diff options
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 6458c359355..37a4d029c0f 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -970,7 +970,8 @@ commands.)" | |||
| 970 | 970 | ||
| 971 | (defun python-shell-get-or-create-process () | 971 | (defun python-shell-get-or-create-process () |
| 972 | "Get or create an inferior Python process for current buffer and return it." | 972 | "Get or create an inferior Python process for current buffer and return it." |
| 973 | (let* ((dedicated-proc-name (python-shell-get-process-name t)) | 973 | (let* ((old-buffer (current-buffer)) |
| 974 | (dedicated-proc-name (python-shell-get-process-name t)) | ||
| 974 | (dedicated-proc-buffer-name (format "*%s*" dedicated-proc-name)) | 975 | (dedicated-proc-buffer-name (format "*%s*" dedicated-proc-name)) |
| 975 | (global-proc-name (python-shell-get-process-name nil)) | 976 | (global-proc-name (python-shell-get-process-name nil)) |
| 976 | (global-proc-buffer-name (format "*%s*" global-proc-name)) | 977 | (global-proc-buffer-name (format "*%s*" global-proc-name)) |
| @@ -982,6 +983,7 @@ commands.)" | |||
| 982 | (setq dedicated-running t) | 983 | (setq dedicated-running t) |
| 983 | (setq global-running t))) | 984 | (setq global-running t))) |
| 984 | ;; Always prefer dedicated | 985 | ;; Always prefer dedicated |
| 986 | (switch-to-buffer old-buffer) | ||
| 985 | (get-buffer-process (if dedicated-running | 987 | (get-buffer-process (if dedicated-running |
| 986 | dedicated-proc-buffer-name | 988 | dedicated-proc-buffer-name |
| 987 | global-proc-buffer-name)))) | 989 | global-proc-buffer-name)))) |