1 ;; erlang-flymake.el --- Flymake support.
3 ;; Author: Mats Cronqvist
5 ;; Keywords: erlang, flymake
8 ;; based on snippets stolen from
9 ;; http://www.emacswiki.org/emacs/FlyMake
11 ;; http://www.emacswiki.org/emacs/FlymakeErlang
13 ;; to enable, put something like this in your erlang-mode-hook
15 ;; (local-set-key (kbd "M-'") 'erlang-flymake-next-error)
17 (if (locate-library "flymake")
20 (defun erlang-flymake-init ()
21 "Set up the command used to parse our buffer"
22 (let* ((erlang-dir (file-name-directory (locate-library "erlang")))
23 (temp-file (flymake-init-create-temp-buffer-copy
24 'flymake-create-temp-inplace
))
25 (local-file (file-relative-name
27 (file-name-directory buffer-file-name
))))
28 (list (concat erlang-dir
"flymaker.sh") (list local-file
))))
29 (defun erlang-flymake-next-error ()
30 "Goto next error, if any. Display error in mini-buffer."
34 (setq err-buf
(next-error-find-buffer))
39 (flymake-goto-next-error)
40 (let ((err (get-char-property (point) 'help-echo
)))
43 ;; add our init file to flymake's alist of filename regexps
45 'flymake-allowed-file-name-masks
46 '(".+\\.erl$" erlang-flymake-init
))))