feat(emacs/lean-flycheck): customize checker name and options

This commit is contained in:
Soonho Kong 2014-08-13 15:06:22 -07:00
parent 3cd381b0f7
commit d2ef577a14
2 changed files with 18 additions and 8 deletions

View file

@ -4,12 +4,15 @@
;; Author: Soonho Kong ;; Author: Soonho Kong
;; ;;
(defvar-local lean-flycheck-initialized nil (defvar lean-flycheck-initialized nil
"Return true if lean-flycheck has been initialized") "Return true if lean-flycheck has been initialized")
(defvar-local lean-flycheck-lmake-name "lmake"
"lmake name") (defun lean-flycheck-command ()
(defvar-local lean-flycheck-lmake-options "--flycheck" (cl-concatenate 'list
"flycheck option for lean") `(,(lean-get-executable lean-flycheck-checker-name))
lean-flycheck-checker-options
'("--")
'(source-inplace)))
(defun lean-flycheck-init () (defun lean-flycheck-init ()
"Initialize lean-flychek checker" "Initialize lean-flychek checker"
@ -18,9 +21,7 @@
(eval (eval
`(flycheck-define-checker lean-checker-file `(flycheck-define-checker lean-checker-file
"A Lean syntax checker (file)." "A Lean syntax checker (file)."
:command (,(lean-get-executable lean-flycheck-lmake-name) :command ,(lean-flycheck-command)
,lean-flycheck-lmake-options
source-inplace)
:error-patterns :error-patterns
((error line-start "FLYCHECK_BEGIN ERROR\n" ((error line-start "FLYCHECK_BEGIN ERROR\n"
(file-name) ":" line ":" column ": error: " (file-name) ":" line ":" column ": error: "

View file

@ -35,6 +35,15 @@
:group 'lean :group 'lean
:type 'boolean) :type 'boolean)
(defcustom lean-flycheck-checker-name "lmake"
"lean-flychecker checker name"
:group 'lean
:type 'string)
(defcustom lean-flycheck-checker-options '("--jobs" "--keep-going" "--flycheck")
"lean-flychecker checker option"
:group 'lean)
(defcustom lean-delete-trailing-whitespace nil (defcustom lean-delete-trailing-whitespace nil
"Set this variable to true to automatically delete trailing "Set this variable to true to automatically delete trailing
whitespace when a buffer is loaded from a file or when it is whitespace when a buffer is loaded from a file or when it is