           (backward-prefix-chars)
           (current-column))
       (let ((function (buffer-substring (point)
-                                        (progn (forward-sexp 1) (point))))
-            method)
+                                        (progn (forward-sexp 1) (point)))))
         (setq method (or (get (intern-soft function) 'lcad-indent-function)
                          (get (intern-soft function) 'lisp-indent-hook)))
         (cond ((or (eq method 'defun)

              ((integerp method)
               (lisp-indent-specform method state
                                     indent-point normal-indent))
              (method
               (funcall method indent-point state)))))))

(defun compile ()

(progn
  (add-to-list 'auto-mode-alist '("\\.lcad\\'" . lcad-mode)))

(defvar lcad-indent-offset 1)

;; lcad specific offsets here
(put 'def 'lcad-indent-function 'defun)
(put 'for 'lcad-indent-function 1)
(put 'mirror 'lcad-indent-function 1)
(put 'rotate 'lcad-indent-function 1)
(put 'translate 'lcad-indent-function 1)
(put 'while 'lcad-indent-function 1)

(defun lcad-indent-function (indent-point state)
  (let ((temp (lcad-indent-function-try1 indent-point state)))
    (print "indent")
    (print temp)
    temp))

(defun lcad-indent-function-try1 (indent-point state)
  (let ((normal-indent (current-column)))
    (goto-char (1+ (elt state 1)))
    (parse-partial-sexp (point) calculate-lisp-indent-last-sexp 0 t)
