I have been working on binding merlin, a scriptable OCaml toplevel, into emacs to greatly improve the OCaml experience inside Emacs.
merlin provides a lot of nice features:
Knowing the type of an expression and a module:
Semantic completion, based on global environments:
Reporting type and parsing errors before compiling:
All these nice features are provided by hacking on top of the OCaml toplevel. merlin provides a json interface, easy enough to bind inside emacs even for an elisp beginner as I am. Of course it is not bug-free yet, as elisp is still very mysterious to me. The README documents how to install it. If you have opam you can use the temporary repository:
opam remote add kiwi http://kiwi.iuwt.fr/~asmanur/opam/.git opam install merlin