 (factor--define-key ?z 'switch-to-factor t)
 (factor--define-key ?c 'comment-region)
 
+(factor--define-auto-indent-key ?\])
+(factor--define-auto-indent-key ?\})
+
 (define-key factor-mode-map "\C-ch" 'factor-help)
 (define-key factor-help-mode-map "\C-ch" 'factor-help)
 (define-key factor-mode-map "\C-m" 'newline-and-indent)

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

(defsubst factor--at-end-of-def ()
  (or (looking-at factor--regex-definition-end)
      (looking-at factor--regex-single-liner)))

(defun factor--at-setter-line ()

            (cl (factor--ppss-brackets-end))
            (ln (line-number-at-pos)))
        (when (> ln (line-number-at-pos op))
          (if (and (> cl 0) (= ln (line-number-at-pos cl)))
              (factor--indentation-at op)
            (factor--increased-indentation (factor--indentation-at op))))))))

