From ac04b996ab2da26d0e55de77472ace5096dcba23 Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Tue, 26 May 2015 15:23:13 -0400 Subject: [PATCH] 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." --- src/emacs/lean-flycheck.el | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/emacs/lean-flycheck.el b/src/emacs/lean-flycheck.el index 2b4019d4b..2de9c78ce 100644 --- a/src/emacs/lean-flycheck.el +++ b/src/emacs/lean-flycheck.el @@ -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 ()