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

classic Classic list List threaded Threaded
2 messages Options
Vladimir Panteleev Vladimir Panteleev
Reply | Threaded
Open this post in threaded view
|

[PATCH] 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.
---
 emacs/notmuch-tree.el | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el
index 022525ae..c64a097a 100644
--- a/emacs/notmuch-tree.el
+++ b/emacs/notmuch-tree.el
@@ -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)
--
2.13.3

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] emacs: Refuse requests to refresh tree views while a refresh is running

Vladimir Panteleev <[hidden email]> writes:

> 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.
>

pushed

d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch