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@tethera.net.
 
       (save-excursion
        (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)))
        (notmuch-show-markup-messages)
        )
       (run-hooks 'notmuch-show-hook)