[PATCH] emacs: Proper error string handling in search sentinel
authorAustin Clements <amdragon@MIT.EDU>
Fri, 17 May 2013 20:14:28 +0000 (16:14 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:54:48 +0000 (09:54 -0800)
a4/4ef398e6c3eff242741b2652066a9b50119f7e [new file with mode: 0644]

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