 
 (defvar evernote-mode-map (make-sparse-keymap)
   "Keymap used in evernote mode.")
-
 (define-key evernote-mode-map "\C-x\C-s" 'evernote-save-note)
 (define-key evernote-mode-map "\C-cet"   'evernote-edit-tags)
 (define-key evernote-mode-map "\C-cee"   'evernote-change-edit-mode)
 (define-key evernote-mode-map "\C-cer"   'evernote-rename-note)
 (define-key evernote-mode-map "\C-ced"   'evernote-delete-note)
 
-(defvar evernote-minibuffer-read-note-name-map
+(defvar evernote-read-note-map
   (copy-keymap minibuffer-local-completion-map))
-
-(define-key evernote-minibuffer-read-note-name-map [tab] 'evernote-minibuffer-note-completion)
-(define-key evernote-minibuffer-read-note-name-map "\C-i" 'evernote-minibuffer-note-completion)
-(define-key evernote-minibuffer-read-note-name-map "\C-m" 'evernote-minibuffer-note-input-finish)
+(define-key evernote-read-note-map [tab] 'evernote-read-note-completion)
+(define-key evernote-read-note-map "\C-i" 'evernote-read-note-completion)
+(define-key evernote-read-note-map "\C-m" 'evernote-read-note-finish)
+(define-key evernote-read-note-map  " "   'self-insert-command)
 
 
 (defvar evernote-search-mode-map (copy-keymap global-map)
   "Keymap used in evernote search mode.")
 (define-key evernote-search-mode-map "\C-m" 'evernote-select-note-in-search-mode)
 
-(defvar evernote-search-mode-displayed-name-and-name-map nil
-  "Formatted name list variable used only in evernote-search-mode buffer")
-(make-variable-buffer-local 'evernote-search-mode-displayed-name-and-name-map)
-
-
-;;(defvar evernote-browsing-mode-map (copy-keymap global-map)
-;;  "Keymap used in evernote browsing mode.")
-;;(define-key evernote-browsing-mode-map "l" 'evernote-command-login)
-;;(define-key evernote-browsing-mode-map "t" 'evernote-command-listtags)
-;;(define-key evernote-browsing-mode-map "\C-m" 'evernote-open-guid)
-
-(defconst evernote-client-buffer-name "*Evernote*")
-(defconst evernote-client-output-buffer-name "*Evernote-Client-Output*")
-
+(defvar evernote-search-mode-formatted-name-displayed-name-alist nil
+  "Alist from formatted names to names used only in evernote-search-mode buffer")
+(make-variable-buffer-local 'evernote-search-mode-formatted-name-displayed-name-alist)
+
+
+(defconst evernote-command-output-buffer-name "*Evernote-Client-Output*")
 (defconst evernote-error-ok                  0)
 (defconst evernote-error-fail                100)
 (defconst evernote-error-parse               101)


(provide 'evernote-mode)

;;(setq debug-on-error nil)


  (force-mode-line-update))


(defun evernote-completing-read-multiple
  (prompt table &optional predicate require-match initial-input hist def inherit-input-method)
  "Read multiple strings with completion. and return nil if no input is given"
  (let (results)
    (setq results
          (completing-read-multiple prompt
                                    table
                                    predicate
                                    require-match
                                    initial-input
                                    hist
                                    def
                                    inherit-input-method))
    (delete "" results)))


;;
