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 93198431FC2
\r
6 for <notmuch@notmuchmail.org>; Tue, 3 Jul 2012 15:21:17 -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 XGcWAp9iwmV0 for <notmuch@notmuchmail.org>;
\r
16 Tue, 3 Jul 2012 15:21:16 -0700 (PDT)
\r
17 Received: from dmz-mailsec-scanner-4.mit.edu (DMZ-MAILSEC-SCANNER-4.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id B8022431FCF
\r
20 for <notmuch@notmuchmail.org>; Tue, 3 Jul 2012 15:21:06 -0700 (PDT)
\r
21 X-AuditID: 1209190f-b7f306d0000008b4-bb-4ff37052d4c9
\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])
\r
23 by dmz-mailsec-scanner-4.mit.edu (Symantec Messaging Gateway) with SMTP
\r
24 id 86.67.02228.25073FF4; Tue, 3 Jul 2012 18:21:06 -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 q63ML5Oc012633;
\r
27 Tue, 3 Jul 2012 18:21:05 -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 q63ML1sH023219
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);
\r
33 Tue, 3 Jul 2012 18:21:02 -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 1SmBSu-0007fK-VV; Tue, 03 Jul 2012 18:21:00 -0400
\r
37 From: Austin Clements <amdragon@MIT.EDU>
\r
38 To: notmuch@notmuchmail.org
\r
39 Subject: [PATCH 1/8] emacs: Clean up notmuch-search-show-result
\r
40 Date: Tue, 3 Jul 2012 18:20:52 -0400
\r
41 Message-Id: <1341354059-29396-2-git-send-email-amdragon@mit.edu>
\r
42 X-Mailer: git-send-email 1.7.10
\r
43 In-Reply-To: <1341354059-29396-1-git-send-email-amdragon@mit.edu>
\r
44 References: <1341354059-29396-1-git-send-email-amdragon@mit.edu>
\r
45 X-Brightmail-Tracker:
\r
46 H4sIAAAAAAAAA+NgFrrEIsWRmVeSWpSXmKPExsUixCmqrBtU8Nnf4NFJEYsje2axWyw985/Z
\r
47 4vrNmcwWb1bOY3Vg8dg56y67x+GvC1k8nq26xezR9GMxawBLFJdNSmpOZllqkb5dAlfG1pY3
\r
48 TAU7BSuaXjeyNjCu5Oti5OSQEDCRODn1ICuELSZx4d56ti5GLg4hgX2MEg9efWKBcNYzShxf
\r
49 e5EVwjnJJPHr9zaozFxGiRXrTrOB9LMJaEhs27+cEcQWEZCW2Hl3NthcZoFcibOth8HiwgL2
\r
50 Euv2LgKrZxFQldjwexUziM0r4CBx9tZWqDvkJZ7e7wOr4RRwlFhx8ywLiC0EVLPtQwfrBEb+
\r
51 BYwMqxhlU3KrdHMTM3OKU5N1i5MT8/JSi3RN9HIzS/RSU0o3MYKDTpJ/B+O3g0qHGAU4GJV4
\r
52 eJMUPvsLsSaWFVfmHmKU5GBSEuW9kgcU4kvKT6nMSCzOiC8qzUktPsQowcGsJMK7Ogkox5uS
\r
53 WFmVWpQPk5LmYFES572actNfSCA9sSQ1OzW1ILUIJivDwaEkwXsgH6hRsCg1PbUiLTOnBCHN
\r
54 xMEJMpwHaPgykBre4oLE3OLMdIj8KUZFKXHenSAJAZBERmkeXC8sKbxiFAd6RZj3KEgVDzCh
\r
55 wHW/AhrMBDQ4b/EnkMEliQgpqQbGJjZO/913f99fv+XbZka/2N964hdij6359lX1gFXuLPX5
\r
56 10I0xE9dLUroe7GTObFkAnO/nP+hlF6HQiW1z6FzPEL1DJs9ZmtGT9e96vch9sGS3MojfOGT
\r
57 Pqcu//RQVJK9QXM/x/Vfn0t+W5RWHNQTuf3bclLvyqnf57Rfff1AQ7mgf2fXQZGdSizFGYmG
\r
58 WsxFxYkAZdWhvuUCAAA=
\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: Tue, 03 Jul 2012 22:21:17 -0000
\r
74 This simplifies the code and makes it no longer cubic in the number of
\r
77 emacs/notmuch.el | 20 ++++++++++----------
\r
78 1 file changed, 10 insertions(+), 10 deletions(-)
\r
80 diff --git a/emacs/notmuch.el b/emacs/notmuch.el
\r
81 index c6236db..be217a2 100644
\r
82 --- a/emacs/notmuch.el
\r
83 +++ b/emacs/notmuch.el
\r
84 @@ -707,29 +707,29 @@ non-authors is found, assume that all of the authors match."
\r
85 (overlay-put overlay 'isearch-open-invisible #'delete-overlay)))
\r
88 -(defun notmuch-search-insert-field (field date count authors subject tags)
\r
89 +(defun notmuch-search-insert-field (field format date count authors subject tags)
\r
91 ((string-equal field "date")
\r
92 - (insert (propertize (format (cdr (assoc field notmuch-search-result-format)) date)
\r
93 + (insert (propertize (format format date)
\r
94 'face 'notmuch-search-date)))
\r
95 ((string-equal field "count")
\r
96 - (insert (propertize (format (cdr (assoc field notmuch-search-result-format)) count)
\r
97 + (insert (propertize (format format count)
\r
98 'face 'notmuch-search-count)))
\r
99 ((string-equal field "subject")
\r
100 - (insert (propertize (format (cdr (assoc field notmuch-search-result-format)) subject)
\r
101 + (insert (propertize (format format subject)
\r
102 'face 'notmuch-search-subject)))
\r
104 ((string-equal field "authors")
\r
105 - (notmuch-search-insert-authors (cdr (assoc field notmuch-search-result-format)) authors))
\r
106 + (notmuch-search-insert-authors format authors))
\r
108 ((string-equal field "tags")
\r
109 - (insert (concat "(" (propertize tags 'font-lock-face 'notmuch-tag-face) ")")))))
\r
111 + (format format (propertize tags 'font-lock-face 'notmuch-tag-face))))))
\r
113 (defun notmuch-search-show-result (date count authors subject tags)
\r
114 - (let ((fields) (field))
\r
115 - (setq fields (mapcar 'car notmuch-search-result-format))
\r
116 - (loop for field in fields
\r
117 - do (notmuch-search-insert-field field date count authors subject tags)))
\r
118 + (dolist (format notmuch-search-result-format)
\r
119 + (notmuch-search-insert-field (car format) (cdr format)
\r
120 + date count authors subject tags))
\r
123 (defun notmuch-search-process-filter (proc string)
\r