Create/manipulate threading in emails. More...
Go to the source code of this file.
Data Structures | |
struct | ThreadsContext |
The "current" threading state. More... | |
Typedefs | |
typedef uint8_t | MuttThreadFlags |
Flags, e.g. MUTT_THREAD_COLLAPSE. | |
Enumerations | |
enum | TreeChar { MUTT_TREE_LLCORNER = 1 , MUTT_TREE_ULCORNER , MUTT_TREE_LTEE , MUTT_TREE_HLINE , MUTT_TREE_VLINE , MUTT_TREE_SPACE , MUTT_TREE_RARROW , MUTT_TREE_STAR , MUTT_TREE_HIDDEN , MUTT_TREE_EQUALS , MUTT_TREE_TTEE , MUTT_TREE_BTEE , MUTT_TREE_MISSING , MUTT_TREE_MAX , MUTT_SPECIAL_INDEX = MUTT_TREE_MAX } |
Tree characters for menus. More... | |
enum | MessageInThread { MIT_NUM_MESSAGES , MIT_POSITION } |
Flags for mutt_messages_in_thread() More... | |
enum | UseThreads { UT_UNSET , UT_FLAT , UT_THREADS , UT_REVERSE } |
Which threading style is active, $use_threads. More... | |
Functions | |
int | mutt_traverse_thread (struct Email *e, MuttThreadFlags flag) |
Recurse through an email thread, matching messages. | |
enum UseThreads | mutt_thread_style (void) |
Which threading style is active? | |
const char * | get_use_threads_str (enum UseThreads value) |
Convert UseThreads enum to string. | |
int | sort_validator (const struct ConfigSet *cs, const struct ConfigDef *cdef, intptr_t value, struct Buffer *err) |
Validate the "sort" config variable - Implements ConfigDef::validator() -. | |
int | mutt_aside_thread (struct Email *e, bool forwards, bool subthreads) |
Find the next/previous (sub)thread. | |
struct ThreadsContext * | mutt_thread_ctx_init (struct MailboxView *mv) |
Initialize a threading context. | |
void | mutt_thread_ctx_free (struct ThreadsContext **ptr) |
Finalize a threading context. | |
void | mutt_thread_collapse_collapsed (struct ThreadsContext *tctx) |
Re-collapse threads marked as collapsed. | |
void | mutt_thread_collapse (struct ThreadsContext *tctx, bool collapse) |
Toggle collapse. | |
bool | mutt_thread_can_collapse (struct Email *e) |
Check whether a thread can be collapsed. | |
void | mutt_clear_threads (struct ThreadsContext *tctx) |
Clear the threading of message in a mailbox. | |
void | mutt_draw_tree (struct ThreadsContext *tctx) |
Draw a tree of threaded emails. | |
bool | mutt_link_threads (struct Email *parent, struct EmailArray *children, struct Mailbox *m) |
Forcibly link threads together. | |
struct HashTable * | mutt_make_id_hash (struct Mailbox *m) |
Create a Hash Table for message-ids. | |
int | mutt_messages_in_thread (struct Mailbox *m, struct Email *e, enum MessageInThread mit) |
Count the messages in a thread. | |
int | mutt_parent_message (struct Email *e, bool find_root) |
Find the parent of a message. | |
off_t | mutt_set_vnum (struct Mailbox *m) |
Set the virtual index number of all the messages in a mailbox. | |
void | mutt_sort_threads (struct ThreadsContext *tctx, bool init) |
Sort email threads. | |
Variables | |
const struct EnumDef | UseThreadsTypeDef |
Data for the $use_threads enumeration. | |
Create/manipulate threading in emails.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file mutt_thread.h.
#define MUTT_THREAD_NO_FLAGS 0 |
No flags are set.
Definition at line 77 of file mutt_thread.h.
#define MUTT_THREAD_COLLAPSE (1 << 0) |
Collapse an email thread.
Definition at line 78 of file mutt_thread.h.
#define MUTT_THREAD_UNCOLLAPSE (1 << 1) |
Uncollapse an email thread.
Definition at line 79 of file mutt_thread.h.
#define MUTT_THREAD_UNREAD (1 << 2) |
Count unread emails in a thread.
Definition at line 80 of file mutt_thread.h.
#define MUTT_THREAD_NEXT_UNREAD (1 << 3) |
Find the next unread email.
Definition at line 81 of file mutt_thread.h.
#define MUTT_THREAD_FLAGGED (1 << 4) |
Count flagged emails in a thread.
Definition at line 82 of file mutt_thread.h.
#define mutt_collapse_thread | ( | e | ) | mutt_traverse_thread(e, MUTT_THREAD_COLLAPSE) |
Definition at line 107 of file mutt_thread.h.
#define mutt_uncollapse_thread | ( | e | ) | mutt_traverse_thread(e, MUTT_THREAD_UNCOLLAPSE) |
Definition at line 108 of file mutt_thread.h.
#define mutt_thread_contains_unread | ( | e | ) | mutt_traverse_thread(e, MUTT_THREAD_UNREAD) |
Definition at line 109 of file mutt_thread.h.
#define mutt_thread_contains_flagged | ( | e | ) | mutt_traverse_thread(e, MUTT_THREAD_FLAGGED) |
Definition at line 110 of file mutt_thread.h.
#define mutt_thread_next_unread | ( | e | ) | mutt_traverse_thread(e, MUTT_THREAD_NEXT_UNREAD) |
Definition at line 111 of file mutt_thread.h.
#define mutt_using_threads | ( | ) | (mutt_thread_style() > UT_FLAT) |
Definition at line 114 of file mutt_thread.h.
#define mutt_next_thread | ( | e | ) | mutt_aside_thread(e, true, false) |
Definition at line 120 of file mutt_thread.h.
#define mutt_previous_thread | ( | e | ) | mutt_aside_thread(e, false, false) |
Definition at line 121 of file mutt_thread.h.
#define mutt_next_subthread | ( | e | ) | mutt_aside_thread(e, true, true) |
Definition at line 122 of file mutt_thread.h.
#define mutt_previous_subthread | ( | e | ) | mutt_aside_thread(e, false, true) |
Definition at line 123 of file mutt_thread.h.
typedef uint8_t MuttThreadFlags |
Flags, e.g. MUTT_THREAD_COLLAPSE.
Definition at line 76 of file mutt_thread.h.
enum TreeChar |
Tree characters for menus.
Definition at line 56 of file mutt_thread.h.
enum MessageInThread |
Flags for mutt_messages_in_thread()
Enumerator | |
---|---|
MIT_NUM_MESSAGES | How many messages are in the thread. |
MIT_POSITION | Our position in the thread. |
Definition at line 87 of file mutt_thread.h.
enum UseThreads |
Which threading style is active, $use_threads.
Enumerator | |
---|---|
UT_UNSET | Not yet set by user, stick to legacy semantics. |
UT_FLAT | Unthreaded. |
UT_THREADS | Normal threading (root above subthreads) |
UT_REVERSE | Reverse threading (subthreads above root) |
Definition at line 96 of file mutt_thread.h.
int mutt_traverse_thread | ( | struct Email * | e_cur, |
MuttThreadFlags | flag | ||
) |
Recurse through an email thread, matching messages.
e_cur | Current Email |
flag | Flag to set, see MuttThreadFlags |
num | Number of matches |
Definition at line 1438 of file mutt_thread.c.
enum UseThreads mutt_thread_style | ( | void | ) |
Which threading style is active?
UT_FLAT | No threading in use |
UT_THREADS | Normal threads (root above subthread) |
UT_REVERSE | Reverse threads (subthread above root) |
Definition at line 82 of file mutt_thread.c.
const char * get_use_threads_str | ( | enum UseThreads | value | ) |
Convert UseThreads enum to string.
value | Value to convert |
ptr | String form of value |
Definition at line 100 of file mutt_thread.c.
int mutt_aside_thread | ( | struct Email * | e, |
bool | forwards, | ||
bool | subthreads | ||
) |
Find the next/previous (sub)thread.
e | Search from this Email |
forwards | Direction to search: 'true' forwards, 'false' backwards |
subthreads | Search subthreads: 'true' subthread, 'false' not |
num | Index into the virtual email table |
-1 | Error |
Definition at line 1287 of file mutt_thread.c.
struct ThreadsContext * mutt_thread_ctx_init | ( | struct MailboxView * | mv | ) |
Initialize a threading context.
mv | Mailbox view |
ptr | Threading context |
Definition at line 357 of file mutt_thread.c.
void mutt_thread_ctx_free | ( | struct ThreadsContext ** | ptr | ) |
Finalize a threading context.
ptr | Threading context to free |
Definition at line 368 of file mutt_thread.c.
void mutt_thread_collapse_collapsed | ( | struct ThreadsContext * | tctx | ) |
Re-collapse threads marked as collapsed.
tctx | Threading context |
Definition at line 1768 of file mutt_thread.c.
void mutt_thread_collapse | ( | struct ThreadsContext * | tctx, |
bool | collapse | ||
) |
Toggle collapse.
tctx | Threading context |
collapse | Collapse / uncollapse |
Definition at line 1789 of file mutt_thread.c.
bool mutt_thread_can_collapse | ( | struct Email * | e | ) |
Check whether a thread can be collapsed.
e | Head of the thread |
true | Can be collapsed |
false | Cannot be collapsed |
Definition at line 1817 of file mutt_thread.c.
void mutt_clear_threads | ( | struct ThreadsContext * | tctx | ) |
Clear the threading of message in a mailbox.
tctx | Threading context |
Definition at line 720 of file mutt_thread.c.
void mutt_draw_tree | ( | struct ThreadsContext * | tctx | ) |
Draw a tree of threaded emails.
tctx | Threading context |
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 MUTT_TREE_* defined in mutt.h.
ncurses should automatically use the default ASCII characters instead of graphics chars on terminals which don't support them (see the man page for curs_addch).
Definition at line 394 of file mutt_thread.c.
Forcibly link threads together.
true | On success |
Definition at line 1747 of file mutt_thread.c.
Create a Hash Table for message-ids.
m | Mailbox |
ptr | Newly allocated Hash Table |
Definition at line 1702 of file mutt_thread.c.
int mutt_messages_in_thread | ( | struct Mailbox * | m, |
struct Email * | e, | ||
enum MessageInThread | mit | ||
) |
Count the messages in a thread.
m | Mailbox |
e | |
mit | Flag, e.g. MIT_NUM_MESSAGES |
num | Number of message / Our position |
Definition at line 1657 of file mutt_thread.c.
int mutt_parent_message | ( | struct Email * | e, |
bool | find_root | ||
) |
Find the parent of a message.
e | Current Email |
find_root | If true, find the root message |
>=0 | Virtual index number of parent/root message |
-1 | Error |
Definition at line 1354 of file mutt_thread.c.
off_t mutt_set_vnum | ( | struct Mailbox * | m | ) |
Set the virtual index number of all the messages in a mailbox.
m | Mailbox |
num | Size in bytes of all messages shown |
Definition at line 1404 of file mutt_thread.c.
void mutt_sort_threads | ( | struct ThreadsContext * | tctx, |
bool | init | ||
) |
Sort email threads.
tctx | Threading context |
init | If true, rebuild the thread |
Definition at line 1031 of file mutt_thread.c.
|
extern |
Data for the $use_threads enumeration.
Definition at line 67 of file mutt_thread.c.