Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / f7 / 40f837d94da95b9be953385dc109ef6d1bb920
1 Return-Path: <aclements@csail.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 CA3AC431FBD\r
6         for <notmuch@notmuchmail.org>; Mon,  6 Oct 2014 16:17:42 -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 QEdN+9r3Ua9Y for <notmuch@notmuchmail.org>;\r
16         Mon,  6 Oct 2014 16:17:42 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu\r
18         [18.9.25.13])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id F0187431FC2\r
22         for <notmuch@notmuchmail.org>; Mon,  6 Oct 2014 16:17:30 -0700 (PDT)\r
23 X-AuditID: 1209190d-f79c06d000006f95-0d-5433230a1b4e\r
24 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
25         (using TLS with cipher AES256-SHA (256/256 bits))\r
26         (Client did not present a certificate)\r
27         by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
28         id 44.74.28565.A0323345; Mon,  6 Oct 2014 19:17:30 -0400 (EDT)\r
29 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
30         by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id s96NHPmP030744; \r
31         Mon, 6 Oct 2014 19:17:25 -0400\r
32 Received: from drake.dyndns.org ([12.185.136.2]) (authenticated bits=0)\r
33         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
34         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s96NHNfm014477\r
35         (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT);\r
36         Mon, 6 Oct 2014 19:17:24 -0400\r
37 Received: from amthrax by drake.dyndns.org with local (Exim 4.84)\r
38         (envelope-from <aclements@csail.mit.edu>)\r
39         id 1XbHWs-0001K4-EG; Mon, 06 Oct 2014 17:17:22 -0600\r
40 From: Austin Clements <aclements@csail.mit.edu>\r
41 To: notmuch@notmuchmail.org\r
42 Subject: [PATCH v2 12/12] lib: Remove unnecessary thread linking steps when\r
43         using ghost messages\r
44 Date: Mon,  6 Oct 2014 17:17:18 -0600\r
45 Message-Id: <1412637438-4821-13-git-send-email-aclements@csail.mit.edu>\r
46 X-Mailer: git-send-email 2.1.0\r
47 In-Reply-To: <1412637438-4821-1-git-send-email-aclements@csail.mit.edu>\r
48 References: <1412637438-4821-1-git-send-email-aclements@csail.mit.edu>\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFtrLIsWRmVeSWpSXmKPExsUixCmqrculbBxicPauvsWN1m5Gi+s3ZzI7\r
51         MHk8W3WL2WPLoffMAUxRXDYpqTmZZalF+nYJXBm3zn9gKnjFW3FwczdbA+Mbri5GTg4JAROJ\r
52         qydnsEHYYhIX7q0Hsrk4hARmM0ksXfaaEcLZwCgxd/dkJghnKZPE7Pk9UM4SRokD8/rZQfrZ\r
53         BPQlVqydxApiiwhIS+y8OxvMZhawlLj6tZ0JxBYWSJBY3rsZKM7BwSKgKtFx1REkzCvgLtG6\r
54         fD87xBlyEht2/2cEsTmB4muuTAYbIyTgJvH851OWCYz8CxgZVjHKpuRW6eYmZuYUpybrFicn\r
55         5uWlFuka6eVmluilppRuYgSHkiTvDsZ3B5UOMQpwMCrx8EbsMAwRYk0sK67MPcQoycGkJMo7\r
56         h904RIgvKT+lMiOxOCO+qDQntfgQowQHs5IIL9dvoxAh3pTEyqrUonyYlDQHi5I476YffCFC\r
57         AumJJanZqakFqUUwWRkODiUJXmMloKGCRanpqRVpmTklCGkmDk6Q4TxAw/8pAtXwFhck5hZn\r
58         pkPkTzEqSonzBoMkBEASGaV5cL2wWH/FKA70ijBvEMgKHmCagOt+BTSYCWiw6Rx9kMEliQgp\r
59         qQbGzBNHD8xVXrTmvWRw0hnJPRv/TNT6et6EP1zi6XST86zb7P2NdlRVqa+8eG7rv+83o2pe\r
60         rp06VyXgjLb6o8gbRhxaGXXV6im+dpYXrv6K5Th6hG/9sV3ZurcXTOcONFZmSr5qujx/7+U5\r
61         a1j3+DU94rTvsEkXn/6Cb/P9tV8zrz9MZw45//jSGiWW4oxEQy3mouJEAHPzeZbQAgAA\r
62 X-BeenThere: notmuch@notmuchmail.org\r
63 X-Mailman-Version: 2.1.13\r
64 Precedence: list\r
65 List-Id: "Use and development of the notmuch mail system."\r
66         <notmuch.notmuchmail.org>\r
67 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
68         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
69 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
70 List-Post: <mailto:notmuch@notmuchmail.org>\r
71 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
72 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
73         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
74 X-List-Received-Date: Mon, 06 Oct 2014 23:17:43 -0000\r
75 \r
76 From: Austin Clements <amdragon@mit.edu>\r
77 \r
78 Previously, it was necessary to link new messages to children to work\r
79 around some (though not all) problems with the old metadata-based\r
80 approach to stored thread IDs.  With ghost messages, this is no longer\r
81 necessary, so don't bother with child linking when ghost messages are\r
82 in use.\r
83 ---\r
84  lib/database.cc | 21 +++++++++++++++++----\r
85  1 file changed, 17 insertions(+), 4 deletions(-)\r
86 \r
87 diff --git a/lib/database.cc b/lib/database.cc\r
88 index 1316529..6e51a72 100644\r
89 --- a/lib/database.cc\r
90 +++ b/lib/database.cc\r
91 @@ -2169,10 +2169,23 @@ _notmuch_database_link_message (notmuch_database_t *notmuch,\r
92      if (status)\r
93         goto DONE;\r
94  \r
95 -    status = _notmuch_database_link_message_to_children (notmuch, message,\r
96 -                                                        &thread_id);\r
97 -    if (status)\r
98 -       goto DONE;\r
99 +    if (! (notmuch->features & NOTMUCH_FEATURE_GHOSTS)) {\r
100 +       /* In general, it shouldn't be necessary to link children,\r
101 +        * since the earlier indexing of those children will have\r
102 +        * stored a thread ID for the missing parent.  However, prior\r
103 +        * to ghost messages, these stored thread IDs were NOT\r
104 +        * rewritten during thread merging (and there was no\r
105 +        * performant way to do so), so if indexed children were\r
106 +        * pulled into a different thread ID by a merge, it was\r
107 +        * necessary to pull them *back* into the stored thread ID of\r
108 +        * the parent.  With ghost messages, we just rewrite the\r
109 +        * stored thread IDs during merging, so this workaround isn't\r
110 +        * necessary. */\r
111 +       status = _notmuch_database_link_message_to_children (notmuch, message,\r
112 +                                                            &thread_id);\r
113 +       if (status)\r
114 +           goto DONE;\r
115 +    }\r
116  \r
117      /* If not part of any existing thread, generate a new thread ID. */\r
118      if (thread_id == NULL) {\r
119 -- \r
120 2.1.0\r
121 \r