Tcl bindings for notmuch

Eric J eric at deptj.eu
Sun Feb 14 04:05:28 PST 2016


I have been using notmuch for a while and I wanted to be able to use
notmuch queries in some Tcl stuff I have been using for a rather longer
while. I could have just called the notmuch CLI every time, but I thought
"no, it's a library, there should be bindings".

Bindings made me think of SWIG, which seems to have been tried for
notmuch in the past but abandoned. However, with some time available...

... I can now, from Tcl, use the API functions from the library to
create a database, close and open it, add messages, tag them, run queries
and retrieve information about the results. I haven't tested every API
function yet, but I will be able to go on with my own needs at least. It
is only functions with pointer-to-pointer arguments that need special
attention, and that is all in the SWIG interface file. You can see that at
http://chiselapp.com/user/emj/repository/tclnotmuch/artifact/527aee944d?txt=1&ln=0
- its about 50 lines (plus some blanks).

That's a Fossil repository, with a home page at
http://chiselapp.com/user/emj/repository/tclnotmuch , if anyone wants
to look further. I think it may benefit from more wrapping from the Tcl
side, just for usability.

BTW, I have no idea if or how the interface file would have to be changed
for other languages.

Eric
-- 
ms fnd in a lbry


More information about the notmuch mailing list