I am writing a compiler in Ocaml with Emacs. I am told that with -annot a file .annot could be generated while compiling, which could help Emacs to show the type of my code. But it is odd that no .annot is generated after running this makefile. Could anyone tell me what is wrong with that?
Also, once i have got .annot, do I need to set up anything (for instance .emacs?) so that my Emacs read it and show the type of my code?
Thank you very much!
Edit1: after make clean and make, I have got the .annot… But I still do not know how to make use of this .annot in Emacs.
Edit2: actually it is necessary to follow this link, copy the files in a local folder, then update .emacs. Then when a .ml is edited in Emacs, C-c C-t returns its type from .annot.
Regarding your emacs inquiry –I don’t use emacs–, this is from the man-pages for
ocamlc,There are also other tools from the thread I mentioned previously.
As for the
Makefilenot creating the.annotfiles, I made a mock directory and successfully had.annotfiles created. I also don’t see anything wrong with yourMakefile. You may want to clean the directory and try again, or switch to another way to build your tool likeocamlbuild–which would require minimal setup, although, I haven’t used it withmenhir.I will also note that
-annotis new since OCaml 3.11.0, and prior the flag was-dtypes.