NeoMutt  2025-12-11-58-g09398d
Teaching an old dog new tricks
DOXYGEN
Loading...
Searching...
No Matches
commands.c File Reference

Functions to parse commands in a config file. More...

#include "config.h"
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include "mutt/lib.h"
#include "address/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "alias/lib.h"
#include "gui/lib.h"
#include "mutt.h"
#include "commands.h"
#include "attach/lib.h"
#include "color/lib.h"
#include "imap/lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "pager/lib.h"
#include "parse/lib.h"
#include "store/lib.h"
#include "alternates.h"
#include "globals.h"
#include "muttlib.h"
#include "mx.h"
#include "score.h"
#include "version.h"
#include "monitor.h"
#include <libintl.h>
+ Include dependency graph for commands.c:

Go to the source code of this file.

Macros

#define MAX_ERRS   128
 

Enumerations

enum  TriBool { TB_UNSET = -1 , TB_FALSE , TB_TRUE }
 Tri-state boolean. More...
 
enum  GroupState { GS_NONE , GS_RX , GS_ADDR }
 Type of email address group. More...
 

Functions

static bool is_function (const char *name)
 Is the argument a neomutt function?
 
static bool is_color_object (const char *name)
 Is the argument a neomutt colour?
 
int parse_grouplist (struct GroupList *gl, struct Buffer *token, struct Buffer *line, struct Buffer *err, struct HashTable *groups)
 Parse a group context.
 
enum CommandResult parse_rc_line_cwd (const char *line, char *cwd, struct Buffer *err)
 Parse and run a muttrc line in a relative directory.
 
char * mutt_get_sourced_cwd (void)
 Get the current file path that is being parsed.
 
int source_rc (const char *rcfile_path, struct Buffer *err)
 Read an initialization file.
 
enum CommandResult parse_cd (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'cd' command - Implements Command::parse() -.
 
enum CommandResult parse_echo (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'echo' command - Implements Command::parse() -.
 
enum CommandResult parse_finish (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'finish' command - Implements Command::parse() -.
 
enum CommandResult parse_group (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'group' and 'ungroup' commands - Implements Command::parse() -.
 
enum CommandResult parse_ifdef (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'ifdef' and 'ifndef' commands - Implements Command::parse() -.
 
enum CommandResult parse_ignore (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'ignore' command - Implements Command::parse() -.
 
enum CommandResult parse_lists (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'lists' command - Implements Command::parse() -.
 
static enum CommandResult mailbox_add (const char *folder, const char *mailbox, const char *label, enum TriBool poll, enum TriBool notify, struct Buffer *err)
 Add a new Mailbox.
 
bool mailbox_add_simple (const char *mailbox, struct Buffer *err)
 Add a new Mailbox.
 
enum CommandResult parse_mailboxes (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'mailboxes' command - Implements Command::parse() -.
 
enum CommandResult parse_my_hdr (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'my_hdr' command - Implements Command::parse() -.
 
enum CommandResult set_dump (enum GetElemListFlags flags, struct Buffer *err)
 Dump list of config variables into a file/pager.
 
static int envlist_sort (const void *a, const void *b, void *sdata)
 Compare two environment strings - Implements sort_t -.
 
enum CommandResult parse_setenv (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'setenv' and 'unsetenv' commands - Implements Command::parse() -.
 
enum CommandResult parse_source (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'source' command - Implements Command::parse() -.
 
enum CommandResult parse_nospam (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'nospam' command - Implements Command::parse() -.
 
enum CommandResult parse_spam (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'spam' command - Implements Command::parse() -.
 
enum CommandResult parse_stailq (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse a list command - Implements Command::parse() -.
 
enum CommandResult parse_subscribe (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'subscribe' command - Implements Command::parse() -.
 
enum CommandResult parse_subscribe_to (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'subscribe-to' command - Implements Command::parse() -.
 
enum CommandResult parse_tag_formats (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'tag-formats' command - Implements Command::parse() -.
 
enum CommandResult parse_tag_transforms (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'tag-transforms' command - Implements Command::parse() -.
 
enum CommandResult parse_unignore (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'unignore' command - Implements Command::parse() -.
 
enum CommandResult parse_unlists (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'unlists' command - Implements Command::parse() -.
 
static void do_unmailboxes (struct Mailbox *m)
 Remove a Mailbox from the Sidebar/notifications.
 
static void do_unmailboxes_star (void)
 Remove all Mailboxes from the Sidebar/notifications.
 
enum CommandResult parse_unmailboxes (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'unmailboxes' command - Implements Command::parse() -.
 
enum CommandResult parse_unmy_hdr (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'unmy_hdr' command - Implements Command::parse() -.
 
enum CommandResult parse_unstailq (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse an unlist command - Implements Command::parse() -.
 
enum CommandResult parse_unsubscribe (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'unsubscribe' command - Implements Command::parse() -.
 
enum CommandResult parse_unsubscribe_from (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'unsubscribe-from' command - Implements Command::parse() -.
 
enum CommandResult parse_version (const struct Command *cmd, struct Buffer *line, struct Buffer *err)
 Parse the 'version' command - Implements Command::parse() -.
 
void source_stack_cleanup (void)
 Free memory from the stack used for the source command.
 
bool commands_init (void)
 Initialize commands array and register default commands.
 

Variables

static struct ListHead MuttrcStack = STAILQ_HEAD_INITIALIZER(MuttrcStack)
 LIFO designed to contain the list of config files that have been sourced and avoid cyclic sourcing.
 
static const struct Command MuttCommands []
 General NeoMutt Commands.
 

Detailed Description

Functions to parse commands in a config file.

Authors
  • Michael R. Elkins
  • g10 Code GmbH
  • Richard Russon
  • Aditya De Saha
  • Matthew Hughes
  • R Primus
  • Pietro Cerutti
  • Marco Sirabella
  • 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 commands.c.

Macro Definition Documentation

◆ MAX_ERRS

#define MAX_ERRS   128

Definition at line 79 of file commands.c.

Enumeration Type Documentation

◆ TriBool

enum TriBool

Tri-state boolean.

Enumerator
TB_UNSET 

Value hasn't been set.

TB_FALSE 

Value is false.

TB_TRUE 

Value is true.

Definition at line 84 of file commands.c.

85{
86 TB_UNSET = -1,
87 TB_FALSE,
88 TB_TRUE,
89};
@ TB_FALSE
Value is false.
Definition commands.c:87
@ TB_TRUE
Value is true.
Definition commands.c:88
@ TB_UNSET
Value hasn't been set.
Definition commands.c:86

◆ GroupState

enum GroupState

Type of email address group.

Enumerator
GS_NONE 

Group is missing an argument.

GS_RX 

Entry is a regular expression.

GS_ADDR 

Entry is an address.

Definition at line 94 of file commands.c.

95{
96 GS_NONE,
97 GS_RX,
98 GS_ADDR,
99};
@ GS_RX
Entry is a regular expression.
Definition commands.c:97
@ GS_NONE
Group is missing an argument.
Definition commands.c:96
@ GS_ADDR
Entry is an address.
Definition commands.c:98

Function Documentation

◆ is_function()

static bool is_function ( const char * name)
static

Is the argument a neomutt function?

Parameters
nameCommand name to be searched for
Return values
trueFunction found
falseFunction not found

Definition at line 107 of file commands.c.

108{
109 for (size_t i = 0; MenuNames[i].name; i++)
110 {
111 const struct MenuFuncOp *fns = km_get_table(MenuNames[i].value);
112 if (!fns)
113 continue;
114
115 for (int j = 0; fns[j].name; j++)
116 if (mutt_str_equal(name, fns[j].name))
117 return true;
118 }
119 return false;
120}
const struct MenuFuncOp * km_get_table(enum MenuType mtype)
Lookup a Menu's functions.
Definition lib.c:485
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
Definition string.c:660
Mapping between a function and an operation.
Definition lib.h:117
const char * name
Name of the function.
Definition lib.h:118
const struct Mapping MenuNames[]
Menu name lookup table.
Definition type.c:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ is_color_object()

static bool is_color_object ( const char * name)
static

Is the argument a neomutt colour?

Parameters
nameColour name to be searched for
Return values
trueFunction found
falseFunction not found

Definition at line 128 of file commands.c.

129{
130 int cid = mutt_map_get_value(name, ColorFields);
131
132 return (cid > 0);
133}
const struct Mapping ColorFields[]
Mapping of colour names to their IDs.
Definition commands.c:54
int mutt_map_get_value(const char *name, const struct Mapping *map)
Lookup the constant for a string.
Definition mapping.c:85
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_grouplist()

int parse_grouplist ( struct GroupList * gl,
struct Buffer * token,
struct Buffer * line,
struct Buffer * err,
struct HashTable * groups )

Parse a group context.

Parameters
glGroupList to add to
tokenTemporary Buffer space
lineBuffer containing string to be parsed
errBuffer for error messages
groupsGroups HashTable
Return values
0Success
-1Error

Definition at line 145 of file commands.c.

147{
148 while (mutt_istr_equal(token->data, "-group"))
149 {
150 if (!MoreArgs(line))
151 {
152 buf_strcpy(err, _("-group: no group name"));
153 return -1;
154 }
155
157
158 grouplist_add_group(gl, groups_get_group(groups, token->data));
159
160 if (!MoreArgs(line))
161 {
162 buf_strcpy(err, _("out of arguments"));
163 return -1;
164 }
165
167 }
168
169 return 0;
170}
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
int parse_extract_token(struct Buffer *dest, struct Buffer *line, TokenFlags flags)
Extract one token from a string.
Definition extract.c:48
#define MoreArgs(buf)
Definition extract.h:30
#define TOKEN_NO_FLAGS
No flags are set.
Definition extract.h:44
struct Group * groups_get_group(struct HashTable *groups, const char *name)
Get a Group by its name.
Definition group.c:291
void grouplist_add_group(struct GroupList *gl, struct Group *g)
Add a Group to a GroupList.
Definition group.c:183
#define _(a)
Definition message.h:28
bool mutt_istr_equal(const char *a, const char *b)
Compare two strings, ignoring case.
Definition string.c:672
char * data
Pointer to data.
Definition buffer.h:37
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_rc_line_cwd()

enum CommandResult parse_rc_line_cwd ( const char * line,
char * cwd,
struct Buffer * err )

Parse and run a muttrc line in a relative directory.

Parameters
lineLine to be parsed
cwdFile relative where to run the line
errWhere to write error messages
Return values
CommandResultResult e.g. MUTT_CMD_SUCCESS

Definition at line 179 of file commands.c.

180{
182
183 struct Buffer *buf = buf_pool_get();
184 buf_strcpy(buf, line);
185 enum CommandResult ret = parse_rc_line(buf, err);
186 buf_pool_release(&buf);
187
188 struct ListNode *np = STAILQ_FIRST(&MuttrcStack);
190 FREE(&np->data);
191 FREE(&np);
192
193 return ret;
194}
CommandResult
Error codes for command_t parse functions.
Definition command.h:35
static struct ListHead MuttrcStack
LIFO designed to contain the list of config files that have been sourced and avoid cyclic sourcing.
Definition commands.c:77
struct ListNode * mutt_list_insert_head(struct ListHead *h, char *s)
Insert a string at the beginning of a List.
Definition list.c:46
#define FREE(x)
Definition memory.h:62
char * mutt_str_dup(const char *str)
Copy a string, safely.
Definition string.c:255
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:82
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:96
#define STAILQ_REMOVE_HEAD(head, field)
Definition queue.h:461
#define STAILQ_FIRST(head)
Definition queue.h:388
enum CommandResult parse_rc_line(struct Buffer *line, struct Buffer *err)
Parse a line of user config.
Definition rc.c:45
#define NONULL(x)
Definition string2.h:43
String manipulation buffer.
Definition buffer.h:36
A List node for strings.
Definition list.h:37
char * data
String.
Definition list.h:38
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mutt_get_sourced_cwd()

char * mutt_get_sourced_cwd ( void )

Get the current file path that is being parsed.

Return values
ptrFile path that is being parsed or cwd at runtime
Note
Caller is responsible for freeing returned string

Definition at line 202 of file commands.c.

203{
204 struct ListNode *np = STAILQ_FIRST(&MuttrcStack);
205 if (np && np->data)
206 return mutt_str_dup(np->data);
207
208 // stack is empty, return our own dummy file relative to cwd
209 struct Buffer *cwd = buf_pool_get();
210 mutt_path_getcwd(cwd);
211 buf_addstr(cwd, "/dummy.rc");
212 char *ret = buf_strdup(cwd);
213 buf_pool_release(&cwd);
214 return ret;
215}
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
Definition buffer.c:226
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
Definition buffer.c:571
const char * mutt_path_getcwd(struct Buffer *cwd)
Get the current working directory.
Definition path.c:476
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ source_rc()

int source_rc ( const char * rcfile_path,
struct Buffer * err )

Read an initialization file.

Parameters
rcfile_pathPath to initialization file
errBuffer for error messages
Return values
<0NeoMutt should pause to let the user know

Definition at line 223 of file commands.c.

224{
225 int lineno = 0, rc = 0, warnings = 0;
226 enum CommandResult line_rc;
227 struct Buffer *linebuf = NULL;
228 char *line = NULL;
229 char *currentline = NULL;
230 char rcfile[PATH_MAX + 1] = { 0 };
231 size_t linelen = 0;
232 pid_t pid;
233
234 mutt_str_copy(rcfile, rcfile_path, sizeof(rcfile));
235
236 size_t rcfilelen = mutt_str_len(rcfile);
237 if (rcfilelen == 0)
238 return -1;
239
240 bool ispipe = rcfile[rcfilelen - 1] == '|';
241
242 if (!ispipe)
243 {
244 struct ListNode *np = STAILQ_FIRST(&MuttrcStack);
245 if (!mutt_path_to_absolute(rcfile, np ? NONULL(np->data) : ""))
246 {
247 mutt_error(_("Error: Can't build path of '%s'"), rcfile_path);
248 return -1;
249 }
250
251 STAILQ_FOREACH(np, &MuttrcStack, entries)
252 {
253 if (mutt_str_equal(np->data, rcfile))
254 {
255 break;
256 }
257 }
258 if (np)
259 {
260 mutt_error(_("Error: Cyclic sourcing of configuration file '%s'"), rcfile);
261 return -1;
262 }
263
265 }
266
267 mutt_debug(LL_DEBUG2, "Reading configuration file '%s'\n", rcfile);
268
269 FILE *fp = mutt_open_read(rcfile, &pid);
270 if (!fp)
271 {
272 buf_printf(err, "%s: %s", rcfile, strerror(errno));
273 return -1;
274 }
275
276 linebuf = buf_pool_get();
277
278 const char *const c_config_charset = cs_subset_string(NeoMutt->sub, "config_charset");
279 const char *const c_charset = cc_charset();
280 while ((line = mutt_file_read_line(line, &linelen, fp, &lineno, MUTT_RL_CONT)) != NULL)
281 {
282 const bool conv = c_config_charset && c_charset;
283 if (conv)
284 {
285 currentline = mutt_str_dup(line);
286 if (!currentline)
287 continue;
288 mutt_ch_convert_string(&currentline, c_config_charset, c_charset, MUTT_ICONV_NO_FLAGS);
289 }
290 else
291 {
292 currentline = line;
293 }
294
295 buf_strcpy(linebuf, currentline);
296
297 buf_reset(err);
298 line_rc = parse_rc_line(linebuf, err);
299 if (line_rc == MUTT_CMD_ERROR)
300 {
301 mutt_error("%s:%d: %s", rcfile, lineno, buf_string(err));
302 if (--rc < -MAX_ERRS)
303 {
304 if (conv)
305 FREE(&currentline);
306 break;
307 }
308 }
309 else if (line_rc == MUTT_CMD_WARNING)
310 {
311 /* Warning */
312 mutt_warning("%s:%d: %s", rcfile, lineno, buf_string(err));
313 warnings++;
314 }
315 else if (line_rc == MUTT_CMD_FINISH)
316 {
317 if (conv)
318 FREE(&currentline);
319 break; /* Found "finish" command */
320 }
321 else
322 {
323 if (rc < 0)
324 rc = -1;
325 }
326 if (conv)
327 FREE(&currentline);
328 }
329
330 FREE(&line);
331 mutt_file_fclose(&fp);
332 if (pid != -1)
333 filter_wait(pid);
334
335 if (rc)
336 {
337 /* the neomuttrc source keyword */
338 buf_reset(err);
339 buf_printf(err, (rc >= -MAX_ERRS) ? _("source: errors in %s") : _("source: reading aborted due to too many errors in %s"),
340 rcfile);
341 rc = -1;
342 }
343 else
344 {
345 /* Don't alias errors with warnings */
346 if (warnings > 0)
347 {
348 buf_printf(err, ngettext("source: %d warning in %s", "source: %d warnings in %s", warnings),
349 warnings, rcfile);
350 rc = -2;
351 }
352 }
353
354 if (!ispipe && !STAILQ_EMPTY(&MuttrcStack))
355 {
356 struct ListNode *np = STAILQ_FIRST(&MuttrcStack);
358 FREE(&np->data);
359 FREE(&np);
360 }
361
362 buf_pool_release(&linebuf);
363 return rc;
364}
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
Definition buffer.c:161
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
Definition buffer.c:76
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
@ MUTT_CMD_ERROR
Error: Can't help the user.
Definition command.h:36
@ MUTT_CMD_WARNING
Warning: Help given to the user.
Definition command.h:37
@ MUTT_CMD_FINISH
Finish: Stop processing this file.
Definition command.h:39
#define MAX_ERRS
Definition commands.c:79
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Definition helpers.c:291
const char * cc_charset(void)
Get the cached value of $charset.
char * mutt_file_read_line(char *line, size_t *size, FILE *fp, int *line_num, ReadLineFlags flags)
Read a line from a file.
Definition file.c:685
#define MUTT_RL_CONT
-continuation
Definition file.h:41
#define mutt_file_fclose(FP)
Definition file.h:139
#define mutt_warning(...)
Definition logging2.h:91
#define mutt_error(...)
Definition logging2.h:93
#define mutt_debug(LEVEL,...)
Definition logging2.h:90
@ LL_DEBUG2
Log at debug level 2.
Definition logging2.h:45
int mutt_ch_convert_string(char **ps, const char *from, const char *to, uint8_t flags)
Convert a string between encodings.
Definition charset.c:831
#define MUTT_ICONV_NO_FLAGS
No flags are set.
Definition charset.h:64
int filter_wait(pid_t pid)
Wait for the exit of a process and return its status.
Definition filter.c:220
bool mutt_path_to_absolute(char *path, const char *reference)
Convert a relative path to its absolute form.
Definition path.c:333
size_t mutt_str_len(const char *a)
Calculate the length of a string, safely.
Definition string.c:498
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
Definition string.c:581
#define PATH_MAX
Definition mutt.h:42
FILE * mutt_open_read(const char *path, pid_t *thepid)
Run a command to read from.
Definition muttlib.c:699
#define STAILQ_FOREACH(var, head, field)
Definition queue.h:390
#define STAILQ_EMPTY(head)
Definition queue.h:382
Container for Accounts, Notifications.
Definition neomutt.h:43
struct ConfigSubset * sub
Inherited config items.
Definition neomutt.h:47
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mailbox_add()

static enum CommandResult mailbox_add ( const char * folder,
const char * mailbox,
const char * label,
enum TriBool poll,
enum TriBool notify,
struct Buffer * err )
static

Add a new Mailbox.

Parameters
folderPath to use for '+' abbreviations
mailboxMailbox to add
labelDescriptive label
pollEnable mailbox polling?
notifyEnable mailbox notification?
errBuffer for error messages
Return values
CommandResultResult e.g. MUTT_CMD_SUCCESS

Definition at line 692 of file commands.c.

695{
696 mutt_debug(LL_DEBUG1, "Adding mailbox: '%s' label '%s', poll %s, notify %s\n",
697 mailbox, label ? label : "[NONE]",
698 (poll == TB_UNSET) ? "[UNSPECIFIED]" :
699 (poll == TB_TRUE) ? "true" :
700 "false",
701 (notify == TB_UNSET) ? "[UNSPECIFIED]" :
702 (notify == TB_TRUE) ? "true" :
703 "false");
704 struct Mailbox *m = mailbox_new();
705
706 buf_strcpy(&m->pathbuf, mailbox);
707 /* int rc = */ mx_path_canon2(m, folder);
708
709 if (m->type <= MUTT_UNKNOWN)
710 {
711 buf_printf(err, "Unknown Mailbox: %s", m->realpath);
712 mailbox_free(&m);
713 return MUTT_CMD_ERROR;
714 }
715
716 bool new_account = false;
717 struct Account *a = mx_ac_find(m);
718 if (!a)
719 {
720 a = account_new(NULL, NeoMutt->sub);
721 a->type = m->type;
722 new_account = true;
723 }
724
725 if (!new_account)
726 {
727 struct Mailbox *m_old = mx_mbox_find(a, m->realpath);
728 if (m_old)
729 {
730 if (!m_old->visible)
731 {
732 m_old->visible = true;
733 m_old->gen = mailbox_gen();
734 }
735
736 if (label)
737 mutt_str_replace(&m_old->name, label);
738
739 if (notify != TB_UNSET)
740 m_old->notify_user = notify;
741
742 if (poll != TB_UNSET)
743 m_old->poll_new_mail = poll;
744
745 struct EventMailbox ev_m = { m_old };
747
748 mailbox_free(&m);
749 return MUTT_CMD_SUCCESS;
750 }
751 }
752
753 if (label)
754 m->name = mutt_str_dup(label);
755
756 if (notify != TB_UNSET)
757 m->notify_user = notify;
758
759 if (poll != TB_UNSET)
760 m->poll_new_mail = poll;
761
762 if (!mx_ac_add(a, m))
763 {
764 mailbox_free(&m);
765 if (new_account)
766 {
767 cs_subset_free(&a->sub);
768 FREE(&a->name);
769 notify_free(&a->notify);
770 FREE(&a);
771 }
772 return MUTT_CMD_SUCCESS;
773 }
774
775 if (new_account)
776 {
778 }
779
780 // this is finally a visible mailbox in the sidebar and mailboxes list
781 m->visible = true;
782
783#ifdef USE_INOTIFY
785#endif
786
787 return MUTT_CMD_SUCCESS;
788}
@ MUTT_CMD_SUCCESS
Success: Command worked.
Definition command.h:38
struct Account * account_new(const char *name, struct ConfigSubset *sub)
Create a new Account.
Definition account.c:44
int mailbox_gen(void)
Get the next generation number.
Definition mailbox.c:58
struct Mailbox * mailbox_new(void)
Create a new Mailbox.
Definition mailbox.c:68
void mailbox_free(struct Mailbox **ptr)
Free a Mailbox.
Definition mailbox.c:89
@ NT_MAILBOX_CHANGE
Mailbox has been changed.
Definition mailbox.h:176
@ MUTT_UNKNOWN
Mailbox wasn't recognised.
Definition mailbox.h:44
@ LL_DEBUG1
Log at debug level 1.
Definition logging2.h:44
int mutt_monitor_add(struct Mailbox *m)
Add a watch for a mailbox.
Definition monitor.c:484
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
Definition notify.c:173
void notify_free(struct Notify **ptr)
Free a notification handler.
Definition notify.c:75
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
Definition string.c:282
struct Mailbox * mx_mbox_find(struct Account *a, const char *path)
Find a Mailbox on an Account.
Definition mx.c:1549
bool mx_ac_add(struct Account *a, struct Mailbox *m)
Add a Mailbox to an Account - Wrapper for MxOps::ac_add()
Definition mx.c:1740
struct Account * mx_ac_find(struct Mailbox *m)
Find the Account owning a Mailbox.
Definition mx.c:1524
int mx_path_canon2(struct Mailbox *m, const char *folder)
Canonicalise the path to realpath.
Definition mx.c:1476
bool neomutt_account_add(struct NeoMutt *n, struct Account *a)
Add an Account to the global list.
Definition neomutt.c:119
@ NT_MAILBOX
Mailbox has changed, NotifyMailbox, EventMailbox.
Definition notify_type.h:49
A group of associated Mailboxes.
Definition account.h:36
enum MailboxType type
Type of Mailboxes this Account contains.
Definition account.h:37
char * name
Name of Account.
Definition account.h:38
struct Notify * notify
Notifications: NotifyAccount, EventAccount.
Definition account.h:41
struct ConfigSubset * sub
Inherited config items.
Definition account.h:39
An Event that happened to a Mailbox.
Definition mailbox.h:190
A mailbox.
Definition mailbox.h:79
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
Definition mailbox.h:81
enum MailboxType type
Mailbox type.
Definition mailbox.h:102
bool poll_new_mail
Check for new mail.
Definition mailbox.h:115
char * name
A short name for the Mailbox.
Definition mailbox.h:82
struct Notify * notify
Notifications: NotifyMailbox, EventMailbox.
Definition mailbox.h:145
bool notify_user
Notify the user of new mail.
Definition mailbox.h:113
struct Buffer pathbuf
Path of the Mailbox.
Definition mailbox.h:80
bool visible
True if a result of "mailboxes".
Definition mailbox.h:130
int gen
Generation number, for sorting.
Definition mailbox.h:147
void cs_subset_free(struct ConfigSubset **ptr)
Free a Config Subset.
Definition subset.c:112
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mailbox_add_simple()

bool mailbox_add_simple ( const char * mailbox,
struct Buffer * err )

Add a new Mailbox.

Parameters
mailboxMailbox to add
errBuffer for error messages
Return values
trueSuccess

Definition at line 796 of file commands.c.

797{
798 enum CommandResult rc = mailbox_add("", mailbox, NULL, TB_UNSET, TB_UNSET, err);
799
800 return (rc == MUTT_CMD_SUCCESS);
801}
static enum CommandResult mailbox_add(const char *folder, const char *mailbox, const char *label, enum TriBool poll, enum TriBool notify, struct Buffer *err)
Add a new Mailbox.
Definition commands.c:692
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set_dump()

enum CommandResult set_dump ( enum GetElemListFlags flags,
struct Buffer * err )

Dump list of config variables into a file/pager.

Parameters
flagsWhich config to dump, e.g. GEL_CHANGED_CONFIG
errBuffer for error message
Returns
num See CommandResult

FIXME: Move me into parse/set.c. Note: this function currently depends on pager, which is the reason it is not included in the parse library.

Definition at line 968 of file commands.c.

969{
970 struct Buffer *tempfile = buf_pool_get();
971 buf_mktemp(tempfile);
972
973 FILE *fp_out = mutt_file_fopen(buf_string(tempfile), "w");
974 if (!fp_out)
975 {
976 // L10N: '%s' is the file name of the temporary file
977 buf_printf(err, _("Could not create temporary file %s"), buf_string(tempfile));
978 buf_pool_release(&tempfile);
979 return MUTT_CMD_ERROR;
980 }
981
982 struct ConfigSet *cs = NeoMutt->sub->cs;
983 struct HashElemArray hea = get_elem_list(cs, flags);
984 dump_config(cs, &hea, CS_DUMP_NO_FLAGS, fp_out);
985 ARRAY_FREE(&hea);
986
987 mutt_file_fclose(&fp_out);
988
989 struct PagerData pdata = { 0 };
990 struct PagerView pview = { &pdata };
991
992 pdata.fname = buf_string(tempfile);
993
994 pview.banner = "set";
996 pview.mode = PAGER_MODE_OTHER;
997
998 mutt_do_pager(&pview, NULL);
999 buf_pool_release(&tempfile);
1000
1001 return MUTT_CMD_SUCCESS;
1002}
#define ARRAY_FREE(head)
Release all memory.
Definition array.h:204
bool dump_config(struct ConfigSet *cs, struct HashElemArray *hea, ConfigDumpFlags flags, FILE *fp)
Write all the config to a file.
Definition dump.c:196
#define CS_DUMP_NO_FLAGS
No flags are set.
Definition dump.h:36
int mutt_do_pager(struct PagerView *pview, struct Email *e)
Display some page-able text to the user (help or attachment)
Definition do_pager.c:122
#define mutt_file_fopen(PATH, MODE)
Definition file.h:138
#define MUTT_PAGER_NO_FLAGS
No flags are set.
Definition lib.h:60
@ PAGER_MODE_OTHER
Pager is invoked via 3rd path. Non-email content is likely to be shown.
Definition lib.h:140
Container for lots of config items.
Definition set.h:248
struct ConfigSet * cs
Parent ConfigSet.
Definition subset.h:50
Data to be displayed by PagerView.
Definition lib.h:159
const char * fname
Name of the file to read.
Definition lib.h:163
Paged view into some data.
Definition lib.h:170
struct PagerData * pdata
Data that pager displays. NOTNULL.
Definition lib.h:171
enum PagerMode mode
Pager mode.
Definition lib.h:172
PagerFlags flags
Additional settings to tweak pager's function.
Definition lib.h:173
const char * banner
Title to display in status bar.
Definition lib.h:174
struct HashElemArray get_elem_list(struct ConfigSet *cs, enum GetElemListFlags flags)
Create a sorted list of all config items.
Definition subset.c:81
#define buf_mktemp(buf)
Definition tmp.h:33
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_unmailboxes()

static void do_unmailboxes ( struct Mailbox * m)
static

Remove a Mailbox from the Sidebar/notifications.

Parameters
mMailbox to unmailboxes

Definition at line 1622 of file commands.c.

1623{
1624#ifdef USE_INOTIFY
1625 if (m->poll_new_mail)
1627#endif
1628 m->visible = false;
1629 m->gen = -1;
1630 if (m->opened)
1631 {
1632 struct EventMailbox ev_m = { NULL };
1633 mutt_debug(LL_NOTIFY, "NT_MAILBOX_CHANGE: NULL\n");
1635 }
1636 else
1637 {
1639 mailbox_free(&m);
1640 }
1641}
void account_mailbox_remove(struct Account *a, struct Mailbox *m)
Remove a Mailbox from an Account.
Definition account.c:94
@ LL_NOTIFY
Log of notifications.
Definition logging2.h:49
int mutt_monitor_remove(struct Mailbox *m)
Remove a watch for a mailbox.
Definition monitor.c:528
struct Account * account
Account that owns this Mailbox.
Definition mailbox.h:127
int opened
Number of times mailbox is opened.
Definition mailbox.h:128
struct Notify * notify
Notifications handler.
Definition neomutt.h:44
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_unmailboxes_star()

static void do_unmailboxes_star ( void )
static

Remove all Mailboxes from the Sidebar/notifications.

Definition at line 1646 of file commands.c.

1647{
1648 struct MailboxArray ma = neomutt_mailboxes_get(NeoMutt, MUTT_MAILBOX_ANY);
1649
1650 struct Mailbox **mp = NULL;
1651 ARRAY_FOREACH(mp, &ma)
1652 {
1653 do_unmailboxes(*mp);
1654 }
1655 ARRAY_FREE(&ma); // Clean up the ARRAY, but not the Mailboxes
1656}
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition array.h:214
static void do_unmailboxes(struct Mailbox *m)
Remove a Mailbox from the Sidebar/notifications.
Definition commands.c:1622
@ MUTT_MAILBOX_ANY
Match any Mailbox type.
Definition mailbox.h:42
struct MailboxArray neomutt_mailboxes_get(struct NeoMutt *n, enum MailboxType type)
Get an Array of matching Mailboxes.
Definition neomutt.c:189
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ source_stack_cleanup()

void source_stack_cleanup ( void )

Free memory from the stack used for the source command.

Definition at line 1936 of file commands.c.

1937{
1939}
void mutt_list_free(struct ListHead *h)
Free a List AND its strings.
Definition list.c:123
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ commands_init()

bool commands_init ( void )

Initialize commands array and register default commands.

Definition at line 2170 of file commands.c.

2171{
2173}
static const struct Command MuttCommands[]
General NeoMutt Commands.
Definition commands.c:1944
bool commands_register(struct CommandArray *ca, const struct Command *cmds)
Add commands to Commands array.
Definition command.c:51
struct CommandArray commands
NeoMutt commands.
Definition neomutt.h:51
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ MuttrcStack

struct ListHead MuttrcStack = STAILQ_HEAD_INITIALIZER(MuttrcStack)
static

LIFO designed to contain the list of config files that have been sourced and avoid cyclic sourcing.

Definition at line 77 of file commands.c.

◆ MuttCommands

const struct Command MuttCommands[]
static

General NeoMutt Commands.

Definition at line 1944 of file commands.c.

1944 {
1945 // clang-format off
1946 { "alias", parse_alias, 0,
1947 N_("Define an alias (name to email address)"),
1948 N_("alias [ -group <name> ... ] <key> <address> [, <address> ... ]"),
1949 "configuration.html#alias" },
1950 { "alternates", parse_alternates, 0,
1951 N_("Define a list of alternate email addresses for the user"),
1952 N_("alternates [ -group <name> ... ] <regex> [ <regex> ... ]"),
1953 "configuration.html#alternates" },
1954 { "alternative_order", parse_stailq, IP &AlternativeOrderList,
1955 N_("Set preference order for multipart alternatives"),
1956 N_("alternative_order <mime-type>[/<mime-subtype> ] [ <mime-type>[/<mime-subtype> ] ... ]"),
1957 "mimesupport.html#alternative-order" },
1958 { "attachments", parse_attachments, 0,
1959 N_("Set attachment counting rules"),
1960 N_("attachments { + | - }<disposition> <mime-type> [ <mime-type> ... ] | ?"),
1961 "mimesupport.html#attachments" },
1962 { "auto_view", parse_stailq, IP &AutoViewList,
1963 N_("Automatically display specified MIME types inline"),
1964 N_("auto_view <mime-type>[/<mime-subtype> ] [ <mime-type>[/<mime-subtype> ] ... ]"),
1965 "mimesupport.html#auto-view" },
1966 { "cd", parse_cd, 0,
1967 N_("Change NeoMutt's current working directory"),
1968 N_("cd [ <directory> ]"),
1969 "configuration.html#cd" },
1970 { "color", parse_color, 0,
1971 N_("Define colors for the user interface"),
1972 N_("color <object> [ <attribute> ... ] <foreground> <background> [ <regex> [ <num> ]]"),
1973 "configuration.html#color" },
1974 { "echo", parse_echo, 0,
1975 N_("Print a message to the status line"),
1976 N_("echo <message>"),
1977 "advancedusage.html#echo" },
1978 { "finish", parse_finish, 0,
1979 N_("Stop reading current config file"),
1980 N_("finish "),
1981 "optionalfeatures.html#ifdef" },
1982 { "group", parse_group, MUTT_GROUP,
1983 N_("Add addresses to an address group"),
1984 N_("group [ -group <name> ... ] { -rx <regex> ... | -addr <address> ... }"),
1985 "configuration.html#addrgroup" },
1986 { "hdr_order", parse_stailq, IP &HeaderOrderList,
1987 N_("Define custom order of headers displayed"),
1988 N_("hdr_order <header> [ <header> ... ]"),
1989 "configuration.html#hdr-order" },
1990 { "ifdef", parse_ifdef, 0,
1991 N_("Conditionally include config commands if symbol defined"),
1992 N_("ifdef <symbol> '<config-command> [ <args> ... ]'"),
1993 "optionalfeatures.html#ifdef" },
1994 { "ifndef", parse_ifdef, 1,
1995 N_("Conditionally include if symbol is not defined"),
1996 N_("ifndef <symbol> '<config-command> [ <args> ... ]'"),
1997 "optionalfeatures.html#ifdef" },
1998 { "ignore", parse_ignore, 0,
1999 N_("Hide specified headers when displaying messages"),
2000 N_("ignore { * | <string> ... }"),
2001 "configuration.html#ignore" },
2002 { "lists", parse_lists, 0,
2003 N_("Add address to the list of mailing lists"),
2004 N_("lists [ -group <name> ... ] <regex> [ <regex> ... ]"),
2005 "configuration.html#lists" },
2006 { "mailboxes", parse_mailboxes, 0,
2007 N_("Define a list of mailboxes to watch"),
2008 N_("mailboxes [[ -label <label> ] | -nolabel ] [[ -notify | -nonotify ] [ -poll | -nopoll ] <mailbox> ] [ ... ]"),
2009 "configuration.html#mailboxes" },
2010 { "mailto_allow", parse_stailq, IP &MailToAllow,
2011 N_("Permit specific header-fields in mailto URL processing"),
2012 N_("mailto_allow { * | <header-field> ... }"),
2013 "configuration.html#mailto-allow" },
2014 { "mime_lookup", parse_stailq, IP &MimeLookupList,
2015 N_("Map specified MIME types/subtypes to display handlers"),
2016 N_("mime_lookup <mime-type>[/<mime-subtype> ] [ <mime-type>[/<mime-subtype> ] ... ]"),
2017 "mimesupport.html#mime-lookup" },
2018 { "mono", parse_mono, 0,
2019 N_("**Deprecated**: Use `color`"),
2020 N_("mono <object> <attribute> [ <pattern> | <regex> ]"),
2021 "configuration.html#color-mono" },
2022 { "my_hdr", parse_my_hdr, 0,
2023 N_("Add a custom header to outgoing messages"),
2024 N_("my_hdr <string>"),
2025 "configuration.html#my-hdr" },
2026 { "named-mailboxes", parse_mailboxes, MUTT_NAMED,
2027 N_("Define a list of labelled mailboxes to watch"),
2028 N_("named-mailboxes <description> <mailbox> [ <description> <mailbox> ... ]"),
2029 "configuration.html#mailboxes" },
2030 { "nospam", parse_nospam, 0,
2031 N_("Remove a spam detection rule"),
2032 N_("nospam { * | <regex> }"),
2033 "configuration.html#spam" },
2034 { "reset", parse_set, MUTT_SET_RESET,
2035 N_("Reset a config option to its initial value"),
2036 N_("reset <variable> [ <variable> ... ]"),
2037 "configuration.html#set" },
2038 { "score", parse_score, 0,
2039 N_("Set a score value on emails matching a pattern"),
2040 N_("score <pattern> <value>"),
2041 "configuration.html#score-command" },
2042 { "set", parse_set, MUTT_SET_SET,
2043 N_("Set a config variable"),
2044 N_("set { [ no | inv | & ] <variable> [?] | <variable> [=|+=|-=] value } [ ... ]"),
2045 "configuration.html#set" },
2046 { "setenv", parse_setenv, MUTT_SET_SET,
2047 N_("Set an environment variable"),
2048 N_("setenv { <variable>? | <variable> <value> }"),
2049 "advancedusage.html#setenv" },
2050 { "source", parse_source, 0,
2051 N_("Read and execute commands from a config file"),
2052 N_("source <filename>"),
2053 "configuration.html#source" },
2054 { "spam", parse_spam, 0,
2055 N_("Define rules to parse spam detection headers"),
2056 N_("spam <regex> <format>"),
2057 "configuration.html#spam" },
2058 { "subjectrx", parse_subjectrx_list, 0,
2059 N_("Apply regex-based rewriting to message subjects"),
2060 N_("subjectrx <regex> <replacement>"),
2061 "advancedusage.html#display-munging" },
2062 { "subscribe", parse_subscribe, 0,
2063 N_("Add address to the list of subscribed mailing lists"),
2064 N_("subscribe [ -group <name> ... ] <regex> [ <regex> ... ]"),
2065 "configuration.html#lists" },
2066 { "tag-formats", parse_tag_formats, 0,
2067 N_("Define expandos tags"),
2068 N_("tag-formats <tag> <format-string> { tag format-string ... }"),
2069 "optionalfeatures.html#custom-tags" },
2070 { "tag-transforms", parse_tag_transforms, 0,
2071 N_("Rules to transform tags into icons"),
2072 N_("tag-transforms <tag> <transformed-string> { tag transformed-string ... }"),
2073 "optionalfeatures.html#custom-tags" },
2074 { "toggle", parse_set, MUTT_SET_INV,
2075 N_("Toggle the value of a boolean/quad config option"),
2076 N_("toggle <variable> [ <variable> ... ]"),
2077 "configuration.html#set" },
2078 { "unalias", parse_unalias, 0,
2079 N_("Remove an alias definition"),
2080 N_("unalias [ -group <name> ... ] { * | <key> ... }"),
2081 "configuration.html#alias" },
2082 { "unalternates", parse_unalternates, 0,
2083 N_("Remove addresses from `alternates` list"),
2084 N_("unalternates [ -group <name> ... ] { * | <regex> ... }"),
2085 "configuration.html#alternates" },
2086 { "unalternative_order", parse_unstailq, IP &AlternativeOrderList,
2087 N_("Remove MIME types from preference order"),
2088 N_("unalternative_order { * | [ <mime-type>[/<mime-subtype> ] ... ] }"),
2089 "mimesupport.html#alternative-order" },
2090 { "unattachments", parse_unattachments, 0,
2091 N_("Remove attachment counting rules"),
2092 N_("unattachments { * | { + | - }<disposition> <mime-type> [ <mime-type> ... ] }"),
2093 "mimesupport.html#attachments" },
2094 { "unauto_view", parse_unstailq, IP &AutoViewList,
2095 N_("Remove MIME types from `auto_view` list"),
2096 N_("unauto_view { * | [ <mime-type>[/<mime-subtype> ] ... ] }"),
2097 "mimesupport.html#auto-view" },
2098 { "uncolor", parse_uncolor, 0,
2099 N_("Remove a `color` definition"),
2100 N_("uncolor <object> { * | <pattern> ... }"),
2101 "configuration.html#color" },
2102 { "ungroup", parse_group, MUTT_UNGROUP,
2103 N_("Remove addresses from an address `group`"),
2104 N_("ungroup [ -group <name> ... ] { * | -rx <regex> ... | -addr <address> ... }"),
2105 "configuration.html#addrgroup" },
2106 { "unhdr_order", parse_unstailq, IP &HeaderOrderList,
2107 N_("Remove header from `hdr_order` list"),
2108 N_("unhdr_order { * | <header> ... }"),
2109 "configuration.html#hdr-order" },
2110 { "unignore", parse_unignore, 0,
2111 N_("Remove a header from the `hdr_order` list"),
2112 N_("unignore { * | <string> ... }"),
2113 "configuration.html#ignore" },
2114 { "unlists", parse_unlists, 0,
2115 N_("Remove address from the list of mailing lists"),
2116 N_("unlists [ -group <name> ... ] { * | <regex> ... }"),
2117 "configuration.html#lists" },
2118 { "unmailboxes", parse_unmailboxes, 0,
2119 N_("Remove mailboxes from the watch list"),
2120 N_("unmailboxes { * | <mailbox> ... }"),
2121 "configuration.html#mailboxes" },
2122 { "unmailto_allow", parse_unstailq, IP &MailToAllow,
2123 N_("Disallow header-fields in mailto processing"),
2124 N_("unmailto_allow { * | <header-field> ... }"),
2125 "configuration.html#mailto-allow" },
2126 { "unmime_lookup", parse_unstailq, IP &MimeLookupList,
2127 N_("Remove custom MIME-type handlers"),
2128 N_("unmime_lookup { * | [ <mime-type>[/<mime-subtype> ] ... ] }"),
2129 "mimesupport.html#mime-lookup" },
2130 { "unmono", parse_unmono, 0,
2131 N_("**Deprecated**: Use `uncolor`"),
2132 N_("unmono <object> { * | <pattern> ... }"),
2133 "configuration.html#color-mono" },
2134 { "unmy_hdr", parse_unmy_hdr, 0,
2135 N_("Remove a header previously added with `my_hdr`"),
2136 N_("unmy_hdr { * | <field> ... }"),
2137 "configuration.html#my-hdr" },
2138 { "unscore", parse_unscore, 0,
2139 N_("Remove scoring rules for matching patterns"),
2140 N_("unscore { * | <pattern> ... }"),
2141 "configuration.html#score-command" },
2142 { "unset", parse_set, MUTT_SET_UNSET,
2143 N_("Reset a config option to false/empty"),
2144 N_("unset <variable> [ <variable> ... ]"),
2145 "configuration.html#set" },
2146 { "unsetenv", parse_setenv, MUTT_SET_UNSET,
2147 N_("Unset an environment variable"),
2148 N_("unsetenv <variable>"),
2149 "advancedusage.html#setenv" },
2150 { "unsubjectrx", parse_unsubjectrx_list, 0,
2151 N_("Remove subject-rewriting rules"),
2152 N_("unsubjectrx { * | <regex> }"),
2153 "advancedusage.html#display-munging" },
2154 { "unsubscribe", parse_unsubscribe, 0,
2155 N_("Remove address from the list of subscribed mailing lists"),
2156 N_("unsubscribe [ -group <name> ... ] { * | <regex> ... }"),
2157 "configuration.html#lists" },
2158 { "version", parse_version, 0,
2159 N_("Show NeoMutt version and build information"),
2160 N_("version "),
2161 "configuration.html#version" },
2162
2163 { NULL, NULL, 0, NULL, NULL, NULL, CF_NO_FLAGS },
2164 // clang-format on
2165};
#define CF_NO_FLAGS
No flags are set.
Definition command.h:46
#define MUTT_NAMED
Definition commands.h:36
#define IP
Definition set.h:52
struct ListHead MailToAllow
List of regexes to identify non-spam emails.
Definition globals.c:42
struct ListHead MimeLookupList
List of mime types that that shouldn't use the mailcap entry.
Definition globals.c:47
struct ListHead AlternativeOrderList
List of preferred mime types to display.
Definition globals.c:44
struct ListHead AutoViewList
List of mime types to auto view.
Definition globals.c:45
struct ListHead HeaderOrderList
List of header fields in the order they should be displayed.
Definition globals.c:46
#define MUTT_GROUP
'group' config command
Definition group.h:32
#define MUTT_UNGROUP
'ungroup' config command
Definition group.h:33
enum CommandResult parse_cd(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'cd' command - Implements Command::parse() -.
Definition commands.c:372
enum CommandResult parse_tag_formats(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'tag-formats' command - Implements Command::parse() -.
Definition commands.c:1463
enum CommandResult parse_unscore(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unscore' command - Implements Command::parse() -.
Definition score.c:220
enum CommandResult parse_alias(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'alias' command - Implements Command::parse() -.
Definition commands.c:137
enum CommandResult parse_lists(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'lists' command - Implements Command::parse() -.
Definition commands.c:645
enum CommandResult parse_finish(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'finish' command - Implements Command::parse() -.
Definition commands.c:437
enum CommandResult parse_version(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'version' command - Implements Command::parse() -.
Definition commands.c:1887
enum CommandResult parse_unsubjectrx_list(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unsubjectrx' command - Implements Command::parse() -.
Definition subjectrx.c:218
enum CommandResult parse_unmy_hdr(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unmy_hdr' command - Implements Command::parse() -.
Definition commands.c:1710
enum CommandResult parse_score(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'score' command - Implements Command::parse() -.
Definition score.c:94
enum CommandResult parse_attachments(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'attachments' command - Implements Command::parse() -.
Definition commands.c:485
enum CommandResult parse_unmailboxes(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unmailboxes' command - Implements Command::parse() -.
Definition commands.c:1664
enum CommandResult parse_unlists(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unlists' command - Implements Command::parse() -.
Definition commands.c:1585
enum CommandResult parse_ignore(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'ignore' command - Implements Command::parse() -.
Definition commands.c:617
enum CommandResult parse_subscribe(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'subscribe' command - Implements Command::parse() -.
Definition commands.c:1364
enum CommandResult parse_ifdef(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'ifdef' and 'ifndef' commands - Implements Command::parse() -.
Definition commands.c:563
enum CommandResult parse_alternates(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'alternates' command - Implements Command::parse() -.
Definition alternates.c:94
enum CommandResult parse_source(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'source' command - Implements Command::parse() -.
Definition commands.c:1185
enum CommandResult parse_my_hdr(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'my_hdr' command - Implements Command::parse() -.
Definition commands.c:916
enum CommandResult parse_set(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'set' family of commands - Implements Command::parse() -.
Definition set.c:473
enum CommandResult parse_unalias(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unalias' command - Implements Command::parse() -.
Definition commands.c:258
enum CommandResult parse_nospam(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'nospam' command - Implements Command::parse() -.
Definition commands.c:1230
enum CommandResult parse_mono(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'mono' command - Implements Command::parse() -.
Definition commands.c:536
enum CommandResult parse_stailq(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse a list command - Implements Command::parse() -.
Definition commands.c:1337
enum CommandResult parse_unsubscribe(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unsubscribe' command - Implements Command::parse() -.
Definition commands.c:1803
enum CommandResult parse_unmono(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unmono' command - Implements Command::parse() -.
Definition commands.c:485
enum CommandResult parse_group(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'group' and 'ungroup' commands - Implements Command::parse() -.
Definition commands.c:456
enum CommandResult parse_setenv(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'setenv' and 'unsetenv' commands - Implements Command::parse() -.
Definition commands.c:1019
enum CommandResult parse_unignore(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unignore' command - Implements Command::parse() -.
Definition commands.c:1553
enum CommandResult parse_unstailq(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse an unlist command - Implements Command::parse() -.
Definition commands.c:1770
enum CommandResult parse_spam(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'spam' command - Implements Command::parse() -.
Definition commands.c:1287
enum CommandResult parse_echo(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'echo' command - Implements Command::parse() -.
Definition commands.c:406
enum CommandResult parse_tag_transforms(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'tag-transforms' command - Implements Command::parse() -.
Definition commands.c:1509
enum CommandResult parse_unalternates(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unalternates' command - Implements Command::parse() -.
Definition alternates.c:140
enum CommandResult parse_unattachments(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'unattachments' command - Implements Command::parse() -.
Definition commands.c:557
enum CommandResult parse_color(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'color' command - Implements Command::parse() -.
Definition commands.c:505
enum CommandResult parse_uncolor(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'uncolor' command - Implements Command::parse() -.
Definition commands.c:449
enum CommandResult parse_subjectrx_list(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'subjectrx' command - Implements Command::parse() -.
Definition subjectrx.c:192
enum CommandResult parse_mailboxes(const struct Command *cmd, struct Buffer *line, struct Buffer *err)
Parse the 'mailboxes' command - Implements Command::parse() -.
Definition commands.c:810
#define N_(a)
Definition message.h:32
@ MUTT_SET_INV
default is to invert all vars
Definition set.h:36
@ MUTT_SET_SET
default is to set all vars
Definition set.h:35
@ MUTT_SET_RESET
default is to reset all vars to default
Definition set.h:38
@ MUTT_SET_UNSET
default is to unset all vars
Definition set.h:37