[PATCH] emacs: Do not pass stderr of notmuch reply to JSON parser
authorMichal Sojka <sojkam1@fel.cvut.cz>
Tue, 1 May 2012 21:10:47 +0000 (23:10 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:46:52 +0000 (09:46 -0800)
46/eaa23e4915be3b688a3316f9b8a9059500e8a0 [new file with mode: 0644]

diff --git a/46/eaa23e4915be3b688a3316f9b8a9059500e8a0 b/46/eaa23e4915be3b688a3316f9b8a9059500e8a0
new file mode 100644 (file)
index 0000000..a741614
--- /dev/null
@@ -0,0 +1,88 @@
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 910B6431FAF\r
+       for <notmuch@notmuchmail.org>; Tue,  1 May 2012 14:11:16 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id u3TSrokyN3Zt for <notmuch@notmuchmail.org>;\r
+       Tue,  1 May 2012 14:11:15 -0700 (PDT)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id AB3EC431FAE\r
+       for <notmuch@notmuchmail.org>; Tue,  1 May 2012 14:11:15 -0700 (PDT)\r
+Received: from localhost (unknown [192.168.200.4])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id 2C20F19F3338;\r
+       Tue,  1 May 2012 23:11:14 +0200 (CEST)\r
+X-Virus-Scanned: IMAP AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+       by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
+       port 10044)\r
+       with ESMTP id aMHYdXNk1lfT; Tue,  1 May 2012 23:11:12 +0200 (CEST)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+       by max.feld.cvut.cz (Postfix) with ESMTP id C08F419F32DF;\r
+       Tue,  1 May 2012 23:11:12 +0200 (CEST)\r
+Received: from steelpick.2x.cz (cable-95-168-136-35.cust.telecolumbus.net\r
+       [95.168.136.35]) (Authenticated sender: sojkam1)\r
+       by imap.feld.cvut.cz (Postfix) with ESMTPSA id B2670660968;\r
+       Tue,  1 May 2012 23:11:08 +0200 (CEST)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.77)\r
+       (envelope-from <sojkam1@fel.cvut.cz>)\r
+       id 1SPKLj-00066f-GN; Tue, 01 May 2012 23:11:07 +0200\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: Do not pass stderr of notmuch reply to JSON parser\r
+Date: Tue,  1 May 2012 23:10:47 +0200\r
+Message-Id: <1335906647-23422-1-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 1.7.10\r
+In-Reply-To:\r
+ <CAMoJFUsnxbRz3yPZSVA0w8C2-Qt8fXx3X6i3RZ+QvZGv2EtiFQ@mail.gmail.com>\r
+References:\r
+ <CAMoJFUsnxbRz3yPZSVA0w8C2-Qt8fXx3X6i3RZ+QvZGv2EtiFQ@mail.gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 01 May 2012 21:11:16 -0000\r
+\r
+Sometimes, notmuch reply outputs something to stderr, for example:\r
+"Failed to verify signed part: Cannot verify multipart/signed part:\r
+unsupported signature protocol". When this happens, replying in emacs\r
+fails, because emacs cannot parse the error message as JSON.\r
+\r
+This patch causes emacs to ignore stderr when reading reply from\r
+notmuch.\r
+---\r
+ emacs/notmuch-mua.el |    2 +-\r
+ 1 file changed, 1 insertion(+), 1 deletion(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 87bd88d..49db603 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -113,7 +113,7 @@ list."\r
+ \r
+     ;; Get the reply object as JSON, and parse it into an elisp object.\r
+     (with-temp-buffer\r
+-      (apply 'call-process (append (list notmuch-command nil (list t t) nil) args))\r
++      (apply 'call-process (append (list notmuch-command nil (list t nil) nil) args))\r
+       (goto-char (point-min))\r
+       (let ((json-object-type 'plist)\r
+           (json-array-type 'list)\r
+-- \r
+1.7.10\r
+\r