Re: [PATCH 2/3] emacs: show: add overlays for each part
[notmuch-archives.git] / 1c / a7c127cc0598d22150e7477305d035df6a1809
1 Return-Path: <joel.borggren.franck@gmail.com>\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 95DC7431FB6\r
6         for <notmuch@notmuchmail.org>; Wed,  1 Dec 2010 12:34:35 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id lb28owIOTD1t for <notmuch@notmuchmail.org>;\r
17         Wed,  1 Dec 2010 12:34:35 -0800 (PST)\r
18 Received: from mail-ew0-f53.google.com (mail-ew0-f53.google.com\r
19         [209.85.215.53])\r
20         by olra.theworths.org (Postfix) with ESMTP id E0DF0431FB5\r
21         for <notmuch@notmuchmail.org>; Wed,  1 Dec 2010 12:34:34 -0800 (PST)\r
22 Received: by ewy6 with SMTP id 6so4421350ewy.26\r
23         for <notmuch@notmuchmail.org>; Wed, 01 Dec 2010 12:34:34 -0800 (PST)\r
24 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
25         h=domainkey-signature:received:received:from:to:subject:date\r
26         :message-id:x-mailer:mime-version:content-type\r
27         :content-transfer-encoding;\r
28         bh=/pWr5I6qt38Oj5a/6oAN4E9lyzXTYFwDUVVW9TFJYao=;\r
29         b=HJDHFIkNhoMRjOcZhOEN+nIWL4cfw5cu3FbjaGpCfCGCS10MOfG5AHESMnTzPMsO3L\r
30         GPIabq/0IZJYNsmPzyZNL0TVpxO9gKagnJx8cVZh85ZOp16gZ7C7d3PU9A5WzpvUgoUm\r
31         M8mwByF3ejnh6Yc0HmX+tGFS7c8dlA6gwYmW4=\r
32 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
33         h=from:to:subject:date:message-id:x-mailer:mime-version:content-type\r
34         :content-transfer-encoding;\r
35         b=L2pGXljERTd5AJ3OOESEYnYSc1zOSyuLc3BRIrsn7gxixSTnFHLgvc1QT5ZiyZnIP4\r
36         k7lHJLmn/K4sFNDuqt2YIG5eVER9KSQJgFyuz/QiSRbevYxp4blj9KVW/TFnBMQMsdkb\r
37         9jMZdV4BGlVTKcaC5MTV3LdmOgdy/SvHqQTkI=\r
38 Received: by 10.213.32.203 with SMTP id e11mr2053351ebd.28.1291235673955;\r
39         Wed, 01 Dec 2010 12:34:33 -0800 (PST)\r
40 Received: from localhost.localdomain (c80-216-237-236.bredband.comhem.se\r
41         [80.216.237.236])\r
42         by mx.google.com with ESMTPS id x54sm321511eeh.17.2010.12.01.12.34.32\r
43         (version=TLSv1/SSLv3 cipher=RC4-MD5);\r
44         Wed, 01 Dec 2010 12:34:33 -0800 (PST)\r
45 From: =?UTF-8?q?Joel=20Borggr=C3=A9n-Franck?= <joel.borggren.franck@gmail.com>\r
46 To: notmuch@notmuchmail.org\r
47 Subject: [PATCH] add headers cc: bcc: and to: (as exactto:) to search index\r
48 Date: Wed,  1 Dec 2010 21:33:55 +0100\r
49 Message-Id: <1291235635-16523-1-git-send-email-joel.borggren.franck@gmail.com>\r
50 X-Mailer: git-send-email 1.7.3.2\r
51 MIME-Version: 1.0\r
52 Content-Type: text/plain; charset=UTF-8\r
53 Content-Transfer-Encoding: 8bit\r
54 X-BeenThere: notmuch@notmuchmail.org\r
55 X-Mailman-Version: 2.1.13\r
56 Precedence: list\r
57 List-Id: "Use and development of the notmuch mail system."\r
58         <notmuch.notmuchmail.org>\r
59 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
61 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
62 List-Post: <mailto:notmuch@notmuchmail.org>\r
63 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
64 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
66 X-List-Received-Date: Wed, 01 Dec 2010 20:34:35 -0000\r
67 \r
68 From: Joel BorggrĂ©n-Franck <jbf@codehouse.se>\r
69 \r
70 Add headers cc: bcc: and to: to index. Real header to: is searched as\r
71 "exactto:foo@bar.baz" and search term "to:" is kept as a union of cc:,\r
72 bcc: and to: for backward compatibility. Use search term "cc:" resp.\r
73 "bcc:" to search those headers respectively.\r
74 ---\r
75  lib/database.cc |   11 +++++++----\r
76  lib/index.cc    |    9 +++++++++\r
77  2 files changed, 16 insertions(+), 4 deletions(-)\r
78 \r
79 diff --git a/lib/database.cc b/lib/database.cc\r
80 index 7a00917..68910f3 100644\r
81 --- a/lib/database.cc\r
82 +++ b/lib/database.cc\r
83 @@ -88,9 +88,9 @@ typedef struct {\r
84   *     MESSAGE_ID:     The unique ID of the mail mess (see "id" above)\r
85   *\r
86   * In addition, terms from the content of the message are added with\r
87 - * "from", "to", "attachment", and "subject" prefixes for use by the\r
88 - * user in searching. But the database doesn't really care itself\r
89 - * about any of these.\r
90 + * "from", "to", "exactto", "cc", "bbc", "attachment" and "subject"\r
91 + * prefixes for use by the user in searching. But the database doesn't\r
92 + * really care itself about any of these.\r
93   *\r
94   * The data portion of a mail document is empty.\r
95   *\r
96 @@ -204,7 +204,10 @@ static prefix_t PROBABILISTIC_PREFIX[]= {\r
97      { "from",                  "XFROM" },\r
98      { "to",                    "XTO" },\r
99      { "attachment",            "XATTACHMENT" },\r
100 -    { "subject",               "XSUBJECT"}\r
101 +    { "subject",               "XSUBJECT"},\r
102 +    { "exactto",                "XEXACTTO"},\r
103 +    { "cc",                     "XCC"},\r
104 +    { "bcc",                    "XBCC"},\r
105  };\r
106  \r
107  int\r
108 diff --git a/lib/index.cc b/lib/index.cc\r
109 index 00478f8..d59c255 100644\r
110 --- a/lib/index.cc\r
111 +++ b/lib/index.cc\r
112 @@ -455,6 +455,15 @@ _notmuch_message_index_file (notmuch_message_t *message,\r
113  \r
114      _index_address_list (message, "from", addresses);\r
115  \r
116 +    addresses = g_mime_message_get_recipients (mime_message, GMIME_RECIPIENT_TYPE_TO);\r
117 +    _index_address_list (message, "exactto", addresses);\r
118 +\r
119 +    addresses = g_mime_message_get_recipients (mime_message, GMIME_RECIPIENT_TYPE_CC);\r
120 +    _index_address_list (message, "cc", addresses);\r
121 +\r
122 +    addresses = g_mime_message_get_recipients (mime_message, GMIME_RECIPIENT_TYPE_BCC);\r
123 +    _index_address_list (message, "bcc", addresses);\r
124 +\r
125      addresses = g_mime_message_get_all_recipients (mime_message);\r
126      _index_address_list (message, "to", addresses);\r
127  \r
128 -- \r
129 1.7.3.2\r
130 \r