unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* bug fix to python.el when pressing C-c C-z
@ 2004-11-18 21:24 Benjamin Rutt
  0 siblings, 0 replies; only message in thread
From: Benjamin Rutt @ 2004-11-18 21:24 UTC (permalink / raw)


I don't like it when I am editing python in a recently started emacs
and I want to press C-c C-z to show my current python buffer, and I
haven't done M-x run-python yet, and I get an error:

Wrong type argument: stringp, nil 

Since `(get-buffer python-buffer)' from the code below can't be
evaluated yet, as `python-buffer' is nil.

This bugfix/enhancement starts up python if it isn't started already
via run-python and fixes this bug.  Anyone care to review and commit
this if it seems OK?  Thanks,

Benjamin Rutt

--- python.el.orig      2004-11-18 14:24:10.000000000 -0500
+++ python.el   2004-11-18 14:25:07.000000000 -0500
@@ -1235,15 +1235,14 @@
   "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'"))
+  (when (or (not python-buffer)
+           (not (get-buffer python-buffer)))
+    (run-python nil t))
+  (pop-to-buffer python-buffer)
   (when eob-p
     (push-mark)
     (goto-char (point-max))))
 
-(add-to-list 'debug-ignored-errors "^No current process buffer.")
-
 (defun python-send-region-and-go (start end)
   "Send the region to the inferior Python process.
 Then switch to the process buffer."

-- 
Benjamin Rutt

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-11-18 21:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-18 21:24 bug fix to python.el when pressing C-c C-z Benjamin Rutt

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).