     (buffer-name buf)))
 
 (defun snails-wrap-file-icon (file)
+  "Wrap display name with file icon, use for file search backend."
   (if (featurep 'all-the-icons)
       (format "%s %s"
               (all-the-icons-icon-for-file file :height 1)
               (string-trim-left file))
     file))
 
+(defun snails-update-select-line ()
+  "Update select line status."
+  ;; Update current line number.
+  (setq snails-select-line-number (line-number-at-pos))
+  ;; Update select line overlay postion.
+  (move-overlay snails-select-line-overlay
+                (point-at-bol)
+                (point-at-eol))
+  ;; Scroll window to keep cursor visible.
+  (snails-keep-cursor-visible))
+
 (defmacro snails-create-backend (name candidate-search-function candiate-do-function)
+  "Macro to simple backend code.
+
+`name' is backend name, such 'Foo Bar'.
+`candidate-search-function' is function that accpet input string, and return candidate list, example format: ((display-name-1 candidate-1) (display-name-2 candidate-2))
+`candidate-do-function' is function that confirm candidate, accpet candidate search, and do anything you want.
+"
   (let* ((backend-template-name (string-join (split-string (downcase name)) "-"))
          (backend-name (intern (format "snails-backend-%s" backend-template-name)))
          (search-function (intern (format "snails-backend-%s-search" backend-template-name))))

;; Maintainer: Andy Stewart <lazycat.manatee@gmail.com>
;; Copyright (C) 2019, Andy Stewart, all rights reserved.
;; Created: 2019-05-16 21:26:09
;; Version: 0.1
;; Last-Updated: 2019-05-16 21:26:09
;;           By: Andy Stewart
;; URL: http://www.emacswiki.org/emacs/download/snails.el
;; Keywords:

    found))

(defun snails-empty-line-p ()
  "Detect current line whether empty line."
  (= (point-at-eol) (point-at-bol)))

(defun snails-wrap-buffer-icon (buf)
  "Wrap display name with buffer icon, use for buffer search backend."
  (if (featurep 'all-the-icons)
      (format "%s %s"
              (with-current-buffer buf
