Tuareg mode and caml mode

I am currently using tuareg-mode, but I would like to use caml-mode functionality as well. In particular, I want to be able to use type annotations interactively, and apparently this happens with caml types. I tried putting http://cristal.inria.fr/~remy/poly/emacs/index.html in my .emacs.d, but I am confused about how these two modes can work together. In fact, I cannot get caml mode to work at all.

I have this line in my init.el:

(add-to-list 'load-path "~/.emacs.d/modes/caml") 

But files do not load - at least none of the function definitions and key bindings. I really thought I was beginning to understand how these emacs plugins work, but I'm starting to wonder. Can someone explain what else is going to happen?

Edit: I did not understand that require 'caml to work for this to work. However, annotations do not seem to work, although I have caml types from http://caml.inria.fr/svn/ocaml/branches/gadts/emacs/ . I am compiling with -annot , but I have not yet been told that there is no annotation file.

+7
source share
1 answer

You may have a type annotation with tuareg mode. If I have this ~ / .emacs file:

 (add-hook 'tuareg-mode-hook '(lambda () (define-key tuareg-mode-map [f10] 'caml-types-show-type); requires caml-types )) (add-to-list 'auto-mode-alist '("\\.ml\\w?" . tuareg-mode)) (autoload 'caml-types-show-type "caml-types" "Show the type of expression or pattern at point." t) 

then pressing F10 shows the type of expression under the dot. As you know, you need to compile foo.ml file with

 ocamlc -annot foo.ml 

so there is a foo.annot file in the same directory as foo.ml

+5
source

All Articles