Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / 7c / 90ee686fdcc8a64b1a81d6024965c51487def6
1 Return-Path: <sojkam1@fel.cvut.cz>\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 C4E4D431FBC\r
6         for <notmuch@notmuchmail.org>; Fri, 31 Aug 2012 14:34:16 -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: -2.3\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3] 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 cVj+nMGOD6vq for <notmuch@notmuchmail.org>;\r
16         Fri, 31 Aug 2012 14:34:15 -0700 (PDT)\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
18         by olra.theworths.org (Postfix) with ESMTP id 9280B431FAF\r
19         for <notmuch@notmuchmail.org>; Fri, 31 Aug 2012 14:34:15 -0700 (PDT)\r
20 Received: from localhost (unknown [192.168.200.4])\r
21         by max.feld.cvut.cz (Postfix) with ESMTP id D1E1F3CFE71;\r
22         Fri, 31 Aug 2012 23:34:14 +0200 (CEST)\r
23 X-Virus-Scanned: IMAP AMAVIS\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])\r
25         by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new,\r
26         port 10044)\r
27         with ESMTP id ER31UVcwZvdE; Fri, 31 Aug 2012 23:34:13 +0200 (CEST)\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
29         by max.feld.cvut.cz (Postfix) with ESMTP id 29B4E19F3302;\r
30         Fri, 31 Aug 2012 23:34:13 +0200 (CEST)\r
31 Received: from steelpick.2x.cz (unknown [213.29.198.144])\r
32         (Authenticated sender: sojkam1)\r
33         by imap.feld.cvut.cz (Postfix) with ESMTPSA id 0F805660904;\r
34         Fri, 31 Aug 2012 23:34:13 +0200 (CEST)\r
35 Received: from wsh by steelpick.2x.cz with local (Exim 4.80)\r
36         (envelope-from <sojkam1@fel.cvut.cz>)\r
37         id 1T7Yqy-0002da-KQ; Fri, 31 Aug 2012 23:34:12 +0200\r
38 From: Michal Sojka <sojkam1@fel.cvut.cz>\r
39 To: Jameson Graef Rollins <jrollins@finestructure.net>,\r
40         Notmuch Mail <notmuch@notmuchmail.org>\r
41 Subject: Re: [PATCH 11/11] lib: add recipients to database\r
42 In-Reply-To: <1345427570-26518-12-git-send-email-jrollins@finestructure.net>\r
43 References: <1345427570-26518-1-git-send-email-jrollins@finestructure.net>\r
44         <1345427570-26518-2-git-send-email-jrollins@finestructure.net>\r
45         <1345427570-26518-3-git-send-email-jrollins@finestructure.net>\r
46         <1345427570-26518-4-git-send-email-jrollins@finestructure.net>\r
47         <1345427570-26518-5-git-send-email-jrollins@finestructure.net>\r
48         <1345427570-26518-6-git-send-email-jrollins@finestructure.net>\r
49         <1345427570-26518-7-git-send-email-jrollins@finestructure.net>\r
50         <1345427570-26518-8-git-send-email-jrollins@finestructure.net>\r
51         <1345427570-26518-9-git-send-email-jrollins@finestructure.net>\r
52         <1345427570-26518-10-git-send-email-jrollins@finestructure.net>\r
53         <1345427570-26518-11-git-send-email-jrollins@finestructure.net>\r
54         <1345427570-26518-12-git-send-email-jrollins@finestructure.net>\r
55 User-Agent: Notmuch/0.14+3~g608c52f (http://notmuchmail.org) Emacs/24.1.1\r
56         (x86_64-pc-linux-gnu)\r
57 Date: Fri, 31 Aug 2012 23:34:12 +0200\r
58 Message-ID: <873932oiej.fsf@steelpick.2x.cz>\r
59 MIME-Version: 1.0\r
60 Content-Type: text/plain\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: Fri, 31 Aug 2012 21:34:16 -0000\r
74 \r
75 On Mon, Aug 20 2012, Jameson Graef Rollins wrote:\r
76 > This adds just the "to" recipients, but probably "cc"s should be\r
77 > included as well.\r
78 > ---\r
79 >  lib/database.cc       |    2 +-\r
80 >  lib/message.cc        |    4 ++++\r
81 >  lib/notmuch-private.h |    2 ++\r
82 >  3 files changed, 7 insertions(+), 1 deletion(-)\r
83 >\r
84 > diff --git a/lib/database.cc b/lib/database.cc\r
85 > index 761dc1a..4c1d578 100644\r
86 > --- a/lib/database.cc\r
87 > +++ b/lib/database.cc\r
88 > @@ -1814,7 +1814,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,\r
89 >               goto DONE;\r
90 >  \r
91 >           date = notmuch_message_file_get_header (message_file, "date");\r
92 > -         _notmuch_message_set_header_values (message, date, from, subject);\r
93 > +         _notmuch_message_set_header_values (message, date, from, to, subject);\r
94 >  \r
95 >           _notmuch_message_index_file (message, filename);\r
96 >       } else {\r
97 > diff --git a/lib/message.cc b/lib/message.cc\r
98 > index fa28073..cc5c8a0 100644\r
99 > --- a/lib/message.cc\r
100 > +++ b/lib/message.cc\r
101 > @@ -420,6 +420,8 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header)\r
102 >       * available */\r
103 >      if (strcasecmp (header, "from") == 0)\r
104 >       value = message->doc.get_value (NOTMUCH_VALUE_FROM);\r
105 > +    if (strcasecmp (header, "to") == 0)\r
106 > +     value = message->doc.get_value (NOTMUCH_VALUE_TO);\r
107 >      else if (strcasecmp (header, "subject") == 0)\r
108 >       value = message->doc.get_value (NOTMUCH_VALUE_SUBJECT);\r
109 >      else if (strcasecmp (header, "message-id") == 0)\r
110 > @@ -830,6 +832,7 @@ void\r
111 >  _notmuch_message_set_header_values (notmuch_message_t *message,\r
112 >                                   const char *date,\r
113 >                                   const char *from,\r
114 > +                                 const char *to,\r
115 >                                   const char *subject)\r
116 >  {\r
117 >      time_t time_value;\r
118 > @@ -844,6 +847,7 @@ _notmuch_message_set_header_values (notmuch_message_t *message,\r
119 >      message->doc.add_value (NOTMUCH_VALUE_TIMESTAMP,\r
120 >                           Xapian::sortable_serialise (time_value));\r
121 >      message->doc.add_value (NOTMUCH_VALUE_FROM, from);\r
122 > +    message->doc.add_value (NOTMUCH_VALUE_TO, to);\r
123 >      message->doc.add_value (NOTMUCH_VALUE_SUBJECT, subject);\r
124 >  }\r
125 >  \r
126 > diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h\r
127 > index 32d1523..f56c580 100644\r
128 > --- a/lib/notmuch-private.h\r
129 > +++ b/lib/notmuch-private.h\r
130 > @@ -95,6 +95,7 @@ typedef enum {\r
131 >      NOTMUCH_VALUE_TIMESTAMP = 0,\r
132 >      NOTMUCH_VALUE_MESSAGE_ID,\r
133 >      NOTMUCH_VALUE_FROM,\r
134 > +    NOTMUCH_VALUE_TO,\r
135 \r
136 It would be definitely useful to add other headers to the database (and\r
137 make them searchable). As far as I remember this is on the todo list for\r
138 ages. I'm only not sure that the approach of adding every possible\r
139 header manually (like in this patch) is a good approach. Emails can\r
140 contain arbitrary headers so there would be always some header missing.\r
141 I'm not that much familiar with Xapian to figure out how to implement\r
142 this.\r
143 \r
144 Otherwise this series looks quite well. I'm only not sure whether to\r
145 merge it now or after changing the storage of headers in the database.\r
146 \r
147 Probably, if emacs interface is also extended to use this feature as\r
148 part of saved searches or hello-section in a way that I can see the list\r
149 of drafts on one click from hello screen. I'd vote for merging this now.\r
150 \r
151 However, I've just looked how does my drafts folder (messages saved with\r
152 C-x C-s) looks like and one problem I see there is that draft messages\r
153 do not have message ids. Do you have an idea how to implement drafts in\r
154 emacs UI?\r
155 \r
156 Thanks,\r
157 -Michal\r
158 \r