unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: Refuse requests to refresh tree views while a refresh is running
@ 2017-08-14  7:08 Vladimir Panteleev
  2017-09-06  1:29 ` David Bremner
  0 siblings, 1 reply; 2+ messages in thread
From: Vladimir Panteleev @ 2017-08-14  7:08 UTC (permalink / raw)
  To: notmuch; +Cc: Vladimir Panteleev

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] emacs: Refuse requests to refresh tree views while a refresh is running
  2017-08-14  7:08 [PATCH] emacs: Refuse requests to refresh tree views while a refresh is running Vladimir Panteleev
@ 2017-09-06  1:29 ` David Bremner
  0 siblings, 0 replies; 2+ messages in thread
From: David Bremner @ 2017-09-06  1:29 UTC (permalink / raw)
  To: Vladimir Panteleev, notmuch; +Cc: Vladimir Panteleev

Vladimir Panteleev <git@thecybershadow.net> 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-09-06  1:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-14  7:08 [PATCH] emacs: Refuse requests to refresh tree views while a refresh is running Vladimir Panteleev
2017-09-06  1:29 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).