expose notmuch_database_new to libraries?
Jani Nikula
jani at nikula.org
Sat Sep 26 00:35:47 PDT 2015
On Sat, 26 Sep 2015, "Wael M. Nasreddine" <wael.nasreddine at gmail.com> wrote:
> I have a use case where I'd like to call 'notmuch new'
> programmatically via the bindings (custom Go bindings). Is it at all
> possible to expose notmuch_new_command[0] through lib/notmuch.h? The
> logic of notmuch_new_command would probably have to extracted to
> lib/database.cc for the exposure.
Short answer, no.
I'm afraid we don't have any documentation describing the split between
the library and the cli, apart from the library API. IIUC the history is
that it was originally all lumped together, and then the library was
abstracted as a toolbox for creating email programs on top. The cli
could be considered one such email program (and notmuch-emacs builds on
top of the cli).
I don't think the notmuch new command would be a good fit in the
library. It has too much application level policy that doesn't belong in
the library. That said, I could imagine coming up with another, higher
level library consisting of the main building blocks of the cli, and
having bindings to that. It's just that it's a non-trivial amount of
work, requiring a significant programming *and* review effort.
BR,
Jani.
More information about the notmuch
mailing list