   (use-local-map factor-mode-map)
   (setq major-mode 'factor-mode)
   (setq mode-name "Factor")
-  (set (make-local-variable 'indent-line-function) #'factor-indent-line)
   (set (make-local-variable 'comment-start) "! ")
   (set (make-local-variable 'font-lock-defaults)
        '(factor-font-lock-keywords t nil nil nil))
   (set-syntax-table factor-mode-syntax-table)
-  (set (make-local-variable 'indent-line-function) 'factor-indent-line)
+  (set (make-local-variable 'indent-line-function) 'factor--indent-line)
   (setq factor-indent-width (factor--guess-indent-width))
   (setq indent-tabs-mode nil)
   (run-hooks 'factor-mode-hook))

      (factor--indent-continuation)
      0))

(defun factor-indent-line ()
  "Indent current line as Factor code"
  (let ((target (factor--calculate-indentation))
        (pos (- (point-max) (point))))

          (factor--indent-continuation)
        (if (factor--at-end-of-def)
            (- (current-indentation) factor-indent-width)
          (if (factor--at-begin-of-def)
              (+ (current-indentation) factor-indent-width)
            (current-indentation)))))))

