56 {
"delete-entry", OP_DELETE },
58 {
"limit", OP_MAIN_LIMIT },
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 },
72 {
"create-alias", OP_CREATE_ALIAS },
74 {
"limit", OP_MAIN_LIMIT },
76 {
"query", OP_QUERY },
77 {
"query-append", OP_QUERY_APPEND },
79 {
"sort-reverse", OP_SORT_REVERSE },
80 {
"tag-pattern", OP_MAIN_TAG_PATTERN },
81 {
"untag-pattern", OP_MAIN_UNTAG_PATTERN },
92 { OP_MAIN_LIMIT,
"l" },
93 { OP_MAIN_TAG_PATTERN,
"T" },
94 { OP_MAIN_UNTAG_PATTERN,
"\024" },
96 { OP_SORT_REVERSE,
"O" },
97 { OP_TAG,
"<space>" },
106 { OP_CREATE_ALIAS,
"a" },
109 { OP_MAIN_LIMIT,
"l" },
110 { OP_MAIN_TAG_PATTERN,
"T" },
111 { OP_MAIN_UNTAG_PATTERN,
"\024" },
113 { OP_QUERY_APPEND,
"A" },
115 { OP_SORT_REVERSE,
"O" },
116 { OP_TAG,
"<space>" },
228 if ((index < 0) || (index >= menu->
max))
231 int n = (count > 1) ? count : 1;
232 if ((index + n) > menu->
max)
233 n = menu->
max - index;
235 for (
int i = 0; i < n; i++)
278 const bool deleted = (
event->op == OP_DELETE);
300 if (c_resolve && ((index + num) < menu->
max))
322 int num =
event->count;
330 if ((num < 1) || (num > menu->
max))
394 if (event->
count > 0)
479 const int op =
event->op;
491 char title[256] = { 0 };
492 snprintf(title,
sizeof(title),
"%s%s",
_(
"Query: "),
buf_string(buf));
502 struct Alias **ap = NULL;
531 mdata->search_state->reverse =
false;
533 case OP_SEARCH_REVERSE:
535 mdata->search_state->reverse =
true;
539 case OP_SEARCH_OPPOSITE:
566 const int op =
event->op;
567 bool reverse = (op == OP_SORT_REVERSE);
571 _(
"Rev-Sort (a)lias, (n)ame, (e)mail or (u)nsorted?") :
573 _(
"Sort (a)lias, (n)ame, (e)mail or (u)nsorted?"),
644 if (!event || !dlg || !dlg->
wdata)
652 const int op =
event->op;
void mutt_addrlist_copy(struct AddressList *dst, const struct AddressList *src, bool prune)
Copy a list of addresses into another list.
void mutt_addrlist_clear(struct AddressList *al)
Unlink and free all Address in an AddressList.
const struct MenuFuncOp OpQuery[]
Functions for the external Query Menu.
static const struct MenuOpSeq QueryDefaultBindings[]
Key bindings for the external Query Menu.
static const struct MenuOpSeq AliasDefaultBindings[]
Key bindings for the Alias Menu.
static int alias_add_selection(struct AliasViewPtrArray *avpa, struct AliasMenuData *mdata, bool tagged, int count)
Build a working set of AliasView pointers for an action.
static const struct AliasFunction AliasFunctions[]
All the NeoMutt functions that the Alias supports.
static void alias_apply_set_deleted(struct AliasViewPtrArray *avpa, bool deleted)
Apply the deleted flag to a working set of AliasViews.
void alias_init_keys(struct NeoMutt *n, struct SubMenu *sm_generic)
Initialise the Alias Keybindings - Implements ::init_keys_api.
static int alias_select_entries(struct AliasMenuData *mdata, int count)
Select entries to return from the Alias Dialog.
static const struct MenuFuncOp OpAlias[]
Functions for the Alias Menu.
void alias_array_sort(struct AliasViewArray *ava, const struct ConfigSubset *sub)
Sort and reindex an AliasViewArray.
Alias private Module data.
Address book sorting functions.
@ ALIAS_SORT_UNSORTED
Sort by the order the Aliases were configured.
@ ALIAS_SORT_NAME
Sort by Real Name.
@ ALIAS_SORT_EMAIL
Sort by Email Address.
@ ALIAS_SORT_ALIAS
Sort by Alias short name.
void aliaslist_clear(struct AliasArray *aa)
Empty a List of Aliases.
void alias_create(struct AddressList *al, const struct ConfigSubset *sub)
Create a new Alias from an Address.
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.
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_EMPTY(head)
Check if an array is empty.
#define ARRAY_SIZE(head)
The number of elements stored.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_GET(head, idx)
Return the element at index.
#define ARRAY_HEAD_INITIALIZER
Static initializer for arrays.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
Convenience wrapper for the config headers.
#define SORT_REVERSE
Reverse the order of the sort.
Convenience wrapper for the core headers.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
const char * dispatcher_get_retval_name(int rv)
Get the name of a return value.
void dispatcher_flush_on_error(int rv)
Flush pending keys after a dispatch error.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_DONE
Exit the Dialog.
@ FR_UNKNOWN
Unknown function.
@ FR_ERROR
Valid function - error occurred.
@ FR_CONTINUE
Remain in the Dialog.
@ FR_NO_ACTION
Valid function - no action performed.
int query_run(const char *s, bool verbose, struct AliasArray *aa, const struct ConfigSubset *sub)
Run an external program to find Addresses.
bool alias_to_addrlist(struct AddressList *al, struct Alias *alias)
Turn an Alias into an AddressList.
@ MUTT_COMP_NONE
No flags are set.
static int op_main_limit(struct AliasFunctionData *fdata, const struct KeyEvent *event)
show only messages matching a pattern - Implements alias_function_t -
static int op_query(struct AliasFunctionData *fdata, const struct KeyEvent *event)
query external program for addresses - Implements alias_function_t -
static int op_create_alias(struct AliasFunctionData *fdata, const struct KeyEvent *event)
create an alias from a message sender - Implements alias_function_t -
static int op_jump(struct AliasFunctionData *fdata, const struct KeyEvent *event)
Jump to an index number - Implements alias_function_t -.
static int op_main_untag_pattern(struct AliasFunctionData *fdata, const struct KeyEvent *event)
Untag messages matching a pattern - Implements alias_function_t -.
static int op_main_tag_pattern(struct AliasFunctionData *fdata, const struct KeyEvent *event)
Tag messages matching a pattern - Implements alias_function_t -.
static int op_exit(struct AliasFunctionData *fdata, const struct KeyEvent *event)
exit this menu - Implements alias_function_t -
static int op_mail(struct AliasFunctionData *fdata, const struct KeyEvent *event)
mail the selected entries - Implements alias_function_t -
static int op_delete(struct AliasFunctionData *fdata, const struct KeyEvent *event)
delete the current entry - Implements alias_function_t -
static int op_search(struct AliasFunctionData *fdata, const struct KeyEvent *event)
search for a regular expression - Implements alias_function_t -
static int op_generic_select_entry(struct AliasFunctionData *fdata, const struct KeyEvent *event)
select the current entry - Implements alias_function_t -
static int op_sort(struct AliasFunctionData *fdata, const struct KeyEvent *event)
sort aliases - Implements alias_function_t -
int alias_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform a Alias function - Implements function_dispatcher_t -.
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 -.
int mw_multi_choice(const char *prompt, const char *letters)
Offer the user a multiple choice question -.
#define mutt_warning(...)
#define mutt_debug(LEVEL,...)
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.
Shared code for the Alias and Query Dialogs.
Read/write command history from/to a file.
@ HC_OTHER
Miscellaneous strings.
void km_menu_add_submenu(struct MenuDefinition *md, struct SubMenu *sm)
Add a SubMenu to a Menu Definition.
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
@ LL_DEBUG1
Log at debug level 1.
@ MODULE_ID_ALIAS
ModuleAlias, Alias
Convenience wrapper for the library headers.
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.
const char * opcodes_get_name(int op)
Get the name of an opcode.
Match patterns to emails.
@ PAA_VISIBLE
Set AliasView.is_visible and hide the rest.
@ PAA_TAG
Set AliasView.is_tagged, but don't touch the others.
@ PAA_UNTAG
Unset AliasView.is_tagged, but don't touch the others.
int mutt_pattern_alias_func(char *prompt, struct AliasMenuData *mdata, enum PatternAlias action, struct Menu *menu)
Perform some Pattern matching for Alias.
int mutt_search_alias_command(struct Menu *menu, int cur, struct SearchState *state, SearchFlags flags)
Perform a search.
#define TAILQ_HEAD_INITIALIZER(head)
void sbar_set_title(struct MuttWindow *win, const char *title)
Set the title for the Simple Bar.
@ SEARCH_NONE
No flags are set.
@ SEARCH_PROMPT
Ask for search input.
@ SEARCH_OPPOSITE
Search in the opposite direction.
Data passed to Alias worker functions.
struct AliasMenuData * wdata
Alias menu data.
int op
Op code, e.g. OP_SEARCH.
alias_function_t function
Function to call.
Alias private Module data.
struct MenuDefinition * menu_query
Query menu definition.
struct MenuDefinition * menu_alias
Alias menu definition.
GUI data wrapping an Alias.
bool is_visible
Is visible?
struct Alias * alias
Alias.
bool is_deleted
Is it deleted?
bool is_tagged
Is it tagged?
A shortcut for an email address or addresses.
String manipulation buffer.
An event such as a keypress.
int count
Optional count prefix, e.g. 3 for 3j
int op
Function opcode, e.g. OP_HELP.
void * wdata
Private data.
Container for Accounts, Notifications.
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.
@ MENU_QUERY
Select from results of external query.
@ MENU_ALIAS
Select an email address by its alias.