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

Definition of the Key Module. More...

#include "config.h"
#include <stdbool.h>
#include <stddef.h>
#include "mutt/lib.h"
#include "core/lib.h"
#include "module_data.h"
+ Include dependency graph for module.c:

Go to the source code of this file.

Functions

static bool key_init (struct NeoMutt *n)
 Initialise a Module - Implements Module::init()
 
static bool key_commands_register (struct NeoMutt *n, struct CommandArray *ca)
 Register NeoMutt Commands - Implements Module::commands_register()
 
static bool key_cleanup (struct NeoMutt *n)
 Clean up a Module - Implements Module::cleanup()
 

Variables

const struct Command KeyCommands []
 Key Binding Commands.
 
const struct Module ModuleKey
 Module for the Key library.
 

Detailed Description

Definition of the Key Module.

Authors
  • Richard Russon

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 module.c.

Function Documentation

◆ key_init()

static bool key_init ( struct NeoMutt * n)
static

Initialise a Module - Implements Module::init()

Definition at line 41 of file module.c.

42{
43 // struct KeyModuleData *md = MUTT_MEM_CALLOC(1, struct KeyModuleData);
44 // neomutt_set_module_data(n, MODULE_ID_KEY, md);
45
46 return true;
47}

◆ key_commands_register()

static bool key_commands_register ( struct NeoMutt * n,
struct CommandArray * ca )
static

Register NeoMutt Commands - Implements Module::commands_register()

Definition at line 52 of file module.c.

53{
55}
bool commands_register(struct CommandArray *ca, const struct Command *cmds)
Add commands to Commands array.
Definition command.c:51
const struct Command KeyCommands[]
Key Binding Commands.
Definition init.c:52
+ Here is the call graph for this function:

◆ key_cleanup()

static bool key_cleanup ( struct NeoMutt * n)
static

Clean up a Module - Implements Module::cleanup()

Definition at line 60 of file module.c.

61{
62 // struct KeyModuleData *md = neomutt_get_module_data(n, MODULE_ID_KEY);
63 // ASSERT(md);
64
65 // FREE(&md);
66 return true;
67}

Variable Documentation

◆ KeyCommands

const struct Command KeyCommands[]
extern

Key Binding Commands.

Definition at line 52 of file init.c.

52 {
53 // clang-format off
54 { "bind", CMD_BIND, parse_bind,
55 N_("Bind a key to a function"),
56 N_("bind <map>[,<map> ... ] <key> <function>"),
57 "configuration.html#bind" },
58 { "exec", CMD_EXEC, parse_exec,
59 N_("Execute a function"),
60 N_("exec <function> [ <function> ... ]"),
61 "configuration.html#exec" },
62 { "macro", CMD_MACRO, parse_macro,
63 N_("Define a keyboard macro"),
64 N_("macro <map>[,<map> ... ] <key> <sequence> [ <description> ]"),
65 "configuration.html#macro" },
66 { "push", CMD_PUSH, parse_push,
67 N_("Push a string into NeoMutt's input queue (simulate typing)"),
68 N_("push <string>"),
69 "configuration.html#push" },
70 { "unbind", CMD_UNBIND, parse_unbind,
71 N_("Remove a key binding"),
72 N_("unbind { * | <map>[,<map> ... ] } [ <key> ]"),
73 "configuration.html#unbind" },
74 { "unmacro", CMD_UNMACRO, parse_unbind,
75 N_("Remove a keyboard `macro`"),
76 N_("unmacro { * | <map>[,<map> ... ] } [ <key> ]"),
77 "configuration.html#unmacro" },
78
79 { NULL, CMD_NONE, NULL, NULL, NULL, NULL, CF_NO_FLAGS },
80 // clang-format on
81};
#define CF_NO_FLAGS
No flags are set.
Definition command.h:48
@ CMD_EXEC
:exec
Definition command.h:74
@ CMD_UNMACRO
:unmacro
Definition command.h:135
@ CMD_MACRO
:macro
Definition command.h:90
@ CMD_PUSH
:push
Definition command.h:101
@ CMD_NONE
No Command.
Definition command.h:59
@ CMD_BIND
:bind
Definition command.h:67
@ CMD_UNBIND
:unbind
Definition command.h:128
enum CommandResult parse_bind(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'bind' command - Implements Command::parse() -.
Definition commands.c:241
enum CommandResult parse_exec(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'exec' command - Implements Command::parse() -.
Definition commands.c:778
enum CommandResult parse_macro(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'macro' command - Implements Command::parse() -.
Definition commands.c:671
enum CommandResult parse_push(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'push' command - Implements Command::parse() -.
Definition commands.c:204
enum CommandResult parse_unbind(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'unbind' and 'unmacro' commands - Implements Command::parse() -.
Definition commands.c:644
#define N_(a)
Definition message.h:32

◆ ModuleKey

const struct Module ModuleKey
Initial value:
= {
"key",
NULL,
NULL,
NULL,
NULL,
}
static bool key_commands_register(struct NeoMutt *n, struct CommandArray *ca)
Register NeoMutt Commands - Implements Module::commands_register()
Definition module.c:52
static bool key_init(struct NeoMutt *n)
Initialise a Module - Implements Module::init()
Definition module.c:41
static bool key_cleanup(struct NeoMutt *n)
Clean up a Module - Implements Module::cleanup()
Definition module.c:60
@ MODULE_ID_KEY
ModuleKey, Key mappings
Definition module_api.h:73

Module for the Key library.

Definition at line 72 of file module.c.

72 {
74 "key",
76 NULL, // config_define_types
77 NULL, // config_define_variables
79 NULL, // gui_init
80 NULL, // gui_cleanup
82};