 ;;                                  (cdr (assoc 'updated attr))
 ;;                                  (cdr (assoc 'name attr)))))
 ;;                  note-list))
-;;    (setq evernote-note-completion-prompt "Note:")
-;;    (cdr (assoc (read-from-minibuffer evernote-note-completion-prompt
-;;                                      nil evernote-read-note-name-map)
+;;    (setq evernote-minibuffer-note-completion-prompt "Note:")
+;;    (cdr (assoc (read-from-minibuffer evernote-minibuffer-note-completion-prompt
+;;                                      nil evernote-minibuffer-read-note-name-map)
 ;;                evernote-note-cands))))
 
 
-(defun evernote-note-completion ()
+(defun evernote-minibuffer-note-completion ()
   "Complete note name and display completion list"
   (interactive)
   (let (word result start)
-    (setq start (+ (string-width evernote-note-completion-prompt) 1))
+    (setq start (+ 1 (minibuffer-prompt-width)))
     (setq word (buffer-substring start (point)))
-                                        ;(evernote-tmp-message (concat "[" word "]"))
-    (setq result (try-completion word evernote-note-cands))
+    (setq result (try-completion word evernote-note-cands)) ;; from here.
+    ;(evernote-tmp-message (concat "[" word "]"))
     (cond
      ((eq result t) (evernote-tmp-message "[Sole Completion]"))
      ((eq result nil) (ding) (evernote-tmp-message "[No Match]"))
      ((string= result word)
-      (let (formatted-name-list)
-        (setq formatted-name-list
+      (let (displayed-name-and-name-map completion-buf)
+        (setq displayed-name-and-name-map
               (mapcar (lambda (name)
-                        (cdr (assoc name evernote-note-display-map)))
+                        (cons
+                         (cdr (assoc name evernote-note-display-map))
+                         name))
                       (all-completions word evernote-note-display-map)))
-        (with-output-to-temp-buffer "*Completions*"
-          (display-completion-list formatted-name-list))))
+        (setq completion-buf (get-buffer-create "*Evernote-Completions*"))
+        (save-excursion
+          (set-buffer completion-buf)
+          (evernote-display-completion-list displayed-name-and-name-map)
+          (setq evernote-search-mode-displayed-name-and-name-map displayed-name-and-name-map)
+          (evernote-search-mode))
+        (display-buffer completion-buf)))
      (t (delete-region start (point))
         (insert result)
         (if (eq t (try-completion result evernote-note-cands))
             nil
           (evernote-tmp-message "[Complete, but not unique]"))))))
+
+
+(defun evernote-minibuffer-note-input-finish ()
+  "Finish input note name"
+  (interactive)
+  (if (assoc
+       (buffer-substring
+        (progn
+          (goto-char (+ 1 (minibuffer-prompt-width)))
+          (point))
+        (progn
+          (end-of-line)
+          (point)))
+       evernote-note-cands)
+      (exit-minibuffer)
+    (evernote-tmp-message "[No Match]")))
 
 
 (defun evernote-tmp-message (msg)

  (let ((name-num-map (make-hash-table :test #'equal))
        evernote-note-cands
        evernote-note-display-map
        evernote-note-completion-prompt)
    (mapc (lambda (attr)
            (let* ((name (cdr (assoc 'name attr)))
                   displayed-name

          note-list)
    (setq evernote-note-cands (nreverse evernote-note-cands)
          evernote-note-display-map (nreverse evernote-note-display-map))
    (cdr (assoc (read-from-minibuffer "Note:"
                                      nil evernote-minibuffer-read-note-name-map)
                evernote-note-cands))))

;;    (setq evernote-note-cands
