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:
parent
0502f46f9b
commit
ac04b996ab
1 changed files with 12 additions and 20 deletions
|
@ -31,28 +31,20 @@
|
||||||
|
|
||||||
(defun lean-flycheck-init ()
|
(defun lean-flycheck-init ()
|
||||||
"Initialize lean-flychek checker"
|
"Initialize lean-flychek checker"
|
||||||
(eval
|
(flycheck-define-command-checker 'lean-checker
|
||||||
`(flycheck-define-checker lean-checker
|
"A Lean syntax checker."
|
||||||
"A Lean syntax checker."
|
:command (lean-flycheck-command)
|
||||||
:command ,(lean-flycheck-command)
|
:error-patterns
|
||||||
:error-patterns
|
'((error line-start "FLYCHECK_BEGIN ERROR" (? "\r") "\n"
|
||||||
((error line-start "FLYCHECK_BEGIN ERROR" (? "\r") "\n"
|
(file-name) ":" line ":" (? column ":") " error: "
|
||||||
(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
|
(minimal-match
|
||||||
(message (one-or-more (zero-or-more not-newline) (? "\r") "\n")))
|
(message (one-or-more (zero-or-more not-newline) (? "\r") "\n")))
|
||||||
"FLYCHECK_END" (? "\r") line-end)
|
"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)))
|
|
||||||
(add-to-list 'flycheck-checkers 'lean-checker))
|
(add-to-list 'flycheck-checkers 'lean-checker))
|
||||||
|
|
||||||
(defun lean-flycheck-turn-on ()
|
(defun lean-flycheck-turn-on ()
|
||||||
|
|
Loading…
Reference in a new issue