Emacsの環境を整理してみた。 その2

この前のものから微妙にメンテ。

;; 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)

;; 行番号を表示する
;;(global-linum-mode)

;; タブ幅は4
(setq-default tab-width 4)
;; Rubyは3文字で
(add-hook 'ruby-mode-hook
          '(lambda ()
             (setq tab-width 3)  ;; タブ幅は3
             (setq ruby-indent-level tab-width)
             )
          )

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

;; 初期のウィンドウの幅と高さ
(if (boundp 'window-system)
    (setq initial-frame-alist
          (append (list
                   '(alpha . (80 70 50 30)) ;; ウィンドウの透明度
                   '(width . 100) ;; ウィンドウの幅
                   '(height . 40) ;; ウインドウの高さ
                   )
                  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))

やったのは、ウインドウの透明化と、Rubyスクリプトをちゃちゃって書くときにタブ幅を3文字にするってところかな。