Shammer's Philosophy

My private adversaria

Windows上のEmacsでtuaregを使う

大した作業ではないけれども、忘れそうなのでメモ。今日の時点で最新のtuaregは2.0.6だった。ダウンロードはここから。

  1. ダウンロードしたファイルを解凍。tuareg-2.0.6を入手
  2. tuareg-2.0.6を%USER_HOME%/.emacs.d/lispへコピー
  3. %USER_HOME%/.emacs.d/init.elに下記を記述

(add-to-list 'load-path "~/.emacs.d/lisp/tuareg-2.0.6")
(setq tuareg-interactive-program "ocaml")
(autoload 'tuareg-mode "tuareg" "Major mode for editing Caml code." t)
(autoload 'tuareg-run-caml "tuareg" "startup a Caml toplevel" t)
(autoload 'camldebug "camldebug" "Run the Caml debugger." t)
(autoload 'tuareg-imenu-set-imenu "tuareg-imenu" "Configuration of imenu for tuareg" t)
(add-hook 'tuareg-mode-hook 'tuareg-imenu-set-imenu)

拡張子との関連付けは以下。

(setq auto-mode-alist
(append '(
("\\.C$" . c-mode)
("\\.cc$" . c-mode)
("\\.cpp$" . c++-mode)
("\\.hh$" . c++-mode)
("\\.c$" . c-mode)
("\\.h$" . c-mode)
("\\.m$" . objc-mode)
("\\.java$" . java-mode)
("\\.pl$" . cperl-mode)
("\\.perl$" . cperl-mode)
("\\.tex$" . yatex-mode)
("\\.sty$" . yatex-mode)
("\\.cls$" . yatex-mode)
("\\.clo$" . yatex-mode)
("\\.dtx$" . yatex-mode)
("\\.fdd$" . yatex-mode)
("\\.ins$" . yatex-mode)
("\\.s?html?$" . html-mode)
("\\.php$" . html-helper-mode)
("\\.jsp$" . html-helper-mode)
("\\.css$" . css-mode)
("\\.js$" . java-mode)
("\\.el$" . emacs-lisp-mode)
("\\.lisp$" . lisp-mode)
("\\.ml[ilyp]?$" . tuareg-mode);ここ
("\\.xml$" . sgml-mode)) auto-mode-alist))

まあ、EmacsWikiTuaregModeとか、ダウンロードしたREADMEにも書いてあるのだけれども・・・