Hi everyone,
I'm not sure how to test for notmuch api versions, but this makes things work with the latest notmuch.
Of course, it'll also break things for older notmuch...
diff --git a/mutt_notmuch.c b/mutt_notmuch.c index 3a05a62..6a27a35 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -347,13 +347,14 @@ static notmuch_database_t *do_database_open(const char *filename, { notmuch_database_t *db = NULL; unsigned int ct = 0; + int status = 0;
dprint(1, (debugfile, "nm: db open '%s' %s (timeout %d)\n", filename, writable ? "[WRITE]" : "[READ]", NotmuchOpenTimeout)); do { - db = notmuch_database_open(filename, + status = notmuch_database_open(filename, writable ? NOTMUCH_DATABASE_MODE_READ_WRITE : - NOTMUCH_DATABASE_MODE_READ_ONLY); + NOTMUCH_DATABASE_MODE_READ_ONLY, &db); if (db || !NotmuchOpenTimeout || ct / 2 > NotmuchOpenTimeout) break;
@@ -364,11 +365,13 @@ static notmuch_database_t *do_database_open(const char *filename, } while (1);
if (verbose) { - if (!db) + if (status) mutt_error (_("Cannot open notmuch database: %s"), filename); else if (ct > 1) mutt_clear_error(); } + if (status) + return NULL; return db; }
On Wed, Jun 13, 2012 at 12:24:10PM -0400, Chris Mason wrote:
Of course, it'll also break things for older notmuch...
Yep, already fixed by patches from David Riebenbaur.
Karel
mutt-kz@lists.fedoraproject.org