This is part of oh-my-emacs.
Package | Windows | Ubuntu/Debian/Mint | ArchLinux | Fedora | Mac OS X | Mandatory? |
---|---|---|---|---|---|---|
ocaml | ocaml | Yes |
Package | Status | Description |
---|---|---|
caml-mode | Required | OCaml code editing commands for Emacs |
tuareg-mode | Required | A GOOD Emacs mode to edit Objective Caml code. |
I’m a newbie in OCaml, so I can’t provide too much help about how to do OCaml programming effectively in Emacs. Real World Ocaml provide really detailed instructions about how to install necessary tools to develop with OCaml. There’re also some good resources about OCaml:
- http://batteries.forge.ocamlcore.org/
- http://www.camlcity.org/
- http://ocaml.org/
- http://search.ocaml.jp/: OCaml API search
- http://caml.inria.fr/index.en.html: The Caml language
Unlike python, there are not too many choices for OCaml in Emacs.
;; Keep an empty hook function for later customization.
(defun ome-caml-mode-setup ())
(when (executable-find "ocaml")
(ome-install 'caml-mode))
You may wonder what’s the relations between caml-mode
and tuareg-mode
? In
fact, you can use tuareg-mode
without caml-mode
, but some basic functions
depends on caml-mode
, so we install both. See typerex’s FAQ for details.
(defun ome-tuareg-mode-setup ()
;; The following settings comes from tuareg-mode's README
;; use new SMIE engine
(setq tuareg-use-smie t)
;; Indent `=' like a standard keyword.
(setq tuareg-lazy-= t)
;; Indent [({ like standard keywords.
(setq tuareg-lazy-paren t)
;; No indentation after `in' keywords.
(setq tuareg-in-indent 0)
;; set ocaml library path
(setq tuareg-library-path "/usr/lib/ocaml")
(add-hook 'tuareg-mode-hook
(lambda ()
(define-key tuareg-mode-map (kbd "RET")
'newline-and-indent))))
(when (executable-find "ocaml")
(ome-install 'tuareg-mode))