 
 ;; open-junk-file
 
-(require 'open-junk-file)
-(setq open-junk-file-format "~/Dropbox/junk/%Y/%m/%Y-%m-%d-%H%M%S.")
-(global-set-key (kbd "C-x j") 'open-junk-file)
+(when (require 'open-junk-file nil t)
+  (setq open-junk-file-format "~/Dropbox/junk/%Y/%m/%Y-%m-%d-%H%M%S.")
+  (global-set-key (kbd "C-x j") 'open-junk-file))
 
 ;; 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)

(add-hook 'c++-mode-hook
          (lambda ()
            (setq indent-tabs-mode nil)))

;; settings for C#
;; http://ongaeshi.hatenablog.com/entry/20110116/1295187496
(add-hook 'csharp-mode-hook
          '(lambda()
             ;; オフセットの調整
             (c-set-offset 'substatement-open '0)
             (c-set-offset 'case-label '+)
             (c-set-offset 'arglist-intro '+)
             (c-set-offset 'arglist-close '0)

             (setq comment-column 40)
             (setq c-basic-offset 4)
             (setq indent-tabs-mode nil)

             (font-lock-add-magic-number)
             )
          )

;; settings for HTML
(add-hook 'html-mode-hook
