     (when (factor-at-begin-of-def) 0)))
 
 (defsubst factor-previous-non-empty ()
+  "Move caret to the beginning of the last non-empty line."
   (forward-line -1)
   (while (and (not (bobp))
-              (factor-looking-at-emptiness))
+              (looking-at "^[ ]*$\\|$"))
     (forward-line -1)))
 
 (defun factor-indent-setter-line ()

(defsubst factor-at-end-of-def ()
  (looking-at factor-end-of-def-regex))

(defsubst factor-looking-at-emptiness ()
  (looking-at "^[ ]*$\\|$"))

(defsubst factor-is-last-char (pos)
  (save-excursion
    (goto-char (1+ pos))

           (goto-char pos)
           (beginning-of-line)
           (point))))

(defsubst factor-beginning-of-defun (&optional times)
  (re-search-backward factor-begin-of-def-regex nil t times))
