Emacsでclojureを扱い易くする環境設定

Emacsclojureの開発環境を整えるために、行なったことのメモ。

install-elisp.elをインストール

1.install-elisp.el をダウンロードします。

# curl -O http://www.emacswiki.org/cgi-bin/wiki/download/install-elisp.el

2.ダウンロードしたファイルを ~.emacs.d/elisp フォルダに置きます。
3. .emacs に設定を書いて保存します。

(require 'install-elisp)
(setq install-elisp-repository-directory "~/.emacs.d/elisp/")

package.el をインストール

1.EmacsでM-x install-elispコマンドを打ち込む
URLは、http://tromey.com/elpa/package-install.el

2.package-install.elファイルの中身がEmacsに表示される。
C-c、C-cで保存、コンパイル、ロードが行われる。

3.いったんEmacsを終了させる。
4. .emacsに以下の内容が追記されている。

;;; This was installed by package-install.el.
;;; This provides support for the package system and
;;; interfacing with ELPA, the package archive.
;;; Move this code earlier if you want to reference
;;; packages in your .emacs.
(when
    (load
     (expand-file-name "~/.emacs.d/elpa/package.el"))
  (package-initialize))

clojure-modeのインストール

M-x package-list-packageコマンドをタイプ

clojure-modeを選択してインストール。

:
I clojure-mode	    1.7.1     available	 Major mode for Clojure code
  clojure-test-mode 1.4	      available	 Minor mode for Clojure tests
:

インストール完了後、.cljファイルを開くと構文のハイライトが有効になる。