flymake mode
I’ve been using flymake mode lately.
I’ve really only started to use flymake-mode after I also began using maven. Thanks to pom-parser I can configure my projects directly from pom.xml, no need to manually setup multiple classpaths, pom-parser takes care of this.
Here’s the steps:
- setup your pom.xml
- setup a simple prj.el like this:
(jde-project-file-version "1.0")
(jde-set-variables
'(jde-compile-option-command-line-args
(quote ("-Xlint:all" "-Xlint:-serial"))))
(require 'pom-parser)
(with-pom ()
(pom-set-jde-variables *pom-node*))
- You’ll need to download the eclipse compiler. At the time of this writing I’m using 3.3.2, the latest eclipse. Save the ecj.jar some place convenient. I like to put mine with the emacs config so I can easily locate the correct version of the jar.
- Enable flymake mode: M-x flymake-mode, or bind it to a key for a mode that makes sense: <tt>(define-key jde-mode-map [f11] ‘flymake-mode)</tt>
- That’s it. Pretty easy.
Here’s rest of my flymake settings:
(custom-set-variables
'(flymake-allowed-file-name-masks
(cons '("\\.java\\'" . (jde-ecj-server-flymake-init jde-ecj-flymake-cleanup))
flymake-allowed-file-name-masks ))
'(flymake-no-changes-timeout 2.0)
'(flymake-log-level 3)
'(flymake-start-syntax-check-on-newline nil)
'(jde-compiler '(("eclipse java compiler server" "~/emacs/ecj-3.3M6.jar")))
'(jde-ecj-command-line-args (quote ("-d" "none" "-1.5" "-warn:unused,semicolon" "-maxProblems" "50" "-g")))
)
1 Comment
Jump to comment form | comments rss [?] | trackback uri [?]