       t)))
 
 ;; Go to start of statement, at or preceding point, starting with
-;; keyword KEY.  Skips blank lines and non-indenting comments upward
-;; first.  If that statement starts with KEY, done, else go back to
-;; first enclosing block starting with KEY.  If successful, leaves
-;; point at the start of the KEY line & returns t.  Else leaves point
-;; at an undefined place & returns nil.
+;; keyword (regular expression) KEY.  Skips blank lines and
+;; non-indenting comments upward first.  If that statement starts with
+;; KEY, then stop.  Otherwise go back to first enclosing block
+;; starting with KEY.  If successful, leaves point at the start of the
+;; KEY line & returns t.  Else leaves point at an undefined place &
+;; returns nil.
 (defun py-go-up-tree-to-keyword (key)
   ;; skip blanks and non-indenting #
   (py-goto-initial-line)

Searches back for the closest preceding `def'.  If you supply a prefix
arg, looks for a `class' instead.  The docs below assume the `def'
case; just substitute `class' for `def' for the other case.

When second optional argument is given programmatically, move to the
COUNTth start of `def'.

pleasant."
  (interactive "P")			; raw prefix arg
  (let ((start (point))
	(which (cond ((eq class 'either) "\\(class\\|def\\)")
		     (class "class")
		     (t "def"))))
    (push-mark start)
    (if (not (py-go-up-tree-to-keyword which))
	(progn (goto-char start)
	       (error "Enclosing %s not found"
		      (if (eq class 'either)
			  "def or class"
			which)))
      ;; else enclosing def/class found
      (setq start (point))
      (py-goto-beyond-block)
