Reply all - issue
[notmuch-archives.git] / d5 / 171a722dcdecdb7f4339bd2a85faf8a75d711c
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 0BC2E431FBF\r
6         for <notmuch@notmuchmail.org>; Thu,  5 Jul 2012 13:52:50 -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 LZi13+giW8MX for <notmuch@notmuchmail.org>;\r
16         Thu,  5 Jul 2012 13:52:48 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-8.mit.edu (DMZ-MAILSEC-SCANNER-8.MIT.EDU\r
18         [18.7.68.37])\r
19         by olra.theworths.org (Postfix) with ESMTP id F310D431FC9\r
20         for <notmuch@notmuchmail.org>; Thu,  5 Jul 2012 13:52:43 -0700 (PDT)\r
21 X-AuditID: 12074425-b7f9b6d0000008c4-89-4ff5fe9be8f0\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
23         by dmz-mailsec-scanner-8.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 2E.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-1.mit.edu (8.13.8/8.9.2) with ESMTP id q65Kqgr8024133; \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 q65KqbV7027234\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-0004XU-Gh; 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 1/9] emacs: Clean up notmuch-search-show-result\r
40 Date: Thu,  5 Jul 2012 16:52:19 -0400\r
41 Message-Id: <1341521547-15502-2-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+NgFjrOIsWRmVeSWpSXmKPExsUixCmqrDv731d/g2NXRC1Wz+WxuH5zJrPF\r
48         m5XzWB2YPXbOusvucfjrQhaPZ6tuMQcwR3HZpKTmZJalFunbJXBlPHx5mLXgoWDF0QnXmRoY\r
49         T/N1MXJySAiYSCyb/4oZwhaTuHBvPVsXIxeHkMA+RomOXVuZIZz1jBLTfm1nhHBOMkn0njoN\r
50         lZnLKPGkezobSD+bgIbEtv3LGUFsEQFpiZ13Z7OC2MwCcRJbpvwHiwsLOEk8/32HBcRmEVCV\r
51         uLxlLVicV8BB4kTbeVaIO+Qlnt7vA5vJKeAocWHiYrAaIYFyiT9L/rFMYORfwMiwilE2JbdK\r
52         NzcxM6c4NVm3ODkxLy+1SNdCLzezRC81pXQTIyi82F1UdzBOOKR0iFGAg1GJh9co94u/EGti\r
53         WXFl7iFGSQ4mJVHext9f/YX4kvJTKjMSizPii0pzUosPMUpwMCuJ8PZmAOV4UxIrq1KL8mFS\r
54         0hwsSuK8N1Ju+gsJpCeWpGanphakFsFkZTg4lCR4n/4FahQsSk1PrUjLzClBSDNxcIIM5wEa\r
55         /gKkhre4IDG3ODMdIn+KUVFKnPc6SEIAJJFRmgfXC4v/V4ziQK8I834CqeIBpg647ldAg5mA\r
56         Buct/gQyuCQRISXVwDjB7OdEOTbxTS9FQyKDDh+y+r2qJ8N1aUCbmqL1fK+s6PyK1JSV/QYH\r
57         Jh/89PCTl3HSk7Q3SZ/dTP36MnXnF+Ra7FsRHM4meSdix/Lwh1WXGTn3vpjuuH7G0wdr1oUx\r
58         HzTb5//fsSxRz+RL1usrh1/lT2nre3Gv8GTz1JhaF81PGwuv8UgxmyuxFGckGmoxFxUnAgA0\r
59         k3Do2gIAAA==\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: Thu, 05 Jul 2012 20:52:50 -0000\r
74 \r
75 This simplifies the code and makes it no longer cubic in the number of\r
76 result fields.\r
77 ---\r
78  emacs/notmuch.el |   19 ++++++++++---------\r
79  1 file changed, 10 insertions(+), 9 deletions(-)\r
80 \r
81 diff --git a/emacs/notmuch.el b/emacs/notmuch.el\r
82 index c6236db..8ad0b68 100644\r
83 --- a/emacs/notmuch.el\r
84 +++ b/emacs/notmuch.el\r
85 @@ -707,29 +707,30 @@ non-authors is found, assume that all of the authors match."\r
86           (overlay-put overlay 'isearch-open-invisible #'delete-overlay)))\r
87        (insert padding))))\r
88  \r
89 -(defun notmuch-search-insert-field (field date count authors subject tags)\r
90 +(defun notmuch-search-insert-field (field format-string date count authors subject tags)\r
91    (cond\r
92     ((string-equal field "date")\r
93 -    (insert (propertize (format (cdr (assoc field notmuch-search-result-format)) date)\r
94 +    (insert (propertize (format format-string date)\r
95                         'face 'notmuch-search-date)))\r
96     ((string-equal field "count")\r
97 -    (insert (propertize (format (cdr (assoc field notmuch-search-result-format)) count)\r
98 +    (insert (propertize (format format-string count)\r
99                         'face 'notmuch-search-count)))\r
100     ((string-equal field "subject")\r
101 -    (insert (propertize (format (cdr (assoc field notmuch-search-result-format)) subject)\r
102 +    (insert (propertize (format format-string subject)\r
103                         'face 'notmuch-search-subject)))\r
104  \r
105     ((string-equal field "authors")\r
106 -    (notmuch-search-insert-authors (cdr (assoc field notmuch-search-result-format)) authors))\r
107 +    (notmuch-search-insert-authors format-string authors))\r
108  \r
109     ((string-equal field "tags")\r
110 +    ;; Ignore format-string here because notmuch-search-set-tags\r
111 +    ;; depends on the format of this\r
112      (insert (concat "(" (propertize tags 'font-lock-face 'notmuch-tag-face) ")")))))\r
113  \r
114  (defun notmuch-search-show-result (date count authors subject tags)\r
115 -  (let ((fields) (field))\r
116 -    (setq fields (mapcar 'car notmuch-search-result-format))\r
117 -    (loop for field in fields\r
118 -         do (notmuch-search-insert-field field date count authors subject tags)))\r
119 +  (dolist (spec notmuch-search-result-format)\r
120 +    (notmuch-search-insert-field (car spec) (cdr spec)\r
121 +                                date count authors subject tags))\r
122    (insert "\n"))\r
123  \r
124  (defun notmuch-search-process-filter (proc string)\r
125 -- \r
126 1.7.10\r
127 \r