NeoMutt  2025-12-11-694-ga89709
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
functions.c File Reference

Alias functions. More...

#include "config.h"
#include <stdbool.h>
#include <stdio.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "functions.h"
#include "lib.h"
#include "editor/lib.h"
#include "history/lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "pattern/lib.h"
#include "question/lib.h"
#include "alias.h"
#include "gui.h"
#include "sort.h"
+ Include dependency graph for functions.c:

Go to the source code of this file.

Functions

void alias_init_keys (struct SubMenu *sm_generic)
 Initialise the Alias Keybindings - Implements ::init_keys_api.
 
static int op_create_alias (struct AliasMenuData *mdata, const struct KeyEvent *event)
 create an alias from a message sender - Implements alias_function_t -
 
static int op_delete (struct AliasMenuData *mdata, const struct KeyEvent *event)
 delete the current entry - Implements alias_function_t -
 
static int op_exit (struct AliasMenuData *mdata, const struct KeyEvent *event)
 exit this menu - Implements alias_function_t -
 
static int op_generic_select_entry (struct AliasMenuData *mdata, const struct KeyEvent *event)
 select the current entry - Implements alias_function_t -
 
static int op_main_limit (struct AliasMenuData *mdata, const struct KeyEvent *event)
 show only messages matching a pattern - Implements alias_function_t -
 
static int op_main_tag_pattern (struct AliasMenuData *mdata, const struct KeyEvent *event)
 Tag messages matching a pattern - Implements alias_function_t -.
 
static int op_main_untag_pattern (struct AliasMenuData *mdata, const struct KeyEvent *event)
 Untag messages matching a pattern - Implements alias_function_t -.
 
static int op_query (struct AliasMenuData *mdata, const struct KeyEvent *event)
 query external program for addresses - Implements alias_function_t -
 
static int op_search (struct AliasMenuData *mdata, const struct KeyEvent *event)
 search for a regular expression - Implements alias_function_t -
 
static int op_sort (struct AliasMenuData *mdata, 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 -.
 

Variables

struct MenuDefinitionMdAlias = NULL
 Alias Menu Definition.
 
struct MenuDefinitionMdQuery = NULL
 Query Menu Definition.
 
static const struct MenuFuncOp OpAlias []
 Functions for the Alias Menu.
 
const struct MenuFuncOp OpQuery []
 Functions for the external Query Menu.
 
static const struct MenuOpSeq AliasDefaultBindings []
 Key bindings for the Alias Menu.
 
static const struct MenuOpSeq QueryDefaultBindings []
 Key bindings for the external Query Menu.
 
static const struct AliasFunction AliasFunctions []
 All the NeoMutt functions that the Alias supports.
 

Detailed Description

Alias functions.

Authors
  • Richard Russon
  • Dennis Schön

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file functions.c.

Function Documentation

◆ alias_init_keys()

void alias_init_keys ( struct SubMenu * sm_generic)

Initialise the Alias Keybindings - Implements ::init_keys_api.

Definition at line 128 of file functions.c.

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}
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 MenuFuncOp OpAlias[]
Functions for the Alias Menu.
Definition functions.c:59
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
Functions for a Dialog or Window.
Definition menu.h:80
Collection of related functions.
Definition menu.h:68
@ 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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ MdAlias

struct MenuDefinition* MdAlias = NULL

Alias Menu Definition.

Definition at line 51 of file functions.c.

◆ MdQuery

struct MenuDefinition* MdQuery = NULL

Query Menu Definition.

Definition at line 53 of file functions.c.

◆ OpAlias

const struct MenuFuncOp OpAlias[]
static
Initial value:
= {
{ "delete-entry", OP_DELETE },
{ "exit", OP_EXIT },
{ "limit", OP_MAIN_LIMIT },
{ "mail", OP_MAIL },
{ "sort-alias", OP_SORT },
{ "sort-alias-reverse", OP_SORT_REVERSE },
{ "tag-pattern", OP_MAIN_TAG_PATTERN },
{ "undelete-entry", OP_UNDELETE },
{ "untag-pattern", OP_MAIN_UNTAG_PATTERN },
{ NULL, 0 },
}

Functions for the Alias Menu.

Definition at line 59 of file functions.c.

59 { /* 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};

◆ OpQuery

const struct MenuFuncOp OpQuery[]
Initial value:
= {
{ "create-alias", OP_CREATE_ALIAS },
{ "exit", OP_EXIT },
{ "limit", OP_MAIN_LIMIT },
{ "mail", OP_MAIL },
{ "query", OP_QUERY },
{ "query-append", OP_QUERY_APPEND },
{ "sort", OP_SORT },
{ "sort-reverse", OP_SORT_REVERSE },
{ "tag-pattern", OP_MAIN_TAG_PATTERN },
{ "untag-pattern", OP_MAIN_UNTAG_PATTERN },
{ NULL, 0 },
}

Functions for the external Query Menu.

Definition at line 75 of file functions.c.

75 { /* 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};

◆ AliasDefaultBindings

const struct MenuOpSeq AliasDefaultBindings[]
static
Initial value:
= {
{ OP_DELETE, "d" },
{ OP_EXIT, "q" },
{ OP_MAIL, "m" },
{ OP_MAIN_LIMIT, "l" },
{ OP_MAIN_TAG_PATTERN, "T" },
{ OP_MAIN_UNTAG_PATTERN, "\024" },
{ OP_SORT, "o" },
{ OP_SORT_REVERSE, "O" },
{ OP_TAG, "<space>" },
{ OP_UNDELETE, "u" },
{ 0, NULL },
}

Key bindings for the Alias Menu.

Definition at line 92 of file functions.c.

92 { /* 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};

◆ QueryDefaultBindings

const struct MenuOpSeq QueryDefaultBindings[]
static
Initial value:
= {
{ OP_CREATE_ALIAS, "a" },
{ OP_EXIT, "q" },
{ OP_MAIL, "m" },
{ OP_MAIN_LIMIT, "l" },
{ OP_MAIN_TAG_PATTERN, "T" },
{ OP_MAIN_UNTAG_PATTERN, "\024" },
{ OP_QUERY, "Q" },
{ OP_QUERY_APPEND, "A" },
{ OP_SORT, "o" },
{ OP_SORT_REVERSE, "O" },
{ OP_TAG, "<space>" },
{ 0, NULL },
}

Key bindings for the external Query Menu.

Definition at line 109 of file functions.c.

109 { /* 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};

◆ AliasFunctions

const struct AliasFunction AliasFunctions[]
static
Initial value:
= {
{ OP_CREATE_ALIAS, op_create_alias },
{ OP_DELETE, op_delete },
{ OP_EXIT, op_exit },
{ OP_GENERIC_SELECT_ENTRY, op_generic_select_entry },
{ OP_MAIN_LIMIT, op_main_limit },
{ OP_MAIN_TAG_PATTERN, op_main_tag_pattern },
{ OP_MAIN_UNTAG_PATTERN, op_main_untag_pattern },
{ OP_QUERY, op_query },
{ OP_QUERY_APPEND, op_query },
{ OP_SEARCH, op_search },
{ OP_SEARCH_NEXT, op_search },
{ OP_SEARCH_OPPOSITE, op_search },
{ OP_SEARCH_REVERSE, op_search },
{ OP_SORT, op_sort },
{ OP_SORT_REVERSE, op_sort },
{ OP_UNDELETE, op_delete },
{ 0, NULL },
}
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

All the NeoMutt functions that the Alias supports.

Definition at line 475 of file functions.c.

475 {
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};