# HG changeset patch # User Richard M. Stallman # Date 1100983156 0 # Node ID 9fc67253aa56fac810d14dce8e0dedb90c566b9c # Parent 4ca1b78a471fd4f0d9858e4a655b7571ca653f3b (python-switch-to-python): If Python isn't running, start it. diff -r 4ca1b78a471f -r 9fc67253aa56 lisp/progmodes/python.el --- 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))))