Re: [RFC PATCH] lib: document new database_open API

Subject: Re: [RFC PATCH] lib: document new database_open API

Date: Sat, 04 Jul 2020 14:01:04 -0300

To: Floris Bruynooghe, notmuch@notmuchmail.org

Cc:

From: David Bremner


Floris Bruynooghe <flub@devork.be> 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
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: