changeset 58357:9fc67253aa56

(python-switch-to-python): If Python isn't running, start it.
author Richard M. Stallman <rms@gnu.org>
date Sat, 20 Nov 2004 20:39:16 +0000
parents 4ca1b78a471f
children 6ec84037b6bc
files lisp/progmodes/python.el
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/python.el	Sat Nov 20 20:18:34 2004 +0000
+++ b/lisp/progmodes/python.el	Sat Nov 20 20:39:16 2004 +0000
@@ -1235,9 +1235,13 @@
   "Switch to the Python process buffer.
 With prefix arg, position cursor at end of buffer."
   (interactive "P")
-  (if (get-buffer python-buffer)
-      (pop-to-buffer python-buffer)
-    (error "No current process buffer.  See variable `python-buffer'"))
+  ;; Start python unless we have a buffer.
+  (unless (and python-buffer
+	       (get-buffer python-buffer))
+    (run-python nil t))
+  (pop-to-buffer python-buffer)
+  ;; Make extra sure python is running in this buffer.
+  (python-proc)
   (when eob-p
     (push-mark)
     (goto-char (point-max))))