(define-key map "s" 'notmuch-search)
(define-key map "o" 'notmuch-search-toggle-order)
(define-key map "=" 'notmuch-search-refresh-view)
+ (define-key map "G" 'notmuch-search-poll-and-refresh-view)
(define-key map "t" 'notmuch-search-filter-by-tag)
(define-key map "f" 'notmuch-search-filter)
(define-key map [mouse-1] 'notmuch-search-show-thread)
(apply 'notmuch-call-notmuch-process "tag"
(append action-split (list notmuch-search-query-string) nil))))
+(defcustom notmuch-folders (quote (("inbox" . "tag:inbox") ("unread" . "tag:unread")))
+ "List of searches for the notmuch folder view"
+ :type '(alist :key-type (string) :value-type (string))
+ :group 'notmuch)
+
(defun notmuch-search-buffer-title (query)
"Returns the title for a buffer with notmuch search results."
(let* ((folder (rassoc-if (lambda (key)
(goto-char (point-min))
))
+(defcustom notmuch-poll-script ""
+ "An external script to incorporate new mail into the notmuch database.
+
+If this variable is non empty, then it should name a script to be
+invoked by `notmuch-search-poll-and-refresh-view' and
+`notmuch-folder-poll-and-refresh-view' (each have a default
+keybinding of 'G'). The script could do any of the following
+depending on the user's needs:
+
+1. Invoke a program to transfer mail to the local mail store
+2. Invoke \"notmuch new\" to incorporate the new mail
+3. Invoke one or more \"notmuch tag\" commands to classify the mail"
+ :type 'string
+ :group 'notmuch)
+
+(defun notmuch-poll ()
+ "Run external script to import mail.
+
+Invokes `notmuch-poll-script' if it is not set to an empty string."
+ (interactive)
+ (if (not (string= notmuch-poll-script ""))
+ (call-process notmuch-poll-script nil nil)))
+
+(defun notmuch-search-poll-and-refresh-view ()
+ "Invoke `notmuch-poll' to import mail, then refresh the current view."
+ (interactive)
+ (notmuch-poll)
+ (notmuch-search-refresh-view))
+
(defun notmuch-search-toggle-order ()
"Toggle the current search order.
(define-key map ">" 'notmuch-folder-last)
(define-key map "<" 'notmuch-folder-first)
(define-key map "=" 'notmuch-folder)
+ (define-key map "G" 'notmuch-folder-poll-and-refresh-view)
(define-key map "s" 'notmuch-search)
(define-key map [mouse-1] 'notmuch-folder-show-search)
(define-key map (kbd "RET") 'notmuch-folder-show-search)
(fset 'notmuch-folder-mode-map notmuch-folder-mode-map)
-(defcustom notmuch-folders (quote (("inbox" . "tag:inbox") ("unread" . "tag:unread")))
- "List of searches for the notmuch folder view"
- :type '(alist :key-type (string) :value-type (string))
- :group 'notmuch)
-
(defun notmuch-folder-mode ()
"Major mode for showing notmuch 'folders'.
(if search
(notmuch-search (cdr search) notmuch-search-oldest-first))))
+(defun notmuch-folder-poll-and-refresh-view ()
+ "Invoke `notmuch-poll' to import mail, then refresh the folder view."
+ (interactive)
+ (notmuch-poll)
+ (notmuch-folder))
+
;;;###autoload
(defun notmuch-folder ()
"Show the notmuch folder view and update the displayed counts."