]> granicus.if.org Git - mutt/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)
committerDavid Champion <dgc@bikeshed.us>
Tue, 13 Dec 2016 20:19:05 +0000 (12:19 -0800)
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 7e45ba68e307a1a25b34af06fd0ae4ed91cf30aa..c1d4ae76038b2f55b77f6bdb8158c96fdaa4a59f 100644 (file)
@@ -390,7 +390,7 @@ static 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));
@@ -402,7 +402,7 @@ static 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 6bec1e9ebf9f08f4086fb4e68ef9cd661207fda3..4578974f86704c380e0e9a45e78eb848d97da4a2 100644 (file)
--- a/init.h
+++ b/init.h
@@ -3639,6 +3639,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 6339613d6a46cbea4ac46438e88ce08ac6f5ac1a..354b15bfd0808d1a0515271454de8fe2dc9f4254 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -462,6 +462,7 @@ enum
   OPTTILDE,
   OPTTSENABLED,
   OPTUNCOLLAPSEJUMP,
+  OPTUNCOLLAPSENEW,
   OPTUSE8BITMIME,
   OPTUSEDOMAIN,
   OPTUSEFROM,