Emacsの環境を整理してみた

MacBookAirを買ってEmacsの設定を考えていたんだけど、.emacsを整理する意味でもう一度ゼロから設定し始めた。もう、.emacsじゃなくて、~/.emacs.d/init.elをメンテすべきなんだね。

元ネタはWeb DB Press Vol.58の特集から。auto-install.elを入れて色の設定をいろいろ。

とりあえずこれで使えるってレベル。

;; load-pathを追加する関数を定義
(defun add-to-load-path (&rest paths)
  (let (path)
    (dolist (path paths paths)
      (let ((default-directory (expand-file-name (concat user-emacs-directory path))))
	(add-to-list 'load-path default-directory)
	(if (fboundp 'normal-top-level-add-subdirs-to-load-path)
	    (normal-top-level-add-subdirs-to-load-path))))))

;;elispとconfディレクトリをサブディレクトリごとload-pathに追加
(add-to-load-path "elisp" "conf")

;; (install-elisp "http://www.emacswiki.org/emacs/download/auto-install.el")
(when (require 'auto-install nil t)
  ;; インストールディレクトリを設定する 初期値は ~/.emacs.d/auto-install/
  (setq auto-install-directory "~/.emacs.d/elisp/")
  ;; EmacsWikiに登録されているelispの名前を取得する
  (auto-install-update-emacswiki-package-name t)
  ;; 必要であればプロキシの設定
  ;; (setq url-proxy-services '(("http" . "localhost:8339")))
  (auto-install-compatibility-setup))

;; 文字コードと日本語ファイル名の設定(Mac用)
(set-language-environment "Japanese")
(require 'ucs-normalize)
(prefer-coding-system 'utf-8-hfs)
(setq file-name-coding-system 'utf-8-hfs)
(setq locale-coding-system 'utf-8-hfs)

;; スタートアップメッセージを非表示
(setq inhibit-startup-screen t)

;; タブ幅は4
(setq-default tab-width 4)

;; タブ文字を利用せずにスペースを利用する
(setq-default indent-tabs-mode nil)

;; 初期のウィンドウの幅と高さ
(if (boundp 'window-system)
    (setq initial-frame-alist
          (append (list
                   '(width . 100) ;; ウィンドウの幅
                   '(height . 80)
                   )
                  initial-frame-alist)))
(setq default-framealist initial-frame-alist)

;; color-theme-6.6.0
(when (require 'color-theme nil t)
  ;; テーマを読み込むための設定
  (color-theme-initialize)
  (color-theme-clarity))

今んところ、中点が□として表示されてしまうことと、フォントがもうちょっとどうにかならないかなぁという点。どこがどうってことじゃないんだけど。

後はタブ幅4でタブじゃなくてスペースを利用するようにしているんだけど、これってMakefileいじるときには微妙に困るんじゃね?って心配がある点。いや、Makefileなんていじらないんだけど。

いずれ解消していこうかなぁと思っているけど、いつになるんだろうなぁ。