[PATCH 1/9] lib: read "property" terms from messages.
[notmuch-archives.git] / 3e / df31d00a11a0bbcf6b406cca89c8e6a271fb4b
1 Return-Path: <tomi.ollila@iki.fi>\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 5512A431FC7\r
6         for <notmuch@notmuchmail.org>; Wed, 23 Oct 2013 12:05:40 -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\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         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 K-squcbNu2j0 for <notmuch@notmuchmail.org>;\r
16         Wed, 23 Oct 2013 12:05:35 -0700 (PDT)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 9918B431FBC\r
19         for <notmuch@notmuchmail.org>; Wed, 23 Oct 2013 12:05:35 -0700 (PDT)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 534D4100217;\r
22         Wed, 23 Oct 2013 22:05:27 +0300 (EEST)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: David Bremner <david@tethera.net>\r
25 Subject: Re: [PATCH 1/3] cli: add insert --must-index option\r
26 In-Reply-To: <87bo2xtdp2.fsf@unb.ca>\r
27 References: <1374365254-13227-1-git-send-email-novalazy@gmail.com>\r
28         <87ip048gbj.fsf@qmul.ac.uk>\r
29         <20130727151510.GA13750@hili.localdomain>\r
30         <87hadtxfrr.fsf@qmul.ac.uk>\r
31         <20130912001349.GA18821@hili.localdomain>\r
32         <87zjqhv264.fsf@zancas.localnet>\r
33         <m238o9fguj.fsf@guru.guru-group.fi> <87bo2xtdp2.fsf@unb.ca>\r
34 User-Agent: Notmuch/0.16+115~g11c2ff5 (http://notmuchmail.org) Emacs/24.3.1\r
35         (x86_64-unknown-linux-gnu)\r
36 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
37         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
38         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
39 Date: Wed, 23 Oct 2013 22:05:26 +0300\r
40 Message-ID: <m2eh7bu7t5.fsf@guru.guru-group.fi>\r
41 MIME-Version: 1.0\r
42 Content-Type: text/plain; charset=utf-8\r
43 Content-Transfer-Encoding: quoted-printable\r
44 Cc: notmuch@notmuchmail.org\r
45 X-BeenThere: notmuch@notmuchmail.org\r
46 X-Mailman-Version: 2.1.13\r
47 Precedence: list\r
48 List-Id: "Use and development of the notmuch mail system."\r
49         <notmuch.notmuchmail.org>\r
50 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
52 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
53 List-Post: <mailto:notmuch@notmuchmail.org>\r
54 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
55 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
56         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
57 X-List-Received-Date: Wed, 23 Oct 2013 19:05:40 -0000\r
58 \r
59 On Thu, Oct 10 2013, David Bremner <david@tethera.net> wrote:\r
60 \r
61 > Tomi Ollila <tomi.ollila@iki.fi> writes:\r
62 >>> I'm not opposed to doing an SONAME bump for 0.17. Are there other ABI\r
63 >>> breaking changes that we have been holding back on? Can these maybe go\r
64 >>> through at the same time?\r
65 >>\r
66 >> Maybe something along these lines...\r
67 >>\r
68 >> (Quick draft for the API part; to start discussion before working too mu=\r
69 ch\r
70 >> for something that is going to be dropped...)\r
71 >>\r
72 >>  notmuch_status_t\r
73 >> -notmuch_database_create (const char *path, notmuch_database_t **databas=\r
74 e);\r
75 >> +notmuch_database_create (const char *path,\r
76 >> +                     notmuch_loghook_t *loghook,\r
77 >> +                     notmuch_database_t **database);\r
78 >\r
79 > Another idea floated (by Austin?) was to pass in an options struct, to\r
80 > allow future options to be added without changing the function\r
81 > signature. I guess with some care this could be done in an upwardly\r
82 > compatible way.\r
83 \r
84 Maybe something like\r
85 \r
86 #define NOTMUCH_API_OPTIONS_VERSION 1\r
87 typedef struct {\r
88         int options_version;\r
89         void (*log)(void *, int level, int status, const char * format, ...=\r
90 );\r
91         void * logdata;\r
92 } notmuch_options_t;=20=20=20=20=20=20=20=20\r
93 \r
94 ...\r
95 \r
96 notmuch_status_t\r
97 notmuch_database_create (const char *path,\r
98                          notmuch_options_t *options,\r
99                          notmuch_database_t **database);\r
100 ...\r
101 \r
102 notmuch_status_t\r
103 notmuch_database_open (const char *path,\r
104                        notmuch_database_mode_t mode,\r
105                        notmuch_options_t *options,\r
106                        notmuch_database_t **database);\r
107 \r
108 then in use:\r
109 \r
110 notmuch_options_t options =3D {\r
111        .options_version =3D NOTMUCH_API_OPTIONS_VERSION,\r
112 \r
113 .. =C3=A4sh, this has problem that the macro changes in header file\r
114 but the structure initialization is not following automatically\r
115 (in other fields than that). Therefore perhaps "fixing"\r
116 the version macros:\r
117 \r
118 #define NOTMUCH_API_OPTIONS_VERSION_1 1\r
119 /* #define NOTMUCH_API_OPTIONS_VERSION_2 2 // added in the future */\r
120 \r
121 notmuch_options_t options =3D {\r
122        .options_version =3D NOTMUCH_API_OPTIONS_VERSION_1,\r
123        .log =3D log_to_stderr,\r
124        .logdata =3D NULL\r
125 };\r
126 \r
127 Well, this is one idea (does not sound as good as I initially\r
128 thought...) how does other software tackle this kind of issues...\r
129 \r
130 If something like this is finally chosen we could provide easy\r
131 transition path to allow NULL as options -- making notmuch CLI\r
132 behave as it used to be (log to stderr...).\r
133 \r
134 \r
135 > d\r
136 \r
137 Tomi\r