NeoMutt  2025-12-11-596-g7cc1dd
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 "sort.h"
49
51struct MenuDefinition *MdAlias = NULL;
53struct MenuDefinition *MdQuery = NULL;
54
55// clang-format off
59static const struct MenuFuncOp OpAlias[] = { /* map: alias */
60 { "delete-entry", OP_DELETE },
61 { "exit", OP_EXIT },
62 { "limit", OP_MAIN_LIMIT },
63 { "mail", OP_MAIL },
64 { "sort-alias", OP_SORT },
65 { "sort-alias-reverse", OP_SORT_REVERSE },
66 { "tag-pattern", OP_MAIN_TAG_PATTERN },
67 { "undelete-entry", OP_UNDELETE },
68 { "untag-pattern", OP_MAIN_UNTAG_PATTERN },
69 { NULL, 0 },
70};
71
75const struct MenuFuncOp OpQuery[] = { /* map: query */
76 { "create-alias", OP_CREATE_ALIAS },
77 { "exit", OP_EXIT },
78 { "limit", OP_MAIN_LIMIT },
79 { "mail", OP_MAIL },
80 { "query", OP_QUERY },
81 { "query-append", OP_QUERY_APPEND },
82 { "sort", OP_SORT },
83 { "sort-reverse", OP_SORT_REVERSE },
84 { "tag-pattern", OP_MAIN_TAG_PATTERN },
85 { "untag-pattern", OP_MAIN_UNTAG_PATTERN },
86 { NULL, 0 },
87};
88
92static const struct MenuOpSeq AliasDefaultBindings[] = { /* map: alias */
93 { OP_DELETE, "d" },
94 { OP_EXIT, "q" },
95 { OP_MAIL, "m" },
96 { OP_MAIN_LIMIT, "l" },
97 { OP_MAIN_TAG_PATTERN, "T" },
98 { OP_MAIN_UNTAG_PATTERN, "\024" }, // <Ctrl-T>
99 { OP_SORT, "o" },
100 { OP_SORT_REVERSE, "O" },
101 { OP_TAG, "<space>" },
102 { OP_UNDELETE, "u" },
103 { 0, NULL },
104};
105
109static const struct MenuOpSeq QueryDefaultBindings[] = { /* map: query */
110 { OP_CREATE_ALIAS, "a" },
111 { OP_EXIT, "q" },
112 { OP_MAIL, "m" },
113 { OP_MAIN_LIMIT, "l" },
114 { OP_MAIN_TAG_PATTERN, "T" },
115 { OP_MAIN_UNTAG_PATTERN, "\024" }, // <Ctrl-T>
116 { OP_QUERY, "Q" },
117 { OP_QUERY_APPEND, "A" },
118 { OP_SORT, "o" },
119 { OP_SORT_REVERSE, "O" },
120 { OP_TAG, "<space>" },
121 { 0, NULL },
122};
123// clang-format on
124
128void alias_init_keys(struct SubMenu *sm_generic)
129{
130 struct MenuDefinition *md = NULL;
131 struct SubMenu *sm = NULL;
132
134 md = km_register_menu(MENU_ALIAS, "alias");
135 km_menu_add_submenu(md, sm);
136 km_menu_add_submenu(md, sm_generic);
138
139 MdAlias = md;
140
142 md = km_register_menu(MENU_QUERY, "query");
143 km_menu_add_submenu(md, sm);
144 km_menu_add_submenu(md, sm_generic);
146
147 MdQuery = md;
148}
149
153static int op_create_alias(struct AliasMenuData *mdata, const struct KeyEvent *event)
154{
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 AliasMenuData *mdata, const struct KeyEvent *event)
198{
199 struct Menu *menu = mdata->menu;
200 const int op = event->op;
201
202 if (menu->tag_prefix)
203 {
204 struct AliasView *avp = NULL;
205 ARRAY_FOREACH(avp, &mdata->ava)
206 {
207 if (avp->is_tagged)
208 avp->is_deleted = (op == OP_DELETE);
209 }
211 }
212 else
213 {
214 int index = menu_get_index(menu);
215 struct AliasView *av = ARRAY_GET(&mdata->ava, index);
216 if (!av)
217 return FR_NO_ACTION;
218
219 av->is_deleted = (op == OP_DELETE);
221 const bool c_resolve = cs_subset_bool(mdata->sub, "resolve");
222 if (c_resolve && (index < (menu->max - 1)))
223 {
224 menu_set_index(menu, index + 1);
226 }
227 }
228 return FR_SUCCESS;
229}
230
234static int op_exit(struct AliasMenuData *mdata, const struct KeyEvent *event)
235{
236 return FR_DONE;
237}
238
248static int op_generic_select_entry(struct AliasMenuData *mdata, const struct KeyEvent *event)
249{
250 struct Menu *menu = mdata->menu;
251 if (menu->tag_prefix)
252 {
253 // Untag any non-visible aliases
254 struct AliasView *avp = NULL;
255 ARRAY_FOREACH(avp, &mdata->ava)
256 {
257 if (avp->is_tagged && !avp->is_visible)
258 avp->is_tagged = false;
259 }
260 }
261 else
262 {
263 // Untag all but the current alias
264 struct AliasView *avp = NULL;
265 const int idx = menu_get_index(menu);
266 ARRAY_FOREACH(avp, &mdata->ava)
267 {
268 avp->is_tagged = (ARRAY_FOREACH_IDX_avp == idx);
269 }
270 }
271
272 return FR_CONTINUE;
273}
274
278static int op_main_limit(struct AliasMenuData *mdata, const struct KeyEvent *event)
279{
280 struct Menu *menu = mdata->menu;
281 int rc = mutt_pattern_alias_func(_("Limit to addresses matching: "), mdata,
282 PAA_VISIBLE, menu);
283 if (rc != 0)
284 return FR_NO_ACTION;
285
286 alias_array_sort(&mdata->ava, mdata->sub);
287 alias_set_title(mdata->sbar, mdata->title, mdata->limit);
289 window_redraw(NULL);
290
291 return FR_SUCCESS;
292}
293
297static int op_main_tag_pattern(struct AliasMenuData *mdata, const struct KeyEvent *event)
298{
299 struct Menu *menu = mdata->menu;
300 int rc = mutt_pattern_alias_func(_("Tag addresses matching: "), mdata, PAA_TAG, menu);
301 if (rc != 0)
302 return FR_NO_ACTION;
303
305 window_redraw(NULL);
306
307 return FR_SUCCESS;
308}
309
313static int op_main_untag_pattern(struct AliasMenuData *mdata, const struct KeyEvent *event)
314{
315 struct Menu *menu = mdata->menu;
316 int rc = mutt_pattern_alias_func(_("Untag addresses matching: "), mdata, PAA_UNTAG, menu);
317 if (rc != 0)
318 return FR_NO_ACTION;
319
321 window_redraw(NULL);
322
323 return FR_SUCCESS;
324}
325
333static int op_query(struct AliasMenuData *mdata, const struct KeyEvent *event)
334{
335 struct Buffer *buf = mdata->query;
336 if ((mw_get_field(_("Query: "), buf, MUTT_COMP_NO_FLAGS, HC_OTHER, NULL, NULL) != 0) ||
337 buf_is_empty(buf))
338 {
339 return FR_NO_ACTION;
340 }
341
342 const int op = event->op;
343 if (op == OP_QUERY)
344 {
345 ARRAY_FREE(&mdata->ava);
346 aliaslist_clear(mdata->aa);
347 }
348
349 struct Menu *menu = mdata->menu;
350 struct AliasArray aa = ARRAY_HEAD_INITIALIZER;
351
352 query_run(buf_string(buf), true, &aa, mdata->sub);
354 char title[256] = { 0 };
355 snprintf(title, sizeof(title), "%s%s", _("Query: "), buf_string(buf));
356 sbar_set_title(mdata->sbar, title);
357
358 if (ARRAY_EMPTY(&aa))
359 {
360 if (op == OP_QUERY)
361 menu->max = 0;
362 return FR_NO_ACTION;
363 }
364
365 struct Alias **ap = NULL;
366 ARRAY_FOREACH(ap, &aa)
367 {
368 alias_array_alias_add(&mdata->ava, *ap);
369 ARRAY_ADD(mdata->aa, *ap); // Transfer
370 }
371 ARRAY_FREE(&aa); // Free the array structure but not the aliases
372 alias_array_sort(&mdata->ava, mdata->sub);
373 menu->max = ARRAY_SIZE(&mdata->ava);
374 return FR_SUCCESS;
375}
376
386static int op_search(struct AliasMenuData *mdata, const struct KeyEvent *event)
387{
389 switch (event->op)
390 {
391 case OP_SEARCH:
392 flags |= SEARCH_PROMPT;
393 mdata->search_state->reverse = false;
394 break;
395 case OP_SEARCH_REVERSE:
396 flags |= SEARCH_PROMPT;
397 mdata->search_state->reverse = true;
398 break;
399 case OP_SEARCH_NEXT:
400 break;
401 case OP_SEARCH_OPPOSITE:
402 flags |= SEARCH_OPPOSITE;
403 break;
404 }
405
406 struct Menu *menu = mdata->menu;
407 int index = menu_get_index(menu);
408 index = mutt_search_alias_command(menu, index, mdata->search_state, flags);
409 if (index == -1)
410 return FR_NO_ACTION;
411
412 menu_set_index(menu, index);
413 return FR_SUCCESS;
414}
415
423static int op_sort(struct AliasMenuData *mdata, const struct KeyEvent *event)
424{
425 int sort = cs_subset_sort(mdata->sub, "alias_sort");
426 bool resort = true;
427 const int op = event->op;
428 bool reverse = (op == OP_SORT_REVERSE);
429
430 switch (mw_multi_choice(reverse ?
431 /* L10N: The highlighted letters must match the "Sort" options */
432 _("Rev-Sort (a)lias, (n)ame, (e)mail or (u)nsorted?") :
433 /* L10N: The highlighted letters must match the "Rev-Sort" options */
434 _("Sort (a)lias, (n)ame, (e)mail or (u)nsorted?"),
435 /* L10N: These must match the highlighted letters from "Sort" and "Rev-Sort" */
436 _("aneu")))
437 {
438 case -1: /* abort */
439 resort = false;
440 break;
441
442 case 1: /* (a)lias */
443 sort = ALIAS_SORT_ALIAS;
444 break;
445
446 case 2: /* (n)ame */
447 sort = ALIAS_SORT_NAME;
448 break;
449
450 case 3: /* (e)mail */
451 sort = ALIAS_SORT_EMAIL;
452 break;
453
454 case 4: /* (u)nsorted */
455 sort = ALIAS_SORT_UNSORTED;
456 break;
457 }
458
459 if (resort)
460 {
461 sort |= reverse ? SORT_REVERSE : 0;
462
463 // This will trigger a WA_RECALC
464 cs_subset_str_native_set(mdata->sub, "alias_sort", sort, NULL);
465 }
466
467 return FR_SUCCESS;
468}
469
470// -----------------------------------------------------------------------------
471
475static const struct AliasFunction AliasFunctions[] = {
476 // clang-format off
477 { OP_CREATE_ALIAS, op_create_alias },
478 { OP_DELETE, op_delete },
479 { OP_EXIT, op_exit },
480 { OP_GENERIC_SELECT_ENTRY, op_generic_select_entry },
481 { OP_MAIL, op_generic_select_entry },
482 { OP_MAIN_LIMIT, op_main_limit },
483 { OP_MAIN_TAG_PATTERN, op_main_tag_pattern },
484 { OP_MAIN_UNTAG_PATTERN, op_main_untag_pattern },
485 { OP_QUERY, op_query },
486 { OP_QUERY_APPEND, op_query },
487 { OP_SEARCH, op_search },
488 { OP_SEARCH_NEXT, op_search },
489 { OP_SEARCH_OPPOSITE, op_search },
490 { OP_SEARCH_REVERSE, op_search },
491 { OP_SORT, op_sort },
492 { OP_SORT_REVERSE, op_sort },
493 { OP_UNDELETE, op_delete },
494 { 0, NULL },
495 // clang-format on
496};
497
501int alias_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
502{
503 // The Dispatcher may be called on any Window in the Dialog
504 struct MuttWindow *dlg = dialog_find(win);
505 if (!event || !dlg || !dlg->wdata)
506 return FR_ERROR;
507
508 struct Menu *menu = dlg->wdata;
509 struct AliasMenuData *mdata = menu->mdata;
510 if (!mdata)
511 return FR_ERROR;
512
513 const int op = event->op;
514
515 int rc = FR_UNKNOWN;
516 for (size_t i = 0; AliasFunctions[i].op != OP_NULL; i++)
517 {
518 const struct AliasFunction *fn = &AliasFunctions[i];
519 if (fn->op == op)
520 {
521 rc = fn->function(mdata, event);
522 break;
523 }
524 }
525
526 if (rc == FR_UNKNOWN) // Not our function
527 return rc;
528
529 const char *result = dispatcher_get_retval_name(rc);
530 mutt_debug(LL_DEBUG1, "Handled %s (%d) -> %s\n", opcodes_get_name(op), op, NONULL(result));
531
532 return rc;
533}
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:75
struct MenuDefinition * MdQuery
Query Menu Definition.
Definition functions.c:53
struct MenuDefinition * MdAlias
Alias Menu Definition.
Definition functions.c:51
static const struct MenuOpSeq QueryDefaultBindings[]
Key bindings for the external Query Menu.
Definition functions.c:109
static const struct MenuOpSeq AliasDefaultBindings[]
Key bindings for the Alias Menu.
Definition functions.c:92
static const struct AliasFunction AliasFunctions[]
All the NeoMutt functions that the Alias supports.
Definition functions.c:475
void alias_init_keys(struct SubMenu *sm_generic)
Initialise the Alias Keybindings - Implements ::init_keys_api.
Definition functions.c:128
static const struct MenuFuncOp OpAlias[]
Functions for the Alias Menu.
Definition functions.c:59
Alias functions.
void alias_array_sort(struct AliasViewArray *ava, const struct ConfigSubset *sub)
Sort and reindex an AliasViewArray.
Definition sort.c:235
Email Aliases.
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:187
bool alias_to_addrlist(struct AddressList *al, struct Alias *alias)
Turn an Alias into an AddressList.
Definition dlg_query.c:118
Edit a string.
#define MUTT_COMP_NO_FLAGS
No flags are set.
Definition wdata.h:42
static int op_generic_select_entry(struct AliasMenuData *mdata, const struct KeyEvent *event)
select the current entry - Implements alias_function_t -
Definition functions.c:248
static int op_search(struct AliasMenuData *mdata, const struct KeyEvent *event)
search for a regular expression - Implements alias_function_t -
Definition functions.c:386
static int op_main_untag_pattern(struct AliasMenuData *mdata, const struct KeyEvent *event)
Untag messages matching a pattern - Implements alias_function_t -.
Definition functions.c:313
static int op_sort(struct AliasMenuData *mdata, const struct KeyEvent *event)
sort aliases - Implements alias_function_t -
Definition functions.c:423
static int op_create_alias(struct AliasMenuData *mdata, const struct KeyEvent *event)
create an alias from a message sender - Implements alias_function_t -
Definition functions.c:153
static int op_main_limit(struct AliasMenuData *mdata, const struct KeyEvent *event)
show only messages matching a pattern - Implements alias_function_t -
Definition functions.c:278
static int op_exit(struct AliasMenuData *mdata, const struct KeyEvent *event)
exit this menu - Implements alias_function_t -
Definition functions.c:234
static int op_query(struct AliasMenuData *mdata, const struct KeyEvent *event)
query external program for addresses - Implements alias_function_t -
Definition functions.c:333
static int op_delete(struct AliasMenuData *mdata, const struct KeyEvent *event)
delete the current entry - Implements alias_function_t -
Definition functions.c:197
static int op_main_tag_pattern(struct AliasMenuData *mdata, const struct KeyEvent *event)
Tag messages matching a pattern - Implements alias_function_t -.
Definition functions.c:297
int alias_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform a Alias function - Implements function_dispatcher_t -.
Definition functions.c:501
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:463
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:123
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
Definition init.c:91
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
Definition init.c:107
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
Definition init.c:136
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:188
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:164
#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:178
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.
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:186
int mutt_search_alias_command(struct Menu *menu, int cur, struct SearchState *state, SearchFlags flags)
Perform a search.
Definition pattern.c:635
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 NONULL(x)
Definition string2.h:44
A NeoMutt function.
Definition functions.h:59
int op
Op code, e.g. OP_SEARCH.
Definition functions.h:60
alias_function_t function
Function to call.
Definition functions.h:61
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 SearchState * search_state
State of the current search.
Definition gui.h:63
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
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.
bool reverse
search backwards
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