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 6723D431FBF
\r
6 for <notmuch@notmuchmail.org>; Mon, 9 Jul 2012 14:42:50 -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 bc5b8DVljDup for <notmuch@notmuchmail.org>;
\r
16 Mon, 9 Jul 2012 14:42:49 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 52D06431FAE
\r
20 for <notmuch@notmuchmail.org>; Mon, 9 Jul 2012 14:42:49 -0700 (PDT)
\r
21 X-AuditID: 1209190d-b7fd56d000000933-8f-4ffb505852b5
\r
22 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39])
\r
23 by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 58.19.02355.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-4.mit.edu (8.13.8/8.9.2) with ESMTP id q69LglVv006999;
\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 q69Lgib6022683
\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-0004fr-01; Mon, 09 Jul 2012 17:42:43 -0400
\r
37 From: Austin Clements <amdragon@MIT.EDU>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH v3 2/9] emacs: Separate search line parsing and display
\r
40 Date: Mon, 9 Jul 2012 17:42:35 -0400
\r
41 Message-Id: <1341870162-17782-3-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+NgFjrOIsWRmVeSWpSXmKPExsUixG6nrhsR8Nvf4NhTDYvVc3ksrt+cyWzx
\r
48 ZuU8Vgdmj52z7rJ7HP66kMXj2apbzAHMUVw2Kak5mWWpRfp2CVwZ139sZSvYJV5xaPsR1gbG
\r
49 l0JdjJwcEgImEq2vNrJC2GISF+6tZ+ti5OIQEtjHKHFg60xWCGc9o8T2/a+hnJNMElfOP4Vy
\r
50 5jJKrGjYxQLSzyagIbFt/3JGEFtEQFpi593ZYHOZBeIktkz5DxYXFnCXWL96NRuIzSKgKjFz
\r
51 +W+wXl4BB4kj/7ZB3SEv8fR+H1gNp4CjxJybO8B6hQTKJT7f+Mc8gZF/ASPDKkbZlNwq3dzE
\r
52 zJzi1GTd4uTEvLzUIl0jvdzMEr3UlNJNjKDw4pTk3cH47qDSIUYBDkYlHt4opt/+QqyJZcWV
\r
53 uYcYJTmYlER58zyBQnxJ+SmVGYnFGfFFpTmpxYcYJTiYlUR4b7kC5XhTEiurUovyYVLSHCxK
\r
54 4rxXUm76CwmkJ5akZqemFqQWwWRlODiUJHin+QM1ChalpqdWpGXmlCCkmTg4QYbzAA2fAFLD
\r
55 W1yQmFucmQ6RP8WoKCXOOxkkIQCSyCjNg+uFxf8rRnGgV4R5d4BU8QBTB1z3K6DBTECD23t+
\r
56 gQwuSURISTUwLspwcJaNtpN4nugvf94n8u1DQ98vT4Qc3k9JL7sYbBZ31+NOwZ/vEadsOWW+
\r
57 O69/tzuz++U5JdZ3/TKNPO9SNUoPveloCTdr2ZMmUM8c+EwiSE4+TGGaftV7ix9qb7Yub7CT
\r
58 K3KTCzzW+erxGacl6do6AUd+z1vo0GGkrt23rK4/x0smRE6JpTgj0VCLuag4EQBgJYcR2gIA AA==
\r
59 Cc: tomi.ollila@iki.fi
\r
60 X-BeenThere: notmuch@notmuchmail.org
\r
61 X-Mailman-Version: 2.1.13
\r
63 List-Id: "Use and development of the notmuch mail system."
\r
64 <notmuch.notmuchmail.org>
\r
65 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
66 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
67 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
68 List-Post: <mailto:notmuch@notmuchmail.org>
\r
69 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
70 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
71 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
72 X-List-Received-Date: Mon, 09 Jul 2012 21:42:50 -0000
\r
74 Previously, much of the display of search lines was done in the same
\r
75 function that parsed the CLI's output. Now the parsing function only
\r
76 parses, and notmuch-search-show-result fully inserts the search result
\r
77 in the search buffer.
\r
79 emacs/notmuch.el | 33 +++++++++++++++++----------------
\r
80 1 file changed, 17 insertions(+), 16 deletions(-)
\r
82 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
83 index 8ad0b68..746d0cb 100644
\r
84 --- a/emacs/notmuch.el
\r
85 +++ b/emacs/notmuch.el
\r
86 @@ -727,11 +727,19 @@ non-authors is found, assume that all of the authors match."
\r
87 ;; depends on the format of this
\r
88 (insert (concat "(" (propertize tags 'font-lock-face 'notmuch-tag-face) ")")))))
\r
90 -(defun notmuch-search-show-result (date count authors subject tags)
\r
91 - (dolist (spec notmuch-search-result-format)
\r
92 - (notmuch-search-insert-field (car spec) (cdr spec)
\r
93 - date count authors subject tags))
\r
95 +(defun notmuch-search-show-result (thread-id date count authors subject tags)
\r
96 + ;; Ignore excluded matches
\r
97 + (unless (eq (aref count 1) ?0)
\r
98 + (let ((beg (point))
\r
99 + (tags-str (mapconcat 'identity tags " ")))
\r
100 + (dolist (spec notmuch-search-result-format)
\r
101 + (notmuch-search-insert-field (car spec) (cdr spec)
\r
102 + date count authors subject tags-str))
\r
104 + (notmuch-search-color-line beg (point) tags)
\r
105 + (put-text-property beg (point) 'notmuch-search-thread-id thread-id)
\r
106 + (put-text-property beg (point) 'notmuch-search-authors authors)
\r
107 + (put-text-property beg (point) 'notmuch-search-subject subject))))
\r
109 (defun notmuch-search-process-filter (proc string)
\r
110 "Process and filter the output of \"notmuch search\""
\r
111 @@ -759,17 +767,10 @@ non-authors is found, assume that all of the authors match."
\r
112 (goto-char (point-max))
\r
113 (if (/= (match-beginning 1) line)
\r
114 (insert (concat "Error: Unexpected output from notmuch search:\n" (substring string line (match-beginning 1)) "\n")))
\r
115 - ;; We currently just throw away excluded matches.
\r
116 - (unless (eq (aref count 1) ?0)
\r
117 - (let ((beg (point)))
\r
118 - (notmuch-search-show-result date count authors subject tags)
\r
119 - (notmuch-search-color-line beg (point) tag-list)
\r
120 - (put-text-property beg (point) 'notmuch-search-thread-id thread-id)
\r
121 - (put-text-property beg (point) 'notmuch-search-authors authors)
\r
122 - (put-text-property beg (point) 'notmuch-search-subject subject)
\r
123 - (when (string= thread-id notmuch-search-target-thread)
\r
124 - (set 'found-target beg)
\r
125 - (set 'notmuch-search-target-thread "found"))))
\r
126 + (when (string= thread-id notmuch-search-target-thread)
\r
127 + (set 'found-target (point))
\r
128 + (set 'notmuch-search-target-thread "found"))
\r
129 + (notmuch-search-show-result thread-id date count authors subject tag-list)
\r
130 (set 'line (match-end 0)))
\r
132 (while (and (< line (length string)) (= (elt string line) ?\n))
\r