From: Josh Poimboeuf Date: Tue, 29 Oct 2013 18:34:57 +0000 (-0700) Subject: fix nm_query_type=messages + query type=threads X-Git-Tag: neomutt-20160404~13^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=452ce73fec083387a30bad855b8b4f9f564f52cc;p=neomutt fix nm_query_type=messages + query type=threads If the default query type is 'messages', and the specific query type is 'threads', make sure the query type is actually 'threads'. --- diff --git a/init.h b/init.h index 4a44438ff..0b8aeb401 100644 --- a/init.h +++ b/init.h @@ -1707,7 +1707,7 @@ struct option_t MuttVars[] = { ** .pp ** This variable specifies the default limit used in notmuch queries. */ - { "nm_query_type", DT_STR, R_NONE, UL &NotmuchQueryType, 0 }, + { "nm_query_type", DT_STR, R_NONE, UL &NotmuchQueryType, UL "messages" }, /* ** .pp ** This variable specifies the default query type (threads or messages) used in notmuch queries. diff --git a/mutt_notmuch.c b/mutt_notmuch.c index d090ef528..607098753 100644 --- a/mutt_notmuch.c +++ b/mutt_notmuch.c @@ -47,7 +47,7 @@ /* read whole-thread or matching messages only? */ enum { - NM_QUERY_TYPE_MESGS = 0, /* default */ + NM_QUERY_TYPE_MESGS = 1, /* default */ NM_QUERY_TYPE_THREADS }; @@ -422,7 +422,7 @@ static int get_limit(struct nm_ctxdata *data) static int get_query_type(struct nm_ctxdata *data) { - return data ? data->query_type : 0; + return (data && data->query_type) ? data->query_type : string_to_guery_type(NULL); } static const char *get_db_filename(struct nm_ctxdata *data)