From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SJKLHNy1AF80fwAA0tVLHw (envelope-from ) for ; Sat, 04 Jul 2020 17:01:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id cIeBGNy1AF+iRwAA1q6Kng (envelope-from ) for ; Sat, 04 Jul 2020 17:01:16 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 130359408E6 for ; Sat, 4 Jul 2020 17:01:14 +0000 (UTC) Received: from [144.217.243.247] (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 08AA91FAE6; Sat, 4 Jul 2020 13:01:08 -0400 (EDT) Received: from fethera.tethera.net (fethera.tethera.net [IPv6:2607:5300:60:c5::1]) by mail.notmuchmail.org (Postfix) with ESMTP id C29D41F9C9 for ; Sat, 4 Jul 2020 13:01:05 -0400 (EDT) Received: by fethera.tethera.net (Postfix, from userid 1001) id A7AC4613B0; Sat, 4 Jul 2020 13:01:05 -0400 (EDT) Received: (nullmailer pid 3732723 invoked by uid 1000); Sat, 04 Jul 2020 17:01:04 -0000 From: David Bremner To: Floris Bruynooghe , notmuch@notmuchmail.org Subject: Re: [RFC PATCH] lib: document new database_open API In-Reply-To: <87eeprxn3m.fsf@powell.devork.be> References: <20200703134338.3311659-1-david@tethera.net> <87eeprxn3m.fsf@powell.devork.be> Date: Sat, 04 Jul 2020 14:01:04 -0300 Message-ID: <87h7unkyen.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: SWOQESF5S3WTSETVWZF2TC3AMG256GSD X-Message-ID-Hash: SWOQESF5S3WTSETVWZF2TC3AMG256GSD X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Spam-Score: 0.53 X-TUID: xDCrHd97uCXg Floris Bruynooghe writes: >> + * >> + * - in the environment variable NOTMUCH_DATABASE, if non-empty >> + * >> + * - by $XDG_DATA_HOME/notmuch/$NOTMUCH_PROFILE where XDG_DATA_HOME >> + * defaults to "$HOME/.local/share" and NOTMUCH_PROFILE defaults to >> + * "default" > > I like the profile support, is the plan for > $XDG_DATA_HOME/notmuch/$NOTMUCH_PROFILE to be written when creating the > database? Yes, with "NOTMUCH_PROFILE=default" by default. > It's nice that the environment variable handling is done in the library, > should make it more consistent for bindings. As long as it can be > overwritten I guess. Overwritten how? By passing parameters? > The API is rather complex though, perhaps easier when split across > several functions? Maybe a notmuch_database_open_profile(const char > *profile, notmuch_database_t**) is useful as the simple one which always > does the right thing when called with NULL for profile. Not sure what > other combinations would be needed. I have no objections to a "do the write thing" wrapper or two. I don't think that increases maintence cost too much. d