JSON readtable error when replying

Michal Sojka sojkam1 at fel.cvut.cz
Mon Apr 30 09:50:37 PDT 2012

Hi Adam,

Adam Wolfe Gordon <awg+notmuch at xvx.ca> writes:
> On Mon, Apr 30, 2012 at 09:00, Michal Sojka <sojkam1 at fel.cvut.cz> wrote:
>> when I try to reply within emacs to a particular message, I get "JSON
>> readtable error". This happens with with the current git master as well
>> as with a version from about a month ago. Is this a known problem or
>> shall I dig into it and find what wrong?
> Sounds like notmuch reply is producing bad JSON for that particular
> message. Could you try the following, replacing <message id> with the
> message ID of the message you're replying to:
> notmuch reply --format=json id:"<message id>" | json_xs -t json-pretty
> and see if it complains? 

json_xs didn't complain, but I've found that notmuch outputs
  Failed to verify signed part: Cannot verify multipart/signed part: unsupported signature protocol 'application/x-pkcs7-signature'.
to stderr before the json output and emacs tries to parse
stderr. Emacs then complains about not finding "F" in json-readtable.

The following patch fixes the problem for me, but I do not know if it is
a good thing to throw away the stderr output of notmuch.

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 87bd88d..49db603 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -113,7 +113,7 @@ list."
     ;; Get the reply object as JSON, and parse it into an elisp object.
-      (apply 'call-process (append (list notmuch-command nil (list t t) nil) args))
+      (apply 'call-process (append (list notmuch-command nil (list t nil) nil) args))
       (goto-char (point-min))
       (let ((json-object-type 'plist)
            (json-array-type 'list)



More information about the notmuch mailing list