From: Thomas Roessler Date: Wed, 22 Mar 2000 08:24:44 +0000 (+0000) Subject: Sorting fix from Gero Treuner. X-Git-Tag: mutt-1-1-10-rel~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=94fbe062408e1ae5df2f3ae0a169f8310376a94e;p=mutt Sorting fix from Gero Treuner. --- diff --git a/init.h b/init.h index acb3697e..d1880c43 100644 --- a/init.h +++ b/init.h @@ -1836,7 +1836,9 @@ struct option_t MuttVars[] = { ** the rest of sort_aux as an ordering. For instance, set sort_aux=last- ** date-received would mean that if a new message is received in a ** thread, that thread becomes the last one displayed (or the first, if - ** you have set sort=reverse-threads.) + ** you have set sort=reverse-threads.) Note: For reversed ``$$sort'' + ** order $$sort_aux is reversed again (which is not the right thing to do, + ** but kept to not break any existing configuration setting). */ { "sort_browser", DT_SORT|DT_SORT_BROWSER, R_NONE, UL &BrowserSort, SORT_SUBJECT }, /* diff --git a/mutt.h b/mutt.h index 48212dab..1edab755 100644 --- a/mutt.h +++ b/mutt.h @@ -665,7 +665,6 @@ typedef struct unsigned int dontwrite : 1; /* dont write the mailbox on close */ unsigned int append : 1; /* mailbox is opened in append mode */ unsigned int quiet : 1; /* inhibit status messages? */ - unsigned int revsort : 1; /* mailbox sorted in reverse? */ unsigned int collapsed : 1; /* are all threads collapsed? */ unsigned int closing : 1; /* mailbox is being closed */ } CONTEXT; diff --git a/sort.c b/sort.c index 16141df4..7fd4633d 100644 --- a/sort.c +++ b/sort.c @@ -218,7 +218,10 @@ void mutt_sort_headers (CONTEXT *ctx, int init) subthreads need to be resorted */ if (option (OPTSORTSUBTHREADS)) { + i = Sort; + Sort = SortAux; ctx->tree = mutt_sort_subthreads (ctx->tree, mutt_get_sort_func (SortAux)); + Sort = i; unset_option (OPTSORTSUBTHREADS); } mutt_sort_threads (ctx, init); @@ -233,11 +236,6 @@ void mutt_sort_headers (CONTEXT *ctx, int init) else qsort ((void *) ctx->hdrs, ctx->msgcount, sizeof (HEADER *), sortfunc); - /* the threading function find_reference() needs to know how the mailbox - * is currently sorted in memory in order to speed things up a bit - */ - ctx->revsort = (Sort & SORT_REVERSE) ? 1 : 0; - /* adjust the virtual message numbers */ ctx->vcount = 0; for (i = 0; i < ctx->msgcount; i++)