elisp hack for Hlint API.

This commit is contained in:
Kazu Yamamoto 2010-06-08 11:23:58 +09:00
parent dec8ab5134
commit 5dd3bb83eb

View File

@ -32,24 +32,19 @@
(let ((file (file-name-nondirectory (buffer-file-name)))) (let ((file (file-name-nondirectory (buffer-file-name))))
(list ghc-module-command (ghc-flymake-command file)))) (list ghc-module-command (ghc-flymake-command file))))
(defvar ghc-hlint (ghc-which "hlint"))
(defvar ghc-flymake-command nil) ;; nil: check, t: lint (defvar ghc-flymake-command nil) ;; nil: check, t: lint
(defun ghc-flymake-command (file) (defun ghc-flymake-command (file)
(if ghc-flymake-command (if ghc-flymake-command
(list "-f" ghc-hlint "lint" file) (list "lint" file)
(list "check" file))) (list "check" file)))
(defun ghc-flymake-toggle-command () (defun ghc-flymake-toggle-command ()
(interactive) (interactive)
(if (and (null ghc-flymake-command) (setq ghc-flymake-command (not ghc-flymake-command))
(not ghc-hlint)) (if ghc-flymake-command
(message "\"hlint\" not found") (message "Syntax check with hlint")
(setq ghc-flymake-command (not ghc-flymake-command)) (message "Syntax check with GHC")))
(if ghc-flymake-command
(message "Syntax check with hlint")
(message "Syntax check with GHC"))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;