Emacs – Tuareg mode and CAML mode

I am currently using Tuareg mode, but I hope to be able to use the function of cam mode In particular, I want to be able to use type annotations interactively, which obviously happens with CAML types I try to http://cristal.inria.fr/ ~remy/poly/emacs/index. HTML into my emacs. D, but I'm confused about how the two models work together In fact, I can't work in cam mode at all

I'm at init There is this line in El:

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

But the file is not loaded - at least there are no function definitions or key bindings I really thought I was beginning to realize how these Emacs plug-ins worked, but I began to doubt Maybe someone can explain what else needs to happen?

Editor: I didn't realize that I had to ask 'CAML' to work Although I'm from http://caml.inria.fr/svn/ocaml/branches/gadts/emacs/ Started using CAML - types, but comments didn't seem to work I compiled using - annot, but I still told me there were no comments on the file

Solution

You can use the Tuareg pattern for type annotation

(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 press F10 to display the expression type under this point As you know, you need to use the compiled file foo ml

ocamlc -annot foo.ml

So in foo In the directory where ml is located, there is a file foo annot.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>