[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / ff / a0b3d6818dd3f417d2a3979d200b3950caef4a
1 Return-Path: <prvs=350ea838c=jrosenthal@jhu.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 ECA27431FB6\r
6         for <notmuch@notmuchmail.org>; Tue,  7 Oct 2014 09:49:03 -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: -1.026\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.026 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_MED=-2.3, RDNS_NONE=1.274] 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 vAh0fxHEIS8B for <notmuch@notmuchmail.org>;\r
16         Tue,  7 Oct 2014 09:48:55 -0700 (PDT)\r
17 Received: from smtpauth.johnshopkins.edu (unknown [162.129.8.150])\r
18         (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 27EDF431FAF\r
21         for <notmuch@notmuchmail.org>; Tue,  7 Oct 2014 09:48:55 -0700 (PDT)\r
22 X-IronPort-AV: E=Sophos;i="5.04,671,1406606400"; d="scan'208";a="99715741"\r
23 Received: from guppy.hwcampus.jhu.edu (HELO localhost) ([10.161.32.234])\r
24         by ipex0.johnshopkins.edu with ESMTP/TLS/AES128-SHA;\r
25         07 Oct 2014 12:48:53 -0400\r
26 From: Jesse Rosenthal <jrosenthal@jhu.edu>\r
27 To: notmuch@notmuchmail.org\r
28 Subject: [PATCH] Avoid empty thread names if possible.\r
29 Date: Tue, 7 Oct 2014 12:35:44 -0400\r
30 Message-ID: <87oatnakqy.fsf@jhu.edu>\r
31 MIME-Version: 1.0\r
32 Content-Type: text/plain\r
33 X-BeenThere: notmuch@notmuchmail.org\r
34 X-Mailman-Version: 2.1.13\r
35 Precedence: list\r
36 List-Id: "Use and development of the notmuch mail system."\r
37         <notmuch.notmuchmail.org>\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
39         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
41 List-Post: <mailto:notmuch@notmuchmail.org>\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
44         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
45 X-List-Received-Date: Tue, 07 Oct 2014 16:49:04 -0000\r
46 \r
47 Currently the thread is named based on either the oldest or newest\r
48 matching message (depending on the search order). If this message has\r
49 an empty subject, though, the thread will show up with an empty\r
50 subject in the search results. (See the thread starting with\r
51 `id:1412371140-21051-1-git-send-email-david@tethera.net` for an\r
52 example.)\r
53 \r
54 This patch changes the behavior to name based on the oldest/newest\r
55 matching non-empty subject. This is particularly helpful for patchsets.\r
56 If the only subjects are empty, the thread subject will still be empty.\r
57 \r
58 Signed-off-by: Jesse Rosenthal <jrosenthal@jhu.edu>\r
59 ---\r
60  lib/thread.cc | 6 ++++--\r
61  1 file changed, 4 insertions(+), 2 deletions(-)\r
62 \r
63 diff --git a/lib/thread.cc b/lib/thread.cc\r
64 index 8922403..ea10295 100644\r
65 --- a/lib/thread.cc\r
66 +++ b/lib/thread.cc\r
67 @@ -348,18 +348,20 @@ _thread_add_matched_message (notmuch_thread_t *thread,\r
68  {\r
69      time_t date;\r
70      notmuch_message_t *hashed_message;\r
71 +    const char *cur_subject;\r
72  \r
73      date = notmuch_message_get_date (message);\r
74 +    cur_subject = notmuch_thread_get_subject (thread);\r
75  \r
76      if (date < thread->oldest || ! thread->matched_messages) {\r
77         thread->oldest = date;\r
78 -       if (sort == NOTMUCH_SORT_OLDEST_FIRST)\r
79 +       if (sort == NOTMUCH_SORT_OLDEST_FIRST || strlen(cur_subject) == 0)\r
80             _thread_set_subject_from_message (thread, message);\r
81      }\r
82  \r
83      if (date > thread->newest || ! thread->matched_messages) {\r
84         thread->newest = date;\r
85 -       if (sort != NOTMUCH_SORT_OLDEST_FIRST)\r
86 +       if (sort != NOTMUCH_SORT_OLDEST_FIRST || strlen(cur_subject) == 0)\r
87             _thread_set_subject_from_message (thread, message);\r
88      }\r
89  \r
90 -- \r
91 2.1.2\r
92 \r