Re: [RFC PATCH] test: add devel/test-in-docker.sh
[notmuch-archives.git] / cb / 6c113132b761141a8586383d2f5d67c8e9921b
1 Return-Path: <BATV+28bf489b39c899822e75+2435+infradead.org+hohndel@bombadil.srs.infradead.org>\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 302C8431FC1\r
6         for <notmuch@notmuchmail.org>; Sat, 24 Apr 2010 10:35:09 -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: -4.2\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3] autolearn=unavailable\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 dLVku3CHUjZ6 for <notmuch@notmuchmail.org>;\r
16         Sat, 24 Apr 2010 10:35:07 -0700 (PDT)\r
17 Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id CFF364196F2\r
19         for <notmuch@notmuchmail.org>; Sat, 24 Apr 2010 10:35:07 -0700 (PDT)\r
20 Received: from localhost ([::1] helo=x200.gr8dns.org)\r
21         by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux))\r
22         id 1O5jFy-0006lt-MX; Sat, 24 Apr 2010 17:35:06 +0000\r
23 Received: by x200.gr8dns.org (Postfix, from userid 500)\r
24         id 82FDCCC598; Sat, 24 Apr 2010 10:35:05 -0700 (PDT)\r
25 From: Dirk Hohndel <hohndel@infradead.org>\r
26 To: Carl Worth <cworth@cworth.org>, notmuch <notmuch@notmuchmail.org>\r
27 Subject: Re: [PATCH] Reordering of thread authors to list matching authors\r
28         first\r
29 In-Reply-To: <87hbn1og2m.fsf@yoom.home.cworth.org>\r
30 References: <m31veru7vn.fsf@x200.gr8dns.org> <87zl1d5fc0.fsf@steelpick.2x.cz>\r
31         <m3zl1cfsb4.fsf@x200.gr8dns.org>\r
32         <87aatcysw8.fsf@wsheee.localdomain>\r
33         <m3wrwg6n9y.fsf@x200.gr8dns.org> <m3aaswyw9t.fsf@x200.gr8dns.org>\r
34         <m38w8gyw7w.fsf@x200.gr8dns.org>\r
35         <87hbn1og2m.fsf@yoom.home.cworth.org>\r
36 User-Agent: Notmuch/0.2-187-g7c5f017 (http://notmuchmail.org) Emacs/23.1.1\r
37         (i386-redhat-linux-gnu)\r
38 Date: Sat, 24 Apr 2010 10:35:05 -0700\r
39 Message-ID: <m3633g3gae.fsf@x200.gr8dns.org>\r
40 MIME-Version: 1.0\r
41 Content-Type: text/plain; charset=us-ascii\r
42 X-SRS-Rewrite: SMTP reverse-path rewritten from <hohndel@infradead.org> by\r
43         bombadil.infradead.org See http://www.infradead.org/rpr.html\r
44 X-BeenThere: notmuch@notmuchmail.org\r
45 X-Mailman-Version: 2.1.13\r
46 Precedence: list\r
47 List-Id: "Use and development of the notmuch mail system."\r
48         <notmuch.notmuchmail.org>\r
49 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
50         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
51 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
52 List-Post: <mailto:notmuch@notmuchmail.org>\r
53 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
54 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
56 X-List-Received-Date: Sat, 24 Apr 2010 17:35:09 -0000\r
57 \r
58 On Fri, 23 Apr 2010 17:21:53 -0700, Carl Worth <cworth@cworth.org> wrote:\r
59 > On Wed, 21 Apr 2010 20:58:27 -0700, Dirk Hohndel <hohndel@infradead.org> wrote:\r
60 > > When displaying threads as result of a search it makes sense to list those\r
61 > > authors first who match the search. The matching authors are separated from the\r
62 > > non-matching ones with a '|' instead of a ','\r
63\r
64 > It seems a reasonable feature to me.\r
65 \r
66 I switched back to origin/master to help get ready for 0.3 and\r
67 tremendously miss this feature :-) \r
68  \r
69 > Some notes on the patch:\r
70\r
71 > > +void\r
72 > > +notmuch_message_set_author (notmuch_message_t *message,\r
73 > > +                       const char *author)\r
74 > > +{\r
75 > > +    message->author = talloc_strdup(message, author);\r
76 > > +    return;\r
77 > > +}\r
78\r
79 > This is leaking any previously set author value, (admittedly, it's only\r
80 > a "talloc leak" so it will still get cleaned up when the message is\r
81 > cleaned up, but still.\r
82 \r
83 Fixed in forthcoming revision of this patch\r
84 \r
85\r
86 > > +/* Set the author member of 'message' - this is the representation used\r
87 > > + * when displaying the message\r
88 > > + */\r
89 > > +void\r
90 > > +notmuch_message_set_author (notmuch_message_t *message, const char *author);\r
91 > > +\r
92 > > +/* Get the author member of 'message'\r
93 > > + */\r
94 > > +const char *\r
95 > > +notmuch_message_get_author (notmuch_message_t *message);\r
96\r
97 > The notmuch.h file is our publicly installed header file for the library\r
98 > interface. I don't think the feature here requires any new library\r
99 > interface. Even if it did, we wouldn't want a public function like\r
100 > set_author that could simply scramble internal state and change the\r
101 > result of future calls to get_author.\r
102 \r
103 My mistake - moved them to notmuch-private.h\r
104 \r
105 > > +/*\r
106 > > + * move authors of matched messages in the thread to \r
107 > > + * the front of the authors list, but keep them in\r
108 > > + * existing order within their group\r
109 > > + */\r
110 > > +static void\r
111 > > +_thread_move_matched_author (notmuch_thread_t *thread,\r
112 > > +                        const char *author)\r
113\r
114 > The implementation here seems a bit fiddly.\r
115\r
116 > We already have two passes over the messages, (first all messages, and\r
117 > then all matched messages). And we're currently calling add_author from\r
118 > the first pass.\r
119\r
120 > How about simply calling a new add_matched_author from the second pass\r
121 > which would look very much like the existing add_author. Then we could\r
122 > change add_author to accumulate authors into an array rather than a\r
123 > string. Then, finally, we would append any of these authors not already\r
124 > in the matched_authors hash tabled onto the final string.\r
125\r
126 > That should be less code and easier to understand I think.\r
127\r
128 > I can take a whack at that later if you don't beat me to it.\r
129 \r
130 Maybe I'm misunderstanding your proposed algorithm - but it seems quite\r
131 a bit more complicated than what I'm doing today...\r
132 \r
133 /D\r