From 660632a6c683ba0c3198ab978b9563908fdadf1c Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sat, 18 May 2013 16:14:28 +2000 Subject: [PATCH] [PATCH] emacs: Proper error string handling in search sentinel --- a4/4ef398e6c3eff242741b2652066a9b50119f7e | 93 +++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 a4/4ef398e6c3eff242741b2652066a9b50119f7e diff --git a/a4/4ef398e6c3eff242741b2652066a9b50119f7e b/a4/4ef398e6c3eff242741b2652066a9b50119f7e new file mode 100644 index 000000000..661a6863a --- /dev/null +++ b/a4/4ef398e6c3eff242741b2652066a9b50119f7e @@ -0,0 +1,93 @@ +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 D8B7C431FC2 + for ; Fri, 17 May 2013 13:14:40 -0700 (PDT) +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 hzT3CMlpdjBv for ; + Fri, 17 May 2013 13:14:34 -0700 (PDT) +Received: from dmz-mailsec-scanner-6.mit.edu (DMZ-MAILSEC-SCANNER-6.MIT.EDU + [18.7.68.35]) + by olra.theworths.org (Postfix) with ESMTP id 94E01431FC9 + for ; Fri, 17 May 2013 13:14:34 -0700 (PDT) +X-AuditID: 12074423-b7f826d000001438-e1-51968faaeaa0 +Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) + by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP + id C0.C2.05176.AAF86915; Fri, 17 May 2013 16:14:34 -0400 (EDT) +Received: from outgoing.mit.edu (OUTGOING-AUTH-1.MIT.EDU [18.9.28.11]) + by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id r4HKEUj2001563; + Fri, 17 May 2013 16:14:31 -0400 +Received: from drake.dyndns.org (26-4-182.dynamic.csail.mit.edu [18.26.4.182]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r4HKETsI004817 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Fri, 17 May 2013 16:14:30 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1UdR2r-0006L5-Gq; Fri, 17 May 2013 16:14:29 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: Proper error string handling in search sentinel +Date: Fri, 17 May 2013 16:14:28 -0400 +Message-Id: <1368821668-24316-1-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.7.10.4 +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFlrKIsWRmVeSWpSXmKPExsUixG6nrruqf1qgQecLLovrN2cyOzB6PFt1 + izmAMYrLJiU1J7MstUjfLoEr4/M5/YIjbBV/V6xmbWD8xtLFyMkhIWAicf3SH2YIW0ziwr31 + bF2MXBxCAvsYJfadecAI4WxklHjx8hkjSJWQwBEmiRcPBCAScxklVq54xwSSYBPQkNi2fzlY + kYiAtMTOu7NZuxg5OJgF1CT+dKmAhIUF3CUmbvzJCmKzCKhKzPq/Cmwzr4CDxPpfzWwQVyhK + dD+bwDaBkXcBI8MqRtmU3Crd3MTMnOLUZN3i5MS8vNQiXTO93MwSvdSU0k2M4BBwUd7B+Oeg + 0iFGAQ5GJR7eD67TAoVYE8uKK3MPMUpyMCmJ8jp0A4X4kvJTKjMSizPii0pzUosPMUpwMCuJ + 8D4vBsrxpiRWVqUW5cOkpDlYlMR5r6Xc9BcSSE8sSc1OTS1ILYLJynBwKEnwCgJDXUiwKDU9 + tSItM6cEIc3EwQkynAdouGgfyPDigsTc4sx0iPwpRl2Ozecnv2MUYsnLz0uVEufVARkkAFKU + UZoHNwcWu68YxYHeEuYVAKniAcY93KRXQEuYgJawXpsKsqQkESEl1cDoFTt7hf7PmJsTZi2c + I5S2VHK/eOds2TlPH4qs2O338Ngnk7jrX/5+flz0z8Xk/XHHpfHqxn94o0TajgR/+t8/qW32 + /8ZbTw9Ovem33MrhhuW+yHsWakVXf9vwP1+evL5n7jzHiLKKs6KhkudWOc3XM+QS4plV1m/8 + I+pM5UmHWIUk7qq4zbtVlViKMxINtZiLihMBEuztZ7gCAAA= +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: Fri, 17 May 2013 20:14:41 -0000 + +Apparently Emacs provides a function to stringify errors properly. +Use this in the search sentinel where we have to do our own error +messaging, rather than assuming the first error argument will be the +descriptive string. +--- + emacs/notmuch.el | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index e58c51d..4c1a6ca 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -660,7 +660,7 @@ of the result." + ;; things happen if a sentinel signals. Mimic + ;; the top-level's handling of error messages. + (error +- (message "%s" (second err)) ++ (message "%s" (error-message-string err)) + (throw 'return nil))) + (if (and atbob + (not (string= notmuch-search-target-thread "found"))) +-- +1.7.10.4 + -- 2.26.2