OCamlPro / ocp-indent

Indentation tool for OCaml, to be used from editors like Emacs and Vim.
http://www.typerex.org/ocp-indent.html
Other
200 stars 63 forks source link

Problem with ocamllex syntax #218

Open correnson opened 8 years ago

correnson commented 8 years ago

It seems that ocp-indent works badly with parsing rules in .mll files. However, it is automatically activated by the tuareg hook.

william3 commented 8 years ago

+1, I am having a really bad time with .mll and .mly files

AltGr commented 8 years ago

Indeed, syntax for .mll and .mly files is quite different.

M-: (setq-local ocp-indent-syntax '("mll"))

In any case, you can locally disable ocp-indent while in tuareg-mode using

M-: (progn (kill-local-variable 'indent-line-function) (kill-local-variable 'indent-region-function) (tuareg--common-mode-setup))
correnson commented 8 years ago

Thanks for those tips!

It would be great to have ocp-indent automatically disabled from tuareg on mll and mly files until a better support for them. I'd share some workaround as soon as I have some.