NeoMutt  2022-04-29-215-gc12b98
Teaching an old dog new tricks
DOXYGEN
index.c
Go to the documentation of this file.
1
68#include "config.h"
69#include <stddef.h>
70#include <stdbool.h>
71#include "mutt/lib.h"
72#include "config/lib.h"
73#include "email/lib.h"
74#include "core/lib.h"
75#include "gui/lib.h"
76#include "attach/lib.h"
77#include "color/lib.h"
78#include "menu/lib.h"
79#include "alternates.h"
80#include "mutt_thread.h"
81#include "muttlib.h"
82#include "mview.h"
83#include "options.h"
84#include "private_data.h"
85#include "score.h"
86#include "shared_data.h"
87#include "subjectrx.h"
88
92static void sort_use_threads_warn(void)
93{
94 static bool warned = false;
95 if (!warned)
96 {
97 mutt_warning(_("Changing threaded display should prefer $use_threads over $sort"));
98 warned = true;
99 mutt_sleep(0);
100 }
101}
102
109static int config_sort(const struct ConfigSubset *sub)
110{
111 const short c_sort = cs_subset_sort(sub, "sort");
112 const unsigned char c_use_threads = cs_subset_enum(sub, "use_threads");
113
114 if (((c_sort & SORT_MASK) != SORT_THREADS) || (c_use_threads == UT_UNSET))
115 return 0;
116
118
119 /* Note: changing a config variable here kicks off a second round of
120 * observers before the first round has completed. Be careful that
121 * changes made here do not cause an infinite loop of toggling
122 * adjustments - the early exit above when $sort no longer uses
123 * SORT_THREADS ends the recursion.
124 */
125 int rc;
126 if ((c_use_threads == UT_FLAT) ||
127 (!(c_sort & SORT_REVERSE) == (c_use_threads == UT_REVERSE)))
128 {
129 /* If we were flat or the user wants to change thread
130 * directions, then leave $sort alone for now and change
131 * $use_threads to match the desired outcome. The 2nd-level
132 * observer for $use_threads will then adjust $sort, and our
133 * 3rd-level observer for $sort will be a no-op.
134 */
135 rc = cs_subset_str_native_set(sub, "use_threads",
136 (c_sort & SORT_REVERSE) ? UT_REVERSE : UT_THREADS, NULL);
137 }
138 else
139 {
140 /* We were threaded, and the user still wants the same thread
141 * direction. Adjust $sort based on $sort_aux, and the 2nd-level
142 * observer for $sort will be a no-op.
143 */
144 short c_sort_aux = cs_subset_sort(sub, "sort_aux");
145 c_sort_aux ^= (c_sort & SORT_REVERSE);
146 rc = cs_subset_str_native_set(sub, "sort", c_sort_aux, NULL);
147 }
148 return (CSR_RESULT(rc) == CSR_SUCCESS) ? 0 : -1;
149}
150
157static int config_use_threads(const struct ConfigSubset *sub)
158{
159 const short c_sort = cs_subset_sort(sub, "sort");
160 const unsigned char c_use_threads = cs_subset_enum(sub, "use_threads");
161
162 if (((c_sort & SORT_MASK) != SORT_THREADS) || (c_use_threads == UT_UNSET))
163 return 0;
164
166
167 /* Note: changing a config variable here kicks off a second round of
168 * observers before the first round has completed. But since we
169 * aren't setting $sort to threads, the 2nd-level observer will be a
170 * no-op.
171 */
172 const short c_sort_aux = cs_subset_sort(sub, "sort_aux");
173 int rc = cs_subset_str_native_set(sub, "sort", c_sort_aux, NULL);
174 return (CSR_RESULT(rc) == CSR_SUCCESS) ? 0 : -1;
175}
176
182{
183 /* For lack of a better way, we fake a "set use_threads" */
185}
186
193static int config_reply_regex(struct Mailbox *m)
194{
195 if (!m)
196 return 0;
197
198 regmatch_t pmatch[1];
199
200 for (int i = 0; i < m->msg_count; i++)
201 {
202 struct Email *e = m->emails[i];
203 if (!e)
204 break;
205 struct Envelope *env = e->env;
206 if (!env || !env->subject)
207 continue;
208
209 const struct Regex *c_reply_regex = cs_subset_regex(NeoMutt->sub, "reply_regex");
210 if (mutt_regex_capture(c_reply_regex, env->subject, 1, pmatch))
211 {
212 env->real_subj = env->subject + pmatch[0].rm_eo;
213 if (env->real_subj[0] == '\0')
214 env->real_subj = NULL;
215 continue;
216 }
217
218 env->real_subj = env->subject;
219 }
220
221 OptResortInit = true; /* trigger a redraw of the index */
222 return 0;
223}
224
229{
230 if (nc->event_type != NT_ALTERN)
231 return 0;
232 if (!nc->global_data)
233 return -1;
234
235 struct MuttWindow *win = nc->global_data;
236 struct MuttWindow *dlg = dialog_find(win);
237 struct IndexSharedData *shared = dlg->wdata;
238
240 mutt_debug(LL_DEBUG5, "alternates done\n");
241 return 0;
242}
243
248{
249 if (nc->event_type != NT_ATTACH)
250 return 0;
251 if (!nc->global_data)
252 return -1;
253
254 struct MuttWindow *win = nc->global_data;
255 struct MuttWindow *dlg = dialog_find(win);
256 struct IndexSharedData *shared = dlg->wdata;
257
259 mutt_debug(LL_DEBUG5, "attachments done\n");
260 return 0;
261}
262
267{
268 if (nc->event_type != NT_COLOR)
269 return 0;
270 if (!nc->global_data || !nc->event_data)
271 return -1;
272
273 struct EventColor *ev_c = nc->event_data;
274
275 const int cid = ev_c->cid;
276
277 // MT_COLOR_MAX is sent on `uncolor *`
278 bool simple = (cid == MT_COLOR_INDEX_COLLAPSED) ||
282
283 bool lists = (cid == MT_COLOR_INDEX) || (cid == MT_COLOR_INDEX_AUTHOR) ||
286 (cid == MT_COLOR_NORMAL) || (cid == MT_COLOR_MAX);
287
288 // The changes aren't relevant to the index menu
289 if (!simple && !lists)
290 return 0;
291
292 struct MuttWindow *win = nc->global_data;
293 struct MuttWindow *dlg = dialog_find(win);
294 struct IndexSharedData *shared = dlg->wdata;
295
296 struct Mailbox *m = shared->mailbox;
297 if (!m)
298 return 0;
299
300 // Colour added/deleted from a list
301 if (lists)
302 {
303 // Force re-caching of index colours
304 for (int i = 0; i < m->msg_count; i++)
305 {
306 struct Email *e = m->emails[i];
307 if (!e)
308 break;
309 e->attr_color = NULL;
310 }
311 }
312
313 struct MuttWindow *panel_index = window_find_child(dlg, WT_INDEX);
314 struct IndexPrivateData *priv = panel_index->wdata;
315 struct Menu *menu = priv->menu;
316 menu->redraw = MENU_REDRAW_FULL;
318 mutt_debug(LL_DEBUG5, "color done, request MENU_REDRAW_FULL\n");
319
320 return 0;
321}
322
327{
328 if (nc->event_type != NT_CONFIG)
329 return 0;
330 if (!nc->global_data || !nc->event_data)
331 return -1;
332
333 struct EventConfig *ev_c = nc->event_data;
334 struct MuttWindow *win = nc->global_data;
335
336 const struct ConfigDef *cdef = ev_c->he->data;
337 ConfigRedrawFlags flags = cdef->type & R_REDRAW_MASK;
338
339 if (flags & R_RESORT_SUB)
340 OptSortSubthreads = true;
341 if (flags & R_RESORT)
342 OptNeedResort = true;
343 if (flags & R_RESORT_INIT)
344 OptResortInit = true;
345 if (!(flags & R_INDEX))
346 return 0;
347
348 if (mutt_str_equal(ev_c->name, "reply_regex"))
349 {
350 struct MuttWindow *dlg = dialog_find(win);
351 struct IndexSharedData *shared = dlg->wdata;
353 mutt_debug(LL_DEBUG5, "config done\n");
354 }
355 else if (mutt_str_equal(ev_c->name, "sort"))
356 {
357 config_sort(ev_c->sub);
358 mutt_debug(LL_DEBUG5, "config done\n");
359 }
360 else if (mutt_str_equal(ev_c->name, "use_threads"))
361 {
362 config_use_threads(ev_c->sub);
363 mutt_debug(LL_DEBUG5, "config done\n");
364 }
365
367 return 0;
368}
369
374{
375 if (nc->event_type != NT_GLOBAL)
376 return 0;
377 if (!nc->global_data)
378 return -1;
380 return 0;
381
382 struct MuttWindow *win = nc->global_data;
383 struct MuttWindow *dlg = dialog_find(win);
384 if (!dlg)
385 return 0;
386
387 struct IndexSharedData *shared = dlg->wdata;
389
390 return 0;
391}
392
397{
398 if (!nc->global_data)
399 return -1;
400
401 struct MuttWindow *win = nc->global_data;
402 win->actions |= WA_RECALC;
403
404 struct Menu *menu = win->wdata;
406 mutt_debug(LL_DEBUG5, "index done, request WA_RECALC\n");
407
408 struct IndexPrivateData *priv = menu->mdata;
409 struct IndexSharedData *shared = priv->shared;
410 if (shared && shared->mailbox)
411 menu->max = shared->mailbox->vcount;
412 else
413 menu->max = 0;
414
415 return 0;
416}
417
422{
423 if (nc->event_type != NT_MENU)
424 return 0;
425 if (!nc->global_data)
426 return -1;
427
428 struct MuttWindow *win = nc->global_data;
429 struct MuttWindow *dlg = dialog_find(win);
430 struct IndexSharedData *shared = dlg->wdata;
431 struct Menu *menu = win->wdata;
432
433 const int index = menu_get_index(menu);
434 struct Email *e = mutt_get_virt_email(shared->mailbox, index);
436
437 return 0;
438}
439
444{
445 if (nc->event_type != NT_SCORE)
446 return 0;
447 if (!nc->global_data)
448 return -1;
449
450 struct MuttWindow *win = nc->global_data;
451 struct MuttWindow *dlg = dialog_find(win);
452 struct IndexSharedData *shared = dlg->wdata;
453
454 struct Mailbox *m = shared->mailbox;
455 if (!m)
456 return 0;
457
458 for (int i = 0; i < m->msg_count; i++)
459 {
460 struct Email *e = m->emails[i];
461 if (!e)
462 break;
463
464 mutt_score_message(m, e, true);
465 e->attr_color = NULL; // Force recalc of colour
466 }
467
468 mutt_debug(LL_DEBUG5, "score done\n");
469 return 0;
470}
471
476{
477 if (nc->event_type != NT_SUBJRX)
478 return 0;
479 if (!nc->global_data)
480 return -1;
481
482 struct MuttWindow *win = nc->global_data;
483 struct MuttWindow *dlg = dialog_find(win);
484 struct IndexSharedData *shared = dlg->wdata;
485
486 subjrx_clear_mods(shared->mailbox);
487 mutt_debug(LL_DEBUG5, "subjectrx done\n");
488 return 0;
489}
490
495{
496 if (nc->event_type != NT_WINDOW)
497 return 0;
498 if (!nc->global_data || !nc->event_data)
499 return -1;
500
501 struct MuttWindow *win = nc->global_data;
502 struct Menu *menu = win->wdata;
504 {
506 return 0;
507 }
508
509 struct EventWindow *ev_w = nc->event_data;
510 if (ev_w->win != win)
511 return 0;
512
513 struct IndexPrivateData *priv = menu->mdata;
514
525
526 mutt_debug(LL_DEBUG5, "window delete done\n");
527 return 0;
528}
529
533static int index_recalc(struct MuttWindow *win)
534{
535 win->actions |= WA_REPAINT;
536 mutt_debug(LL_DEBUG5, "recalc done, request WA_REPAINT\n");
537 return 0;
538}
539
543static int index_repaint(struct MuttWindow *win)
544{
545 struct Menu *menu = win->wdata;
546
547 if (menu->redraw & MENU_REDRAW_FULL)
548 menu_redraw_full(menu);
549
550 // If we don't have the focus, then this is a mini-Index ($pager_index_lines)
551 if (!window_is_focused(menu->win))
552 {
553 int indicator = menu->page_len / 3;
554
555 /* some fudge to work out whereabouts the indicator should go */
556 const int index = menu_get_index(menu);
557 if ((index - indicator) < 0)
558 menu->top = 0;
559 else if ((menu->max - index) < (menu->page_len - indicator))
560 menu->top = menu->max - menu->page_len;
561 else
562 menu->top = index - indicator;
563 }
564 menu_adjust(menu);
566
567 struct IndexPrivateData *priv = menu->mdata;
568 struct IndexSharedData *shared = priv->shared;
569 struct Mailbox *m = shared->mailbox;
570 const int index = menu_get_index(menu);
571 if (m && m->emails && (index < m->vcount))
572 {
573 if (menu->redraw & MENU_REDRAW_INDEX)
574 {
575 menu_redraw_index(menu);
576 }
577 else if (menu->redraw & MENU_REDRAW_MOTION)
578 menu_redraw_motion(menu);
579 else if (menu->redraw & MENU_REDRAW_CURRENT)
581 }
582
584 mutt_debug(LL_DEBUG5, "repaint done\n");
585 return 0;
586}
587
593{
595 win->recalc = index_recalc;
596 win->repaint = index_repaint;
597
598 struct Menu *menu = win->wdata;
599 menu->mdata = priv;
600 menu->mdata_free = NULL; // Menu doesn't own the data
601 priv->menu = menu;
602
613
614 return win;
615}
616
625{
626 if (!AllDialogsWindow)
627 return NULL;
628
629 struct MuttWindow *np = NULL;
630 TAILQ_FOREACH_REVERSE(np, &AllDialogsWindow->children, MuttWindowList, entries)
631 {
632 struct MuttWindow *win = window_find_child(np, WT_DLG_INDEX);
633 if (win)
634 {
635 struct IndexSharedData *shared = win->wdata;
636 return shared->mailbox;
637 }
638 }
639
640 return NULL;
641}
642
651{
652 if (!AllDialogsWindow)
653 return NULL;
654
655 struct MuttWindow *np = NULL;
656 TAILQ_FOREACH_REVERSE(np, &AllDialogsWindow->children, MuttWindowList, entries)
657 {
658 struct MuttWindow *dlg = window_find_child(np, WT_DLG_INDEX);
659 if (dlg)
660 {
661 struct MuttWindow *panel_index = window_find_child(dlg, WT_INDEX);
662 struct IndexPrivateData *priv = panel_index->wdata;
663 return priv->menu;
664 }
665 }
666
667 return NULL;
668}
void mutt_alternates_reset(struct Mailbox *m)
Clear the recipient valid flag of all emails.
Definition: alternates.c:72
Alternate address handling.
GUI display the mailboxes in a side panel.
void mutt_attachments_reset(struct Mailbox *m)
Reset the attachment count for all Emails.
Definition: attachments.c:285
Color and attribute parsing.
@ MT_COLOR_INDEX_AUTHOR
Index: author field (takes a pattern)
Definition: color.h:78
@ MT_COLOR_MAX
Definition: color.h:89
@ MT_COLOR_INDEX_SIZE
Index: size field.
Definition: color.h:87
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
Definition: color.h:88
@ MT_COLOR_INDEX_SUBJECT
Index: subject field (takes a pattern)
Definition: color.h:80
@ MT_COLOR_INDEX_DATE
Index: date field.
Definition: color.h:84
@ MT_COLOR_INDEX_TAG
Index: tag field (g, takes a pattern)
Definition: color.h:81
@ MT_COLOR_TREE
Index: tree-drawing characters.
Definition: color.h:73
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:54
@ MT_COLOR_INDEX_LABEL
Index: label field.
Definition: color.h:85
@ MT_COLOR_INDEX
Index: default colour (takes a pattern)
Definition: color.h:77
@ MT_COLOR_INDEX_NUMBER
Index: index number.
Definition: color.h:86
@ MT_COLOR_INDEX_FLAGS
Index: flags field (takes a pattern)
Definition: color.h:79
@ MT_COLOR_INDEX_COLLAPSED
Index: number of messages in collapsed thread.
Definition: color.h:83
const struct Regex * cs_subset_regex(const struct ConfigSubset *sub, const char *name)
Get a regex config item by name.
Definition: helpers.c:243
unsigned char cs_subset_enum(const struct ConfigSubset *sub, const char *name)
Get a enumeration config item by name.
Definition: helpers.c:97
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Definition: helpers.c:292
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
struct MuttWindow * AllDialogsWindow
Parent of all Dialogs.
Definition: dialog.c:74
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition: dialog.c:83
void menu_redraw_current(struct Menu *menu)
Redraw the current menu.
Definition: draw.c:445
void menu_redraw_index(struct Menu *menu)
Force the redraw of the index.
Definition: draw.c:329
void menu_redraw_full(struct Menu *menu)
Force the redraw of the Menu.
Definition: draw.c:315
void menu_redraw_motion(struct Menu *menu)
Force the redraw of the list part of the menu.
Definition: draw.c:386
Structs that make up an email.
#define mutt_warning(...)
Definition: logging.h:85
#define mutt_debug(LEVEL,...)
Definition: logging.h:84
static int index_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition: index.c:266
static int index_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: index.c:326
static int index_index_observer(struct NotifyCallback *nc)
Notification that the Index has changed - Implements observer_t -.
Definition: index.c:396
static int index_menu_observer(struct NotifyCallback *nc)
Notification that the Menu has changed - Implements observer_t -.
Definition: index.c:421
static int index_score_observer(struct NotifyCallback *nc)
Notification that a 'score' command has occurred - Implements observer_t -.
Definition: index.c:443
static int index_global_observer(struct NotifyCallback *nc)
Notification that a Global event occurred - Implements observer_t -.
Definition: index.c:373
static int index_altern_observer(struct NotifyCallback *nc)
Notification that an 'alternates' command has occurred - Implements observer_t -.
Definition: index.c:228
static int index_subjrx_observer(struct NotifyCallback *nc)
Notification that a 'subjectrx' command has occurred - Implements observer_t -.
Definition: index.c:475
static int index_attach_observer(struct NotifyCallback *nc)
Notification that an 'attachments' command has occurred - Implements observer_t -.
Definition: index.c:247
static int index_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: index.c:494
static int index_recalc(struct MuttWindow *win)
Recalculate the Index display - Implements MuttWindow::recalc() -.
Definition: index.c:533
static int index_repaint(struct MuttWindow *win)
Repaint the Index display - Implements MuttWindow::repaint() -.
Definition: index.c:543
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.
Definition: shared_data.c:230
Data shared between Index, Pager and Sidebar.
static int config_sort(const struct ConfigSubset *sub)
React to changes to "sort".
Definition: index.c:109
void index_adjust_sort_threads(const struct ConfigSubset *sub)
Adjust use_threads/sort/sort_aux.
Definition: index.c:181
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition: index.c:624
struct Menu * get_current_menu(void)
Get the current Menu.
Definition: index.c:650
static void sort_use_threads_warn(void)
Alert the user to odd $sort settings.
Definition: index.c:92
struct MuttWindow * index_window_new(struct IndexPrivateData *priv)
Create a new Index Window (list of Emails)
Definition: index.c:592
static int config_use_threads(const struct ConfigSubset *sub)
React to changes to "use_threads".
Definition: index.c:157
static int config_reply_regex(struct Mailbox *m)
React to changes to $reply_regex.
Definition: index.c:193
@ LL_DEBUG5
Log at debug level 5.
Definition: logging.h:44
GUI present the user with a selectable list.
#define MENU_REDRAW_FULL
Redraw everything.
Definition: lib.h:59
void menu_adjust(struct Menu *menu)
Reapply the config to the Menu.
Definition: move.c:319
#define MENU_REDRAW_INDEX
Redraw the index.
Definition: lib.h:56
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition: menu.c:178
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:154
#define MENU_REDRAW_NO_FLAGS
No flags are set.
Definition: lib.h:55
struct MuttWindow * menu_window_new(enum MenuType type, struct ConfigSubset *sub)
Create a new Menu Window.
Definition: window.c:136
#define MENU_REDRAW_CURRENT
Redraw the current line of the menu.
Definition: lib.h:58
#define MENU_REDRAW_MOTION
Redraw after moving the menu list.
Definition: lib.h:57
Convenience wrapper for the library headers.
#define _(a)
Definition: message.h:28
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
Definition: notify.c:228
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
Definition: notify.c:189
bool mutt_regex_capture(const struct Regex *regex, const char *str, size_t nmatch, regmatch_t matches[])
Match a regex against a string, with provided options.
Definition: regex.c:614
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:807
Create/manipulate threading in emails.
@ UT_FLAT
Unthreaded.
Definition: mutt_thread.h:85
@ UT_UNSET
Not yet set by user, stick to legacy semantics.
Definition: mutt_thread.h:84
@ UT_THREADS
Normal threading (root above subthreads)
Definition: mutt_thread.h:86
@ UT_REVERSE
Reverse threading (subthreads above root)
Definition: mutt_thread.h:87
bool window_is_focused(const struct MuttWindow *win)
Does the given Window have the focus?
Definition: mutt_window.c:629
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
Definition: mutt_window.c:522
#define WA_RECALC
Recalculate the contents of the Window.
Definition: mutt_window.h:110
@ WT_DLG_INDEX
Index Dialog, index_pager_init()
Definition: mutt_window.h:86
@ WT_INDEX
A panel containing the Index Window.
Definition: mutt_window.h:97
@ NT_WINDOW_DELETE
Window is about to be deleted.
Definition: mutt_window.h:206
#define WA_REPAINT
Redraw the contents of the Window.
Definition: mutt_window.h:111
void mutt_sleep(short s)
Sleep for a while.
Definition: muttlib.c:1455
Some miscellaneous functions.
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
Definition: mview.c:414
The "currently-open" mailbox.
@ NT_GLOBAL_COMMAND
A NeoMutt command.
Definition: neomutt.h:55
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:55
@ NT_MENU
Menu has changed, MenuRedrawFlags.
Definition: notify_type.h:51
@ NT_ATTACH
Attachment command changed, NotifyAttach.
Definition: notify_type.h:39
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
@ NT_COLOR
Colour has changed, NotifyColor, EventColor.
Definition: notify_type.h:41
@ NT_SCORE
Email scoring has changed.
Definition: notify_type.h:53
@ NT_ALL
Register for all notifications.
Definition: notify_type.h:35
@ NT_GLOBAL
Not object-related, NotifyGlobal.
Definition: notify_type.h:46
@ NT_ALTERN
Alternates command changed, NotifyAlternates.
Definition: notify_type.h:38
@ NT_SUBJRX
Subject Regex has changed, NotifySubjRx.
Definition: notify_type.h:54
Handling of global boolean variables.
bool OptResortInit
(pseudo) used to force the next resort to be from scratch
Definition: options.h:56
bool OptSortSubthreads
(pseudo) used when $sort_aux changes
Definition: options.h:59
bool OptNeedResort
(pseudo) used to force a re-sort
Definition: options.h:48
Private state data for the Pager.
#define TAILQ_FOREACH_REVERSE(var, head, headname, field)
Definition: queue.h:745
void mutt_check_rescore(struct Mailbox *m)
Do the emails need to have their scores recalculated?
Definition: score.c:63
void mutt_score_message(struct Mailbox *m, struct Email *e, bool upd_mbox)
Apply scoring to an email.
Definition: score.c:159
Routines for adding user scores to emails.
#define CSR_RESULT(x)
Definition: set.h:52
#define CSR_SUCCESS
Action completed successfully.
Definition: set.h:35
#define SORT_MASK
Mask for the sort id.
Definition: sort2.h:78
@ SORT_THREADS
Sort by email threads.
Definition: sort2.h:49
#define SORT_REVERSE
Reverse the order of the sort.
Definition: sort2.h:79
Definition: set.h:64
uint32_t type
Variable type, e.g. DT_STRING.
Definition: set.h:66
A set of inherited config items.
Definition: subset.h:47
The envelope/body of an email.
Definition: email.h:37
struct Envelope * env
Envelope information.
Definition: email.h:66
struct AttrColor * attr_color
Color-pair to use when displaying in the index.
Definition: email.h:112
int index
The absolute (unsorted) message number.
Definition: email.h:110
The header of an Email.
Definition: envelope.h:57
char * subject
Email's subject.
Definition: envelope.h:70
char * real_subj
Offset of the real subject.
Definition: envelope.h:71
An Event that happened to a Colour.
Definition: notify2.h:53
enum ColorId cid
Colour ID that has changed.
Definition: notify2.h:54
A config-change event.
Definition: subset.h:70
const struct ConfigSubset * sub
Config Subset.
Definition: subset.h:71
const char * name
Name of config item that changed.
Definition: subset.h:72
struct HashElem * he
Config item that changed.
Definition: subset.h:73
An Event that happened to a Window.
Definition: mutt_window.h:216
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:217
void * data
User-supplied data.
Definition: hash.h:47
Private state data for the Index.
Definition: private_data.h:35
struct IndexSharedData * shared
Shared Index data.
Definition: private_data.h:42
struct Menu * menu
Menu controlling the index.
Definition: private_data.h:43
Data shared between Index, Pager and Sidebar.
Definition: shared_data.h:37
struct Mailbox * mailbox
Current Mailbox.
Definition: shared_data.h:41
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition: shared_data.h:44
A mailbox.
Definition: mailbox.h:79
int vcount
The number of virtual messages.
Definition: mailbox.h:99
int msg_count
Total number of messages.
Definition: mailbox.h:88
struct Email ** emails
Array of Emails.
Definition: mailbox.h:96
Definition: lib.h:69
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
MenuRedrawFlags redraw
When to redraw the screen.
Definition: lib.h:72
void(* mdata_free)(struct Menu *menu, void **ptr)
Definition: lib.h:152
int top
Entry that is the top of the current page.
Definition: lib.h:80
struct Notify * notify
Notifications.
Definition: lib.h:135
void * mdata
Private data.
Definition: lib.h:137
int max
Number of entries in the menu.
Definition: lib.h:71
int page_len
Number of entries per screen.
Definition: lib.h:74
int(* repaint)(struct MuttWindow *win)
Definition: mutt_window.h:182
void * wdata
Private data.
Definition: mutt_window.h:145
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
Definition: mutt_window.h:138
int(* recalc)(struct MuttWindow *win)
Definition: mutt_window.h:171
struct MuttWindowList children
Children Windows.
Definition: mutt_window.h:136
WindowActionFlags actions
Actions to be performed, e.g. WA_RECALC.
Definition: mutt_window.h:132
Container for Accounts, Notifications.
Definition: neomutt.h:37
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
struct ConfigSubset * sub
Inherited config items.
Definition: neomutt.h:39
Data passed to a notification function.
Definition: observer.h:34
void * event_data
Data from notify_send()
Definition: observer.h:38
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
Definition: observer.h:36
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
Definition: observer.h:37
void * global_data
Data from notify_observer_add()
Definition: observer.h:39
Cached regular expression.
Definition: regex3.h:89
void subjrx_clear_mods(struct Mailbox *m)
Clear out all modified email subjects.
Definition: subjectrx.c:146
Subject Regex handling.
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.
Definition: subset.c:305
@ MENU_INDEX
Index panel (list of emails)
Definition: type.h:50
#define R_RESORT
Resort the mailbox.
Definition: types.h:68
#define R_RESORT_SUB
Resort subthreads.
Definition: types.h:69
uint32_t ConfigRedrawFlags
Flags for redraw/resort, e.g. R_INDEX.
Definition: types.h:63
#define R_REDRAW_MASK
Mask for the Redraw Flags.
Definition: types.h:74
#define R_INDEX
Redraw the index menu (MENU_INDEX)
Definition: types.h:65
#define R_RESORT_INIT
Resort from scratch.
Definition: types.h:70