Update from comments: Your Emacs is version 22.1, which is ancient and too old for tuareg
:
These instructions have been tested on emacs 24.2 and should work for that version and newer. There are some reports of problems with earlier emacsen.
My original answer recommending the use of MELPA follows, and still applies.
This site that you linked suggests an alternative to manually installing tuareg
:
Using Emacs24 packages
As an alternative to the setup above, here is a simplified OCaml setup using MELPA packages.
Add to .emacs.d/init.el
(require 'package)
(add-to-list 'package-archives
'("melpa" . "http://melpa.milkbox.net/packages/") t)
Now do M-x package-install
and install tuareg
, utop
and merlin
.
Then add the rest of the configuration to .emacs.d/init.el
(add-hook 'tuareg-mode-hook 'tuareg-imenu-set-imenu)
(setq auto-mode-alist
(append '(("\\.ml[ily]?$" . tuareg-mode)
("\\.topml$" . tuareg-mode))
auto-mode-alist))
(autoload 'utop-setup-ocaml-buffer "utop" "Toplevel for OCaml" t)
(add-hook 'tuareg-mode-hook 'utop-setup-ocaml-buffer)
(add-hook 'tuareg-mode-hook 'merlin-mode)
(setq merlin-use-auto-complete-mode t)
(setq merlin-error-after-save nil)
In my opinion this is a much better solution. Packages like this are the future of Emacs, and they are often easier to install and work with.