Fetching contributors…
Cannot retrieve contributors at this time
45 lines (40 sloc) 1.66 KB
;; erlang-flymake.el --- Flymake support.
;; Author: Mats Cronqvist
;; Version: 0.1
;; Keywords: erlang, flymake
;; Created: 2009-05-14
;; based on snippets stolen from
;; and
;; to enable, put something like this in your erlang-mode-hook
;; (flymake-mode)
;; (local-set-key (kbd "M-'") 'erlang-flymake-next-error)
(if (locate-library "flymake")
(require 'flymake)
(defun erlang-flymake-tmp-filename(filename prefix)
"Make a temp file name (in $HOME/.erlang-flymake)"
(let* ((tmp-dir (concat (getenv "HOME") "/.erlang-flymake"))
(tmp-name (file-name-nondirectory filename))
(tmp-file (concat tmp-dir "/" tmp-name)))
(flymake-log 3 "temp-file is: %s" tmp-file)
(defun erlang-flymake-init ()
"Set up the command used to parse our buffer"
(let* ((erlang-dir (file-name-directory (locate-library "erlang")))
(temp-file (flymake-init-create-temp-buffer-copy
(list (concat erlang-dir "")
(list temp-file default-directory))))
(defun erlang-flymake-next-error ()
"Goto next error, if any. Display error in mini-buffer."
(let ((err (get-char-property (point) 'help-echo)))
(when err
(message err))))
;; add our init file to flymake's alist of filename regexps
'(".+\\.erl$" erlang-flymake-init))))