unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Benjamin Rutt <rutt.4+news@osu.edu>
Subject: bug fix to python.el when pressing C-c C-z
Date: Thu, 18 Nov 2004 16:24:50 -0500	[thread overview]
Message-ID: <87fz36svdp.fsf@penguin.brutt.org> (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

                 reply	other threads:[~2004-11-18 21:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fz36svdp.fsf@penguin.brutt.org \
    --to=rutt.4+news@osu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).