NeoMutt  2025-12-11-769-g906513
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions.c
Go to the documentation of this file.
1
23
29
30#include "config.h"
31#include <stdbool.h>
32#include <stdio.h>
33#include "mutt/lib.h"
34#include "address/lib.h"
35#include "config/lib.h"
36#include "core/lib.h"
37#include "gui/lib.h"
38#include "functions.h"
39#include "lib.h"
40#include "editor/lib.h"
41#include "history/lib.h"
42#include "key/lib.h"
43#include "menu/lib.h"
44#include "pattern/lib.h"
45#include "question/lib.h"
46#include "alias.h"
47#include "gui.h"
48#include "module_data.h"
49#include "sort.h"
50
51// clang-format off
55static const struct MenuFuncOp OpAlias[] = { /* map: alias */
56 { "delete-entry", OP_DELETE },
57 { "exit", OP_EXIT },
58 { "limit", OP_MAIN_LIMIT },
59 { "mail", OP_MAIL },
60 { "sort-alias", OP_SORT },
61 { "sort-alias-reverse", OP_SORT_REVERSE },
62 { "tag-pattern", OP_MAIN_TAG_PATTERN },
63 { "undelete-entry", OP_UNDELETE },
64 { "untag-pattern", OP_MAIN_UNTAG_PATTERN },
65 { NULL, 0 },
66};
67
71const struct MenuFuncOp OpQuery[] = { /* map: query */
72 { "create-alias", OP_CREATE_ALIAS },
73 { "exit", OP_EXIT },
74 { "limit", OP_MAIN_LIMIT },
75 { "mail", OP_MAIL },
76 { "query", OP_QUERY },
77 { "query-append", OP_QUERY_APPEND },
78 { "sort", OP_SORT },
79 { "sort-reverse", OP_SORT_REVERSE },
80 { "tag-pattern", OP_MAIN_TAG_PATTERN },
81 { "untag-pattern", OP_MAIN_UNTAG_PATTERN },
82 { NULL, 0 },
83};
84
88static const struct MenuOpSeq AliasDefaultBindings[] = { /* map: alias */
89 { OP_DELETE, "d" },
90 { OP_EXIT, "q" },
91 { OP_MAIL, "m" },
92 { OP_MAIN_LIMIT, "l" },
93 { OP_MAIN_TAG_PATTERN, "T" },
94 { OP_MAIN_UNTAG_PATTERN, "\024" }, // <Ctrl-T>
95 { OP_SORT, "o" },
96 { OP_SORT_REVERSE, "O" },
97 { OP_TAG, "<space>" },
98 { OP_UNDELETE, "u" },
99 { 0, NULL },
100};
101
105static const struct MenuOpSeq QueryDefaultBindings[] = { /* map: query */
106 { OP_CREATE_ALIAS, "a" },
107 { OP_EXIT, "q" },
108 { OP_MAIL, "m" },
109 { OP_MAIN_LIMIT, "l" },
110 { OP_MAIN_TAG_PATTERN, "T" },
111 { OP_MAIN_UNTAG_PATTERN, "\024" }, // <Ctrl-T>
112 { OP_QUERY, "Q" },
113 { OP_QUERY_APPEND, "A" },
114 { OP_SORT, "o" },
115 { OP_SORT_REVERSE, "O" },
116 { OP_TAG, "<space>" },
117 { 0, NULL },
118};
119// clang-format on
120
124void alias_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
125{
127 ASSERT(mod_data);
128
129 struct MenuDefinition *md = NULL;
130 struct SubMenu *sm = NULL;
131
133 md = km_register_menu(MENU_ALIAS, "alias");
134 km_menu_add_submenu(md, sm);
135 km_menu_add_submenu(md, sm_generic);
137
138 mod_data->menu_alias = md;
139
141 md = km_register_menu(MENU_QUERY, "query");
142 km_menu_add_submenu(md, sm);
143 km_menu_add_submenu(md, sm_generic);
145
146 mod_data->menu_query = md;
147}
148
152static int op_create_alias(struct AliasFunctionData *fdata, const struct KeyEvent *event)
153{
154 struct AliasMenuData *mdata = fdata->wdata;
155 struct Menu *menu = mdata->menu;
156
157 if (menu->tag_prefix)
158 {
159 struct AddressList naddr = TAILQ_HEAD_INITIALIZER(naddr);
160
161 struct AliasView *avp = NULL;
162 ARRAY_FOREACH(avp, &mdata->ava)
163 {
164 if (!avp->is_tagged)
165 continue;
166
167 struct AddressList al = TAILQ_HEAD_INITIALIZER(al);
168 if (alias_to_addrlist(&al, avp->alias))
169 {
170 mutt_addrlist_copy(&naddr, &al, false);
172 }
173 }
174
175 alias_create(&naddr, mdata->sub);
176 mutt_addrlist_clear(&naddr);
177 }
178 else
179 {
180 struct AliasView *av = ARRAY_GET(&mdata->ava, menu_get_index(menu));
181 if (!av)
182 return FR_NO_ACTION;
183
184 struct AddressList al = TAILQ_HEAD_INITIALIZER(al);
185 if (alias_to_addrlist(&al, av->alias))
186 {
187 alias_create(&al, mdata->sub);
189 }
190 }
191 return FR_SUCCESS;
192}
193
197static int op_delete(struct AliasFunctionData *fdata, const struct KeyEvent *event)
198{
199 struct AliasMenuData *mdata = fdata->wdata;
200 struct Menu *menu = mdata->menu;
201 const int op = event->op;
202
203 if (menu->tag_prefix)
204 {
205 struct AliasView *avp = NULL;
206 ARRAY_FOREACH(avp, &mdata->ava)
207 {
208 if (avp->is_tagged)
209 avp->is_deleted = (op == OP_DELETE);
210 }
212 }
213 else
214 {
215 int index = menu_get_index(menu);
216 struct AliasView *av = ARRAY_GET(&mdata->ava, index);
217 if (!av)
218 return FR_NO_ACTION;
219
220 av->is_deleted = (op == OP_DELETE);
222 const bool c_resolve = cs_subset_bool(mdata->sub, "resolve");
223 if (c_resolve && (index < (menu->max - 1)))
224 {
225 menu_set_index(menu, index + 1);
227 }
228 }
229 return FR_SUCCESS;
230}
231
235static int op_exit(struct AliasFunctionData *fdata, const struct KeyEvent *event)
236{
237 return FR_DONE;
238}
239
249static int op_generic_select_entry(struct AliasFunctionData *fdata, const struct KeyEvent *event)
250{
251 struct AliasMenuData *mdata = fdata->wdata;
252 struct Menu *menu = mdata->menu;
253 if (menu->tag_prefix)
254 {
255 // Untag any non-visible aliases
256 struct AliasView *avp = NULL;
257 ARRAY_FOREACH(avp, &mdata->ava)
258 {
259 if (avp->is_tagged && !avp->is_visible)
260 avp->is_tagged = false;
261 }
262 }
263 else
264 {
265 // Untag all but the current alias
266 struct AliasView *avp = NULL;
267 const int idx = menu_get_index(menu);
268 ARRAY_FOREACH(avp, &mdata->ava)
269 {
270 avp->is_tagged = (ARRAY_FOREACH_IDX_avp == idx);
271 }
272 }
273
274 return FR_CONTINUE;
275}
276
280static int op_main_limit(struct AliasFunctionData *fdata, const struct KeyEvent *event)
281{
282 struct AliasMenuData *mdata = fdata->wdata;
283 struct Menu *menu = mdata->menu;
284 int rc = mutt_pattern_alias_func(_("Limit to addresses matching: "), mdata,
285 PAA_VISIBLE, menu);
286 if (rc != 0)
287 return FR_NO_ACTION;
288
289 alias_array_sort(&mdata->ava, mdata->sub);
290 alias_set_title(mdata->sbar, mdata->title, mdata->limit);
292 window_redraw(NULL);
293
294 return FR_SUCCESS;
295}
296
300static int op_main_tag_pattern(struct AliasFunctionData *fdata, const struct KeyEvent *event)
301{
302 struct AliasMenuData *mdata = fdata->wdata;
303 struct Menu *menu = mdata->menu;
304 int rc = mutt_pattern_alias_func(_("Tag addresses matching: "), mdata, PAA_TAG, menu);
305 if (rc != 0)
306 return FR_NO_ACTION;
307
309 window_redraw(NULL);
310
311 return FR_SUCCESS;
312}
313
317static int op_main_untag_pattern(struct AliasFunctionData *fdata, const struct KeyEvent *event)
318{
319 struct AliasMenuData *mdata = fdata->wdata;
320 struct Menu *menu = mdata->menu;
321 int rc = mutt_pattern_alias_func(_("Untag addresses matching: "), mdata, PAA_UNTAG, menu);
322 if (rc != 0)
323 return FR_NO_ACTION;
324
326 window_redraw(NULL);
327
328 return FR_SUCCESS;
329}
330
338static int op_query(struct AliasFunctionData *fdata, const struct KeyEvent *event)
339{
340 struct AliasMenuData *mdata = fdata->wdata;
341 struct Buffer *buf = mdata->query;
342 if ((mw_get_field(_("Query: "), buf, MUTT_COMP_NO_FLAGS, HC_OTHER, NULL, NULL) != 0) ||
343 buf_is_empty(buf))
344 {
345 return FR_NO_ACTION;
346 }
347
348 const int op = event->op;
349 if (op == OP_QUERY)
350 {
351 ARRAY_FREE(&mdata->ava);
352 aliaslist_clear(mdata->aa);
353 }
354
355 struct Menu *menu = mdata->menu;
356 struct AliasArray aa = ARRAY_HEAD_INITIALIZER;
357
358 query_run(buf_string(buf), true, &aa, mdata->sub);
360 char title[256] = { 0 };
361 snprintf(title, sizeof(title), "%s%s", _("Query: "), buf_string(buf));
362 sbar_set_title(mdata->sbar, title);
363
364 if (ARRAY_EMPTY(&aa))
365 {
366 if (op == OP_QUERY)
367 menu->max = 0;
368 return FR_NO_ACTION;
369 }
370
371 struct Alias **ap = NULL;
372 ARRAY_FOREACH(ap, &aa)
373 {
374 alias_array_alias_add(&mdata->ava, *ap);
375 ARRAY_ADD(mdata->aa, *ap); // Transfer
376 }
377 ARRAY_FREE(&aa); // Free the array structure but not the aliases
378 alias_array_sort(&mdata->ava, mdata->sub);
379 menu->max = ARRAY_SIZE(&mdata->ava);
380 return FR_SUCCESS;
381}
382
392static int op_search(struct AliasFunctionData *fdata, const struct KeyEvent *event)
393{
394 struct AliasMenuData *mdata = fdata->wdata;
396 switch (event->op)
397 {
398 case OP_SEARCH:
399 flags |= SEARCH_PROMPT;
400 mdata->search_state->reverse = false;
401 break;
402 case OP_SEARCH_REVERSE:
403 flags |= SEARCH_PROMPT;
404 mdata->search_state->reverse = true;
405 break;
406 case OP_SEARCH_NEXT:
407 break;
408 case OP_SEARCH_OPPOSITE:
409 flags |= SEARCH_OPPOSITE;
410 break;
411 }
412
413 struct Menu *menu = mdata->menu;
414 int index = menu_get_index(menu);
415 index = mutt_search_alias_command(menu, index, mdata->search_state, flags);
416 if (index == -1)
417 return FR_NO_ACTION;
418
419 menu_set_index(menu, index);
420 return FR_SUCCESS;
421}
422
430static int op_sort(struct AliasFunctionData *fdata, const struct KeyEvent *event)
431{
432 struct AliasMenuData *mdata = fdata->wdata;
433 int sort = cs_subset_sort(mdata->sub, "alias_sort");
434 bool resort = true;
435 const int op = event->op;
436 bool reverse = (op == OP_SORT_REVERSE);
437
438 switch (mw_multi_choice(reverse ?
439 /* L10N: The highlighted letters must match the "Sort" options */
440 _("Rev-Sort (a)lias, (n)ame, (e)mail or (u)nsorted?") :
441 /* L10N: The highlighted letters must match the "Rev-Sort" options */
442 _("Sort (a)lias, (n)ame, (e)mail or (u)nsorted?"),
443 /* L10N: These must match the highlighted letters from "Sort" and "Rev-Sort" */
444 _("aneu")))
445 {
446 case -1: /* abort */
447 resort = false;
448 break;
449
450 case 1: /* (a)lias */
451 sort = ALIAS_SORT_ALIAS;
452 break;
453
454 case 2: /* (n)ame */
455 sort = ALIAS_SORT_NAME;
456 break;
457
458 case 3: /* (e)mail */
459 sort = ALIAS_SORT_EMAIL;
460 break;
461
462 case 4: /* (u)nsorted */
463 sort = ALIAS_SORT_UNSORTED;
464 break;
465 }
466
467 if (resort)
468 {
469 sort |= reverse ? SORT_REVERSE : 0;
470
471 // This will trigger a WA_RECALC
472 cs_subset_str_native_set(mdata->sub, "alias_sort", sort, NULL);
473 }
474
475 return FR_SUCCESS;
476}
477
478// -----------------------------------------------------------------------------
479
483static const struct AliasFunction AliasFunctions[] = {
484 // clang-format off
485 { OP_CREATE_ALIAS, op_create_alias },
486 { OP_DELETE, op_delete },
487 { OP_EXIT, op_exit },
488 { OP_GENERIC_SELECT_ENTRY, op_generic_select_entry },
489 { OP_MAIL, op_generic_select_entry },
490 { OP_MAIN_LIMIT, op_main_limit },
491 { OP_MAIN_TAG_PATTERN, op_main_tag_pattern },
492 { OP_MAIN_UNTAG_PATTERN, op_main_untag_pattern },
493 { OP_QUERY, op_query },
494 { OP_QUERY_APPEND, op_query },
495 { OP_SEARCH, op_search },
496 { OP_SEARCH_NEXT, op_search },
497 { OP_SEARCH_OPPOSITE, op_search },
498 { OP_SEARCH_REVERSE, op_search },
499 { OP_SORT, op_sort },
500 { OP_SORT_REVERSE, op_sort },
501 { OP_UNDELETE, op_delete },
502 { 0, NULL },
503 // clang-format on
504};
505
509int alias_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
510{
511 // The Dispatcher may be called on any Window in the Dialog
512 struct MuttWindow *dlg = dialog_find(win);
513 if (!event || !dlg || !dlg->wdata)
514 return FR_ERROR;
515
516 struct Menu *menu = dlg->wdata;
517 struct AliasMenuData *mdata = menu->mdata;
518 if (!mdata)
519 return FR_ERROR;
520
521 const int op = event->op;
522
523 struct AliasFunctionData fdata = {
524 .n = NeoMutt,
525 .wdata = mdata,
526 };
527
528 int rc = FR_UNKNOWN;
529 for (size_t i = 0; AliasFunctions[i].op != OP_NULL; i++)
530 {
531 const struct AliasFunction *fn = &AliasFunctions[i];
532 if (fn->op == op)
533 {
534 rc = fn->function(&fdata, event);
535 break;
536 }
537 }
538
539 if (rc == FR_UNKNOWN) // Not our function
540 return rc;
541
542 const char *result = dispatcher_get_retval_name(rc);
543 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
544
545 return rc;
546}
void mutt_addrlist_copy(struct AddressList *dst, const struct AddressList *src, bool prune)
Copy a list of addresses into another list.
Definition address.c:774
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
Definition address.c:1469
Email Address Handling.
const struct MenuFuncOp OpQuery[]
Functions for the external Query Menu.
Definition functions.c:71
static const struct MenuOpSeq QueryDefaultBindings[]
Key bindings for the external Query Menu.
Definition functions.c:105
static const struct MenuOpSeq AliasDefaultBindings[]
Key bindings for the Alias Menu.
Definition functions.c:88
static const struct AliasFunction AliasFunctions[]
All the NeoMutt functions that the Alias supports.
Definition functions.c:483
void alias_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Alias Keybindings - Implements ::init_keys_api.
Definition functions.c:124
static const struct MenuFuncOp OpAlias[]
Functions for the Alias Menu.
Definition functions.c:55
Alias functions.
void alias_array_sort(struct AliasViewArray *ava, const struct ConfigSubset *sub)
Sort and reindex an AliasViewArray.
Definition sort.c:235
Email Aliases.
Alias private Module data.
Address book sorting functions.
@ ALIAS_SORT_UNSORTED
Sort by the order the Aliases were configured.
Definition sort.h:34
@ ALIAS_SORT_NAME
Sort by Real Name.
Definition sort.h:33
@ ALIAS_SORT_EMAIL
Sort by Email Address.
Definition sort.h:32
@ ALIAS_SORT_ALIAS
Sort by Alias short name.
Definition sort.h:31
void aliaslist_clear(struct AliasArray *aa)
Empty a List of Aliases.
Definition alias.c:698
void alias_create(struct AddressList *al, const struct ConfigSubset *sub)
Create a new Alias from an Address.
Definition alias.c:368
Representation of a single alias to an email address.
int alias_array_alias_add(struct AliasViewArray *ava, struct Alias *alias)
Add an Alias to the AliasViewArray.
Definition array.c:47
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
Definition array.h:157
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition array.h:223
#define ARRAY_EMPTY(head)
Check if an array is empty.
Definition array.h:74
#define ARRAY_SIZE(head)
The number of elements stored.
Definition array.h:87
#define ARRAY_FREE(head)
Release all memory.
Definition array.h:209
#define ARRAY_GET(head, idx)
Return the element at index.
Definition array.h:109
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
Definition array.h:58
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
Definition buffer.c:291
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Definition helpers.c:47
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Definition helpers.c:266
Convenience wrapper for the config headers.
#define SORT_REVERSE
Reverse the order of the sort.
Definition sort.h:40
Convenience wrapper for the core headers.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition dialog.c:89
const char * dispatcher_get_retval_name(int rv)
Get the name of a return value.
Definition dispatcher.c:54
@ FR_SUCCESS
Valid function - successfully performed.
Definition dispatcher.h:40
@ FR_DONE
Exit the Dialog.
Definition dispatcher.h:36
@ FR_UNKNOWN
Unknown function.
Definition dispatcher.h:34
@ FR_ERROR
Valid function - error occurred.
Definition dispatcher.h:39
@ FR_CONTINUE
Remain in the Dialog.
Definition dispatcher.h:35
@ FR_NO_ACTION
Valid function - no action performed.
Definition dispatcher.h:38
int query_run(const char *s, bool verbose, struct AliasArray *aa, const struct ConfigSubset *sub)
Run an external program to find Addresses.
Definition dlg_query.c:188
bool alias_to_addrlist(struct AddressList *al, struct Alias *alias)
Turn an Alias into an AddressList.
Definition dlg_query.c:119
Edit a string.
#define MUTT_COMP_NO_FLAGS
No flags are set.
Definition wdata.h:42
static int op_main_limit(struct AliasFunctionData *fdata, const struct KeyEvent *event)
show only messages matching a pattern - Implements alias_function_t -
Definition functions.c:280
static int op_query(struct AliasFunctionData *fdata, const struct KeyEvent *event)
query external program for addresses - Implements alias_function_t -
Definition functions.c:338
static int op_create_alias(struct AliasFunctionData *fdata, const struct KeyEvent *event)
create an alias from a message sender - Implements alias_function_t -
Definition functions.c:152
static int op_main_untag_pattern(struct AliasFunctionData *fdata, const struct KeyEvent *event)
Untag messages matching a pattern - Implements alias_function_t -.
Definition functions.c:317
static int op_main_tag_pattern(struct AliasFunctionData *fdata, const struct KeyEvent *event)
Tag messages matching a pattern - Implements alias_function_t -.
Definition functions.c:300
static int op_exit(struct AliasFunctionData *fdata, const struct KeyEvent *event)
exit this menu - Implements alias_function_t -
Definition functions.c:235
static int op_delete(struct AliasFunctionData *fdata, const struct KeyEvent *event)
delete the current entry - Implements alias_function_t -
Definition functions.c:197
static int op_search(struct AliasFunctionData *fdata, const struct KeyEvent *event)
search for a regular expression - Implements alias_function_t -
Definition functions.c:392
static int op_generic_select_entry(struct AliasFunctionData *fdata, const struct KeyEvent *event)
select the current entry - Implements alias_function_t -
Definition functions.c:249
static int op_sort(struct AliasFunctionData *fdata, const struct KeyEvent *event)
sort aliases - Implements alias_function_t -
Definition functions.c:430
int alias_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform a Alias function - Implements function_dispatcher_t -.
Definition functions.c:509
int mw_get_field(const char *prompt, struct Buffer *buf, CompletionFlags complete, enum HistoryClass hclass, const struct CompleteOps *comp_api, void *cdata)
Ask the user for a string -.
Definition window.c:467
int mw_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question -.
Definition question.c:62
#define mutt_debug(LEVEL,...)
Definition logging2.h:91
Convenience wrapper for the gui headers.
void alias_set_title(struct MuttWindow *sbar, char *menu_name, char *limit)
Create a title string for the Menu.
Definition gui.c:72
Shared code for the Alias and Query Dialogs.
Read/write command history from/to a file.
@ HC_OTHER
Miscellaneous strings.
Definition lib.h:60
void km_menu_add_submenu(struct MenuDefinition *md, struct SubMenu *sm)
Add a SubMenu to a Menu Definition.
Definition init.c:121
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
Definition init.c:87
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
Definition init.c:104
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
Definition init.c:134
Manage keymappings.
@ LL_DEBUG1
Log at debug level 1.
Definition logging2.h:45
GUI present the user with a selectable list.
#define MENU_REDRAW_FULL
Redraw everything.
Definition lib.h:60
#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:189
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:165
#define MENU_REDRAW_CURRENT
Redraw the current line of the menu.
Definition lib.h:59
MenuRedrawFlags menu_set_index(struct Menu *menu, int index)
Set the current selection in the Menu.
Definition menu.c:179
@ MODULE_ID_ALIAS
ModuleAlias, Alias
Definition module_api.h:48
Convenience wrapper for the library headers.
#define _(a)
Definition message.h:28
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:665
const char * opcodes_get_name(int op)
Get the name of an opcode.
Definition opcodes.c:48
Match patterns to emails.
@ PAA_VISIBLE
Set AliasView.is_visible and hide the rest.
Definition lib.h:191
@ PAA_TAG
Set AliasView.is_tagged, but don't touch the others.
Definition lib.h:189
@ PAA_UNTAG
Unset AliasView.is_tagged, but don't touch the others.
Definition lib.h:190
int mutt_pattern_alias_func(char *prompt, struct AliasMenuData *mdata, enum PatternAlias action, struct Menu *menu)
Perform some Pattern matching for Alias.
Definition pattern.c:170
int mutt_search_alias_command(struct Menu *menu, int cur, struct SearchState *state, SearchFlags flags)
Perform a search.
Definition pattern.c:619
Ask the user a question.
#define TAILQ_HEAD_INITIALIZER(head)
Definition queue.h:694
void sbar_set_title(struct MuttWindow *win, const char *title)
Set the title for the Simple Bar.
Definition sbar.c:227
#define SEARCH_OPPOSITE
Search in the opposite direction.
uint8_t SearchFlags
Flags for a specific search, e.g. SEARCH_PROMPT.
#define SEARCH_NO_FLAGS
No flags are set.
#define SEARCH_PROMPT
Ask for search input.
#define ASSERT(COND)
Definition signal2.h:59
#define NONULL(x)
Definition string2.h:44
Data passed to Alias worker functions.
Definition functions.h:40
struct AliasMenuData * wdata
Alias menu data.
Definition functions.h:42
A NeoMutt function.
Definition functions.h:64
int op
Op code, e.g. OP_SEARCH.
Definition functions.h:65
alias_function_t function
Function to call.
Definition functions.h:66
AliasView array wrapper with Pattern information -.
Definition gui.h:54
struct AliasViewArray ava
All Aliases/Queries.
Definition gui.h:55
struct AliasArray * aa
Alias data.
Definition gui.h:56
struct MuttWindow * sbar
Status Bar.
Definition gui.h:61
struct Menu * menu
Menu.
Definition gui.h:58
struct Buffer * query
Query string.
Definition gui.h:59
struct ConfigSubset * sub
Config items.
Definition gui.h:57
Alias private Module data.
Definition module_data.h:33
struct MenuDefinition * menu_query
Query menu definition.
Definition module_data.h:43
struct MenuDefinition * menu_alias
Alias menu definition.
Definition module_data.h:42
GUI data wrapping an Alias.
Definition gui.h:38
bool is_visible
Is visible?
Definition gui.h:45
struct Alias * alias
Alias.
Definition gui.h:46
bool is_deleted
Is it deleted?
Definition gui.h:44
bool is_tagged
Is it tagged?
Definition gui.h:43
A shortcut for an email address or addresses.
Definition alias.h:35
String manipulation buffer.
Definition buffer.h:36
An event such as a keypress.
Definition get.h:50
int op
Function opcode, e.g. OP_HELP.
Definition get.h:52
Functions for a Dialog or Window.
Definition menu.h:80
Mapping between a function and an operation.
Definition menu.h:38
Mapping between an operation and a key sequence.
Definition menu.h:48
Definition lib.h:80
void * mdata
Private data.
Definition lib.h:149
bool tag_prefix
User has pressed <tag-prefix>
Definition lib.h:86
int max
Number of entries in the menu.
Definition lib.h:82
void * wdata
Private data.
Container for Accounts, Notifications.
Definition neomutt.h:41
Collection of related functions.
Definition menu.h:68
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:303
@ MENU_QUERY
Select from results of external query.
Definition type.h:48
@ MENU_ALIAS
Select an email address by its alias.
Definition type.h:34