[PATCH 6/7] emacs: Special handling for version mismatch errors
authorAustin Clements <amdragon@MIT.EDU>
Sun, 16 Dec 2012 03:17:28 +0000 (22:17 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:52:22 +0000 (09:52 -0800)
02/2af0b37b8ab5707e13f136fd8ca987da5fe414 [new file with mode: 0644]

diff --git a/02/2af0b37b8ab5707e13f136fd8ca987da5fe414 b/02/2af0b37b8ab5707e13f136fd8ca987da5fe414
new file mode 100644 (file)
index 0000000..96fd1e9
--- /dev/null
@@ -0,0 +1,105 @@
+Return-Path: <amdragon@mit.edu>\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 CAC0C431FC0\r
+       for <notmuch@notmuchmail.org>; Sat, 15 Dec 2012 19:17:47 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 e48pGluUJCb2 for <notmuch@notmuchmail.org>;\r
+       Sat, 15 Dec 2012 19:17:43 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU\r
+       [18.9.25.13])\r
+       by olra.theworths.org (Postfix) with ESMTP id 127BB431FC4\r
+       for <notmuch@notmuchmail.org>; Sat, 15 Dec 2012 19:17:41 -0800 (PST)\r
+X-AuditID: 1209190d-b7f266d00000092b-2c-50cd3d55bcfe\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+       by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id EE.F6.02347.55D3DC05; Sat, 15 Dec 2012 22:17:41 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id qBG3He09012442; \r
+       Sat, 15 Dec 2012 22:17:40 -0500\r
+Received: from drake.dyndns.org\r
+       (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [209.6.116.242]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qBG3Hb2g012060\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sat, 15 Dec 2012 22:17:39 -0500 (EST)\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1Tk4jP-0007cE-QQ; Sat, 15 Dec 2012 22:17:35 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 6/7] emacs: Special handling for version mismatch errors\r
+Date: Sat, 15 Dec 2012 22:17:28 -0500\r
+Message-Id: <1355627849-29099-7-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1355627849-29099-1-git-send-email-amdragon@mit.edu>\r
+References: <1355627849-29099-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixG6nohtqezbAYN5NZYvVc3ksrt+cyezA\r
+       5LFz1l12j2erbjEHMEVx2aSk5mSWpRbp2yVwZdz584G1YClXxdM3y5gaGGdydDFyckgImEjc\r
+       blrHAmGLSVy4t56ti5GLQ0hgH6PE1w37GCGcDYwSXZO+skI4j5gkvq9/zwzhzGWU2L2umRmk\r
+       n01AQ2Lb/uWMILaIgLTEzruzWUFsZgFHic/7F7GB2MICHhI/nu0Bs1kEVCUadj8Gq+cVcJC4\r
+       e/0oI8QdihLdzyaA1XAC9W7e8hPMFgKqmX3kKNsERv4FjAyrGGVTcqt0cxMzc4pTk3WLkxPz\r
+       8lKLdI30cjNL9FJTSjcxgkKJU5J3B+O7g0qHGAU4GJV4eC2+ngkQYk0sK67MPcQoycGkJMqb\r
+       Y3k2QIgvKT+lMiOxOCO+qDQntfgQowQHs5IIb9J8oHLelMTKqtSifJiUNAeLkjjvlZSb/kIC\r
+       6YklqdmpqQWpRTBZGQ4OJQleZhugoYJFqempFWmZOSUIaSYOTpDhPEDDlUFqeIsLEnOLM9Mh\r
+       8qcYFaXEeaVAEgIgiYzSPLheWKy/YhQHekWYVwOkigeYJuC6XwENZgIavNwG5OrikkSElFQD\r
+       Y9xlh2e9H9fWFB0z3v1QZOnmB6zXCx7Me6ikdZzhUn+B3eIDkn2W/zV7MqQPHtHIyPcpWNV7\r
+       TL18ft40AdP6hhO3+pgfM6jdX2JTFjbvwXvrt+sETke0XV4XWLlkc4Bck2pbm7dwl0JT446P\r
+       sssPL26tYT8oZ23XbG6Y6TrHkOGpCuucS/d5lFiKMxINtZiLihMB2dR/FNACAAA=\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: Sun, 16 Dec 2012 03:17:48 -0000\r
+\r
+Since Emacs has more semantic information, we suppress the generic\r
+format version error from the CLI and give a more informative error.\r
+---\r
+ emacs/notmuch-lib.el |   11 ++++++++++-\r
+ 1 file changed, 10 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+index 8f84087..9ec30ea 100644\r
+--- a/emacs/notmuch-lib.el\r
++++ b/emacs/notmuch-lib.el\r
+@@ -360,9 +360,18 @@ giving the output of command.  ERR-FILE, if provided, is the name\r
+ of a file containing the error output of command.  OUTPUT and the\r
+ contents of ERR-FILE will be included in the error message."\r
\r
+-  ;; This is implemented as a cond to make it easy to expand.\r
+   (cond\r
+    ((eq exit-status 0) t)\r
++   ((eq exit-status 20)\r
++    (notmuch-pop-up-error "Error: Version mismatch.\r
++Emacs requested an older output format than supported by the notmuch CLI.\r
++You may need to restart Emacs or upgrade your notmuch Emacs package.")\r
++    (error "notmuch CLI version mismatch"))\r
++   ((eq exit-status 21)\r
++    (notmuch-pop-up-error "Error: Version mismatch.\r
++Emacs requested a newer output format than supported by the notmuch CLI.\r
++You may need to restart Emacs or upgrade your notmuch package.")\r
++    (error "notmuch CLI version mismatch"))\r
+    (t\r
+     (notmuch-pop-up-error\r
+      (concat\r
+-- \r
+1.7.10.4\r
+\r