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

Definition of the Commands Module. More...

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

Go to the source code of this file.

Functions

static bool commands_commands_register (struct NeoMutt *n, struct CommandArray *ca)
 Register NeoMutt Commands - Implements Module::commands_register()
 

Variables

const struct Command CommandsCommands []
 General NeoMutt Commands.
 
const struct Module ModuleCommands
 Module for the Commands library.
 

Detailed Description

Definition of the Commands 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

◆ commands_commands_register()

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

Register NeoMutt Commands - Implements Module::commands_register()

Definition at line 39 of file module.c.

40{
42}
const struct Command CommandsCommands[]
General NeoMutt Commands.
Definition commands.c:45
bool commands_register(struct CommandArray *ca, const struct Command *cmds)
Add commands to Commands array.
Definition command.c:51
+ Here is the call graph for this function:

Variable Documentation

◆ CommandsCommands

const struct Command CommandsCommands[]
extern

General NeoMutt Commands.

Definition at line 45 of file commands.c.

45 {
46 // clang-format off
47 { "cd", CMD_CD, parse_cd,
48 N_("Change NeoMutt's current working directory"),
49 N_("cd [ <directory> ]"),
50 "configuration.html#cd" },
51 { "color", CMD_COLOR, parse_color,
52 N_("Define colors for the user interface"),
53 N_("color <object> [ <attribute> ... ] <fg> <bg> [ <regex> [ <num> ]]"),
54 "configuration.html#color" },
55 { "echo", CMD_ECHO, parse_echo,
56 N_("Print a message to the status line"),
57 N_("echo <message>"),
58 "advancedusage.html#echo" },
59 { "finish", CMD_FINISH, parse_finish,
60 N_("Stop reading current config file"),
61 N_("finish"),
62 "optionalfeatures.html#ifdef" },
63 { "ifdef", CMD_IFDEF, parse_ifdef,
64 N_("Conditionally include config commands if symbol defined"),
65 N_("ifdef <symbol> '<config-command> [ <args> ... ]'"),
66 "optionalfeatures.html#ifdef" },
67 { "ifndef", CMD_IFNDEF, parse_ifdef,
68 N_("Conditionally include if symbol is not defined"),
69 N_("ifndef <symbol> '<config-command> [ <args> ... ]'"),
70 "optionalfeatures.html#ifdef" },
71 { "mailboxes", CMD_MAILBOXES, parse_mailboxes,
72 N_("Define a list of mailboxes to watch"),
73 N_("mailboxes [ -label <label> ] [ -notify ] [ -poll ] <mailbox> [ ... ]"),
74 "configuration.html#mailboxes" },
75 { "mono", CMD_MONO, parse_mono,
76 N_("Deprecated: Use `color` instead"),
77 N_("mono <object> <attribute> [ <pattern> | <regex> ]"),
78 "configuration.html#color-mono" },
79 { "named-mailboxes", CMD_NAMED_MAILBOXES, parse_mailboxes,
80 N_("Define a list of labelled mailboxes to watch"),
81 N_("named-mailboxes [ -notify ] [ -poll ] <label> <mailbox> [ ... ]"),
82 "configuration.html#mailboxes" },
83 { "reset", CMD_RESET, parse_set,
84 N_("Reset a config option to its initial value"),
85 N_("reset <variable> [ <variable> ... ]"),
86 "configuration.html#set" },
87 { "set", CMD_SET, parse_set,
88 N_("Set a config variable"),
89 N_("set [ no | inv | & ] <variable> [?] | <variable> [=|+=|-=] <value> [...]"),
90 "configuration.html#set" },
91 { "setenv", CMD_SETENV, parse_setenv,
92 N_("Set an environment variable"),
93 N_("setenv { <variable>? | <variable>=<value> }"),
94 "advancedusage.html#setenv" },
95 { "source", CMD_SOURCE, parse_source,
96 N_("Read and execute commands from a config file"),
97 N_("source <filename> [ <filename> ... ]"),
98 "configuration.html#source" },
99 { "subscribe", CMD_SUBSCRIBE, parse_subscribe,
100 N_("Add address to the list of subscribed mailing lists"),
101 N_("subscribe [ -group <name> ... ] <regex> [ ... ]"),
102 "configuration.html#lists" },
103 { "toggle", CMD_TOGGLE, parse_set,
104 N_("Toggle the value of a boolean/quad config option"),
105 N_("toggle <variable> [ ... ]"),
106 "configuration.html#set" },
107 { "uncolor", CMD_UNCOLOR, parse_uncolor,
108 N_("Remove a `color` definition"),
109 N_("uncolor <object> { * | <pattern> ... }"),
110 "configuration.html#color" },
111 { "unmailboxes", CMD_UNMAILBOXES, parse_unmailboxes,
112 N_("Remove mailboxes from the watch list"),
113 N_("unmailboxes { * | <mailbox> ... }"),
114 "configuration.html#mailboxes" },
115 { "unmono", CMD_UNMONO, parse_unmono,
116 N_("Deprecated: Use `uncolor` instead"),
117 N_("unmono <object> { * | <pattern> ... }"),
118 "configuration.html#color-mono" },
119 { "unset", CMD_UNSET, parse_set,
120 N_("Reset a config option to false/empty"),
121 N_("unset <variable> [ <variable> ... ]"),
122 "configuration.html#set" },
123 { "unsetenv", CMD_UNSETENV, parse_setenv,
124 N_("Unset an environment variable"),
125 N_("unsetenv <variable>"),
126 "advancedusage.html#setenv" },
127 { "unsubscribe", CMD_UNSUBSCRIBE, parse_unsubscribe,
128 N_("Remove address from the list of subscribed mailing lists"),
129 N_("unsubscribe { * | <regex> ... }"),
130 "configuration.html#lists" },
131 { "version", CMD_VERSION, parse_version,
132 N_("Show NeoMutt version and build information"),
133 N_("version"),
134 "advancedusage.html#version" },
135
136 { NULL, CMD_NONE, NULL, NULL, NULL, NULL, CF_NO_FLAGS },
137 // clang-format on
138};
#define CF_NO_FLAGS
No flags are set.
Definition command.h:48
@ CMD_SUBSCRIBE
:subscribe
Definition command.h:117
@ CMD_UNSUBSCRIBE
:unsubscribe
Definition command.h:145
@ CMD_CD
:cd
Definition command.h:68
@ CMD_IFNDEF
:ifndef
Definition command.h:84
@ CMD_UNCOLOR
:uncolor
Definition command.h:129
@ CMD_COLOR
:color
Definition command.h:71
@ CMD_SETENV
:setenv
Definition command.h:109
@ CMD_IFDEF
:ifdef
Definition command.h:83
@ CMD_SOURCE
:source
Definition command.h:113
@ CMD_ECHO
:echo
Definition command.h:73
@ CMD_VERSION
:version
Definition command.h:147
@ CMD_NONE
No Command.
Definition command.h:59
@ CMD_MAILBOXES
:mailboxes
Definition command.h:91
@ CMD_FINISH
:finish
Definition command.h:77
@ CMD_MONO
:mono
Definition command.h:96
@ CMD_UNSETENV
:unsetenv
Definition command.h:143
@ CMD_UNMAILBOXES
:unmailboxes
Definition command.h:136
@ CMD_UNMONO
:unmono
Definition command.h:139
@ CMD_RESET
:reset
Definition command.h:103
@ CMD_NAMED_MAILBOXES
:named-mailboxes
Definition command.h:98
@ CMD_TOGGLE
:toggle
Definition command.h:122
@ CMD_UNSET
:unset
Definition command.h:142
@ CMD_SET
:set
Definition command.h:108
enum CommandResult parse_subscribe(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'subscribe' command - Implements Command::parse() -.
Definition group.c:236
enum CommandResult parse_finish(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'finish' command - Implements Command::parse() -.
Definition ifdef.c:150
enum CommandResult parse_echo(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'echo' command - Implements Command::parse() -.
Definition parse.c:96
enum CommandResult parse_cd(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'cd' command - Implements Command::parse() -.
Definition parse.c:59
enum CommandResult parse_uncolor(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'uncolor' command - Implements Command::parse() -.
Definition commands.c:445
enum CommandResult parse_unmono(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'unmono' command - Implements Command::parse() -.
Definition commands.c:483
enum CommandResult parse_setenv(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'setenv' and 'unsetenv' commands - Implements Command::parse() -.
Definition setenv.c:67
enum CommandResult parse_mono(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'mono' command - Implements Command::parse() -.
Definition commands.c:538
enum CommandResult parse_version(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'version' command - Implements Command::parse() -.
Definition parse.c:125
enum CommandResult parse_unmailboxes(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'unmailboxes' command - Implements Command::parse() -.
Definition mailboxes.c:437
enum CommandResult parse_ifdef(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'ifdef' and 'ifndef' commands - Implements Command::parse() -.
Definition ifdef.c:89
enum CommandResult parse_unsubscribe(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'unsubscribe' command - Implements Command::parse() -.
Definition group.c:332
enum CommandResult parse_mailboxes(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'mailboxes' command - Implements Command::parse() -.
Definition mailboxes.c:346
enum CommandResult parse_source(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'source' command - Implements Command::parse() -.
Definition source.c:229
enum CommandResult parse_set(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'set' family of commands - Implements Command::parse() -.
Definition set.c:474
enum CommandResult parse_color(const struct Command *cmd, struct Buffer *line, const struct ParseContext *pc, struct ParseError *pe)
Parse the 'color' command - Implements Command::parse() -.
Definition commands.c:505
#define N_(a)
Definition message.h:32

◆ ModuleCommands

const struct Module ModuleCommands
Initial value:
= {
"commands",
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
}
static bool commands_commands_register(struct NeoMutt *n, struct CommandArray *ca)
Register NeoMutt Commands - Implements Module::commands_register()
Definition module.c:39
@ MODULE_ID_COMMANDS
ModuleCommands, NeoMutt Commands
Definition module_api.h:54

Module for the Commands library.

Definition at line 47 of file module.c.

47 {
49 "commands",
50 NULL, // init
51 NULL, // config_define_types
52 NULL, // config_define_variables
54 NULL, // gui_init
55 NULL, // gui_cleanup
56 NULL, // cleanup
57};