From 6e6e1c9ad789c89d23dcbbacbdfa81648e530d94 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Sat, 29 May 2010 13:33:54 +0900 Subject: [PATCH] Does not allow C-cC-c when hlint does not exist. --- elisp/ghc-flymake.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/elisp/ghc-flymake.el b/elisp/ghc-flymake.el index 9ca01df..055d1e2 100644 --- a/elisp/ghc-flymake.el +++ b/elisp/ghc-flymake.el @@ -43,10 +43,13 @@ (defun ghc-flymake-toggle-command () (interactive) - (setq ghc-flymake-command (not ghc-flymake-command)) - (if ghc-flymake-command - (message "Syntax check with hlint") - (message "Syntax check with GHC"))) + (if (and (null ghc-flymake-command) + (not ghc-hlint)) + (message "\"hlint\" not found") + (setq ghc-flymake-command (not ghc-flymake-command)) + (if ghc-flymake-command + (message "Syntax check with hlint") + (message "Syntax check with GHC")))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;