Small bug in json-search changes
Mark Walters
markwalters1009 at gmail.com
Mon Aug 6 16:10:43 PDT 2012
Hi
I have found a small bug in the recent changes to notmuch search to use
the JSON output. If you refresh the search buffer "point" does not stay
on the same thread.
I think the problem is that notmuch-search-refresh-view calls notmuch
search with target-thread set to notmuch-search-find-thread-id which
returns the thread-id with "thread:" prefixed, whereas
notmuch-search-show-result checks for a match with (plist-get result
:thread) which is the thread id with no prefix.
The patch below fixes this but I am not sure it is the nicest fix.
Best wishes
Mark
diff --git a/emacs/notmuch.el b/emacs/notmuch.el
index d2d82a9..a53d5a0 100644
--- a/emacs/notmuch.el
+++ b/emacs/notmuch.el
@@ -798,7 +798,7 @@ non-authors is found, assume that all of the authors match."
(insert "\n")
(notmuch-search-color-line beg (point) (plist-get result :tags))
(put-text-property beg (point) 'notmuch-search-result result))
- (when (string= (plist-get result :thread) notmuch-search-target-thread)
+ (when (string= (concat "thread:" (plist-get result :thread)) notmuch-search-target-thread)
(setq notmuch-search-target-thread "found")
(goto-char beg)))))
More information about the notmuch
mailing list