GIG

赴くままに技術を。

Auto Complete Modeを使ってみる

今更ながらemacsのカスタムにはまる。 まずは保管機能があればいいなと思ったら、Auto Complete Mode が良さそうな感じ。

インストール

githubからソースとってきてインストールする。 MacでGNU Emacsを利用している場合は、/Applications/Emacs.app/Contents/Resources/site-lispに*.elを格納することに注意。

$ git clone https://github.com/auto-complete/auto-complete.git
$ cd auto-complete/
$ git checkout 1.3
$ make install DIR=/Applications/Emacs.app/Contents/Resources/site-lisp/
emacs -Q -L . -batch -l etc/install /Applications/Emacs.app/Contents/Resources/site-lisp/
Loading subst-ksc...
Loading subst-gb2312...
Loading subst-big5...
Loading subst-jis...
Installing to /Applications/Emacs.app/Contents/Resources/site-lisp/ from     
/Users/hermesian/dev/emacs/auto-complete/
Wrote /Users/hermesian/dev/emacs/auto-complete/auto-complete-config.elc
Wrote /Users/hermesian/dev/emacs/auto-complete/auto-complete.elc
Wrote /Users/hermesian/dev/emacs/auto-complete/fuzzy.elc
Wrote /Users/hermesian/dev/emacs/auto-complete/popup.elc
Successfully installed!

Add the following code to your .emacs:

(add-to-list 'load-path "/Applications/Emacs.app/Contents/Resources/site-lisp/")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "/Applications/Emacs.app/Contents/Resources/site-l  
isp//ac-dict")
(ac-config-default)

あとstable版を使わないと、必要な.elがないよって怒られる(https://github.com/auto-complete/auto-complete/issues/89)。 インストールが成功すると出力される設定を~/.emacs.elに記載して終了。