            (exts     '(".ilean" ".d" ".olean"))
            (tempfiles (--map (concat tempfile it) exts)))
       (mapc #'flycheck-safe-delete tempfiles))))
-
 
 (defun lean-flycheck-error-list-buffer-width ()
   "Return the width of flycheck-error list buffer"

      (lean-flycheck-turn-off)
    (lean-flycheck-turn-on)))

(eval-after-load "flycheck"
  '(defadvice flycheck-try-parse-error-with-pattern
     (after lean-flycheck-try-parse-error-with-pattern activate)
     "Add 1 to error-column."
     (let* ((err ad-return-value)
            (col (and err (flycheck-error-column err))))
       (when (and (string= major-mode "lean-mode") col)
         (setf (flycheck-error-column ad-return-value) (1+ col))))))

(defun lean-flycheck-delete-temporaries ()
  "Delete temporaries files generated by flycheck."
  (when (eq major-mode 'lean-mode)

              (minimal-match
               (message (one-or-more (zero-or-more not-newline) (? "\r") "\n")))
              "FLYCHECK_END" (? "\r") line-end))
    :error-filter
    '(lambda (errors)
       (flycheck-sanitize-errors (flycheck-increment-error-columns errors)))
    :modes '(lean-mode))
  (add-to-list 'flycheck-checkers 'lean-checker))

(defun lean-flycheck-turn-on ()
