+(defun notmuch-hello-poll-and-update ()
+ "Invoke `notmuch-poll' to import mail, then refresh the current view."
+ (interactive)
+ (notmuch-poll)
+ (notmuch-hello-update))
+
+
+(defvar notmuch-hello-mode-map
+ (let ((map (make-sparse-keymap)))
+ (set-keymap-parent map widget-keymap)
+ (define-key map "v" '(lambda () "Display the notmuch version" (interactive)
+ (message "notmuch version %s" (notmuch-version))))
+ (define-key map "?" 'notmuch-help)
+ (define-key map "q" 'notmuch-kill-this-buffer)
+ (define-key map "=" 'notmuch-hello-update)
+ (define-key map "G" 'notmuch-hello-poll-and-update)
+ (define-key map (kbd "<C-tab>") 'widget-backward)
+ (define-key map "m" 'notmuch-mua-new-mail)
+ (define-key map "s" 'notmuch-hello-goto-search)
+ map)
+ "Keymap for \"notmuch hello\" buffers.")
+(fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
+
+(defun notmuch-hello-mode ()
+ "Major mode for convenient notmuch navigation. This is your entry portal into notmuch.
+
+Complete list of currently available key bindings:
+
+\\{notmuch-hello-mode-map}"
+ (interactive)
+ (kill-all-local-variables)
+ (use-local-map notmuch-hello-mode-map)
+ (setq major-mode 'notmuch-hello-mode
+ mode-name "notmuch-hello")
+ ;;(setq buffer-read-only t)
+)
+
+(defun notmuch-hello-generate-tag-alist ()
+ "Return an alist from tags to queries to display in the all-tags section."
+ (notmuch-remove-if-not
+ #'cdr
+ (mapcar (lambda (tag)
+ (cons tag
+ (cond
+ ((functionp notmuch-hello-tag-list-make-query)
+ (concat "tag:" tag " and ("
+ (funcall notmuch-hello-tag-list-make-query tag) ")"))
+ ((stringp notmuch-hello-tag-list-make-query)
+ (concat "tag:" tag " and ("
+ notmuch-hello-tag-list-make-query ")"))
+ (t (concat "tag:" tag)))))
+ (notmuch-remove-if-not
+ (lambda (tag)
+ (not (member tag notmuch-hello-hide-tags)))
+ (process-lines notmuch-command "search-tags")))))
+
+;;;###autoload