Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / 36 / ba68f9a1f1cfddefcbfff0a098edc57a4934e6
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 504FB431FBF;\r
6         Sun, 22 Nov 2009 19:51:50 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 Received: from olra.theworths.org ([127.0.0.1])\r
9         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
10         with ESMTP id WyTmEipyC3aF; Sun, 22 Nov 2009 19:51:49 -0800 (PST)\r
11 Received: from cworth.org (localhost [127.0.0.1])\r
12         by olra.theworths.org (Postfix) with ESMTP id C73E8431FAE;\r
13         Sun, 22 Nov 2009 19:51:48 -0800 (PST)\r
14 From: Carl Worth <cworth@cworth.org>\r
15 To: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,\r
16         notmuch@notmuchmail.org\r
17 In-Reply-To:\r
18  <1258914526-30984-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
19 References:\r
20  <1258914526-30984-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com>\r
21 Date: Mon, 23 Nov 2009 04:51:34 +0100\r
22 Message-ID: <87pr79gapl.fsf@yoom.home.cworth.org>\r
23 MIME-Version: 1.0\r
24 Content-Type: text/plain; charset=us-ascii\r
25 Subject: Re: [notmuch] [RFC PATCH -V2] notmuch: Add support for multiple\r
26  maildirs\r
27 X-BeenThere: notmuch@notmuchmail.org\r
28 X-Mailman-Version: 2.1.12\r
29 Precedence: list\r
30 List-Id: "Use and development of the notmuch mail system."\r
31         <notmuch.notmuchmail.org>\r
32 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
33         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
34 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
35 List-Post: <mailto:notmuch@notmuchmail.org>\r
36 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
37 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
38         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
39 X-List-Received-Date: Mon, 23 Nov 2009 03:51:50 -0000\r
40 \r
41 On Sun, 22 Nov 2009 23:58:46 +0530, "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> wrote:\r
42 > This patch separate database path and maildir paths.\r
43 > It also adds support for multiple maildir paths which\r
44 > is represented by comma separated values.\r
45 \r
46 I have a running joke with my good friend Behdad that we should add a\r
47 git-hook to refuse any commit with the word "also" in the commit\r
48 message. It's often a sign that the commit is actually doing two\r
49 independent things, and that those two independent things should be\r
50 split into separate commits.\r
51 \r
52 I think that's the case here.\r
53 \r
54 > You need to have in ~/.notmuch-config\r
55 > [maildirs]\r
56 > path=path1,path2\r
57 \r
58 Documentation in the commit message doesn't count. We need this\r
59 documentation to be inserted into the configuration file as a comment,\r
60 like with the other values.\r
61 \r
62 > +          dirs = g_key_file_get_string (config->key_file,\r
63 > +                                  "maildirs", "path", NULL);\r
64 > +             if (dirs) {\r
65 > +                     size = sizeof(struct count_ele) + strlen(dirs) + 1;\r
66 > +                     /* comma separated paths */\r
67 > +                     maildirs = (struct count_ele *)malloc(size);\r
68 \r
69 There's a g_key_file_get_string_list function that will do all the\r
70 splitting of a multiple-valued configuration entry into multiple\r
71 strings. I suggest using that here instead of doing open-coded parsing.\r
72 \r
73 > -    prompt ("Top-level directory of your email archive [%s]: ",\r
74 > +    prompt ("Directory for notmuch database [%s]: ",\r
75 \r
76 Is there really a reason to prompt for this here, rather than just using\r
77 a default value (and letting the user know what it is?). One thing I'm\r
78 worried about is the user thinking they can run "notmuch setup", change\r
79 this value, and expect things to work, (which of course, they won't).\r
80 \r
81 I'd be happier if the user understood that the database is relocatable\r
82 and they can just "mv" things around as they want to.\r
83 \r
84 Of course, for that, then we'd actually need to *make* the database\r
85 relocatable. One thing that we get right now with the .notmuch directory\r
86 _inside_ the mail directory is that everything is relocatable.\r
87 \r
88 If you just pull it out, like you do here, then suddenly the database\r
89 will be full of absolute paths to mail files, and things will break if\r
90 the top-level mail-directory is moved. And that's a regression compared\r
91 to the current case.\r
92 \r
93 > +    prompt ("Comma separated maildirs [%s]: ", cmaildirs);\r
94 \r
95 If we are going to support multiple directories for mail here, then we\r
96 should prompt separately for each (like we are doing for the email\r
97 addresses already).\r
98 \r
99 Also, I'd prefer something like "Top-level directory of email archive"\r
100 like we had before. I certainly don't want to give the user the\r
101 impression that they need to type in a path to each individual maildir\r
102 that they have.\r
103 \r
104 Finally, (and maybe I should have started with this), what's the actual\r
105 use case here? Is it difficult to just arrange all mail to be under one\r
106 top-level directory, (perhaps just using symlinks even).\r
107 \r
108 -Carl\r