(third elem)
(cdr elem))))
(insert
- (notmuch-hello-filtered-query count-query
- (or (plist-get options :filter-count)
- (plist-get options :filter)))
- "\n")))
+ (replace-regexp-in-string
+ "\n" " "
+ (notmuch-hello-filtered-query count-query
+ (or (plist-get options :filter-count)
+ (plist-get options :filter))))
+ "\n")))
(unless (= (call-process-region (point-min) (point-max) notmuch-command
t t nil "count" "--batch") 0)
(defun notmuch-hello-update (&optional no-display)
"Update the current notmuch view."
;; Lazy - rebuild everything.
- (interactive)
(notmuch-hello 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))
-
(defun notmuch-hello-window-configuration-change ()
"Hook function to update the hello buffer when it is switched to."
(let ((hello-buf (get-buffer "*notmuch-hello*"))
(defvar notmuch-hello-mode-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map widget-keymap)
+ (let ((map (if (fboundp 'make-composed-keymap)
+ ;; Inherit both widget-keymap and notmuch-common-keymap
+ (make-composed-keymap widget-keymap)
+ ;; Before Emacs 24, keymaps didn't support multiple
+ ;; inheritance,, so just copy the widget keymap since
+ ;; it's unlikely to change.
+ (copy-keymap widget-keymap))))
+ (set-keymap-parent map notmuch-common-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-search)
map)
"Keymap for \"notmuch hello\" buffers.")
(fset 'notmuch-hello-mode-map notmuch-hello-mode-map)
\\{notmuch-hello-mode-map}"
(interactive)
(kill-all-local-variables)
+ (setq notmuch-buffer-refresh-function #'notmuch-hello-update)
(use-local-map notmuch-hello-mode-map)
(setq major-mode 'notmuch-hello-mode
mode-name "notmuch-hello")
"Run notmuch and display saved searches, known tags, etc."
(interactive)
+ (notmuch-assert-cli-sane)
;; This may cause a window configuration change, so if the
;; auto-refresh hook is already installed, avoid recursive refresh.
(let ((notmuch-hello-auto-refresh nil))