97 static bool warned =
false;
100 mutt_warning(
_(
"Changing threaded display should prefer $use_threads over $sort"));
115 const unsigned char c_use_threads =
cs_subset_enum(sub,
"use_threads");
129 if ((c_use_threads ==
UT_FLAT) ||
163 const unsigned char c_use_threads =
cs_subset_enum(sub,
"use_threads");
269 const int cid = ev_c->
cid;
318 const int R_RESORT = (1 << 0);
319 const int R_RESORT_INIT = (1 << 1);
320 const int R_RESORT_SUB = (1 << 2);
322 static const struct Mapping sort_options[] = {
324 {
"duplicate_threads", R_RESORT | R_RESORT_INIT },
325 {
"reply_regex", R_RESORT },
326 {
"sort", R_RESORT },
327 {
"sort_aux", R_RESORT | R_RESORT_SUB },
328 {
"sort_re", R_RESORT | R_RESORT_INIT },
329 {
"strict_threads", R_RESORT | R_RESORT_INIT },
330 {
"thread_received", R_RESORT | R_RESORT_INIT },
331 {
"use_threads", R_RESORT },
340 if (flags & R_RESORT)
342 if (flags & R_RESORT_INIT)
344 if (flags & R_RESORT_SUB)
357 static const char *index_options[] = {
358 "ascii_chars",
"crypt_chars",
359 "flag_chars",
"from_chars",
360 "group_index_format",
"hide_limited",
361 "hide_missing",
"hide_thread_subject",
362 "hide_top_limited",
"hide_top_missing",
363 "imap_headers",
"index_format",
365 "narrow_tree",
"postponed",
366 "real_name",
"reverse_alias",
367 "reverse_name",
"reverse_real_name",
368 "status_chars",
"status_format",
369 "to_chars",
"ts_enabled",
370 "ts_icon_format",
"ts_status_format"
393 if (!ev_c->
name || !ev_c->
he)
611 if ((index - indicator) < 0)
613 else if ((menu->
max - index) < (menu->
page_len - indicator))
616 menu->
top = index - indicator;
void mutt_alternates_reset(struct MailboxView *mv)
Clear the recipient valid flag of all emails.
Alternate address handling.
GUI display the mailboxes in a side panel.
void mutt_attachments_reset(struct MailboxView *mv)
Reset the attachment count for all Emails.
Color and attribute parsing.
void mutt_color_observer_remove(observer_t callback, void *global_data)
Remove an observer.
void mutt_color_observer_add(observer_t callback, void *global_data)
Add an observer.
@ MT_COLOR_INDEX_AUTHOR
Index: author field.
@ MT_COLOR_INDEX_SIZE
Index: size field.
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
@ MT_COLOR_INDEX_DATE
Index: date field.
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
@ MT_COLOR_TREE
Index: tree-drawing characters.
@ MT_COLOR_NORMAL
Plain text.
@ MT_COLOR_INDEX_LABEL
Index: label field.
@ MT_COLOR_INDEX
Index: default colour.
@ MT_COLOR_INDEX_NUMBER
Index: index number.
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
unsigned char cs_subset_enum(const struct ConfigSubset *sub, const char *name)
Get a enumeration config item by name.
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Convenience wrapper for the config headers.
#define CSR_SUCCESS
Action completed successfully.
Convenience wrapper for the core headers.
struct MuttWindow * AllDialogsWindow
Parent of all Dialogs.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
void menu_redraw_current(struct Menu *menu)
Redraw the current menu.
void menu_redraw_index(struct Menu *menu)
Force the redraw of the index.
void menu_redraw_full(struct Menu *menu)
Force the redraw of the Menu.
void menu_redraw_motion(struct Menu *menu)
Force the redraw of the list part of the menu.
Structs that make up an email.
void mutt_env_set_subject(struct Envelope *env, const char *subj)
Set both subject and real_subj to subj.
bool OptResortInit
(pseudo) used to force the next resort to be from scratch
bool OptSortSubthreads
(pseudo) used when $sort_aux changes
bool OptNeedResort
(pseudo) used to force a re-sort
#define mutt_warning(...)
#define mutt_debug(LEVEL,...)
static int index_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
static int index_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
static int index_index_observer(struct NotifyCallback *nc)
Notification that the Index has changed - Implements observer_t -.
static int index_menu_observer(struct NotifyCallback *nc)
Notification that the Menu has changed - Implements observer_t -.
static int index_score_observer(struct NotifyCallback *nc)
Notification that a 'score' command has occurred - Implements observer_t -.
static int index_global_observer(struct NotifyCallback *nc)
Notification that a Global event occurred - Implements observer_t -.
static int index_altern_observer(struct NotifyCallback *nc)
Notification that an 'alternates' command has occurred - Implements observer_t -.
static int index_subjrx_observer(struct NotifyCallback *nc)
Notification that a 'subjectrx' command has occurred - Implements observer_t -.
static int index_attach_observer(struct NotifyCallback *nc)
Notification that an 'attachments' command has occurred - Implements observer_t -.
static int index_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
static int index_recalc(struct MuttWindow *win)
Recalculate the Index display - Implements MuttWindow::recalc() -.
static int index_repaint(struct MuttWindow *win)
Repaint the Index display - Implements MuttWindow::repaint() -.
Convenience wrapper for the gui headers.
void index_shared_data_set_email(struct IndexSharedData *shared, struct Email *e)
Set the current Email for the Index and friends.
Data shared between Index, Pager and Sidebar.
static int config_sort(const struct ConfigSubset *sub)
React to changes to "sort".
void index_adjust_sort_threads(const struct ConfigSubset *sub)
Adjust use_threads/sort/sort_aux.
static int config_reply_regex(struct MailboxView *mv)
React to changes to $reply_regex.
bool config_check_index(const char *option)
Does this config option affect the Index?
struct MailboxView * get_current_mailbox_view(void)
Get the current Mailbox view.
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
struct Menu * get_current_menu(void)
Get the current Menu.
static void sort_use_threads_warn(void)
Alert the user to odd $sort settings.
static bool config_check_sort(const char *option)
Does this config option affect the Index sorting?
struct MuttWindow * index_window_new(struct IndexPrivateData *priv)
Create a new Index Window (list of Emails)
static int config_use_threads(const struct ConfigSubset *sub)
React to changes to "use_threads".
@ LL_DEBUG5
Log at debug level 5.
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
#define mutt_array_size(x)
Convenience wrapper for the library headers.
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Create/manipulate threading in emails.
@ UT_UNSET
Not yet set by user, stick to legacy semantics.
@ UT_THREADS
Normal threading (root above subthreads)
@ UT_REVERSE
Reverse threading (subthreads above root)
bool window_is_focused(const struct MuttWindow *win)
Does the given Window have the focus?
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
#define WA_RECALC
Recalculate the contents of the Window.
@ WT_DLG_INDEX
Index Dialog, dlg_index()
@ WT_DLG_POSTPONED
Postponed Dialog, dlg_postponed()
@ WT_INDEX
A panel containing the Index Window.
@ NT_WINDOW_DELETE
Window is about to be deleted.
@ NT_WINDOW_FOCUS
Window focus has changed.
#define WA_REPAINT
Redraw the contents of the Window.
void mutt_sleep(short s)
Sleep for a while.
Some miscellaneous functions.
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
@ NT_GLOBAL_COMMAND
A NeoMutt command.
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
@ NT_MENU
Menu has changed, MenuRedrawFlags.
@ NT_ATTACH
Attachment command changed, NotifyAttach.
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
@ NT_SCORE
Email scoring has changed.
@ NT_ALL
Register for all notifications.
@ NT_GLOBAL
Not object-related, NotifyGlobal.
@ NT_ALTERN
Alternates command changed, NotifyAlternates.
@ NT_SUBJRX
Subject Regex has changed, NotifySubjRx.
struct MailboxView * postponed_get_mailbox_view(struct MuttWindow *dlg)
Extract the Mailbox from the Postponed Dialog.
#define TAILQ_FOREACH_REVERSE(var, head, headname, field)
void mutt_check_rescore(struct Mailbox *m)
Do the emails need to have their scores recalculated?
void mutt_score_message(struct Mailbox *m, struct Email *e, bool upd_mbox)
Apply scoring to an email.
Routines for adding user scores to emails.
#define SORT_MASK
Mask for the sort id.
SortType
Methods for sorting.
@ SORT_THREADS
Sort by email threads.
#define SORT_REVERSE
Reverse the order of the sort.
A set of inherited config items.
struct Notify * notify
Notifications: NotifyConfig, EventConfig.
The envelope/body of an email.
struct Envelope * env
Envelope information.
const struct AttrColor * attr_color
Color-pair to use when displaying in the index.
int index
The absolute (unsorted) message number.
char *const subject
Email's subject.
An Event that happened to a Colour.
enum ColorId cid
Colour ID that has changed.
const struct ConfigSubset * sub
Config Subset.
const char * name
Name of config item that changed.
struct HashElem * he
Config item that changed.
An Event that happened to a Window.
struct MuttWindow * win
Window that changed.
Private state data for the Index.
struct IndexSharedData * shared
Shared Index data.
struct Menu * menu
Menu controlling the index.
Data shared between Index, Pager and Sidebar.
struct Mailbox * mailbox
Current Mailbox.
struct MailboxView * mailbox_view
Current Mailbox view.
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
struct Mailbox * mailbox
Current Mailbox.
int vcount
The number of virtual messages.
int msg_count
Total number of messages.
struct Email ** emails
Array of Emails.
Mapping between user-readable string and a constant.
int(* repaint)(struct MuttWindow *win)
void * wdata
Private data.
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
int(* recalc)(struct MuttWindow *win)
struct MuttWindowList children
Children Windows.
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
Container for Accounts, Notifications.
struct Notify * notify
Notifications handler.
struct ConfigSubset * sub
Inherited config items.
Data passed to a notification function.
void * event_data
Data from notify_send()
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
void * global_data
Data from notify_observer_add()
void subjrx_clear_mods(struct MailboxView *mv)
Clear out all modified email subjects.
int cs_subset_str_native_set(const struct ConfigSubset *sub, const char *name, intptr_t value, struct Buffer *err)
Natively set the value of a string config item.
@ MENU_INDEX
Index panel (list of emails)