[PATCH v2 0/4] Add refresh all buffers functionality

Ioan-Adrian Ratiu adi at adirat.com
Sat Sep 24 13:07:31 PDT 2016


Changes since v1 (thank you Mark for your feedback):
    * Major rewrite/simplification of the notmuch-show refresh patch to
    support simultaneous refreshing multiple windows displaying a buffer
    * Removed the notmuch-show-message-adjust () patch because it's not
    needed after the above rewrite
    * Rewrote notmuch-refresh-all-buffers () to use dolist instead of
    while loop
    * Minor commit message/metadata improvements

This patch series adds a function to refresh all buffers, including an
option to silently refresh them in the background i.e. to not show the
newly refreshed buffer in any window.

This is very useful for asynchronously updating all buffers when new
mail arrives, using logic similar to the following (it's what I use):

(setq process-connection-type nil)

(defun done-index-sentinel (process event)
  (notmuch-refresh-all-buffers t)
  (message "Mail sync complete"))

(defun done-sync-sentinel (process event)
  (message "Indexing mail using notmuch")
  (set-process-sentinel (start-process "notmuch" nil "notmuch" "new")
			'done-index-sentinel))

(defun run-mail-sync ()
  (message "Syncing mail in background")
  (set-process-sentinel (start-process "mbsync" nil "mbsync" "gmail")
			  'done-sync-sentinel))

(run-with-idle-timer 600 nil 'run-mail-sync)

Ioan-Adrian Ratiu (4):
  emacs: reuse buffer when refreshing searches
  emacs: notmuch-show: refresh all windows showing a buffer
  emacs: add refresh buffer optional no-display arg
  emacs: notmuch-lib: add refresh all buffers function

 emacs/notmuch-lib.el  | 22 +++++++++++++++++++---
 emacs/notmuch-show.el | 19 +++++++++++++------
 emacs/notmuch.el      | 24 ++++++++++++++++--------
 3 files changed, 48 insertions(+), 17 deletions(-)

-- 
2.10.0



More information about the notmuch mailing list