NeoMutt  2022-04-29-247-gc6aae8
Teaching an old dog new tricks
DOXYGEN
dlg_alias.c
Go to the documentation of this file.
1
74#include "config.h"
75#include <stdbool.h>
76#include <stdint.h>
77#include <stdio.h>
78#include <string.h>
79#include "mutt/lib.h"
80#include "address/lib.h"
81#include "config/lib.h"
82#include "email/lib.h"
83#include "core/lib.h"
84#include "gui/lib.h"
85#include "lib.h"
86#include "menu/lib.h"
87#include "pattern/lib.h"
88#include "send/lib.h"
89#include "alias.h"
90#include "format_flags.h"
91#include "functions.h"
92#include "gui.h"
93#include "keymap.h"
94#include "mutt_logging.h"
95#include "muttlib.h"
96#include "opcodes.h"
97
99static const struct Mapping AliasHelp[] = {
100 // clang-format off
101 { N_("Exit"), OP_EXIT },
102 { N_("Del"), OP_DELETE },
103 { N_("Undel"), OP_UNDELETE },
104 { N_("Sort"), OP_SORT },
105 { N_("Rev-Sort"), OP_SORT_REVERSE },
106 { N_("Select"), OP_GENERIC_SELECT_ENTRY },
107 { N_("Help"), OP_HELP },
108 { NULL, 0 },
109 // clang-format on
110};
111
124static const char *alias_format_str(char *buf, size_t buflen, size_t col, int cols,
125 char op, const char *src, const char *prec,
126 const char *if_str, const char *else_str,
127 intptr_t data, MuttFormatFlags flags)
128{
129 char fmt[128], addr[1024];
130 struct AliasView *av = (struct AliasView *) data;
131 struct Alias *alias = av->alias;
132
133 switch (op)
134 {
135 case 'a':
136 mutt_format_s(buf, buflen, prec, alias->name);
137 break;
138 case 'c':
139 mutt_format_s(buf, buflen, prec, alias->comment);
140 break;
141 case 'f':
142 snprintf(fmt, sizeof(fmt), "%%%ss", prec);
143 snprintf(buf, buflen, fmt, av->is_deleted ? "D" : " ");
144 break;
145 case 'n':
146 snprintf(fmt, sizeof(fmt), "%%%sd", prec);
147 snprintf(buf, buflen, fmt, av->num + 1);
148 break;
149 case 'r':
150 addr[0] = '\0';
151 mutt_addrlist_write(&alias->addr, addr, sizeof(addr), true);
152 mutt_format_s(buf, buflen, prec, addr);
153 break;
154 case 't':
155 buf[0] = av->is_tagged ? '*' : ' ';
156 buf[1] = '\0';
157 break;
158 }
159
160 return src;
161}
162
168static void alias_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
169{
170 const struct AliasMenuData *mdata = menu->mdata;
171 const struct AliasViewArray *ava = &mdata->ava;
172 const struct AliasView *av = ARRAY_GET(ava, line);
173
174 const char *const alias_format = cs_subset_string(mdata->sub, "alias_format");
175
176 mutt_expando_format(buf, buflen, 0, menu->win->state.cols, NONULL(alias_format),
178}
179
183static int alias_tag(struct Menu *menu, int sel, int act)
184{
185 const struct AliasMenuData *mdata = menu->mdata;
186 const struct AliasViewArray *ava = &mdata->ava;
187 struct AliasView *av = ARRAY_GET(ava, sel);
188
189 bool ot = av->is_tagged;
190
191 av->is_tagged = ((act >= 0) ? act : !av->is_tagged);
192
193 return av->is_tagged - ot;
194}
195
200{
201 if (nc->event_type != NT_ALIAS)
202 return 0;
203 if (!nc->global_data || !nc->event_data)
204 return -1;
205
206 struct EventAlias *ev_a = nc->event_data;
207 struct Menu *menu = nc->global_data;
208 struct AliasMenuData *mdata = menu->mdata;
209 struct Alias *alias = ev_a->alias;
210
211 if (nc->event_subtype == NT_ALIAS_ADD)
212 {
213 alias_array_alias_add(&mdata->ava, alias);
214
215 if (alias_array_count_visible(&mdata->ava) != ARRAY_SIZE(&mdata->ava))
216 {
217 mutt_pattern_alias_func(NULL, mdata, menu);
218 }
219 }
220 else if (nc->event_subtype == NT_ALIAS_DELETE)
221 {
222 alias_array_alias_delete(&mdata->ava, alias);
223
224 int vcount = alias_array_count_visible(&mdata->ava);
225 int index = menu_get_index(menu);
226 if ((index > (vcount - 1)) && (index > 0))
227 menu_set_index(menu, index - 1);
228 }
229
230 alias_array_sort(&mdata->ava, mdata->sub);
231
232 menu->max = alias_array_count_visible(&mdata->ava);
234 mutt_debug(LL_DEBUG5, "alias done, request WA_RECALC, MENU_REDRAW_FULL\n");
235
236 return 0;
237}
238
247{
248 if (nc->event_type != NT_WINDOW)
249 return 0;
250 if (!nc->global_data || !nc->event_data)
251 return -1;
253 return 0;
254
255 struct MuttWindow *win_menu = nc->global_data;
256 struct EventWindow *ev_w = nc->event_data;
257 if (ev_w->win != win_menu)
258 return 0;
259
260 struct Menu *menu = win_menu->wdata;
261
265
266 mutt_debug(LL_DEBUG5, "window delete done\n");
267 return 0;
268}
269
275static struct MuttWindow *alias_dialog_new(struct AliasMenuData *mdata)
276{
278
279 struct Menu *menu = dlg->wdata;
280
282 menu->custom_search = true;
283 menu->tag = alias_tag;
284 menu->max = alias_array_count_visible(&mdata->ava);
285 menu->mdata = mdata;
286 menu->mdata_free = NULL; // Menu doesn't own the data
287
288 struct MuttWindow *win_menu = menu->win;
289
290 // Override the Simple Dialog's recalc()
291 win_menu->recalc = alias_recalc;
292
293 struct MuttWindow *sbar = window_find_child(dlg, WT_STATUS_BAR);
294 alias_set_title(sbar, mdata->title, mdata->limit);
295
296 // NT_COLOR is handled by the SimpleDialog
300
301 return dlg;
302}
303
310static bool dlg_select_alias(struct Buffer *buf, struct AliasMenuData *mdata)
311{
312 if (ARRAY_EMPTY(&mdata->ava))
313 {
314 mutt_warning(_("You have no aliases"));
315 return false;
316 }
317
318 mdata->query = buf;
319 mdata->title = mutt_str_dup(_("Aliases"));
320
321 struct MuttWindow *dlg = alias_dialog_new(mdata);
322 struct Menu *menu = dlg->wdata;
323 struct MuttWindow *win_sbar = window_find_child(dlg, WT_STATUS_BAR);
324 mdata->menu = menu;
325 mdata->sbar = win_sbar;
326
327 alias_array_sort(&mdata->ava, mdata->sub);
328
329 struct AliasView *avp = NULL;
330 ARRAY_FOREACH(avp, &mdata->ava)
331 {
332 avp->num = ARRAY_FOREACH_IDX;
333 }
334
335 // ---------------------------------------------------------------------------
336 // Event Loop
337 int rc = 0;
338 int op = OP_NULL;
339 do
340 {
341 menu_tagging_dispatcher(menu->win, op);
342 window_redraw(NULL);
343
344 op = km_dokey(MENU_ALIAS);
345 mutt_debug(LL_DEBUG1, "Got op %s (%d)\n", opcodes_get_name(op), op);
346 if (op < 0)
347 continue;
348 if (op == OP_NULL)
349 {
351 continue;
352 }
354
355 rc = alias_function_dispatcher(dlg, op);
356 if (rc == FR_UNKNOWN)
357 rc = menu_function_dispatcher(menu->win, op);
358 if (rc == FR_UNKNOWN)
359 rc = global_function_dispatcher(NULL, op);
360 } while ((rc != FR_DONE) && (rc != FR_CONTINUE));
361 // ---------------------------------------------------------------------------
362
363 simple_dialog_free(&dlg);
364 window_redraw(NULL);
365 return (rc == FR_CONTINUE); // Was a selection made?
366}
367
380int alias_complete(char *buf, size_t buflen, struct ConfigSubset *sub)
381{
382 struct Alias *np = NULL;
383 char bestname[8192] = { 0 };
384
385 struct AliasMenuData mdata = { ARRAY_HEAD_INITIALIZER, NULL, sub };
386 mdata.limit = mutt_str_dup(buf);
387
388 if (buf[0] != '\0')
389 {
390 TAILQ_FOREACH(np, &Aliases, entries)
391 {
392 if (np->name && mutt_strn_equal(np->name, buf, strlen(buf)))
393 {
394 if (bestname[0] == '\0') /* init */
395 {
396 mutt_str_copy(bestname, np->name,
397 MIN(mutt_str_len(np->name) + 1, sizeof(bestname)));
398 }
399 else
400 {
401 int i;
402 for (i = 0; np->name[i] && (np->name[i] == bestname[i]); i++)
403 ; // do nothing
404
405 bestname[i] = '\0';
406 }
407 }
408 }
409
410 if (bestname[0] == '\0')
411 {
412 // Create a View Array of all the Aliases
413 FREE(&mdata.limit);
414 TAILQ_FOREACH(np, &Aliases, entries)
415 {
417 }
418 }
419 else
420 {
421 /* fake the pattern for menu title */
422 char *mtitle = NULL;
423 mutt_str_asprintf(&mtitle, "~f ^%s", buf);
424 FREE(&mdata.limit);
425 mdata.limit = mtitle;
426
427 if (!mutt_str_equal(bestname, buf))
428 {
429 /* we are adding something to the completion */
430 mutt_str_copy(buf, bestname, mutt_str_len(bestname) + 1);
431 FREE(&mdata.limit);
432 return 1;
433 }
434
435 /* build alias list and show it */
436 TAILQ_FOREACH(np, &Aliases, entries)
437 {
438 int aasize = alias_array_alias_add(&mdata.ava, np);
439
440 struct AliasView *av = ARRAY_GET(&mdata.ava, aasize - 1);
441
442 if (np->name && !mutt_strn_equal(np->name, buf, strlen(buf)))
443 {
444 av->is_visible = false;
445 }
446 }
447 }
448 }
449
450 if (ARRAY_EMPTY(&mdata.ava))
451 {
452 TAILQ_FOREACH(np, &Aliases, entries)
453 {
454 alias_array_alias_add(&mdata.ava, np);
455 }
456
457 mutt_pattern_alias_func(NULL, &mdata, NULL);
458 }
459
460 if (!dlg_select_alias(NULL, &mdata))
461 goto done;
462
463 buf[0] = '\0';
464
465 // Extract the selected aliases
466 struct AliasView *avp = NULL;
467 ARRAY_FOREACH(avp, &mdata.ava)
468 {
469 if (!avp->is_tagged)
470 continue;
471
472 mutt_addrlist_write(&avp->alias->addr, buf, buflen, true);
473 }
474
475done:
476 // Process any deleted aliases
477 ARRAY_FOREACH(avp, &mdata.ava)
478 {
479 if (!avp->is_deleted)
480 continue;
481
482 TAILQ_REMOVE(&Aliases, avp->alias, entries);
483 alias_free(&avp->alias);
484 }
485
486 ARRAY_FREE(&mdata.ava);
487 FREE(&mdata.limit);
488 FREE(&mdata.title);
489
490 return 0;
491}
492
498void alias_dialog(struct Mailbox *m, struct ConfigSubset *sub)
499{
500 struct Alias *np = NULL;
501
502 struct AliasMenuData mdata = { ARRAY_HEAD_INITIALIZER, NULL, sub };
503
504 // Create a View Array of all the Aliases
505 TAILQ_FOREACH(np, &Aliases, entries)
506 {
508 }
509
510 if (!dlg_select_alias(NULL, &mdata))
511 goto done;
512
513 // Prepare the "To:" field of a new email
514 struct Email *e = email_new();
515 e->env = mutt_env_new();
516
517 struct AliasView *avp = NULL;
518 ARRAY_FOREACH(avp, &mdata.ava)
519 {
520 if (!avp->is_tagged)
521 continue;
522
523 struct AddressList al_copy = TAILQ_HEAD_INITIALIZER(al_copy);
524 if (alias_to_addrlist(&al_copy, avp->alias))
525 {
526 mutt_addrlist_copy(&e->env->to, &al_copy, false);
527 mutt_addrlist_clear(&al_copy);
528 }
529 }
530
531 mutt_send_message(SEND_REVIEW_TO, e, NULL, m, NULL, sub);
532
533done:
534 // Process any deleted aliases
535 ARRAY_FOREACH(avp, &mdata.ava)
536 {
537 if (avp->is_deleted)
538 {
539 TAILQ_REMOVE(&Aliases, avp->alias, entries);
540 alias_free(&avp->alias);
541 }
542 }
543
544 ARRAY_FREE(&mdata.ava);
545 FREE(&mdata.limit);
546 FREE(&mdata.title);
547}
void mutt_addrlist_copy(struct AddressList *dst, const struct AddressList *src, bool prune)
Copy a list of addresses into another list.
Definition: address.c:737
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
Definition: address.c:1470
size_t mutt_addrlist_write(const struct AddressList *al, char *buf, size_t buflen, bool display)
Write an Address to a buffer.
Definition: address.c:1150
Email Address Handling.
void alias_array_sort(struct AliasViewArray *ava, const struct ConfigSubset *sub)
Sort and reindex an AliasViewArray.
Definition: sort.c:156
void alias_free(struct Alias **ptr)
Free an Alias.
Definition: alias.c:641
struct AliasList Aliases
List of all the user's email aliases.
Definition: alias.c:58
Representation of a single alias to an email address.
@ NT_ALIAS_ADD
Alias has been added.
Definition: alias.h:54
@ NT_ALIAS_DELETE
Alias is about to be deleted.
Definition: alias.h:55
int alias_array_count_visible(struct AliasViewArray *ava)
Count number of visible Aliases.
Definition: array.c:95
int alias_array_alias_delete(struct AliasViewArray *ava, const struct Alias *alias)
Delete an Alias from the AliasViewArray.
Definition: array.c:73
int alias_array_alias_add(struct AliasViewArray *ava, struct Alias *alias)
Add an Alias to the AliasViewArray.
Definition: array.c:47
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition: array.h:211
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition: array.h:73
#define ARRAY_SIZE(head)
The number of elements stored.
Definition: array.h:86
#define ARRAY_FREE(head)
Release all memory.
Definition: array.h:203
#define ARRAY_GET(head, idx)
Return the element at index.
Definition: array.h:108
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
Definition: array.h:57
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition: helpers.c:317
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
void mutt_format_s(char *buf, size_t buflen, const char *prec, const char *s)
Format a simple string.
Definition: curs_lib.c:793
@ FR_DONE
Exit the Dialog.
Definition: dispatcher.h:35
@ FR_UNKNOWN
Unknown function.
Definition: dispatcher.h:33
@ FR_CONTINUE
Remain in the Dialog.
Definition: dispatcher.h:34
static const struct Mapping AliasHelp[]
Help Bar for the Alias dialog (address book)
Definition: dlg_alias.c:99
static bool dlg_select_alias(struct Buffer *buf, struct AliasMenuData *mdata)
Display a menu of Aliases.
Definition: dlg_alias.c:310
void alias_dialog(struct Mailbox *m, struct ConfigSubset *sub)
Open the aliases dialog.
Definition: dlg_alias.c:498
int alias_complete(char *buf, size_t buflen, struct ConfigSubset *sub)
Alias completion routine.
Definition: dlg_alias.c:380
static struct MuttWindow * alias_dialog_new(struct AliasMenuData *mdata)
Create an Alias Selection Dialog.
Definition: dlg_alias.c:275
bool alias_to_addrlist(struct AddressList *al, struct Alias *alias)
Turn an Alias into an AddressList.
Definition: dlg_query.c:118
struct Email * email_new(void)
Create a new Email.
Definition: email.c:78
Structs that make up an email.
struct Envelope * mutt_env_new(void)
Create a new Envelope.
Definition: envelope.c:43
Flags to control mutt_expando_format()
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
Definition: format_flags.h:35
uint8_t MuttFormatFlags
Flags for mutt_expando_format(), e.g. MUTT_FORMAT_FORCESUBJ.
Definition: format_flags.h:29
int menu_tagging_dispatcher(struct MuttWindow *win, int op)
Perform tagging operations on the Menu - Implements function_dispatcher_t -.
Definition: tagging.c:223
int global_function_dispatcher(struct MuttWindow *win, int op)
Perform a Global function - Implements function_dispatcher_t -.
Definition: global.c:164
int menu_function_dispatcher(struct MuttWindow *win, int op)
Perform a Menu function - Implements function_dispatcher_t -.
Definition: functions.c:320
int alias_function_dispatcher(struct MuttWindow *win, int op)
Perform a Alias function - Implements function_dispatcher_t -.
Definition: functions.c:333
static const char * alias_format_str(char *buf, size_t buflen, size_t col, int cols, char op, const char *src, const char *prec, const char *if_str, const char *else_str, intptr_t data, MuttFormatFlags flags)
Format a string for the alias list - Implements format_t -.
Definition: dlg_alias.c:124
void mutt_expando_format(char *buf, size_t buflen, size_t col, int cols, const char *src, format_t callback, intptr_t data, MuttFormatFlags flags)
Expand expandos (x) in a string -.
Definition: muttlib.c:777
#define mutt_warning(...)
Definition: logging.h:85
#define mutt_debug(LEVEL,...)
Definition: logging.h:84
static void alias_make_entry(struct Menu *menu, char *buf, size_t buflen, int line)
Format a menu item for the alias list - Implements Menu::make_entry() -.
Definition: dlg_alias.c:168
static int alias_tag(struct Menu *menu, int sel, int act)
Tag some aliases - Implements Menu::tag() -.
Definition: dlg_alias.c:183
static int alias_window_observer(struct NotifyCallback *nc)
Notification that a Window has changed - Implements observer_t -.
Definition: dlg_alias.c:246
static int alias_alias_observer(struct NotifyCallback *nc)
Notification that an Alias has changed - Implements observer_t -.
Definition: dlg_alias.c:199
int alias_config_observer(struct NotifyCallback *nc)
Notification that a Config Variable has changed - Implements observer_t -.
Definition: gui.c:43
int alias_recalc(struct MuttWindow *win)
Recalculate the display of the Alias Window - Implements MuttWindow::recalc() -.
Definition: gui.c:89
Convenience wrapper for the gui headers.
void simple_dialog_free(struct MuttWindow **ptr)
Destroy a simple index Dialog.
Definition: simple.c:166
struct MuttWindow * simple_dialog_new(enum MenuType mtype, enum WindowType wtype, const struct Mapping *help_data)
Create a simple index Dialog.
Definition: simple.c:129
void alias_set_title(struct MuttWindow *sbar, char *menu_name, char *limit)
Create a title string for the Menu.
Definition: gui.c:69
Shared code for the Alias and Query Dialogs.
int km_dokey(enum MenuType mtype)
Determine what a keypress should do.
Definition: keymap.c:795
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
Definition: keymap.c:1061
Manage keymappings.
@ LL_DEBUG5
Log at debug level 5.
Definition: logging.h:44
@ LL_DEBUG1
Log at debug level 1.
Definition: logging.h:40
#define FREE(x)
Definition: memory.h:43
#define MIN(a, b)
Definition: memory.h:31
GUI present the user with a selectable list.
#define MENU_REDRAW_FULL
Redraw everything.
Definition: lib.h:59
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
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition: menu.c:168
Convenience wrapper for the library headers.
#define N_(a)
Definition: message.h:32
#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
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition: string.c:250
int mutt_str_asprintf(char **strp, const char *fmt,...)
Definition: string.c:1031
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition: string.c:807
bool mutt_strn_equal(const char *a, const char *b, size_t num)
Check for equality of two strings (to a maximum), safely.
Definition: string.c:496
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition: string.c:567
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition: string.c:652
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
Definition: mutt_logging.c:74
NeoMutt Logging.
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
Definition: mutt_window.c:604
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
@ WT_DLG_ALIAS
Alias Dialog, dlg_select_alias()
Definition: mutt_window.h:77
@ WT_STATUS_BAR
Status Bar containing extra info about the Index/Pager/etc.
Definition: mutt_window.h:102
@ NT_WINDOW_DELETE
Window is about to be deleted.
Definition: mutt_window.h:206
Some miscellaneous functions.
@ NT_WINDOW
MuttWindow has changed, NotifyWindow, EventWindow.
Definition: notify_type.h:55
@ NT_CONFIG
Config has changed, NotifyConfig, EventConfig.
Definition: notify_type.h:43
@ NT_ALIAS
Alias has changed, NotifyAlias, EventAlias.
Definition: notify_type.h:37
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition: opcodes.c:46
All user-callable functions.
Match patterns to emails.
int mutt_pattern_alias_func(char *prompt, struct AliasMenuData *mdata, struct Menu *menu)
Perform some Pattern matching for Alias.
Definition: pattern.c:243
#define TAILQ_FOREACH(var, head, field)
Definition: queue.h:725
#define TAILQ_REMOVE(head, elm, field)
Definition: queue.h:841
#define TAILQ_HEAD_INITIALIZER(head)
Definition: queue.h:637
Convenience wrapper for the send headers.
int mutt_send_message(SendFlags flags, struct Email *e_templ, const char *tempfile, struct Mailbox *m, struct EmailList *el, struct ConfigSubset *sub)
Send an email.
Definition: send.c:2126
#define SEND_REVIEW_TO
Allow the user to edit the To field.
Definition: send.h:54
Sidebar functions.
Key value store.
#define NONULL(x)
Definition: string2.h:37
AliasView array wrapper with Pattern information -.
Definition: gui.h:52
char * limit
Limit being used.
Definition: gui.h:58
struct AliasViewArray ava
All Aliases/Queries.
Definition: gui.h:53
struct MuttWindow * sbar
Status Bar.
Definition: gui.h:59
struct Menu * menu
Menu.
Definition: gui.h:56
struct Buffer * query
Query string.
Definition: gui.h:57
char * title
Title for the status bar.
Definition: gui.h:60
struct ConfigSubset * sub
Config items.
Definition: gui.h:55
GUI data wrapping an Alias.
Definition: gui.h:36
bool is_visible
Is visible?
Definition: gui.h:43
struct Alias * alias
Alias.
Definition: gui.h:44
bool is_deleted
Is it deleted?
Definition: gui.h:42
bool is_tagged
Is it tagged?
Definition: gui.h:41
int num
Index number in list.
Definition: gui.h:37
A shortcut for an email address or addresses.
Definition: alias.h:34
char * comment
Free-form comment string.
Definition: alias.h:37
char * name
Short name.
Definition: alias.h:35
struct AddressList addr
List of Addresses the Alias expands to.
Definition: alias.h:36
String manipulation buffer.
Definition: buffer.h:34
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 AddressList to
Email's 'To' list.
Definition: envelope.h:60
An alias-change event.
Definition: alias.h:64
struct Alias * alias
Alias that changed.
Definition: alias.h:65
An Event that happened to a Window.
Definition: mutt_window.h:216
struct MuttWindow * win
Window that changed.
Definition: mutt_window.h:217
A mailbox.
Definition: mailbox.h:79
Mapping between user-readable string and a constant.
Definition: mapping.h:32
Definition: lib.h:69
struct MuttWindow * win
Window holding the Menu.
Definition: lib.h:76
void(* make_entry)(struct Menu *menu, char *buf, size_t buflen, int line)
Definition: lib.h:96
void(* mdata_free)(struct Menu *menu, void **ptr)
Definition: lib.h:152
int(* tag)(struct Menu *menu, int sel, int act)
Definition: lib.h:121
void * mdata
Private data.
Definition: lib.h:137
int max
Number of entries in the menu.
Definition: lib.h:71
bool custom_search
The menu implements its own non-Menusearch()-compatible search, trickle OP_SEARCH*.
Definition: lib.h:84
struct WindowState state
Current state of the Window.
Definition: mutt_window.h:127
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
Container for Accounts, Notifications.
Definition: neomutt.h:37
struct Notify * notify
Notifications handler.
Definition: neomutt.h:38
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
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
Definition: mutt_window.h:60
@ MENU_ALIAS
Select an email address by its alias.
Definition: type.h:37