 (when (fboundp 'tool-bar-mode)
   (tool-bar-mode 0))
 
-(setq exec-path
-      (append
-       (list "/opt/local/bin"
-             "/opt/local/lib/erlang/bin")
-       exec-path))
+;; http://sakito.jp/emacs/emacsshell.html#path
+;; 後に記述したものの方が PATH の先頭に追加されます
+(dolist (dir (list
+              "/sbin"
+              "/usr/sbin"
+              "/bin"
+              "/usr/bin"
+              "/usr/local/sbin"
+              "/usr/local/bin"
+              (expand-file-name "~/bin")
+              ))
+  ;; PATH と exec-path に同じ内容を追加します
+  (when ;; (and
+         (file-exists-p dir) ;; (not (member dir exec-path)))
+    (setenv "PATH" (concat dir ":" (getenv "PATH")))
+    (setq exec-path (append (list dir) exec-path))))
 
 ;; Avoid running silly /usr/share/emacs/site-lisp/default.el.
 ;; (for Fedora/RHEL/CentOS)

(mac-set-input-method-parameter "com.justsystems.inputmethod.atok25.Japanese" `cursor-type 'box)
(mac-set-input-method-parameter "com.justsystems.inputmethod.atok25.Japanese" `cursor-color "brown")

;; package.el

(when (require 'package nil t)
  (add-to-list 'package-archives
               '("melpa" . "http://melpa.milkbox.net/packages/") t)
  (add-to-list 'package-archives
               '("marmalade" . "http://marmalade-repo.org/packages/") t)
  (package-initialize))

;; Using customization file
;; http://www.gnu.org/software/emacs/manual/html_node/emacs/Saving-Customizations.html


;; avoid "Symbolic link to SVN-controlled source file; follow link? (yes or no)"
(setq vc-follow-symlinks t)

;; package.el

(when (require 'package nil t)
  (add-to-list 'package-archives
               '("melpa" . "http://melpa.milkbox.net/packages/") t)
  (add-to-list 'package-archives
               '("marmalade" . "http://marmalade-repo.org/packages/") t)
  (package-initialize))

(defvar installing-package-list
  '(
    ;; ここに使っているパッケージを書く。
    php-mode
    haskell-mode
    yaml-mode
    open-junk-file
    gtags
    ))

(eval-when-compile
  (require 'cl))

(let ((not-installed (loop for x in installing-package-list
                            when (not (package-installed-p x))
                            collect x)))
  (when not-installed
    (package-refresh-contents)
    (dolist (pkg not-installed)
        (package-install pkg))))

;; anthy.el をロードする。
(if (require 'anthy nil t)
