Erlang開発環境準備on Arch Linux

# yaort -S erlang

これでelispも一緒に入ってくるらしい。
emacsの設定は、Erlang本家のドキュメント
http://www.erlang.org/doc/apps/tools/erlang_mode_chapter.html
を参考にしましょ…

3.4  Setup on UNIX

To set up the Erlang Emacs mode on a UNIX systems, edit/create the file .emacs in the your home directory.
Below is a complete example of what should be added to a user's .emacs provided that OTP is installed in the directory /usr/local/otp :

 (setq load-path (cons  "/usr/local/otp/lib/tools-/emacs"
      load-path))
      (setq erlang-root-dir "/usr/local/otp")
      (setq exec-path (cons "/usr/local/otp/bin" exec-path))
      (require 'erlang-start)

うーん、パスの直書きってのがなあ。バージョン番号変わったときにどうするのかとか…
というわけで、こうしてみました。
~/.zshrc

export ERLANG_HOME=/usr/lib/erlang

~/.emacs.d/init.el

(setq load-path
        (cons (let *1
        load-path))
(setq erlang-root-dir (getenv "ERLANG_HOME"))
(setq exec-path (cons (concat (getenv "ERLANG_HOME") "/bin") exec-path))
(require 'erlang-start)

で、emacs起動。



え、何かエラー出てる。
バグでerlang-skels.elが入ってないとか、もうね…。
https://bugs.archlinux.org/task/18706
githubにて目標捕捉。
http://github.com/erlang/otp/raw/dev/lib/tools/emacs/erlang-skels.el
これを
/usr/lib/erlang/lib/tools-2.6.5.1/emacs
に設置して完了。

…あー、バイトコンパイルするのや、~/.emacs.d/elispの下に置いたりするのはどうするかな。

*1:erllib (concat (getenv "ERLANG_HOME") "/lib/"))) (concat erllib (file-name-completion "tools-" erllib) "emacs"