--- /dev/null
+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 1055A431FD2\r
+ for <notmuch@notmuchmail.org>; Thu, 5 Jul 2012 13:52:46 -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 U3FugbHiEpfr for <notmuch@notmuchmail.org>;\r
+ Thu, 5 Jul 2012 13:52:45 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU\r
+ [18.9.25.14])\r
+ by olra.theworths.org (Postfix) with ESMTP id 75B7E431FC2\r
+ for <notmuch@notmuchmail.org>; Thu, 5 Jul 2012 13:52:43 -0700 (PDT)\r
+X-AuditID: 1209190e-b7fb56d0000008b2-3b-4ff5fe9b6692\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+ by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id CB.2A.02226.B9EF5FF4; Thu, 5 Jul 2012 16:52:43 -0400 (EDT)\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 q65KqgQN026897; \r
+ Thu, 5 Jul 2012 16:52:42 -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.6/8.12.4) with ESMTP id q65KqbOZ027236\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Thu, 5 Jul 2012 16:52:40 -0400 (EDT)\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1Smt2T-0004XZ-I6; Thu, 05 Jul 2012 16:52:37 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2 3/9] emacs: Helper for reporting search parsing errors\r
+Date: Thu, 5 Jul 2012 16:52:21 -0400\r
+Message-Id: <1341521547-15502-4-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.10\r
+In-Reply-To: <1341521547-15502-1-git-send-email-amdragon@mit.edu>\r
+References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>\r
+ <1341521547-15502-1-git-send-email-amdragon@mit.edu>\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFjrOIsWRmVeSWpSXmKPExsUixG6nojv731d/gy1XhCxWz+WxuH5zJrPF\r
+ m5XzWB2YPXbOusvucfjrQhaPZ6tuMQcwR3HZpKTmZJalFunbJXBlTHx+hrlgJk/Fv2WLmBsY\r
+ 33B2MXJySAiYSOzftYAVwhaTuHBvPVsXIxeHkMA+Rok1y7czQzjrGSUeXDsJlTnJJPF/2WUW\r
+ CGcuo8T6hy/YQPrZBDQktu1fzghiiwhIS+y8OxtsLrNAnMSWKf/B4sICnhJrnyxjBrFZBFQl\r
+ nu/6AWbzCjhITH33jxniDnmJp/f7wGZyCjhKXJi4GKxXSKBc4s+SfywTGPkXMDKsYpRNya3S\r
+ zU3MzClOTdYtTk7My0st0jXWy80s0UtNKd3ECAovTkm+HYxfDyodYhTgYFTi4TXO/eIvxJpY\r
+ VlyZe4hRkoNJSZS38fdXfyG+pPyUyozE4oz4otKc1OJDjBIczEoivL0ZQDnelMTKqtSifJiU\r
+ NAeLkjjvlZSb/kIC6YklqdmpqQWpRTBZGQ4OJQnelX+BGgWLUtNTK9Iyc0oQ0kwcnCDDeYCG\r
+ rwWp4S0uSMwtzkyHyJ9iVJQS550JkhAASWSU5sH1wuL/FaM40CvCvJ9AqniAqQOu+xXQYCag\r
+ wXmLP4EMLklESEk1MM4zuXVx+n7vx55CKVufn1561HG723uH6Qfu5H/3YY1fkPyzOHHPASXZ\r
+ Y6xn3l58pSUlVftVYrWv3UzPVLOKTKFcX9PpAsdddKsqdi78sV/wde9d3x7vLwvzszqf/rLe\r
+ FOZWyNtZzOArkCpRbsDL7l//deoMPf6s6fcb7POj/p+9/Mim+uG560osxRmJhlrMRcWJAHBQ\r
+ DMLaAgAA\r
+Cc: tomi.ollila@iki.fi\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: Thu, 05 Jul 2012 20:52:46 -0000\r
+\r
+This removes the last bit of direct output from the parsing function.\r
+With the parser now responsible solely for parsing, we can swap it out\r
+for another parser.\r
+---\r
+ emacs/notmuch.el | 8 +++++++-\r
+ 1 file changed, 7 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
+index 746d0cb..f952fa8 100644\r
+--- a/emacs/notmuch.el\r
++++ b/emacs/notmuch.el\r
+@@ -741,6 +741,11 @@ non-authors is found, assume that all of the authors match."\r
+ (put-text-property beg (point) 'notmuch-search-authors authors)\r
+ (put-text-property beg (point) 'notmuch-search-subject subject))))\r
+ \r
++(defun notmuch-search-show-error (string &rest objects)\r
++ (insert "Error: Unexpected output from notmuch search:\n")\r
++ (insert (apply #'format string objects))\r
++ (insert "\n"))\r
++\r
+ (defun notmuch-search-process-filter (proc string)\r
+ "Process and filter the output of \"notmuch search\""\r
+ (let ((buffer (process-buffer proc))\r
+@@ -766,7 +771,8 @@ non-authors is found, assume that all of the authors match."\r
+ (tag-list (if tags (save-match-data (split-string tags)))))\r
+ (goto-char (point-max))\r
+ (if (/= (match-beginning 1) line)\r
+- (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n")))\r
++ (notmuch-search-show-error\r
++ (substring string line (match-beginning 1))))\r
+ (when (string= thread-id notmuch-search-target-thread)\r
+ (set 'found-target (point))\r
+ (set 'notmuch-search-target-thread "found"))\r
+-- \r
+1.7.10\r
+\r