This makes it available for use within the field processors. --- lib/notmuch-private.h | 5 +++++ lib/query.cc | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index 9bdb68ab..f0657147 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -519,6 +519,11 @@ void _notmuch_doc_id_set_remove (notmuch_doc_id_set_t *doc_ids, unsigned int doc_id); +/* utility function to control debugging output */ + +bool +_notmuch_query_debug (); + /* querying xapian documents by type (e.g. "mail" or "ghost"): */ notmuch_status_t _notmuch_query_search_documents (notmuch_query_t *query, diff --git a/lib/query.cc b/lib/query.cc index 792aba21..7b815dc5 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -67,8 +67,8 @@ _notmuch_doc_id_set_init (void *ctx, notmuch_doc_id_set_t *doc_ids, GArray *arr); -static bool -_debug_query (void) +bool +_notmuch_query_debug (void) { char *env = getenv ("NOTMUCH_DEBUG_QUERY"); @@ -90,7 +90,7 @@ notmuch_query_create (notmuch_database_t *notmuch, { notmuch_query_t *query; - if (_debug_query ()) + if (_notmuch_query_debug ()) fprintf (stderr, "Query string is:\n%s\n", query_string); query = talloc (notmuch, notmuch_query_t); @@ -334,7 +334,7 @@ _notmuch_query_search_documents (notmuch_query_t *query, break; } - if (_debug_query ()) { + if (_notmuch_query_debug ()) { fprintf (stderr, "Exclude query is:\n%s\n", exclude_query.get_description ().c_str ()); fprintf (stderr, "Final query is:\n%s\n", @@ -638,7 +638,7 @@ _notmuch_query_count_documents (notmuch_query_t *query, const char *type, unsign enquire.set_weighting_scheme (Xapian::BoolWeight ()); enquire.set_docid_order (Xapian::Enquire::ASCENDING); - if (_debug_query ()) { + if (_notmuch_query_debug ()) { fprintf (stderr, "Exclude query is:\n%s\n", exclude_query.get_description ().c_str ()); fprintf (stderr, "Final query is:\n%s\n", -- 2.23.0.rc1 _______________________________________________ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch