      ;;  (when (timerp flymake-display-err-timer)
      ;;  (cancel-timer flymake-display-err-timer)
      ;;  (setq flymake-display-err-timer nil)))
-     ))
+     )))
 
 ;; anything
-(when (and (require 'anything-config nil t)
-           (require 'anything-complete nil t))
+(when (and (kui/package-require 'anything nil nil t)
+           (kui/package-require 'anything-obsolete nil nil t)
+           (kui/package-require 'anything-config nil nil t)
+           (kui/package-require 'anything-match-plugin nil nil t)
+           (kui/package-require 'anything-complete nil nil t))
   (global-set-key "\C-xa" 'anything-apropos)
   (global-set-key "\C-x\C-f" 'anything-find-file)
   (global-set-key "\C-xb" 'anything-buffers+)

;; 自作関数

;; require のパッケージが無かった時に自動的に package-install を実行してくれる
(defun kui/require-package (feature &optional filename packagename noerror)
  "If PACKAGENAME(or FEATURE) was installed, execute (`require' FEATURE
 &optional FILENAME NOERROR).
if not installed, install PACKAGENAME(or FEATURE) and then execute `require'."
  (unless kui/require-package-refreshed
    (package-refresh-contents)
    (setq kui/require-package-refreshed t))
  (let* ((pname (if packagename packagename feature)))
    (unless (package-installed-p pname)
        (package-install pname)))
  (require feature filename noerror)
  )
(defvar kui/require-package-refreshed nil)

;; C-w をもう少し賢く
(defun kui/backward-kill-word-or-kill-region ()

;; -------------------------------------------------------------------------
;; 便利な感じのマイナーモード

;; popup
(when (kui/package-require 'popup nil nil t))

;; popwin
(when (kui/package-require 'popwin nil nil t)
  (setq
   ;; display-buffer の置き換え
   display-buffer-function 'popwin:display-buffer
