 to newline-and-indent in the global keymap, and shadows them with
 local bindings to py-newline-and-indent."))
 
-;;; Helper functions
++
+;; Helper functions
 
 (defvar py-parse-state-re
   (concat
    "^[ \t]*\\(if\\|elif\\|else\\|while\\|def\\|class\\)\\>"
    "\\|"
    "^[^ #\t\n]"))
+
 ;; returns the parse state at point (see parse-partial-sexp docs)
 (defun py-parse-state ()
   (save-excursion
-    (let ( (here (point)) )
+    (let ((here (point)) )
       ;; back up to the first preceding line (if any; else start of
       ;; buffer) that begins with a popular Python keyword, or a non-
-      ;; whitespace and non-comment character.  These are good places to
-      ;; start parsing to see whether where we started is at a non-zero
-      ;; nesting level.  It may be slow for people who write huge code
-      ;; blocks or huge lists ... tough beans.
+      ;; whitespace and non-comment character.  These are good places
+      ;; to start parsing to see whether where we started is at a
+      ;; non-zero nesting level.  It may be slow for people who write
+      ;; huge code blocks or huge lists ... tough beans.
       (re-search-backward py-parse-state-re nil 'move)
       (beginning-of-line)
       (parse-partial-sexp (point) here))))

    ;; force non-blank so py-goto-block-up doesn't ignore it
    (insert-char ?* 1)
    (backward-char)
    (let ( (base-indent 0)		; indentation of base line
	   (base-text "")		; and text of base line
	   (base-found-p nil))
      (condition-case nil		; in case no enclosing block
	  (save-excursion
	    (py-goto-block-up 'no-mark)

;; without fee, for any purpose and by any individual or organization, is
;; hereby granted, provided that the above copyright notice and this
;; paragraph appear in all copies.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;; At some point this mode will undergo a rewrite to bring it more in
;; line with GNU Emacs Lisp coding standards.  But all in all, the
;; mode works exceedingly well.

;; The following statements, placed in your .emacs file or
;; site-init.el, will cause this file to be autoloaded, and
;; python-mode invoked, when visiting .py files (assuming this file is
;; in your load-path):
;;
;;	(autoload 'python-mode "python-mode" "Python editing mode." t)
;;	(setq auto-mode-alist
;;	      (cons '("\\.py$" . python-mode) auto-mode-alist))

;; Here's a brief to do list:
;;
;; 1. Better integration with gud-mode for debugging.
;; 2. Rewrite according to GNU Emacs Lisp standards.

;; If you can think of more things you'd like to see, drop me a line.
;; If you want to report bugs, use py-submit-bug-report (C-c C-b).
;;
;; Note that I only test things on XEmacs (currently 19.11).  If you
;; port stuff to FSF Emacs 19, or Emacs 18, please send me your
;; patches.

;; LCD Archive Entry:
;; python-mode|Barry A. Warsaw|bwarsaw@cnri.reston.va.us
;; |Major mode for editing Python programs
;; |$Date$|$Revision$|

;;; Code:


;; user definable variables
;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

(defvar py-python-command "python"
  "*Shell command used to start Python interpreter.")

(defvar py-indent-offset 8		; argue with Guido <grin>
  "*Indentation increment.
Note that `\\[py-guess-indent-offset]' can usually guess a good value
when you're editing someone else's Python code.")

(defvar py-block-comment-prefix "##"
  "*String used by `py-comment-region' to comment out a block of code.
This should follow the convention for non-indenting comment lines so
that the indentation commands won't get confused (i.e., the string
should be of the form `#x...' where `x' is not a blank or a tab, and
