]> granicus.if.org Git - neomutt/commitdiff
Add option to control whether threads uncollapse when new mail arrives.
authorDavid Champion <dgc@bikeshed.us>
Tue, 13 Dec 2016 20:19:05 +0000 (12:19 -0800)
committerRichard Russon <rich@flatcap.org>
Fri, 30 Dec 2016 20:05:36 +0000 (20:05 +0000)
Adds $uncollapse_new: when set, the default, a collapsed thread into
which a new message arrives will be uncollapsed to reveal the new
message.

curs_main.c
init.h
mutt.h

index 72dd885f2853cc9d86c701d818e20af721ae6fb0..5c35d8453adc47bba42039f95914aff365e844e0 100644 (file)
@@ -481,7 +481,7 @@ void update_index (MUTTMENU *menu, CONTEXT *ctx, int check,
   }
 
   /* save the list of new messages */
-  if (oldcount && check != MUTT_REOPENED
+  if (option(OPTUNCOLLAPSENEW) && oldcount && check != MUTT_REOPENED
       && ((Sort & SORT_MASK) == SORT_THREADS))
   {
     save_new = (HEADER **) safe_malloc (sizeof (HEADER *) * (ctx->msgcount - oldcount));
@@ -493,7 +493,7 @@ void update_index (MUTTMENU *menu, CONTEXT *ctx, int check,
   mutt_sort_headers (ctx, (check == MUTT_REOPENED));
 
   /* uncollapse threads with new mail */
-  if ((Sort & SORT_MASK) == SORT_THREADS)
+  if (option(OPTUNCOLLAPSENEW) && ((Sort & SORT_MASK) == SORT_THREADS))
   {
     if (check == MUTT_REOPENED)
     {
diff --git a/init.h b/init.h
index e146a66baaed94610e912fcf62846965106ad831..add06ad8fbf1f0378e12acf46cfa0d20b7d428d5 100644 (file)
--- a/init.h
+++ b/init.h
@@ -4047,6 +4047,14 @@ struct option_t MuttVars[] = {
   ** When \fIset\fP, Mutt will jump to the next unread message, if any,
   ** when the current thread is \fIun\fPcollapsed.
   */
+  { "uncollapse_new",  DT_BOOL, R_NONE, OPTUNCOLLAPSENEW, 1 },
+  /*
+  ** .pp
+  ** When \fIset\fP, Mutt will automatically uncollapse any collapsed thread
+  ** that receives a new message. When \fIunset\fP, collapsed threads will
+  ** remain collapsed. the presence of the new message will still affect
+  ** index sorting, though.
+  */
   { "use_8bitmime",    DT_BOOL, R_NONE, OPTUSE8BITMIME, 0 },
   /*
   ** .pp
diff --git a/mutt.h b/mutt.h
index bb8d09f3a7a1e2520a834d902a2c57bfad28cce7..1d693e0c79a5b4ee4450c04f8a722960d83a5b99 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -514,6 +514,7 @@ enum
   OPTTILDE,
   OPTTSENABLED,
   OPTUNCOLLAPSEJUMP,
+  OPTUNCOLLAPSENEW,
   OPTUSE8BITMIME,
   OPTUSEDOMAIN,
   OPTUSEFROM,