From 9ab0f4bf19f723f5b69441b261871d1a6fd278dc Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Thu, 27 Mar 2014 10:35:09 +0900 Subject: [PATCH] hlint again in Elisp. --- elisp/ghc-check.el | 17 ++++++++++++++++- elisp/ghc.el | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/elisp/ghc-check.el b/elisp/ghc-check.el index f36e55a..403625b 100644 --- a/elisp/ghc-check.el +++ b/elisp/ghc-check.el @@ -45,7 +45,9 @@ (ghc-defstruct hilit-info file line col msg err) (defun ghc-check-send () - (concat "check " ghc-process-original-file "\n")) + (if ghc-check-command + (concat "lint " ghc-process-original-file "\n") + (concat "check " ghc-process-original-file "\n"))) (defun ghc-check-callback () (let ((regex "^\\([^\n\0]*\\):\\([0-9]+\\):\\([0-9]+\\): *\\(.+\\)") @@ -252,4 +254,17 @@ (insert " _")) (insert " = error \"" fn "\""))))) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(defvar ghc-hlint-options nil "*Hlint options") + +(defvar ghc-check-command nil) + +(defun ghc-toggle-check-command () + (interactive) + (setq ghc-check-command (not ghc-check-command)) + (if ghc-check-command + (message "Syntax check with hlint") + (message "Syntax check with GHC"))) + (provide 'ghc-check) diff --git a/elisp/ghc.el b/elisp/ghc.el index f8d0515..b0b612e 100644 --- a/elisp/ghc.el +++ b/elisp/ghc.el @@ -78,7 +78,7 @@ (define-key haskell-mode-map ghc-insert-key 'ghc-insert-template) (define-key haskell-mode-map ghc-sort-key 'ghc-sort-lines) (define-key haskell-mode-map ghc-check-key 'ghc-save-buffer) -;; (define-key haskell-mode-map ghc-toggle-key 'ghc-flymake-toggle-command) -- fixme + (define-key haskell-mode-map ghc-toggle-key 'ghc-toggle-check-command) (define-key haskell-mode-map ghc-module-key 'ghc-insert-module) (define-key haskell-mode-map ghc-hoogle-key 'haskell-hoogle) (define-key haskell-mode-map ghc-shallower-key 'ghc-make-indent-shallower)