Here is my proposal, based on Clint's suggestion on IRC, and on the sed hack from librhash, to hide all symbols that are not explicitly part of the notmuch API. In particular it hides the various symbols related to Xapian exceptions.