summaryrefslogtreecommitdiffstats
path: root/mutt.h
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-08-03 11:08:22 -0700
committerKevin McCarthy <kevin@8t8.us>2021-08-08 13:02:29 -0700
commit5aa75ed2b8eac107d7acf5c58cd66bd0def213ae (patch)
tree6b2d72701a39e416ba2c7ae63ffa8365c32510c9 /mutt.h
parentb879daa74513d44aa1786985796526914eedb48a (diff)
Add $sort_thread_groups for top-level thread sorting.
closes #368. Rename THREAD->sort_key to sort_aux_key, to make the fields more distinct. Add THREAD->sort_group_key for caching the top-level sort HEADER. An additional value is needed to allow propagating up values, for place-holder threads, and for "last" sort handling. Add recalc_aux_key and recalc_group_key bits to THREAD, in addition to sort_children. These are used to allow separate flagging of either the group key or aux key needing to be recalculated. Adding these two fields helped me keep better track of how the subthread sorting was working, because I'm just not as smart the people who originally wrote the threading code. :-) Fix up some of the logic with rescoring, and "first_message" to take the new config vars into account. Add %T expando to $status_format, and change the default to conditionally show the value based on whether $sort is "threads" and $sort_thread_groups is not "aux". Lastly, a thank you to Eric Blake. He implemented separate thread/subthread sorting in the NeoMutt code, after suggesting it on the #mutt IRC channel a couple months ago. When ticket 368 was opened he pointed me at his work and offered to port. However, I couldn't pass up the opportunity to learn more about the thread code myself, so I declined his offer. Although no copy/pasting was done, the basic of structure of the mutt_sort_subthreads() changes is the same, and I did look at his modifications to the function for guidance. Thank you Eric!
Diffstat (limited to 'mutt.h')
-rw-r--r--mutt.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/mutt.h b/mutt.h
index 88b71da5..1e7016cc 100644
--- a/mutt.h
+++ b/mutt.h
@@ -952,6 +952,8 @@ struct mutt_thread
unsigned int fake_thread : 1;
unsigned int duplicate_thread : 1;
unsigned int sort_children : 1;
+ unsigned int recalc_aux_key : 1;
+ unsigned int recalc_group_key : 1;
unsigned int check_subject : 1;
unsigned int visible : 1;
unsigned int deep : 1;
@@ -962,7 +964,8 @@ struct mutt_thread
THREAD *next;
THREAD *prev;
HEADER *message;
- HEADER *sort_key;
+ HEADER *sort_group_key; /* $sort_thread_groups - for thread roots */
+ HEADER *sort_aux_key; /* $sort_aux - for messages below the root */
};