[notmuch] [PATCH] notmuch.el: patch notmuch-show to call notmuch show without query-context (i.e. without tag:inbox) if the first query returns nothing.

david at tethera.net david at tethera.net
Thu Dec 10 07:14:35 PST 2009

From: David Bremner <bremner at unb.ca>

This fixes the annoying bug of archiving a thread, and then going back
to open it and getting an error.  It needs the notmuch-show API
changing patch of 1259979997-31544-3-git-send-email-david at tethera.net.

I'm not really expecting Carl to push this patch, because I think he
has a better solution in mind, but in the mean time maybe someone
finds it useful. It is saving my sanity already, since in wanderlust
 'a' = reply :).

 notmuch.el |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index cf472f7..0cd4386 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -997,7 +997,9 @@ matching this search term are shown if non-nil. "
 	(let* ((basic-args (list notmuch-command nil t nil "show" "--entire-thread" thread-id))
 		(args (if query-context (append basic-args (list "and (" query-context ")")) basic-args)))
-	  (apply 'call-process args))
+	  (apply 'call-process args)
+	  (when (and (eq (buffer-size) 0) query-context)
+	    (apply 'call-process basic-args)))
       (run-hooks 'notmuch-show-hook)

More information about the notmuch mailing list