 	  (base-text "")		; and text of base line
 	  (base-found-p nil))
       (save-excursion
-	(while (< 0 count)
+	(while (< 0 arg)
 	  (condition-case nil		; in case no enclosing block
 	      (progn
 		(py-goto-block-up 'no-mark)

		      (define-key
			py-mode-map key 'py-newline-and-indent)))
   (where-is-internal 'newline-and-indent))

  ;; BAW - you could do it this way, but its not considered proper
  ;; major-mode form.
  (mapcar (function
	   (lambda (x)
	     (define-key py-mode-map (car x) (cdr x))))
	  '((":"         . py-electric-colon)
	    ("\C-c\C-c"  . py-execute-buffer)
	    ("\C-c|"	 . py-execute-region)
	    ("\C-c!"	 . py-shell)
	    ("\177"	 . py-delete-char)
	    ("\n"	 . py-newline-and-indent)
	    ("\C-c:"	 . py-guess-indent-offset)
	    ("\C-c\t"	 . py-indent-region)
	    ("\C-c\C-l"  . py-shift-region-left)
	    ("\C-c\C-r"  . py-shift-region-right)
	    ("\C-c<"	 . py-shift-region-left)
	    ("\C-c>"	 . py-shift-region-right)
	    ("\C-c\C-n"  . py-next-statement)
	    ("\C-c\C-p"  . py-previous-statement)
	    ("\C-c\C-u"  . py-goto-block-up)
	    ("\C-c\C-m"  . py-mark-block)
	    ("\C-c#"	 . py-comment-region)
	    ("\C-c?"	 . py-describe-mode)
	    ("\C-c\C-hm" . py-describe-mode)
	    ("\e\C-a"	 . beginning-of-python-def-or-class)
	    ("\e\C-e"	 . end-of-python-def-or-class)
	    ( "\e\C-h"	 . mark-python-def-or-class)))
  ;; should do all keybindings this way
  (define-key py-mode-map "\C-c\C-b" 'py-submit-bug-report)
  (define-key py-mode-map "\C-c\C-v" 'py-version)
  )

(defvar py-mode-syntax-table nil



;; Electric deletion
(defun py-electric-backspace (arg)
  "Deletes preceding character or levels of indentation.
Deletion is performed by calling the function in `py-backspace-function'
with a single argument (the number of characters to delete).

If point is at the leftmost column, deletes the preceding newline.

Otherwise, if point is at the leftmost non-whitespace character of a
line that is neither a continuation line nor a non-indenting comment
line, or if point is at the end of a blank line, this command reduces
the indentation to match that of the line that opened the current
block of code.  The line that opened the block is displayed in the
echo area to help you keep track of where you are.  With numeric arg,
outdents that many blocks (but not past column zero).

Otherwise the preceding character is deleted, converting a tab to
spaces if needed so that only a single column position is deleted.
Numeric argument deletes that many preceding characters."
  (interactive "*p")
  (if (or (/= (current-indentation) (current-column))
	  (bolp)
	  (py-continuation-line-p)
	  (not py-honor-comment-indentation)
	  (looking-at "#[^ \t\n]"))	; non-indenting #
      (funcall py-backspace-function arg)
    ;; else indent the same as the colon line that opened the block
    ;; force non-blank so py-goto-block-up doesn't ignore it
    (insert-char ?* 1)
    (backward-char)
