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 88B39431FC2
\r
6 for <notmuch@notmuchmail.org>; Thu, 5 Jul 2012 13:52:48 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\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 4GDSbmNaQWib for <notmuch@notmuchmail.org>;
\r
16 Thu, 5 Jul 2012 13:52:47 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id B824B431FC7
\r
20 for <notmuch@notmuchmail.org>; Thu, 5 Jul 2012 13:52:43 -0700 (PDT)
\r
21 X-AuditID: 12074425-b7f9b6d0000008c4-88-4ff5fe9b6b2d
\r
22 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])
\r
23 by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 1E.07.02244.B9EF5FF4; Thu, 5 Jul 2012 16:52:43 -0400 (EDT)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q65Kqgv1011303;
\r
27 Thu, 5 Jul 2012 16:52:42 -0400
\r
28 Received: from drake.dyndns.org (26-4-182.dynamic.csail.mit.edu [18.26.4.182])
\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 q65KqbmT027235
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Thu, 5 Jul 2012 16:52:39 -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 1Smt2T-0004XX-HV; Thu, 05 Jul 2012 16:52:37 -0400
\r
37 From: Austin Clements <amdragon@MIT.EDU>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH v2 2/9] emacs: Separate search line parsing and display
\r
40 Date: Thu, 5 Jul 2012 16:52:20 -0400
\r
41 Message-Id: <1341521547-15502-3-git-send-email-amdragon@mit.edu>
\r
42 X-Mailer: git-send-email 1.7.10
\r
43 In-Reply-To: <1341521547-15502-1-git-send-email-amdragon@mit.edu>
\r
44 References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>
\r
45 <1341521547-15502-1-git-send-email-amdragon@mit.edu>
\r
46 X-Brightmail-Tracker:
\r
47 H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsUixCmqrTv731d/g6ZlIhar5/JYXL85k9ni
\r
48 zcp5rA7MHjtn3WX3OPx1IYvHs1W3mAOYo7hsUlJzMstSi/TtErgyrv/YylawS7zi0PYjrA2M
\r
49 L4W6GDk5JARMJHZcP8YOYYtJXLi3nq2LkYtDSGAfo8SlEx1MEM56Rolrc9YzQjgnmSQeHLnP
\r
50 DuHMZZRo/tzEBtLPJqAhsW3/ckYQW0RAWmLn3dmsIDazQJzElin/weLCAu4S1+/1AcU5OFgE
\r
51 VCUe7bcAMXkFHCR+bhKBuEJe4un9PrCJnAKOEhcmLgbrFBIol/iz5B/LBEb+BYwMqxhlU3Kr
\r
52 dHMTM3OKU5N1i5MT8/JSi3Qt9HIzS/RSU0o3MYJCi91FdQfjhENKhxgFOBiVeHiNcr/4C7Em
\r
53 lhVX5h5ilORgUhLlbfz91V+ILyk/pTIjsTgjvqg0J7X4EKMEB7OSCG9vBlCONyWxsiq1KB8m
\r
54 Jc3BoiTOeyPlpr+QQHpiSWp2ampBahFMVoaDQ0mC9+lfoEbBotT01Iq0zJwShDQTByfIcB6g
\r
55 4S9AaniLCxJzizPTIfKnGBWlxHmvgyQEQBIZpXlwvbDYf8UoDvSKMO8nkCoeYNqA634FNJgJ
\r
56 aHDe4k8gg0sSEVJSDYyHDd24n+xVzdhZH9gisDl0oZmrvtaZx39+qydec/qxofTwIl+Xf0Hf
\r
57 aw22yi3s5BeoYleLc54oKVDywF7qSfwm4WbtaXJbWVe+7RZedsJ8caxsn8SBcwvnftDuObr7
\r
58 15mPzjb7rijrJf1WdZ8h9qdfVTFH1r/Edy/j3vXrq9ZKuM09d/3BhTlKLMUZiYZazEXFiQBK
\r
60 Cc: tomi.ollila@iki.fi
\r
61 X-BeenThere: notmuch@notmuchmail.org
\r
62 X-Mailman-Version: 2.1.13
\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: Thu, 05 Jul 2012 20:52:48 -0000
\r
75 Previously, much of the display of search lines was done in the same
\r
76 function that parsed the CLI's output. Now the parsing function only
\r
77 parses, and notmuch-search-show-result fully inserts the search result
\r
78 in the search buffer.
\r
80 emacs/notmuch.el | 33 +++++++++++++++++----------------
\r
81 1 file changed, 17 insertions(+), 16 deletions(-)
\r
83 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
84 index 8ad0b68..746d0cb 100644
\r
85 --- a/emacs/notmuch.el
\r
86 +++ b/emacs/notmuch.el
\r
87 @@ -727,11 +727,19 @@ non-authors is found, assume that all of the authors match."
\r
88 ;; depends on the format of this
\r
89 (insert (concat "(" (propertize tags 'font-lock-face 'notmuch-tag-face) ")")))))
\r
91 -(defun notmuch-search-show-result (date count authors subject tags)
\r
92 - (dolist (spec notmuch-search-result-format)
\r
93 - (notmuch-search-insert-field (car spec) (cdr spec)
\r
94 - date count authors subject tags))
\r
96 +(defun notmuch-search-show-result (thread-id date count authors subject tags)
\r
97 + ;; Ignore excluded matches
\r
98 + (unless (eq (aref count 1) ?0)
\r
99 + (let ((beg (point))
\r
100 + (tags-str (mapconcat 'identity tags " ")))
\r
101 + (dolist (spec notmuch-search-result-format)
\r
102 + (notmuch-search-insert-field (car spec) (cdr spec)
\r
103 + date count authors subject tags-str))
\r
105 + (notmuch-search-color-line beg (point) tags)
\r
106 + (put-text-property beg (point) 'notmuch-search-thread-id thread-id)
\r
107 + (put-text-property beg (point) 'notmuch-search-authors authors)
\r
108 + (put-text-property beg (point) 'notmuch-search-subject subject))))
\r
110 (defun notmuch-search-process-filter (proc string)
\r
111 "Process and filter the output of \"notmuch search\""
\r
112 @@ -759,17 +767,10 @@ non-authors is found, assume that all of the authors match."
\r
113 (goto-char (point-max))
\r
114 (if (/= (match-beginning 1) line)
\r
115 (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n")))
\r
116 - ;; We currently just throw away excluded matches.
\r
117 - (unless (eq (aref count 1) ?0)
\r
118 - (let ((beg (point)))
\r
119 - (notmuch-search-show-result date count authors subject tags)
\r
120 - (notmuch-search-color-line beg (point) tag-list)
\r
121 - (put-text-property beg (point) 'notmuch-search-thread-id thread-id)
\r
122 - (put-text-property beg (point) 'notmuch-search-authors authors)
\r
123 - (put-text-property beg (point) 'notmuch-search-subject subject)
\r
124 - (when (string= thread-id notmuch-search-target-thread)
\r
125 - (set 'found-target beg)
\r
126 - (set 'notmuch-search-target-thread "found"))))
\r
127 + (when (string= thread-id notmuch-search-target-thread)
\r
128 + (set 'found-target (point))
\r
129 + (set 'notmuch-search-target-thread "found"))
\r
130 + (notmuch-search-show-result thread-id date count authors subject tag-list)
\r
131 (set 'line (match-end 0)))
\r
133 (while (and (< line (length string)) (= (elt string line) ?\n))
\r