Permalink
Browse files

gh-4 Enable flycheck when in malabar-mode

  • Loading branch information...
Matthew O. Smith
Matthew O. Smith committed Jan 16, 2014
1 parent fd1bf00 commit 3d584e219d1016c03e05d5901e0dcf842b0772c4
Showing with 17 additions and 8 deletions.
  1. +17 −8 src/main/lisp/malabar-flycheck.el
@@ -27,11 +27,20 @@
;; "-cp" (malabar-classpath-test buf)
;; (malabar-util-expand-file-name (buffer-file-name buf))))))
-
-(flycheck-define-checker malabar-mode-javac
- "Syntax java code on the fly"
- :command ("javac"
- "-cp" (eval (malabar-classpath-test))
- (eval (malabar-util-expand-file-name (buffer-file-name))))
- :error-parser flycheck-parse-checkstyle
- :modes malabar-mode)
+(eval-after-load 'malabar-mode
+ '(progn
+ (flycheck-define-checker malabar-mode-javac
+ "Syntax java code on the fly"
+ :command ("javac"
+ "-cp" (eval (malabar-classpath-test))
+ (eval (malabar-util-expand-file-name (buffer-file-name))))
+ :error-parser flycheck-parse-checkstyle
+ :modes malabar-mode)
+
+
+ (defun malabar-flycheck-enable ()
+ (setq flycheck-checker 'malabar-mode-javac)
+ (flycheck-mode 1))
+
+ (add-hook 'malabar-mode-hook #'malabar-flycheck-enable)))
+

0 comments on commit 3d584e2

Please sign in to comment.