JSON readtable error when replying

Adam Wolfe Gordon awg+notmuch at xvx.ca
Mon Apr 30 20:36:28 PDT 2012

On Mon, Apr 30, 2012 at 10:50, Michal Sojka <sojkam1 at fel.cvut.cz> wrote:
> 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.
>     (with-temp-buffer
> -      (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)
> Comments?

Good catch. I'm not sure what (if anything) we want to do with the
stderr output, but putting it in the buffer with the JSON is
definitely not the right thing. Your fix looks fine to me - would you
mind doing a commit and sending a patch to the list?

David, it would probably be good to get this (pretty trivial) fix in
before 0.13, since it will include the JSON reply stuff.

-- Adam

More information about the notmuch mailing list