fix(emacs/lean-flycheck.el): use flycheck-define-command-checker

Comment from @lunaryorn (flycheck author):

"eval around flycheck-define-checker breaks byte compilation and
scoping. Please use flycheck-define-command-checker if you need to
create :command dynamically."
This commit is contained in:
Soonho Kong 2015-05-26 15:23:13 -04:00
parent 0502f46f9b
commit ac04b996ab

View file

@ -31,28 +31,20 @@
(defun lean-flycheck-init ()
"Initialize lean-flychek checker"
(eval
`(flycheck-define-checker lean-checker
"A Lean syntax checker."
:command ,(lean-flycheck-command)
:error-patterns
((error line-start "FLYCHECK_BEGIN ERROR" (? "\r") "\n"
(file-name) ":" line ":" (? column ":") " error: "
(flycheck-define-command-checker 'lean-checker
"A Lean syntax checker."
:command (lean-flycheck-command)
:error-patterns
'((error line-start "FLYCHECK_BEGIN ERROR" (? "\r") "\n"
(file-name) ":" line ":" (? column ":") " error: "
(minimal-match
(message (one-or-more (zero-or-more not-newline) (? "\r") "\n")))
"FLYCHECK_END" (? "\r") line-end)
(warning line-start "FLYCHECK_BEGIN INFORMATION" (? "\r") "\n"
(file-name) ":" line ":" (? column ":") " information: "
(minimal-match
(message (one-or-more (zero-or-more not-newline) (? "\r") "\n")))
"FLYCHECK_END" (? "\r") line-end)
(warning line-start "FLYCHECK_BEGIN INFORMATION" (? "\r") "\n"
(file-name) ":" line ":" (? column ":") " information: "
(minimal-match
(message (one-or-more (zero-or-more not-newline) (? "\r") "\n")))
"FLYCHECK_END" (? "\r") line-end)
;; (warning line-start "FLYCHECK_BEGIN WARNING" (? "\r") "\n"
;; (file-name) ":" line ":" (? column ":") " warning: "
;; (minimal-match
;; (message (one-or-more (zero-or-more not-newline) (? "\r") "\n")))
;; "FLYCHECK_END" (? "\r") line-end)
)
:modes (lean-mode)))
"FLYCHECK_END" (? "\r") line-end))
(add-to-list 'flycheck-checkers 'lean-checker))
(defun lean-flycheck-turn-on ()