   (when evernote-password-cache
     (with-current-buffer (get-buffer-create enh-password-cache-buffer)
       (write-region (prin1-to-string user-password) nil
-		    enh-password-cache-file))))
+                    enh-password-cache-file))))
 
 
 (defun enh-password-cache-close ()

  (interactive)
  (if (called-interactively-p) (enh-clear-onmem-cache))
  (when evernote-mode
      (setq evernote-note-modified-name
            (read-string "New note name:"
                         (enutil-aget 'title (enh-get-note-attr evernote-note-guid))))
      (rename-buffer evernote-note-modified-name t)
      (enh-base-change-major-mode-from-note-name evernote-note-modified-name)
      (set-buffer-modified-p t)))


(defun evernote-delete-note ()



(defun enh-menu-is-visible-on-ordinary-mode ()
  (not evernote-browsing-mode))

(defun enh-menu-is-visible-on-evernote-mode ()
  (and evernote-mode (not evernote-browsing-mode)))

(defun enh-menu-is-visible-on-evernote-browsing-mode ()
  evernote-browsing-mode)

(let ((menu-bar-map (make-sparse-keymap "Evernote")))
  (define-key-after global-map [menu-bar evernote]
    `(menu-item "Evernote" ,menu-bar-map
                :visible evernote-mode-display-menu)
    'tools)
  (define-key menu-bar-map [browser]
    '(menu-item "Evernote Browser" evernote-browser
                :visible (enh-menu-is-visible-on-ordinary-mode)))
  (define-key menu-bar-map [seperator-0]
    '(menu-item "--" nil
                :visible (enh-menu-is-visible-on-ordinary-mode)))
  (define-key menu-bar-map [toggle-read-only]
    '(menu-item "Toggle Read Only" evernote-toggle-read-only
                :visible (enh-menu-is-visible-on-evernote-mode)))
  (define-key menu-bar-map [delete-note]
    '(menu-item "Delete Note" evernote-delete-note
                :visible (enh-menu-is-visible-on-evernote-mode)))
  (define-key menu-bar-map [rename-note]
    '(menu-item "Rename Note" evernote-rename-note
                :visible (enh-menu-is-visible-on-evernote-mode)))
  (define-key menu-bar-map [change-edit-mode]
    '(menu-item "Change Edit Mode" evernote-change-edit-mode
                :visible (enh-menu-is-visible-on-evernote-mode)))
  (define-key menu-bar-map [edit-tag]
    '(menu-item "Edit Tag" evernote-edit-tags
                :visible (enh-menu-is-visible-on-evernote-mode)))
  (define-key menu-bar-map [save-note]
    '(menu-item "Save Note" evernote-save-note
                :visible (enh-menu-is-visible-on-evernote-mode)))
  (define-key menu-bar-map [seperator-1]
    '(menu-item "--" nil
                :visible (enh-menu-is-visible-on-evernote-mode)))
  (define-key menu-bar-map [edit-search]
    '(menu-item "Edit Saved Search" evernote-edit-search
                :visible (enh-menu-is-visible-on-ordinary-mode)))
  (define-key menu-bar-map [create-search]
    '(menu-item "Create Saved Search" evernote-create-search
                :visible (enh-menu-is-visible-on-ordinary-mode)))
  (define-key menu-bar-map [do-saved-search]
    '(menu-item "Do Saved Search" evernote-do-saved-search
                :visible (enh-menu-is-visible-on-ordinary-mode)))
  (define-key menu-bar-map [search-note]
    '(menu-item "Search Note" evernote-search-notes
                :visible (enh-menu-is-visible-on-ordinary-mode)))
  (define-key menu-bar-map [seperator-2]
    '(menu-item "--" nil
                :visible (enh-menu-is-visible-on-ordinary-mode)))
  (define-key menu-bar-map [post-region]
    '(menu-item "Post Region" evernote-post-region
                :visible (enh-menu-is-visible-on-ordinary-mode)))
  (define-key menu-bar-map [write-note]
    '(menu-item "Write Note" evernote-write-note
                :visible (enh-menu-is-visible-on-ordinary-mode)))
  (define-key menu-bar-map [create-note]
    '(menu-item "Create Note" evernote-create-note
                :visible (enh-menu-is-visible-on-ordinary-mode)))
  (define-key menu-bar-map [open-note]
    '(menu-item "Open Note" evernote-open-note
                :visible (enh-menu-is-visible-on-ordinary-mode)))
  (define-key menu-bar-map [browsing-prev-page]
    '(menu-item "Prev Page" evernote-browsing-prev-page
                :visible (enh-menu-is-visible-on-evernote-browsing-mode)))
  (define-key menu-bar-map [browsing-next-page]
    '(menu-item "Next Page" evernote-browsing-next-page
                :visible (enh-menu-is-visible-on-evernote-browsing-mode)))
  (define-key menu-bar-map [browsing-search-notes]
    '(menu-item "Searche Notes" evernote-browsing-search-notes
                :visible (enh-menu-is-visible-on-evernote-browsing-mode)))
  (define-key menu-bar-map [browsing-list-searches]
    '(menu-item "List Saved Searches" evernote-browsing-list-searches
                :visible (enh-menu-is-visible-on-evernote-browsing-mode)))
  (define-key menu-bar-map [browsing-list-tags]
    '(menu-item "List Tags" evernote-browsing-list-tags
                :visible (enh-menu-is-visible-on-evernote-browsing-mode)))
  (define-key menu-bar-map [browsing-list-notebooks]
    '(menu-item "List Notebooks" evernote-browsing-list-notebooks
                :visible (enh-menu-is-visible-on-evernote-browsing-mode))))


(defun evernote-mode (&optional guid)
