]> granicus.if.org Git - neomutt/commitdiff
fix nm_query_type=messages + query type=threads
authorJosh Poimboeuf <jpoimboe@redhat.com>
Tue, 29 Oct 2013 18:34:57 +0000 (11:34 -0700)
committerRichard Russon <rich@flatcap.org>
Mon, 14 Mar 2016 23:11:43 +0000 (23:11 +0000)
If the default query type is 'messages', and the specific query type is
'threads', make sure the query type is actually 'threads'.

init.h
mutt_notmuch.c

diff --git a/init.h b/init.h
index b7a8c94165419f712b534e9ab218f66c9f0de924..a95dc5ecf0ff54256cabea10f065746c18afb004 100644 (file)
--- a/init.h
+++ b/init.h
@@ -1686,7 +1686,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.
index d090ef52836ea710b2dae3e0fbbd0a1ffe877b80..607098753b294bf7278ea64440212f255043bc21 100644 (file)
@@ -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)