 ;; Utilities
 
 (defmacro py-safe (&rest body)
-  ;; safely execute BODY, return nil if an error occurred
+  "Safely execute BODY, return nil if an error occurred."
   (` (condition-case nil
 	 (progn (,@ body))
        (error nil))))
 
 (defsubst py-keep-region-active ()
-  ;; Do whatever is necessary to keep the region active in XEmacs.
+  "Keep the region active in XEmacs."
   ;; Ignore byte-compiler warnings you might see.  Also note that
   ;; FSF's Emacs 19 does it differently; its policy doesn't require us
   ;; to take explicit action.


;; 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)

  (let* ((ci (current-indentation))
	 (move-to-indentation-p (<= (current-column) ci))
	 (need (py-compute-indentation (not arg))))
    ;; see if we need to dedent
    (if (py-outdent-p)
	(setq need (- need py-indent-offset)))
    (if (/= ci need)
