NeoMutt  2020-11-20
Teaching an old dog new tricks
Go to the documentation of this file.
26 #include <stdbool.h>
27 #include <stdint.h>
29 struct Email;
30 struct EmailList;
31 struct Mailbox;
32 struct MuttThread;
33 struct ThreadsContext;
35 /* These Config Variables are only used in mutt_thread.c */
36 extern bool C_CollapseFlagged;
37 extern bool C_CollapseUnread;
38 extern bool C_DuplicateThreads;
39 extern bool C_HideLimited;
40 extern bool C_HideMissing;
41 extern bool C_HideThreadSubject;
42 extern bool C_HideTopLimited;
43 extern bool C_HideTopMissing;
44 extern bool C_NarrowTree;
45 extern bool C_SortRe;
46 extern bool C_StrictThreads;
47 extern bool C_ThreadReceived;
55 {
72 };
74 typedef uint8_t MuttThreadFlags;
76 #define MUTT_THREAD_COLLAPSE (1 << 0)
77 #define MUTT_THREAD_UNCOLLAPSE (1 << 1)
78 #define MUTT_THREAD_UNREAD (1 << 2)
79 #define MUTT_THREAD_NEXT_UNREAD (1 << 3)
80 #define MUTT_THREAD_FLAGGED (1 << 4)
82 int mutt_traverse_thread(struct Email *e, MuttThreadFlags flag);
83 #define mutt_collapse_thread(e) mutt_traverse_thread(e, MUTT_THREAD_COLLAPSE)
84 #define mutt_uncollapse_thread(e) mutt_traverse_thread(e, MUTT_THREAD_UNCOLLAPSE)
85 #define mutt_thread_contains_unread(e) mutt_traverse_thread(e, MUTT_THREAD_UNREAD)
86 #define mutt_thread_contains_flagged(e) mutt_traverse_thread(e, MUTT_THREAD_FLAGGED)
87 #define mutt_thread_next_unread(e) mutt_traverse_thread(e, MUTT_THREAD_NEXT_UNREAD)
89 int mutt_aside_thread(struct Email *e, bool forwards, bool subthreads);
90 #define mutt_next_thread(e) mutt_aside_thread(e, true, false)
91 #define mutt_previous_thread(e) mutt_aside_thread(e, false, false)
92 #define mutt_next_subthread(e) mutt_aside_thread(e, true, true)
93 #define mutt_previous_subthread(e) mutt_aside_thread(e, false, true)
95 struct ThreadsContext *mutt_thread_ctx_init (struct Mailbox *m);
96 void mutt_thread_ctx_free (struct ThreadsContext **tctx);
98 void mutt_thread_collapse (struct ThreadsContext *tctx, bool collapse);
99 bool mutt_thread_can_collapse (struct Email *e);
101 void mutt_clear_threads (struct ThreadsContext *tctx);
102 void mutt_draw_tree (struct ThreadsContext *tctx);
103 bool mutt_link_threads (struct Email *parent, struct EmailList *children, struct Mailbox *m);
104 struct HashTable * mutt_make_id_hash (struct Mailbox *m);
105 int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, int flag);
106 int mutt_parent_message (struct Email *e, bool find_root);
107 off_t mutt_set_vnum (struct Mailbox *m);
108 void mutt_sort_subthreads (struct ThreadsContext *tctx, bool init);
109 void mutt_sort_threads (struct ThreadsContext *tctx, bool init);
112 #endif /* MUTT_MUTT_THREAD_H */
Star character (for threads)
Definition: mutt_thread.h:63
bool C_DuplicateThreads
Config: Highlight messages with duplicated message IDs.
Definition: mutt_thread.c:47
Ampersand character (for threads)
Definition: mutt_thread.h:64
int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, int flag)
Count the messages in a thread.
Definition: mutt_thread.c:1479
The envelope/body of an email.
Definition: email.h:37
A Hash Table.
Definition: hash.h:84
bool C_SortRe
Config: Sort method for the sidebar.
Definition: mutt_thread.c:54
int mutt_aside_thread(struct Email *e, bool forwards, bool subthreads)
Find the next/previous (sub)thread.
Definition: mutt_thread.c:1119
bool mutt_thread_can_collapse(struct Email *e)
Check whether a thread can be collapsed.
Definition: mutt_thread.c:1635
The "current" threading state.
Definition: mutt_thread.c:61
bool C_HideTopMissing
Config: Don&#39;t indicate missing top message, in the thread tree.
Definition: mutt_thread.c:52
bool C_StrictThreads
Config: Thread messages using &#39;In-Reply-To&#39; and &#39;References&#39; headers.
Definition: mutt_thread.c:55
bool C_NarrowTree
Config: Draw a narrower thread tree in the index.
Definition: mutt_thread.c:53
off_t mutt_set_vnum(struct Mailbox *m)
Set the virtual index number of all the messages in a mailbox.
Definition: mutt_thread.c:1232
Lower left corner.
Definition: mutt_thread.h:56
int mutt_parent_message(struct Email *e, bool find_root)
Find the parent of a message.
Definition: mutt_thread.c:1182
struct HashTable * mutt_make_id_hash(struct Mailbox *m)
Create a Hash Table for message-ids.
Definition: mutt_thread.c:1521
Top T-piece.
Definition: mutt_thread.h:66
bool C_HideThreadSubject
Config: Hide subjects that are similar to that of the parent message.
Definition: mutt_thread.c:50
Tree characters for menus.
Definition: mutt_thread.h:54
void mutt_draw_tree(struct ThreadsContext *tctx)
Draw a tree of threaded emails.
Definition: mutt_thread.c:320
Vertical line.
Definition: mutt_thread.h:60
uint8_t MuttThreadFlags
Definition: mutt_thread.h:74
bool C_ThreadReceived
Config: Sort threaded messages by their received date.
Definition: mutt_thread.c:56
A mailbox.
Definition: mailbox.h:81
Right arrow.
Definition: mutt_thread.h:62
void mutt_thread_collapse_collapsed(struct ThreadsContext *tctx)
re-collapse threads marked as collapsed
Definition: mutt_thread.c:1586
bool mutt_link_threads(struct Email *parent, struct EmailList *children, struct Mailbox *m)
Forcibly link threads together.
Definition: mutt_thread.c:1566
void mutt_sort_subthreads(struct ThreadsContext *tctx, bool init)
Sort the children of a thread.
Definition: mutt_thread.c:687
Bottom T-piece.
Definition: mutt_thread.h:67
bool C_CollapseFlagged
Config: Prevent the collapse of threads with flagged emails.
Definition: mutt_thread.c:45
Left T-piece.
Definition: mutt_thread.h:58
void mutt_thread_ctx_free(struct ThreadsContext **tctx)
Finalize a threading context.
Definition: mutt_thread.c:301
void mutt_thread_collapse(struct ThreadsContext *tctx, bool collapse)
toggle collapse
Definition: mutt_thread.c:1607
bool C_HideTopLimited
Config: Don&#39;t indicate hidden top message, in the thread tree.
Definition: mutt_thread.c:51
Upper left corner.
Definition: mutt_thread.h:57
bool C_HideMissing
Config: Don&#39;t indicate missing messages, in the thread tree.
Definition: mutt_thread.c:49
An Email conversation.
Definition: thread.h:34
Horizontal line.
Definition: mutt_thread.h:59
bool C_CollapseUnread
Config: Prevent the collapse of threads with unread emails.
Definition: mutt_thread.c:46
Colour indicator.
Definition: mutt_thread.h:71
void mutt_sort_threads(struct ThreadsContext *tctx, bool init)
Sort email threads.
Definition: mutt_thread.c:870
void mutt_clear_threads(struct ThreadsContext *tctx)
Clear the threading of message in a mailbox.
Definition: mutt_thread.c:637
int mutt_traverse_thread(struct Email *e, MuttThreadFlags flag)
Recurse through an email thread, matching messages.
Definition: mutt_thread.c:1266
Blank space.
Definition: mutt_thread.h:61
Question mark.
Definition: mutt_thread.h:68
bool C_HideLimited
Config: Don&#39;t indicate hidden messages, in the thread tree.
Definition: mutt_thread.c:48
struct ThreadsContext * mutt_thread_ctx_init(struct Mailbox *m)
Initialize a threading context.
Definition: mutt_thread.c:288
Equals (for threads)
Definition: mutt_thread.h:65