Only in mutt-1.3.24.working: flea diff -durp -xdoc -xpo -xMuttrc* mutt-1.3.24/hdrline.c mutt-1.3.24.working/hdrline.c --- mutt-1.3.24/hdrline.c Mon Nov 19 05:37:38 2001 +++ mutt-1.3.24.working/hdrline.c Fri Dec 14 11:43:37 2001 @@ -527,7 +527,7 @@ hdr_format_str (char *dest, case 's': - if (flags & M_FORMAT_TREE) + if (flags & M_FORMAT_TREE && !hdr->collapsed) { if (flags & M_FORMAT_FORCESUBJ) { Only in mutt-1.3.24.working/imap: Makefile diff -durp -xdoc -xpo -xMuttrc* mutt-1.3.24/menu.c mutt-1.3.24.working/menu.c --- mutt-1.3.24/menu.c Tue Nov 6 15:38:16 2001 +++ mutt-1.3.24.working/menu.c Wed Dec 12 20:01:40 2001 @@ -88,6 +88,22 @@ static void print_enriched_string (int a else addch (ACS_VLINE); break; + case M_TREE_TTEE: + if (option (OPTASCIICHARS)) + addch ('-'); + else if (Charset_is_utf8) + addstr ("\342\224\200"); /* FIXME: this is WACS_HLINE but should be WACS_TTEE */ + else + addch (ACS_TTEE); + break; + case M_TREE_BTEE: + if (option (OPTASCIICHARS)) + addch ('-'); + else if (Charset_is_utf8) + addstr ("\342\224\200"); /* FIXME: this is WACS_HLINE but should be WACS_BTEE */ + else + addch (ACS_BTEE); + break; case M_TREE_SPACE: addch (' '); break; @@ -100,11 +116,11 @@ static void print_enriched_string (int a case M_TREE_HIDDEN: addch ('&'); break; - case M_TREE_MISSING: - addch ('?'); - break; case M_TREE_EQUALS: addch ('='); + break; + case M_TREE_MISSING: + addch ('?'); break; } s++, n--; diff -durp -xdoc -xpo -xMuttrc* mutt-1.3.24/mutt.h mutt-1.3.24.working/mutt.h --- mutt-1.3.24/mutt.h Thu Nov 8 12:35:13 2001 +++ mutt-1.3.24.working/mutt.h Wed Dec 12 20:01:40 2001 @@ -154,9 +154,11 @@ typedef enum #define M_TREE_RARROW 7 #define M_TREE_STAR 8 #define M_TREE_HIDDEN 9 -#define M_TREE_MISSING 10 -#define M_TREE_EQUALS 11 -#define M_TREE_MAX 12 +#define M_TREE_EQUALS 10 +#define M_TREE_TTEE 11 +#define M_TREE_BTEE 12 +#define M_TREE_MISSING 13 +#define M_TREE_MAX 14 #define M_THREAD_COLLAPSE (1<<0) #define M_THREAD_UNCOLLAPSE (1<<1) Only in mutt-1.3.24: mutt_dotlock.c diff -durp -xdoc -xpo -xMuttrc* mutt-1.3.24/sort.c mutt-1.3.24.working/sort.c --- mutt-1.3.24/sort.c Mon Nov 12 04:53:54 2001 +++ mutt-1.3.24.working/sort.c Wed Dec 12 18:54:23 2001 @@ -181,6 +181,7 @@ void mutt_sort_headers (CONTEXT *ctx, in THREAD *thread, *top; sort_t *sortfunc; + init = 1; /* XXX temporary bug workaround (hopefully!) */ unset_option (OPTNEEDRESORT); if (!ctx) Only in mutt-1.3.24: stamp-doc-rc diff -durp -xdoc -xpo -xMuttrc* mutt-1.3.24/thread.c mutt-1.3.24.working/thread.c --- mutt-1.3.24/thread.c Mon Nov 19 05:37:38 2001 +++ mutt-1.3.24.working/thread.c Fri Dec 14 11:31:48 2001 @@ -114,7 +114,6 @@ static int is_next_displayed (CONTEXT *c return (0); } - /* Since the graphics characters have a value >255, I have to resort to * using escape sequences to pass the information to print_enriched_string(). * These are the macros M_TREE_* defined in mutt.h. @@ -126,15 +125,24 @@ static int is_next_displayed (CONTEXT *c void mutt_linearize_tree (CONTEXT *ctx, int linearize) { char *pfx = NULL, *mypfx = NULL, *arrow = NULL, *myarrow = NULL; - char corner = Sort & SORT_REVERSE ? M_TREE_ULCORNER : M_TREE_LLCORNER; + char corner = (Sort & SORT_REVERSE) ? M_TREE_ULCORNER : M_TREE_LLCORNER; + char vtee = (Sort & SORT_REVERSE) ? M_TREE_BTEE : M_TREE_TTEE; int depth = 0, start_depth = 0, max_depth = 0, max_width = 0; - int nextdisp = 0, visible; + int nextdisp = 0, visible, pseudo = 0, hidden = 0; THREAD *tree = ctx->tree; HEADER **array = ctx->hdrs + (Sort & SORT_REVERSE ? ctx->msgcount - 1 : 0); HEADER *hdr; - FOREVER + while (tree) { + if (depth >= max_depth) + safe_realloc ((void **) &pfx, + (max_depth += 32) * 2 * sizeof (char)); + + if (depth - start_depth >= max_width) + safe_realloc ((void **) &arrow, + (max_width += 16) * 2 * sizeof (char)); + hdr = tree->message; if (hdr) @@ -147,33 +155,28 @@ void mutt_linearize_tree (CONTEXT *ctx, else visible = 0; - if (depth >= max_depth) - safe_realloc ((void **) &pfx, - (max_depth += 32) * 2 * sizeof (char)); - - if (depth - start_depth >= max_width) - safe_realloc ((void **) &arrow, - (max_width += 16) * 2 * sizeof (char)); - if (depth) { myarrow = arrow + (depth - start_depth - (start_depth ? 0 : 1)) * 2; - nextdisp = is_next_displayed (ctx, tree); if (depth && start_depth == depth) myarrow[0] = nextdisp ? M_TREE_LTEE : corner; + else if (hidden) + myarrow[0] = M_TREE_HIDDEN; + else if (option (OPTHIDEMISSING)) + myarrow[0] = nextdisp ? vtee : M_TREE_HLINE; else - myarrow[0] = tree->parent->message ? M_TREE_HIDDEN : M_TREE_MISSING; - myarrow[1] = (tree->fake_thread ? M_TREE_STAR - : (tree->duplicate_thread ? M_TREE_EQUALS : M_TREE_HLINE)); + myarrow[0] = M_TREE_MISSING; + myarrow[1] = pseudo ? M_TREE_STAR + : (tree->duplicate_thread ? M_TREE_EQUALS : M_TREE_HLINE); + pseudo = 0; + hidden = 0; + if (visible) { myarrow[2] = M_TREE_RARROW; myarrow[3] = 0; - } - if (visible) - { hdr->tree = safe_malloc ((2 + depth * 2) * sizeof (char)); if (start_depth > 1) { @@ -192,43 +195,66 @@ void mutt_linearize_tree (CONTEXT *ctx, array += Sort & SORT_REVERSE ? -1 : 1; } - if (tree->child) + if (tree->child && depth) { - if (depth) - { - mypfx = pfx + (depth - 1) * 2; - mypfx[0] = nextdisp ? M_TREE_VLINE : M_TREE_SPACE; - mypfx[1] = M_TREE_SPACE; - } - if (depth || !option (OPTHIDEMISSING) - || tree->message || tree->child->next) - depth++; - if (visible) - start_depth = depth; - tree = tree->child; - hdr = tree->message; + mypfx = pfx + (depth - 1) * 2; + mypfx[0] = nextdisp ? M_TREE_VLINE : M_TREE_SPACE; + mypfx[1] = M_TREE_SPACE; } - else + + nextdisp = 0; + + do { - while (!tree->next && tree->parent) + if (tree->child) { - if (hdr && VISIBLE (hdr, ctx)) - start_depth = depth; - tree = tree->parent; + if (hdr || !option (OPTHIDEMISSING) || tree->child->next) + { + depth++; + if (visible) + start_depth = depth; + } + if (hdr) + hidden = 1; + + tree = tree->child; + if (tree->fake_thread) + pseudo = 1; + if (!nextdisp) + nextdisp = is_next_displayed (ctx, tree); hdr = tree->message; - if (depth) + } + else + { + while (!tree->next && tree->parent) { - if (start_depth == depth) - start_depth--; - depth--; + if (hdr && VISIBLE (hdr, ctx)) + start_depth = depth; + + tree = tree->parent; + hdr = tree->message; + + if (hdr || !option (OPTHIDEMISSING) || tree->child->next) + { + if (start_depth == depth) + start_depth--; + depth--; + } } + + if (hdr && VISIBLE (hdr, ctx)) + start_depth = depth; + tree = tree->next; + if (!tree) + break; + if (!nextdisp) + nextdisp = is_next_displayed (ctx, tree); + if (tree->fake_thread) + pseudo = 1; + hdr = tree->message; } - if (hdr && VISIBLE (hdr, ctx)) - start_depth = depth; - tree = tree->next; - if (!tree) - break; } + while (!(hdr || !option (OPTHIDEMISSING) || tree->child->next)); } safe_free ((void **) &pfx); @@ -857,7 +883,7 @@ void mutt_sort_threads (CONTEXT *ctx, in mutt_linearize_tree (ctx, 1); } -static HEADER *find_virtual (THREAD *cur) +static HEADER *find_virtual (THREAD *cur, int reverse) { THREAD *top; @@ -868,24 +894,32 @@ static HEADER *find_virtual (THREAD *cur if ((cur = cur->child) == NULL) return (NULL); + while (reverse && cur->next) + cur = cur->next; + FOREVER { if (cur->message && cur->message->virtual >= 0) return (cur->message); if (cur->child) + { cur = cur->child; - else if (cur->next) - cur = cur->next; + + while (reverse && cur->next) + cur = cur->next; + } + else if (reverse ? cur->prev : cur->next) + cur = reverse ? cur->prev : cur->next; else { - while (!cur->next) + while (!(reverse ? cur->prev : cur->next)) { cur = cur->parent; if (cur == top) return (NULL); } - cur = cur->next; + cur = reverse ? cur->prev : cur->next; } /* not reached */ } @@ -930,7 +964,7 @@ int _mutt_aside_thread (HEADER *hdr, sho cur = cur->next; if (!cur) return (-1); - tmp = find_virtual (cur); + tmp = find_virtual (cur, 0); } while (!tmp); } else @@ -940,7 +974,7 @@ int _mutt_aside_thread (HEADER *hdr, sho cur = cur->prev; if (!cur) return (-1); - tmp = find_virtual (cur); + tmp = find_virtual (cur, 1); } while (!tmp); } @@ -1050,7 +1084,7 @@ int _mutt_traverse_thread (CONTEXT *ctx, } } - if ((thread = thread->child) == NULL) + if (thread == top && (thread = thread->child) == NULL) { /* return value depends on action requested */ if (flag & (M_THREAD_COLLAPSE | M_THREAD_UNCOLLAPSE)) Only in mutt-1.3.24.working: thread.c.orig