X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-hello.el;h=bbeb5de0c8c7d7d164af31477457b2fdcf1465f9;hb=f1f7e71e0347672e0658362c513e49c05b0f4161;hp=82a3a4b1d56602ba4465e165d9e3e9aa534bd554;hpb=2a6a0e248174d93f431018ce8b809fc0fdebd847;p=notmuch diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index 82a3a4b1..bbeb5de0 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -27,7 +27,7 @@ (require 'notmuch-mua) (declare-function notmuch-search "notmuch" (query &optional oldest-first target-thread target-line continuation)) -(declare-function notmuch-folder-count "notmuch" (search)) +(declare-function notmuch-poll "notmuch" ()) (defvar notmuch-hello-search-bar-marker nil "The position of the search bar within the notmuch-hello buffer.") @@ -45,11 +45,6 @@ (defvar notmuch-hello-indent 4 "How much to indent non-headers.") -(defcustom notmuch-saved-searches nil - "A list of saved searches to display." - :type '(alist :key-type string :value-type string) - :group 'notmuch) - (defcustom notmuch-show-logo t "Should the notmuch logo be shown?" :type 'boolean @@ -198,17 +193,19 @@ diagonal." (interactive) (notmuch-hello no-display)) -(defun notmuch-hello (&optional no-display) +(defun notmuch-hello-poll-and-update () + "Invoke `notmuch-poll' to import mail, then refresh the current view." (interactive) + (notmuch-poll) + (notmuch-hello-update)) - ;; Provide support for the deprecated name of this variable - (if (not notmuch-saved-searches) - (setq notmuch-saved-searches notmuch-folders)) +(defun notmuch-hello (&optional no-display) + (interactive) - ;; And set a default if neither has been set by the user + ; Jump through a hoop to get this value from the deprecated variable + ; name (`notmuch-folders') or from the default value. (if (not notmuch-saved-searches) - (setq notmuch-saved-searches '(("inbox" . "tag:inbox") - ("unread" . "tag:unread")))) + (setq notmuch-saved-searches (notmuch-saved-searches))) (if no-display (set-buffer "*notmuch-hello*") @@ -386,6 +383,7 @@ diagonal." (use-local-map widget-keymap) (local-set-key "=" 'notmuch-hello-update) + (local-set-key "G" 'notmuch-hello-poll-and-update) (local-set-key "m" 'notmuch-mua-mail) (local-set-key "q" '(lambda () (interactive) (kill-buffer (current-buffer)))) (local-set-key "s" 'notmuch-hello-goto-search)