 Note that doing this command repeatedly will take you closer to the
 start of the buffer each time.
 
-If you want to mark the current `def', see `\\[py-mark-def-or-class]'."
+To mark the current `def', see `\\[py-mark-def-or-class]'."
   (interactive "P")			; raw prefix arg
   (if (not count)
       (setq count 1))
   (let ((at-or-before-p (<= (current-column) (current-indentation)))
 	(start-of-line (goto-char (py-point 'bol)))
 	(start-of-stmt (goto-char (py-point 'bos)))
-	(start-re (if class
-		      "^[ \t]*class\\>"
-		    "^[ \t]*def\\>"))
+	(start-re (cond ((eq class 'either) "^[ \t]*\\(class\\|def\\)\\>")
+			(class "^[ \t]*class\\>")
+			(t "^[ \t]*def\\>")))
 	)
     ;; searching backward
     (if (and (< 0 count)

;; statement we need to skip over the continuation lines.  Tricky:
;; Again we need to be clever to avoid quadratic time behavior.
(defun py-goto-beyond-final-line ()
  ;; TEST ADDED BY MDE; not quite the right solution
  (if (looking-at (concat "[ \t]*\\(" py-stringlit-re "\\)"))
      (goto-char (match-end 0)))
  ;;

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)
