diff options
| author | Richard M. Stallman | 2004-11-20 20:39:16 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2004-11-20 20:39:16 +0000 |
| commit | 7c6152ff9eedabd45eb3e121387aae427a72b8b7 (patch) | |
| tree | d431c6c16cbc0bc67cc7b6a5c591549c59206cd7 /lisp/progmodes/python.el | |
| parent | c326ddd1909dd9d7901301c1e2d7fc045c9fedee (diff) | |
| download | emacs-7c6152ff9eedabd45eb3e121387aae427a72b8b7.tar.gz emacs-7c6152ff9eedabd45eb3e121387aae427a72b8b7.zip | |
(python-switch-to-python): If Python isn't running, start it.
Diffstat (limited to 'lisp/progmodes/python.el')
| -rw-r--r-- | lisp/progmodes/python.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el index 9be2c7599b8..016e84270db 100644 --- a/lisp/progmodes/python.el +++ b/lisp/progmodes/python.el | |||
| @@ -1235,9 +1235,13 @@ to this as appropriate. Runs the hook `inferior-python-mode-hook' | |||
| 1235 | "Switch to the Python process buffer. | 1235 | "Switch to the Python process buffer. |
| 1236 | With prefix arg, position cursor at end of buffer." | 1236 | With prefix arg, position cursor at end of buffer." |
| 1237 | (interactive "P") | 1237 | (interactive "P") |
| 1238 | (if (get-buffer python-buffer) | 1238 | ;; Start python unless we have a buffer. |
| 1239 | (pop-to-buffer python-buffer) | 1239 | (unless (and python-buffer |
| 1240 | (error "No current process buffer. See variable `python-buffer'")) | 1240 | (get-buffer python-buffer)) |
| 1241 | (run-python nil t)) | ||
| 1242 | (pop-to-buffer python-buffer) | ||
| 1243 | ;; Make extra sure python is running in this buffer. | ||
| 1244 | (python-proc) | ||
| 1241 | (when eob-p | 1245 | (when eob-p |
| 1242 | (push-mark) | 1246 | (push-mark) |
| 1243 | (goto-char (point-max)))) | 1247 | (goto-char (point-max)))) |