NeoMutt  2023-05-17-56-ga67199
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 "postpone/lib.h"
80#include "alternates.h"
81#include "globals.h" // IWYU pragma: keep
82#include "mutt_thread.h"
83#include "muttlib.h"
84#include "mview.h"
85#include "private_data.h"
86#include "score.h"
87#include "shared_data.h"
88#include "subjectrx.h"
89
93static void sort_use_threads_warn(void)
94{
95 static bool warned = false;
96 if (!warned)
97 {
98 mutt_warning(_("Changing threaded display should prefer $use_threads over $sort"));
99 warned = true;
100 mutt_sleep(0);
101 }
102}
103
110static int config_sort(const struct ConfigSubset *sub)
111{
112 const enum SortType c_sort = cs_subset_sort(sub, "sort");
113 const unsigned char c_use_threads = cs_subset_enum(sub, "use_threads");
114
115 if (((c_sort & SORT_MASK) != SORT_THREADS) || (c_use_threads == UT_UNSET))
116 return 0;
117
119
120 /* Note: changing a config variable here kicks off a second round of
121 * observers before the first round has completed. Be careful that
122 * changes made here do not cause an infinite loop of toggling
123 * adjustments - the early exit above when $sort no longer uses
124 * SORT_THREADS ends the recursion.
125 */
126 int rc;
127 if ((c_use_threads == UT_FLAT) ||
128 (!(c_sort & SORT_REVERSE) == (c_use_threads == UT_REVERSE)))
129 {
130 /* If we were flat or the user wants to change thread
131 * directions, then leave $sort alone for now and change
132 * $use_threads to match the desired outcome. The 2nd-level
133 * observer for $use_threads will then adjust $sort, and our
134 * 3rd-level observer for $sort will be a no-op.
135 */
136 rc = cs_subset_str_native_set(sub, "use_threads",
137 (c_sort & SORT_REVERSE) ? UT_REVERSE : UT_THREADS, NULL);
138 }
139 else
140 {
141 /* We were threaded, and the user still wants the same thread
142 * direction. Adjust $sort based on $sort_aux, and the 2nd-level
143 * observer for $sort will be a no-op.
144 */
145 enum SortType c_sort_aux = cs_subset_sort(sub, "sort_aux");
146 c_sort_aux ^= (c_sort & SORT_REVERSE);
147 rc = cs_subset_str_native_set(sub, "sort", c_sort_aux, NULL);
148 }
149 return (CSR_RESULT(rc) == CSR_SUCCESS) ? 0 : -1;
150}
151
158static int config_use_threads(const struct ConfigSubset *sub)
159{
160 const enum SortType c_sort = cs_subset_sort(sub, "sort");
161 const unsigned char c_use_threads = cs_subset_enum(sub, "use_threads");
162
163 if (((c_sort & SORT_MASK) != SORT_THREADS) || (c_use_threads == UT_UNSET))
164 return 0;
165
167
168 /* Note: changing a config variable here kicks off a second round of
169 * observers before the first round has completed. But since we
170 * aren't setting $sort to threads, the 2nd-level observer will be a
171 * no-op.
172 */
173 const enum SortType c_sort_aux = cs_subset_sort(sub, "sort_aux");
174 int rc = cs_subset_str_native_set(sub, "sort", c_sort_aux, NULL);
175 return (CSR_RESULT(rc) == CSR_SUCCESS) ? 0 : -1;
176}
177
183{
184 /* For lack of a better way, we fake a "set use_threads" */
186}
187
194static int config_reply_regex(struct MailboxView *mv)
195{
196 if (!mv || !mv->mailbox)
197 return 0;
198
199 struct Mailbox *m = mv->mailbox;
200
201 regmatch_t pmatch[1];
202
203 const struct Regex *c_reply_regex = cs_subset_regex(NeoMutt->sub, "reply_regex");
204 for (int i = 0; i < m->msg_count; i++)
205 {
206 struct Email *e = m->emails[i];
207 if (!e)
208 break;
209 struct Envelope *env = e->env;
210 if (!env || !env->subject)
211 continue;
212
213 if (mutt_regex_capture(c_reply_regex, env->subject, 1, pmatch))
214 {
215 env->real_subj = env->subject + pmatch[0].rm_eo;
216 if (env->real_subj[0] == '\0')
217 env->real_subj = NULL;
218 continue;
219 }
220
221 env->real_subj = env->subject;
222 }
223
224 OptResortInit = true; /* trigger a redraw of the index */
225 return 0;
226}
227
232{
233 if (nc->event_type != NT_ALTERN)
234 return 0;
235 if (!nc->global_data)
236 return -1;
237
238 struct MuttWindow *win = nc->global_data;
239 struct MuttWindow *dlg = dialog_find(win);
240 struct IndexSharedData *shared = dlg->wdata;
241
243 mutt_debug(LL_DEBUG5, "alternates done\n");
244 return 0;
245}
246
251{
252 if (nc->event_type != NT_ATTACH)
253 return 0;
254 if (!nc->global_data)
255 return -1;
256
257 struct MuttWindow *win = nc->global_data;
258 struct MuttWindow *dlg = dialog_find(win);
259 struct IndexSharedData *shared = dlg->wdata;
260
262 mutt_debug(LL_DEBUG5, "attachments done\n");
263 return 0;
264}
265
270{
271 if (nc->event_type != NT_COLOR)
272 return 0;
273 if (!nc->global_data || !nc->event_data)
274 return -1;
275
276 struct EventColor *ev_c = nc->event_data;
277
278 const int cid = ev_c->cid;
279
280 // MT_COLOR_MAX is sent on `uncolor *`
281 if (!((cid == MT_COLOR_INDEX) || (cid == MT_COLOR_INDEX_AUTHOR) ||
287 (cid == MT_COLOR_NORMAL) || (cid == MT_COLOR_TREE)))
288 {
289 // The changes aren't relevant to the index menu
290 return 0;
291 }
292
293 struct MuttWindow *win = nc->global_data;
294 struct MuttWindow *dlg = dialog_find(win);
295 struct IndexSharedData *shared = dlg->wdata;
296
297 struct Mailbox *m = shared->mailbox;
298 if (!m)
299 return 0;
300
301 // Force re-caching of index colours
302 for (int i = 0; i < m->msg_count; i++)
303 {
304 struct Email *e = m->emails[i];
305 if (!e)
306 break;
307 e->attr_color = NULL;
308 }
309
310 struct MuttWindow *panel_index = window_find_child(dlg, WT_INDEX);
311 struct IndexPrivateData *priv = panel_index->wdata;
312 struct Menu *menu = priv->menu;
313 menu->redraw = MENU_REDRAW_FULL;
315 mutt_debug(LL_DEBUG5, "color done, request MENU_REDRAW_FULL\n");
316
317 return 0;
318}
319
324{
325 if (nc->event_type != NT_CONFIG)
326 return 0;
327 if (!nc->global_data || !nc->event_data)
328 return -1;
329
330 struct EventConfig *ev_c = nc->event_data;
331 if (!ev_c->name || !ev_c->he)
332 return 0;
333
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
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 {
507 return 0;
508 }
509
510 struct EventWindow *ev_w = nc->event_data;
511 if (ev_w->win != win)
512 return 0;
513
514 struct IndexPrivateData *priv = menu->mdata;
515
526
527 mutt_debug(LL_DEBUG5, "window delete done\n");
528 return 0;
529}
530
534static int index_recalc(struct MuttWindow *win)
535{
536 win->actions |= WA_REPAINT;
537 mutt_debug(LL_DEBUG5, "recalc done, request WA_REPAINT\n");
538 return 0;
539}
540
544static int index_repaint(struct MuttWindow *win)
545{
546 struct Menu *menu = win->wdata;
547
548 if (menu->redraw & MENU_REDRAW_FULL)
549 menu_redraw_full(menu);
550
551 // If we don't have the focus, then this is a mini-Index ($pager_index_lines)
552 if (!window_is_focused(menu->win))
553 {
554 int indicator = menu->page_len / 3;
555
556 /* some fudge to work out whereabouts the indicator should go */
557 const int index = menu_get_index(menu);
558 if ((index - indicator) < 0)
559 menu->top = 0;
560 else if ((menu->max - index) < (menu->page_len - indicator))
561 menu->top = menu->max - menu->page_len;
562 else
563 menu->top = index - indicator;
564 }
565 menu_adjust(menu);
567
568 struct IndexPrivateData *priv = menu->mdata;
569 struct IndexSharedData *shared = priv->shared;
570 struct Mailbox *m = shared->mailbox;
571 const int index = menu_get_index(menu);
572 if (m && m->emails && (index < m->vcount))
573 {
574 if (menu->redraw & MENU_REDRAW_INDEX)
575 {
576 menu_redraw_index(menu);
577 }
578 else if (menu->redraw & MENU_REDRAW_MOTION)
579 {
580 menu_redraw_motion(menu);
581 }
582 else if (menu->redraw & MENU_REDRAW_CURRENT)
583 {
585 }
586 }
587
589 mutt_debug(LL_DEBUG5, "repaint done\n");
590 return 0;
591}
592
599{
601 win->recalc = index_recalc;
602 win->repaint = index_repaint;
603
604 struct Menu *menu = win->wdata;
605 menu->mdata = priv;
606 menu->mdata_free = NULL; // Menu doesn't own the data
607 priv->menu = menu;
608
619
620 return win;
621}
622
631{
632 if (!AllDialogsWindow)
633 return NULL;
634
635 struct MuttWindow *np = NULL;
636 TAILQ_FOREACH_REVERSE(np, &AllDialogsWindow->children, MuttWindowList, entries)
637 {
638 struct MuttWindow *win = window_find_child(np, WT_DLG_INDEX);
639 if (win)
640 {
641 struct IndexSharedData *shared = win->wdata;
642 return shared->mailbox_view;
643 }
644
646 if (win)
647 {
648 return postponed_get_mailbox_view(win);
649 }
650 }
651
652 return NULL;
653}
654
663{
665 if (mv)
666 return mv->mailbox;
667
668 return NULL;
669}
670
679{
680 if (!AllDialogsWindow)
681 return NULL;
682
683 struct MuttWindow *np = NULL;
684 TAILQ_FOREACH_REVERSE(np, &AllDialogsWindow->children, MuttWindowList, entries)
685 {
686 struct MuttWindow *dlg = window_find_child(np, WT_DLG_INDEX);
687 if (dlg)
688 {
689 struct MuttWindow *panel_index = window_find_child(dlg, WT_INDEX);
690 struct IndexPrivateData *priv = panel_index->wdata;
691 return priv->menu;
692 }
693 }
694
695 return NULL;
696}
void mutt_alternates_reset(struct MailboxView *mv)
Clear the recipient valid flag of all emails.
Definition: alternates.c:73
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.
Definition: attachments.c:288
Color and attribute parsing.
@ MT_COLOR_INDEX_AUTHOR
Index: author field.
Definition: color.h:82
@ MT_COLOR_MAX
Definition: color.h:92
@ MT_COLOR_INDEX_SIZE
Index: size field.
Definition: color.h:88
@ MT_COLOR_INDEX_TAGS
Index: tags field (g, J)
Definition: color.h:91
@ MT_COLOR_INDEX_SUBJECT
Index: subject field.
Definition: color.h:89
@ MT_COLOR_INDEX_DATE
Index: date field.
Definition: color.h:84
@ MT_COLOR_INDEX_TAG
Index: tag field (G)
Definition: color.h:90
@ MT_COLOR_TREE
Index: tree-drawing characters.
Definition: color.h:77
@ MT_COLOR_NORMAL
Plain text.
Definition: color.h:57
@ MT_COLOR_INDEX_LABEL
Index: label field.
Definition: color.h:86
@ MT_COLOR_INDEX
Index: default colour.
Definition: color.h:81
@ MT_COLOR_INDEX_NUMBER
Index: index number.
Definition: color.h:87
@ MT_COLOR_INDEX_FLAGS
Index: flags field.
Definition: color.h:85
@ 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.
#define CSR_RESULT(x)
Definition: set.h:52
#define CSR_SUCCESS
Action completed successfully.
Definition: set.h:35
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:438
void menu_redraw_index(struct Menu *menu)
Force the redraw of the index.
Definition: draw.c:322
void menu_redraw_full(struct Menu *menu)
Force the redraw of the Menu.
Definition: draw.c:308
void menu_redraw_motion(struct Menu *menu)
Force the redraw of the list part of the menu.
Definition: draw.c:379
Structs that make up an email.
bool OptResortInit
(pseudo) used to force the next resort to be from scratch
Definition: globals.c:85
bool OptSortSubthreads
(pseudo) used when $sort_aux changes
Definition: globals.c:88
bool OptNeedResort
(pseudo) used to force a re-sort
Definition: globals.c:77
#define mutt_warning(...)
Definition: logging2.h:88
#define mutt_debug(LEVEL,...)
Definition: logging2.h:87
static int index_color_observer(struct NotifyCallback *nc)
Notification that a Color has changed - Implements observer_t -.
Definition: index.c:269
static int index_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: index.c:323
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:231
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:250
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:534
static int index_repaint(struct MuttWindow *win)
Repaint the Index display - Implements MuttWindow::repaint() -.
Definition: index.c:544
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:97
Data shared between Index, Pager and Sidebar.
static int config_sort(const struct ConfigSubset *sub)
React to changes to "sort".
Definition: index.c:110
void index_adjust_sort_threads(const struct ConfigSubset *sub)
Adjust use_threads/sort/sort_aux.
Definition: index.c:182
static int config_reply_regex(struct MailboxView *mv)
React to changes to $reply_regex.
Definition: index.c:194
struct MailboxView * get_current_mailbox_view(void)
Get the current Mailbox view.
Definition: index.c:630
struct Mailbox * get_current_mailbox(void)
Get the current Mailbox.
Definition: index.c:662
struct Menu * get_current_menu(void)
Get the current Menu.
Definition: index.c:678
static void sort_use_threads_warn(void)
Alert the user to odd $sort settings.
Definition: index.c:93
struct MuttWindow * index_window_new(struct IndexPrivateData *priv)
Create a new Index Window (list of Emails)
Definition: index.c:598
static int config_use_threads(const struct ConfigSubset *sub)
React to changes to "use_threads".
Definition: index.c:158
@ LL_DEBUG5
Log at debug level 5.
Definition: logging2.h:47
GUI present the user with a selectable list.
#define MENU_REDRAW_FULL
Redraw everything.
Definition: lib.h:60
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:57
void menu_queue_redraw(struct Menu *menu, MenuRedrawFlags redraw)
Queue a request for a redraw.
Definition: menu.c:179
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition: menu.c:155
#define MENU_REDRAW_NO_FLAGS
No flags are set.
Definition: lib.h:56
struct MuttWindow * menu_window_new(enum MenuType type, struct ConfigSubset *sub)
Create a new Menu Window.
Definition: window.c:138
#define MENU_REDRAW_CURRENT
Redraw the current line of the menu.
Definition: lib.h:59
#define MENU_REDRAW_MOTION
Redraw after moving the menu list.
Definition: lib.h:58
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:618
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:798
Create/manipulate threading in emails.
@ UT_FLAT
Unthreaded.
Definition: mutt_thread.h:97
@ UT_UNSET
Not yet set by user, stick to legacy semantics.
Definition: mutt_thread.h:96
@ UT_THREADS
Normal threading (root above subthreads)
Definition: mutt_thread.h:98
@ UT_REVERSE
Reverse threading (subthreads above root)
Definition: mutt_thread.h:99
bool window_is_focused(const struct MuttWindow *win)
Does the given Window have the focus?
Definition: mutt_window.c:630
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
Definition: mutt_window.c:523
#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_DLG_POSTPONE
Postpone Dialog, dlg_select_postponed_email()
Definition: mutt_window.h:89
@ 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:205
@ NT_WINDOW_FOCUS
Window focus has changed.
Definition: mutt_window.h:208
#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:1424
Some miscellaneous functions.
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
Definition: mview.c:407
View of a 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
Private state data for the Pager.
struct MailboxView * postponed_get_mailbox_view(struct MuttWindow *dlg)
Extract the Mailbox from the Postponed Dialog.
Definition: functions.c:170
Postponed Emails.
#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:64
void mutt_score_message(struct Mailbox *m, struct Email *e, bool upd_mbox)
Apply scoring to an email.
Definition: score.c:161
Routines for adding user scores to emails.
#define SORT_MASK
Mask for the sort id.
Definition: sort2.h:74
SortType
Methods for sorting.
Definition: sort2.h:38
@ SORT_THREADS
Sort by email threads.
Definition: sort2.h:45
#define SORT_REVERSE
Reverse the order of the sort.
Definition: sort2.h:75
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:111
int index
The absolute (unsorted) message number.
Definition: email.h:109
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:71
const struct ConfigSubset * sub
Config Subset.
Definition: subset.h:72
const char * name
Name of config item that changed.
Definition: subset.h:73
struct HashElem * he
Config item that changed.
Definition: subset.h:74
An Event that happened to a Window.
Definition: mutt_window.h:215
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:216
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 MailboxView * mailbox_view
Current Mailbox view.
Definition: shared_data.h:40
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
Definition: shared_data.h:44
View of a Mailbox.
Definition: mview.h:39
struct Mailbox * mailbox
Current Mailbox.
Definition: mview.h:50
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:70
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:77
MenuRedrawFlags redraw
When to redraw the screen.
Definition: lib.h:73
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:81
struct Notify * notify
Notifications.
Definition: lib.h:136
void * mdata
Private data.
Definition: lib.h:138
int max
Number of entries in the menu.
Definition: lib.h:72
int page_len
Number of entries per screen.
Definition: lib.h:75
int(* repaint)(struct MuttWindow *win)
Definition: mutt_window.h:181
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:170
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 MailboxView *mv)
Clear out all modified email subjects.
Definition: subjectrx.c:148
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:310
@ MENU_INDEX
Index panel (list of emails)
Definition: type.h:50
#define R_RESORT
Resort the mailbox.
Definition: types.h:69
#define R_RESORT_SUB
Resort subthreads.
Definition: types.h:70
uint32_t ConfigRedrawFlags
Flags for redraw/resort, e.g. R_INDEX.
Definition: types.h:66
#define R_REDRAW_MASK
Mask for the Redraw Flags.
Definition: types.h:73
#define R_INDEX
Redraw the index menu (MENU_INDEX)
Definition: types.h:68
#define R_RESORT_INIT
Resort from scratch.
Definition: types.h:71