[PATCH] configure: add --without-api-docs option
[notmuch-archives.git] / 82 / 2a81c5d4b7a83ea65bdd51ae72aeffef888e30
1 Return-Path: <lrilling@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 67CCF429E2E\r
6         for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 07:37: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: -0.699\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
13         RCVD_IN_DNSWL_LOW=-0.7] autolearn=unavailable\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 gDYELG43j+Pm for <notmuch@notmuchmail.org>;\r
17         Mon, 11 Jul 2011 07:37:09 -0700 (PDT)\r
18 Received: from mail-ew0-f53.google.com (mail-ew0-f53.google.com\r
19         [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 0C9C1429E33\r
22         for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 07:37:08 -0700 (PDT)\r
23 Received: by ewy8 with SMTP id 8so1385964ewy.26\r
24         for <notmuch@notmuchmail.org>; Mon, 11 Jul 2011 07:37:07 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to\r
27         :references; bh=09ELn3Ezeow3aklX4DBM5yd/G8Ho6OKH053vPrCCWCY=;\r
28         b=uX+WhCJxnq43RaGiZVMuGjq648Xo01Yq/R5PUez+MEYdiRvigsFxOgUZYbLrlTdTdC\r
29         Aun0Mp0jyxWv43ke6M5VNDL4gTE3A0G/7sZNgApkz0f9JUYtdnQmXKRQx3J/RuaN+l95\r
30         pd6J+dZYJ8Z6jz1q+PN1CcEiLxld/bmzJylPM=\r
31 Received: by 10.213.99.139 with SMTP id u11mr284661ebn.85.1310395027679;\r
32         Mon, 11 Jul 2011 07:37:07 -0700 (PDT)\r
33 Received: from osdor.le-roi-du-couscous.fr ([78.222.14.116])\r
34         by mx.google.com with ESMTPS id q16sm1163418eef.41.2011.07.11.07.37.06\r
35         (version=SSLv3 cipher=OTHER); Mon, 11 Jul 2011 07:37:07 -0700 (PDT)\r
36 Sender: Louis Rilling <lrilling@gmail.com>\r
37 From: Louis Rilling <l.rilling@av7.net>\r
38 To: Carl Worth <cworth@cworth.org>\r
39 Subject: [PATCH 2/2] tags_to_maildir_flags: Don't rename if no flags change\r
40 Date: Mon, 11 Jul 2011 16:36:18 +0200\r
41 Message-Id: <1310394978-11883-3-git-send-email-l.rilling@av7.net>\r
42 X-Mailer: git-send-email 1.7.2.5\r
43 In-Reply-To: <87d3hzgemi.fsf@yoom.home.cworth.org>\r
44 References: <87d3hzgemi.fsf@yoom.home.cworth.org>\r
45 Cc: notmuch@notmuchmail.org, Austin Clements <amdragon@mit.edu>\r
46 X-BeenThere: notmuch@notmuchmail.org\r
47 X-Mailman-Version: 2.1.13\r
48 Precedence: list\r
49 List-Id: "Use and development of the notmuch mail system."\r
50         <notmuch.notmuchmail.org>\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
52         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
54 List-Post: <mailto:notmuch@notmuchmail.org>\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
58 X-List-Received-Date: Mon, 11 Jul 2011 14:37:09 -0000\r
59 \r
60 notmuch_message_tags_to_maildir_flags() unconditionally moves messages from\r
61 maildir directory "new/" to maildir directory "cur/", which makes messages lose\r
62 their "new" status in the MUA. However some users want to keep this "new"\r
63 status after, for instance, an auto-tagging of new messages.\r
64 \r
65 However, as Austin mentioned and according to the maildir specification,\r
66 messages living in "new/" are not allowed to have flags, even if mutt allows it\r
67 to happen. For this reason, this patch prevents moving messages from "new/" to\r
68 "cur/", only if no flags have to be changed. It's hopefully enough to satisfy\r
69 mutt (and maybe other MUAs showing the "new" status) users checking the "new"\r
70 status.\r
71 \r
72 Signed-off-by: Louis Rilling <l.rilling@av7.net>\r
73 ---\r
74  lib/message.cc |   12 +++++++++++-\r
75  1 files changed, 11 insertions(+), 1 deletions(-)\r
76 \r
77 diff --git a/lib/message.cc b/lib/message.cc\r
78 index 64b6cf8..131d99b 100644\r
79 --- a/lib/message.cc\r
80 +++ b/lib/message.cc\r
81 @@ -1139,7 +1139,7 @@ _get_maildir_flag_actions (notmuch_message_t *message,\r
82   * compute the new maildir filename.\r
83   *\r
84   * If the existing filename is in the directory "new", the new\r
85 - * filename will be in the directory "cur".\r
86 + * filename will be in the directory "cur", unless no flags are changed.\r
87   *\r
88   * After a sequence of ":2," in the filename, any subsequent\r
89   * single-character flags will be added or removed according to the\r
90 @@ -1162,6 +1162,7 @@ _new_maildir_filename (void *ctx,\r
91      char *filename_new, *dir;\r
92      char flag_map[128];\r
93      int flags_in_map = 0;\r
94 +    bool flags_changed = false;\r
95      unsigned int i;\r
96      char *s;\r
97  \r
98 @@ -1202,6 +1203,7 @@ _new_maildir_filename (void *ctx,\r
99         if (flag_map[flag] == 0) {\r
100             flag_map[flag] = 1;\r
101             flags_in_map++;\r
102 +           flags_changed = true;\r
103         }\r
104      }\r
105  \r
106 @@ -1210,9 +1212,17 @@ _new_maildir_filename (void *ctx,\r
107         if (flag_map[flag]) {\r
108             flag_map[flag] = 0;\r
109             flags_in_map--;\r
110 +           flags_changed = true;\r
111         }\r
112      }\r
113  \r
114 +    /* No need to rename. Messages in new/ can be kept in new/.\r
115 +     * Note: We don't even try to fix buggy messages having flags and living in\r
116 +     * new/. It's not our business.\r
117 +     */\r
118 +    if (!flags_changed)\r
119 +       return NULL;\r
120 +\r
121      filename_new = (char *) talloc_size (ctx,\r
122                                          info - filename +\r
123                                          strlen (":2,") + flags_in_map + 1);\r
124 -- \r
125 1.7.2.5\r
126 \r