Skip to content

Instantly share code, notes, and snippets.

@ichiban
Created October 16, 2011 08:21
Show Gist options
  • Save ichiban/1290650 to your computer and use it in GitHub Desktop.
Save ichiban/1290650 to your computer and use it in GitHub Desktop.
Flymake Ocaml settings that doesn't hang my GNU Emacs 23.3.1 (x86_64-apple-darwin10.7.0, NS apple-appkit-1038.35)
;; Flymake Ocaml
(add-to-list 'exec-path "~/bin")
(defun flymake-ocaml-init ()
(flymake-simple-make-init-impl
'flymake-create-temp-with-folder-structure nil nil
(file-name-nondirectory buffer-file-name)
'flymake-get-ocaml-cmdline))
(defun flymake-get-ocaml-cmdline (source base-dir)
(list "ocaml_flycheck.pl"
(list source base-dir)))
(setq flymake-allowed-file-name-masks
'((".+\\.ml[yilp]?$" flymake-ocaml-init)))
(setq flymake-err-line-patterns
'(("^\\(\.+\.ml[yilp]?\\|\.lhs\\):\\([0-9]+\\):\\([0-9]+\\):\\(.+\\)" 1 2 3 4)))
;; optional setting
;; if you want to use flymake always, then add the following hook.
(add-hook 'tuareg-mode-hook
'(lambda ()
(if (not (null buffer-file-name)) (flymake-mode))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment