Re: [PATCH v2 00/20] insert command
[notmuch-archives.git] / 36 / 49ca53ce4fbebcdab8e8abe4e9587b79825ebe
1 Return-Path: <cworth@cworth.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 17B8E40DBD5\r
6         for <notmuch@notmuchmail.org>; Wed, 10 Nov 2010 08:49:08 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -2.89\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-2.89 tagged_above=-999 required=5\r
12         tests=[ALL_TRUSTED=-1, BAYES_00=-1.9, T_MIME_NO_TEXT=0.01]\r
13         autolearn=ham\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 IbKtT+EEirSa; Wed, 10 Nov 2010 08:48:55 -0800 (PST)\r
17 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
18         by olra.theworths.org (Postfix) with ESMTP id B029940DBD6;\r
19         Wed, 10 Nov 2010 08:48:54 -0800 (PST)\r
20 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
21         id 56C4E25412B; Wed, 10 Nov 2010 08:48:54 -0800 (PST)\r
22 From: Carl Worth <cworth@cworth.org>\r
23 To: Michal Sojka <sojkam1@fel.cvut.cz>, notmuch@notmuchmail.org\r
24 Subject: Re: [PATCH v4 0/4] Maildir synchronization\r
25 In-Reply-To: <874obp325b.fsf@steelpick.2x.cz>\r
26 References: <87tyk3vpxd.fsf@wsheee.2x.cz>\r
27         <1288560558-18915-1-git-send-email-sojkam1@fel.cvut.cz>\r
28         <877hgsrjau.fsf@yoom.home.cworth.org> <87d3qhq527.fsf@resox.2x.cz>\r
29         <874obrmww9.fsf@yoom.home.cworth.org>\r
30         <87iq066cbd.fsf@steelpick.2x.cz>\r
31         <87oc9ykzae.fsf@yoom.home.cworth.org>\r
32         <877hgm2hjg.fsf@steelpick.2x.cz>\r
33         <87lj52knbp.fsf@yoom.home.cworth.org>\r
34         <874obp325b.fsf@steelpick.2x.cz>\r
35 User-Agent: Notmuch/0.4 (http://notmuchmail.org) Emacs/23.2.1\r
36         (i486-pc-linux-gnu)\r
37 Date: Wed, 10 Nov 2010 08:48:54 -0800\r
38 Message-ID: <87fwv9ktu1.fsf@yoom.home.cworth.org>\r
39 MIME-Version: 1.0\r
40 Content-Type: multipart/signed; boundary="=-=-=";\r
41         micalg=pgp-sha1; protocol="application/pgp-signature"\r
42 X-BeenThere: notmuch@notmuchmail.org\r
43 X-Mailman-Version: 2.1.13\r
44 Precedence: list\r
45 List-Id: "Use and development of the notmuch mail system."\r
46         <notmuch.notmuchmail.org>\r
47 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
49 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
50 List-Post: <mailto:notmuch@notmuchmail.org>\r
51 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
52 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
53         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
54 X-List-Received-Date: Wed, 10 Nov 2010 16:49:08 -0000\r
55 \r
56 --=-=-=\r
57 Content-Transfer-Encoding: quoted-printable\r
58 \r
59 On Wed, 10 Nov 2010 11:26:40 +0100, Michal Sojka <sojkam1@fel.cvut.cz> wrot=\r
60 e:\r
61 > > So maybe we will need a new function for the purpose of synchronizing\r
62 > > the current tags of a message to a maildir filename. So that would be,\r
63 > > perhaps, notmuch_message_tags_to_maildir_flags or so?\r
64 >=20\r
65 > This sounds good and allows us to get rid of\r
66 > NOTMUCH_MESSAGE_FLAG_TAGS_INVALID.\r
67 \r
68 Yes. And I'm now pursuing simply two new synchronization functions, (as\r
69 opposed to the _with_maildir_flags variant of _add_message I proposed\r
70 earlier). So the two new functions are:\r
71 \r
72         notmuch_message_maildir_flags_to_tags\r
73 and     notmuch_message_tags_to_maildir_flags\r
74 \r
75 > But can we say the the function _removes_ the unread tag if 'S' is\r
76 > present and adds it otherwise?\r
77 \r
78 I think so. I ended up getting close to this with the code I was writing\r
79 yesterday. I eventually had the original (non-maildir-related)\r
80 notmuch_database_add_message adding the "unread" tag (which is a new\r
81 behavior) and the _add_message_with_maildir_flags removing it if\r
82 necessary.\r
83 \r
84 The semantics will be slightly different with the explicit flags_to_tags\r
85 function, but I think I'll get this right.\r
86 \r
87 > I understand your point but this change would break how I use notmuch\r
88 > now. My new_tags contains only "new" tag and if this tag is not added\r
89 > during notmuch new the message would not be properly tagged by my\r
90 > initial tagging script.\r
91 \r
92 And of course I found the same problem with my own setup. ;-)\r
93 \r
94 So the tag named configured in [new.tags] will need to be applied\r
95 unconditionally to all new messages, (as currently documented). I was\r
96 getting concerned when my patches started adding an "unread" tag to new\r
97 messages (even without [maildir.synchronize_flags] configuration) and\r
98 the existing configuration wouldn't allow a user to prevent that.\r
99 \r
100 But perhaps with the new functions proposed above we can avoid that\r
101 problem.\r
102 \r
103 >   notmuch tag -inbox not tag:unread\r
104 >=20\r
105 > We could also show this hint at the end of notmuch new when it is run\r
106 > for the first time and all messages are tagged by inbox.\r
107 \r
108 Yes. That might be the right answer.\r
109 \r
110 > Great. I've finished the additional tests, which I send as a reply to\r
111 > this mail. Some test are marked as broken because I do not want to touch\r
112 > C sources while you are woking on them.\r
113 \r
114 Thanks!\r
115 \r
116 In addition to this test:\r
117 \r
118        +test_begin_subtest 'Duplicated message is tagged according to the d=\r
119 uplicate'\r
120        +cp "$MAIL_DIR/cur/msg-003" "$MAIL_DIR/cur/msg-003-dup:2,RS"=20\r
121 \r
122 I'd like to see a similar test that starts with "some-message:2,RS" and\r
123 then copies it to "some-message". When we add this message would we\r
124 expect the "replied" tag to be removed and the "unread" tag added?\r
125 \r
126 I'm still trying to work out exactly how the\r
127 notmuch_message_maildir_flags_to_tags function should be documented,\r
128 (whereas notmuch_message_tags_to_maildir_flags seems entirely obvious).\r
129 \r
130 Thanks,\r
131 \r
132 =2DCarl\r
133 \r
134 =2D-=20\r
135 carl.d.worth@intel.com\r
136 \r
137 --=-=-=\r
138 Content-Type: application/pgp-signature\r
139 \r
140 -----BEGIN PGP SIGNATURE-----\r
141 Version: GnuPG v1.4.10 (GNU/Linux)\r
142 \r
143 iD8DBQFM2sz26JDdNq8qSWgRAhalAJ4i2P6Y5tXuVRc0bbkMBntzMN/UIgCfeNbl\r
144 KyhkZkL6JcW45i8/Wq93R/I=\r
145 =QPd6\r
146 -----END PGP SIGNATURE-----\r
147 --=-=-=--\r