auto-complete の最新版を導入しました。

どうもりんこです。なんだかさぶいですね。


auto-complete.el マンセー

環境

導入

といっても,私の場合は更新。

% (cd ~/.emacs.d && mkdir old && mv auto-complete*.el old)
% git clone http://cx4a.org/repo/auto-complete.git
% cd auto-complete 
% cp *.el ~/.emacs.d/

ほいで,Meadow の再起動して,設定の見直し && さらしあげ。
どうやら,今まで使用していた,ac-auto-complete-mode-map というのは,
defvaralias で,ac-completing-map になっていて,オリジナルは,
ac-completing-map の方のようなので,そちらを使うように修正。
それから,C-g とかで補完を中止させた後に,あ,やっぱまた補完したい場合が,
私の場合,結構あるので,それを実現するために,
(define-key ac-mode-map "\C-c\C-i" 'auto-complete)
を追加。ほいで,動作を確認。オッケー牧場。

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; auto-complete mode
;; http://www.emacswiki.org/emacs/AutoComplete
;; http://cx4a.org/repo/auto-complete.git
(when (and (require 'auto-complete nil t) (require 'auto-complete-config nil t))
  (require 'ac-dabbrev)
  (global-auto-complete-mode t)
  (setq ac-auto-start 2)
  (set-default 'ac-sources '(ac-source-abbrev ac-source-words-in-buffer))
  (setq ac-modes (append ac-modes '(jde-mode)))
  (define-key ac-completing-map "\C-n" 'ac-next)
  (define-key ac-completing-map "\C-p" 'ac-previous)
  (define-key ac-mode-map "\C-c\C-i" 'auto-complete)
  (add-to-list 'ac-gtags-modes 'jde-mode t)
  (custom-set-faces  '(pulldown-default-face ((t (:background "slate gray" :foreground "white"))))
                     '(pulldown-default-selection-face ((t (:background "blue" :foreground "white"))))
                     '(ac-completion-face ((t (:background "blue" :foreground "white"))))
                     '(ac-candidate-face ((t (:background "slate gray" :foreground "white"))))
                     '(ac-selection-face ((t (:background "blue" :foreground "white"))))
                     '(ac-dabbrev-menu-face ((t (:background "slate gray" :foreground "white"))))
                     '(ac-dabbrev-selection-face ((t (:background "firebrick4" :foreground "white"))))
                     '(ac-gtags-candidate-face ((t (:background "slate gray" :foreground "white"))))
                     '(ac-gtags-selection-face ((t (:background "indian red" :foreground "white")))))
  )

色の問題も前回解決済みなので,モーマンタイ。
TODO に etags, ctags とあったので,期待。
global だけでは対応言語がしんどいし,etags の方が手軽っちゃー手軽だし。
恐れ多くも,オレに何かできるか? とも考えたが,
すでにやっている人いそうだから,陰ながら応援するとこにした。


それから。
作者さま,本当にありがとう!
まじめな話,感動してます。無償でこういったすばらしいものを造り出して
使わせてもらえるのは,本当に本当にありがたいです。
そしてワシはいろんな人の努力のおかげて生きていられるんだなぁと
まじで思います。いかんなぁ,最近涙腺ゆるめだし,すぐ感謝したくなるし。
すばらしい英訳本にであって,まじで感動して泣きそうになるし。
老いさらばえたのかなぁ。

おまけのコーナー

  • git ls-files というナニコレ便利的コマンドを知った。

早速,alias gitl='git ls-files' しちゃった。大丈夫かな?

  • もいっこおまけがあったけど,思い出せん。あー,思い出した,session だ。

C-xC-f して,C-r なり,M-r なりして,以前開いたファイルを履歴から
検索して開こうと思ったけど,見つからなかった。そもそも履歴数が少なすぎ。
以前,history-length を1000にしたのに。
で,なんか適当に,session の設定が問題じゃね? と思って,
下記のように適当に設定してみた。
つぎに Meadow を再起動するのがいつになるかわからんが,
そのときに結果がわかるはず。

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Maximum length for histroy lists
(setq history-length 10000)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; session.el
(when (require 'session nil t)
  (setq session-initialize '(session places))
  (setq session-globals-max-size 1024)
  (setq session-globals-max-string (* 1024 1024))
  (setq session-globals-include '((kill-ring 100) (session-file-alist 512) (file-name-history 512)))
  (add-hook 'after-init-hook 'session-initialize))