emacs: Refuse requests to refresh tree views while a refresh is running

notmuch-tree did not protect against concurrent refreshes like
notmuch-search, meaning, hitting '=' (notmuch-refresh-this-buffer)
quickly will spawn multiple parallel notmuch processes, and clobber
the existing results in the current buffer.

* notmuch-tree.el: Add a guard to notmuch-tree-refresh-view similar to
  the one in notmuch-search.
This commit is contained in:
Vladimir Panteleev 2017-08-14 07:08:36 +00:00 committed by David Bremner
parent 0260ee371e
commit 1348212cb0

View file

@ -598,6 +598,8 @@ message will be \"unarchived\", i.e. the tag changes in
(defun notmuch-tree-refresh-view ()
"Refresh view."
(interactive)
(when (get-buffer-process (current-buffer))
(error "notmuch tree process already running for current buffer"))
(let ((inhibit-read-only t)
(basic-query notmuch-tree-basic-query)
(query-context notmuch-tree-query-context)