"snoozing" with notmuch?
[notmuch-archives.git] / ef / 5a134c212b6becb267393b96ef3059bfc620aa
1 Return-Path: <amdragon@mit.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id E12FA429E34\r
6         for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 14:42:51 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 9GNWJ6Vl6Rh7 for <notmuch@notmuchmail.org>;\r
16         Mon,  9 Jul 2012 14:42:51 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
18         [18.7.68.34])\r
19         by olra.theworths.org (Postfix) with ESMTP id 0E7BE429E2F\r
20         for <notmuch@notmuchmail.org>; Mon,  9 Jul 2012 14:42:49 -0700 (PDT)\r
21 X-AuditID: 12074422-b7f1f6d00000090b-4e-4ffb5058c38e\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 95.39.02315.8505BFF4; Mon,  9 Jul 2012 17:42:48 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id q69LgljQ011260; \r
27         Mon, 9 Jul 2012 17:42:47 -0400\r
28 Received: from drake.dyndns.org (26-4-176.dynamic.csail.mit.edu [18.26.4.176])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q69LgiSH022684\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Mon, 9 Jul 2012 17:42:45 -0400 (EDT)\r
34 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1SoLjA-0004fu-0N; Mon, 09 Jul 2012 17:42:44 -0400\r
37 From: Austin Clements <amdragon@MIT.EDU>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v3 3/9] emacs: Helper for reporting search parsing errors\r
40 Date: Mon,  9 Jul 2012 17:42:36 -0400\r
41 Message-Id: <1341870162-17782-4-git-send-email-amdragon@mit.edu>\r
42 X-Mailer: git-send-email 1.7.10\r
43 In-Reply-To: <1341870162-17782-1-git-send-email-amdragon@mit.edu>\r
44 References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>\r
45         <1341870162-17782-1-git-send-email-amdragon@mit.edu>\r
46 X-Brightmail-Tracker:\r
47  H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsUixCmqrBsR8NvfoPegpsXquTwW12/OZLZ4\r
48         s3IeqwOzx85Zd9k9Dn9dyOLxbNUt5gDmKC6blNSczLLUIn27BK6Mic/PMBfM5Kn4t2wRcwPj\r
49         G84uRg4OCQETiaeTpLoYOYFMMYkL99azdTFycQgJ7GOUOPnkJhOEs55Ron3lbyjnJJPEhsXX\r
50         oJy5jBKz7vxkBulnE9CQ2LZ/OSOILSIgLbHz7mxWEJtZIE5iy5T/jCDrhAU8Jfp+lYOEWQRU\r
51         JTb9f8IEYvMKOEh8OdHCAnGGvMTT+31sIDangKPEnJs7wEYKCZRLfL7xj3kCI/8CRoZVjLIp\r
52         uVW6uYmZOcWpybrFyYl5ealFuqZ6uZkleqkppZsYQaHF7qK0g/HnQaVDjAIcjEo8vJtYfvsL\r
53         sSaWFVfmHmKU5GBSEuXN8wQK8SXlp1RmJBZnxBeV5qQWH2KU4GBWEuG95QqU401JrKxKLcqH\r
54         SUlzsCiJ815LuekvJJCeWJKanZpakFoEk5Xh4FCS4J3mD9QoWJSanlqRlplTgpBm4uAEGc4D\r
55         NPwcSA1vcUFibnFmOkT+FKOilDjvdZCEAEgiozQPrhcW+68YxYFeEebdAVLFA0wbcN2vgAYz\r
56         AQ1u7/kFMrgkESEl1cDYYNzHfV/zuGCt7+wLRntU9wvfmMJ80lfQmb9gxuPqNyHh+lrewosZ\r
57         S+7uigisaZ+cf3eleQcra36uiGDOw+OWRdcZOf5/iLFnulK5m2vGl1lyNlPMBVhNLhlFTd8b\r
58         LqA59/uRAibP49IZG6dFBYb/XnREKpctoi6vJU87d7pC0umds8tlJyqxFGckGmoxFxUnAgDK\r
59         kNBe2AIAAA==\r
60 Cc: tomi.ollila@iki.fi\r
61 X-BeenThere: notmuch@notmuchmail.org\r
62 X-Mailman-Version: 2.1.13\r
63 Precedence: list\r
64 List-Id: "Use and development of the notmuch mail system."\r
65         <notmuch.notmuchmail.org>\r
66 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
67         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
68 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
69 List-Post: <mailto:notmuch@notmuchmail.org>\r
70 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
71 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
72         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
73 X-List-Received-Date: Mon, 09 Jul 2012 21:42:52 -0000\r
74 \r
75 This removes the last bit of direct output from the parsing function.\r
76 With the parser now responsible solely for parsing, we can swap it out\r
77 for another parser.\r
78 ---\r
79  emacs/notmuch.el |    8 +++++++-\r
80  1 file changed, 7 insertions(+), 1 deletion(-)\r
81 \r
82 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
83 index 746d0cb..f952fa8 100644\r
84 --- a/emacs/notmuch.el\r
85 +++ b/emacs/notmuch.el\r
86 @@ -741,6 +741,11 @@ non-authors is found, assume that all of the authors match."\r
87        (put-text-property beg (point) 'notmuch-search-authors authors)\r
88        (put-text-property beg (point) 'notmuch-search-subject subject))))\r
89  \r
90 +(defun notmuch-search-show-error (string &rest objects)\r
91 +  (insert "Error: Unexpected output from notmuch search:\n")\r
92 +  (insert (apply #'format string objects))\r
93 +  (insert "\n"))\r
94 +\r
95  (defun notmuch-search-process-filter (proc string)\r
96    "Process and filter the output of \"notmuch search\""\r
97    (let ((buffer (process-buffer proc))\r
98 @@ -766,7 +771,8 @@ non-authors is found, assume that all of the authors match."\r
99                            (tag-list (if tags (save-match-data (split-string tags)))))\r
100                       (goto-char (point-max))\r
101                       (if (/= (match-beginning 1) line)\r
102 -                         (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n")))\r
103 +                         (notmuch-search-show-error\r
104 +                          (substring string line (match-beginning 1))))\r
105                       (when (string= thread-id notmuch-search-target-thread)\r
106                         (set 'found-target (point))\r
107                         (set 'notmuch-search-target-thread "found"))\r
108 -- \r
109 1.7.10\r
110 \r