     (switch-to-buffer "*scratch*")
     (insert initial-scratch-message)))
 
+(defun kui/active-minor-mode-p (mode)
+  "Return MODE if MODE was activate on the current buffer,
+but if not, return nil."
+  (not (and (boundp mode)
+            (symbol-value mode)
+            (fboundp (or (get mode :minor-mode-function) mode)))))
+
 (defun kui/current-minor-modes ()
   "Return minor modes on the current buffer"
-  (remove-if
-   (lambda (mode)
-     (not (and (boundp mode) (symbol-value mode)
-               (fboundp (or (get mode :minor-mode-function) mode)))))
-   minor-mode-list))
-
-(defun kui/active-minor-modep (mode)
-  "Return MODE if MODE was activate on the current buffer,
-but if not, return nil."
-  (find-if (lambda (m) (eq m mode)) (kui/current-minor-modes)))
+  (remove-if 'kui/active-minor-mode-p
+             minor-mode-list))
 
 (defun kui/find-font (&rest fonts)
   "Return an existing font which was find at first"


(when (and (kui/package-require 'flycheck nil nil t)
           (kui/package-require 'flycheck-pos-tip nil nil t))
  ;; ...
  (eval-after-load 'flycheck
    '(custom-set-variables
      '(flycheck-display-errors-function #'flycheck-pos-tip-error-messages)))
  )

;; auto-complete-mode

;; rust-mode
(when (and (kui/autoload-if-exist 'rust-mode "rust-mode")
           (kui/package-require 'flycheck-rust nil nil t))

  ;; flycheck
  (eval-after-load 'flycheck
    '(add-hook 'flycheck-mode-hook #'flycheck-rust-setup))
  (add-hook 'rust-mode-hook #'flycheck-mode)

  ;; racer(Code Completion)
  (let* ((racer-path (executable-find "racer"))
         (racer-path (if racer-path (file-chase-links racer-path 100)))
         (racer-dir (if racer-path
                        (file-name-directory
                         (directory-file-name
                          (file-name-directory racer-path)))))
         (racer-load-path (if racer-dir
                              (concat racer-dir "editors")))
         (rust-path (getenv "RUST_SRC_PATH")))
    (when (and racer-dir
               rust-path)
      (add-to-list 'load-path racer-load-path)
      (require 'racer nil t)
      (setq racer-rust-src-path rust-path
            racer-cmd racer-path)))
  )

;; -------------------------------------------------------------------------
