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