aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIoan-Adrian Ratiu <adi@adirat.com>2016-10-15 08:32:45 +0100
committerDavid Bremner <david@tethera.net>2016-10-17 09:07:32 -0300
commit02d3c7610297437da5ddc414e16cd1fabf95dcfb (patch)
tree85b55bf0bb491c44c3a524b738490582323329fa
parent4954bc50e8ed35c28ba0eed5470d133205a46654 (diff)
emacs: notmuch-lib: add refresh all buffers function
notmuch-refresh-all-buffers calls each buffer's major mode specific refresh function using the generic notmuch-refresh-this-buffer function. Since the earlier changesets have stopped the refresh functions from forcing the buffers to be redisplayed this can refresh buffers that are not currently displayed without disturbing the user. This is very useful for silent async background updating the emacs display when new mail is fetched. Signed-off-by: Ioan-Adrian Ratiu <adi@adirat.com>
-rw-r--r--emacs/notmuch-lib.el15
1 files changed, 15 insertions, 0 deletions
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 56dd3669..7cb1169c 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -426,6 +426,21 @@ of its command symbol."
(notmuch-poll)
(notmuch-refresh-this-buffer))
+(defun notmuch-refresh-all-buffers ()
+ "Invoke `notmuch-refresh-this-buffer' on all notmuch major-mode buffers.
+
+The buffers are silently refreshed, i.e. they are not forced to
+be displayed."
+ (interactive)
+ (dolist (buffer (buffer-list))
+ (let ((buffer-mode (buffer-local-value 'major-mode buffer)))
+ (when (memq buffer-mode '(notmuch-show-mode
+ notmuch-tree-mode
+ notmuch-search-mode
+ notmuch-hello-mode))
+ (with-current-buffer buffer
+ (notmuch-refresh-this-buffer))))))
+
(defun notmuch-prettify-subject (subject)
;; This function is used by `notmuch-search-process-filter' which
;; requires that we not disrupt its' matching state.