unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Tomi Ollila <tomi.ollila@iki.fi>
To: Kirill Elagin <kirelagin@gmail.com>, notmuch@notmuchmail.org
Subject: Re: Database path discovery in bindings
Date: Wed, 22 Apr 2020 21:28:23 +0300	[thread overview]
Message-ID: <m2k127gyt4.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <CABVT_gfpVXxddgziFQdOpNTx6ZZ+DQjUceEmeppsd_fk83t5Ew@mail.gmail.com>

On Sun, Apr 19 2020, Kirill Elagin wrote:

> Hello,
>
> Notmuch contains a bit of logic for “normalising” the database path: it can
> be relative to $HOME and fallsback to $MAILDIR or $HOME/mail. However, this
> logic is implemented in `notmuch_config_open` and is not available through
> bindings. So if a third-party tool wants to discover the database, it will
> either do this incorrectly ([alot]) or will have to roll its own
> implementation ([afew]). Neither option is good.
>
> [alot]: https://github.com/pazz/alot/issues/1396
> [afew]: https://github.com/afewmail/afew/pull/233
>
> Rather than reimplementing it in bindings, I see two possible solutions:
>
> 1. Move the logic to `notmuch_database_open` itself.
> 2. Extract into a separate C function, use it in `notmuch_config_open`, and
> expose through bindings.
>
> What do you think?

There has been thoughts to dump the configuration file, and put the
configuration to the database -- so then the bindings can just open the
database to find the configuration.... oh wait...

In this case we'd find the database in $NOTMUCH_DATABASE_DIR[ECTORY?] or
in $HOME/mail/.notmuch/... if that env var did not exist.

There are at least 2 issues to solve with this approach:

1: SMOP
2: how to edit the configuration using text editor (preserving comments),
   i.e. export and import functionality
3. review latency (especially w/ large patches...) ;/

>
> Cheers,
> Kirill

Tomi

  reply	other threads:[~2020-04-22 18:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-19 18:53 Database path discovery in bindings Kirill Elagin
2020-04-22 18:28 ` Tomi Ollila [this message]
2020-04-22 18:48   ` Kirill Elagin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2k127gyt4.fsf@guru.guru-group.fi \
    --to=tomi.ollila@iki.fi \
    --cc=kirelagin@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).