68 {
"catchup", OP_CATCHUP },
69 {
"change-dir", OP_CHANGE_DIRECTORY },
70 {
"check-new", OP_CHECK_NEW },
71 {
"create-mailbox", OP_CREATE_MAILBOX },
72 {
"delete-mailbox", OP_DELETE_MAILBOX },
73 {
"descend-directory", OP_DESCEND_DIRECTORY },
74 {
"display-filename", OP_BROWSER_TELL },
75 {
"enter-mask", OP_ENTER_MASK },
77 {
"goto-folder", OP_BROWSER_GOTO_FOLDER },
78 {
"goto-parent", OP_GOTO_PARENT },
79 {
"mailbox-list", OP_MAILBOX_LIST },
80 {
"reload-active", OP_LOAD_ACTIVE },
81 {
"rename-mailbox", OP_RENAME_MAILBOX },
82 {
"select-new", OP_BROWSER_NEW_FILE },
84 {
"sort-reverse", OP_SORT_REVERSE },
85 {
"subscribe", OP_BROWSER_SUBSCRIBE },
86 {
"subscribe-pattern", OP_SUBSCRIBE_PATTERN },
87 {
"toggle-mailboxes", OP_TOGGLE_MAILBOXES },
88 {
"toggle-subscribed", OP_BROWSER_TOGGLE_LSUB },
89 {
"uncatchup", OP_UNCATCHUP },
90 {
"unsubscribe", OP_BROWSER_UNSUBSCRIBE },
91 {
"unsubscribe-pattern", OP_UNSUBSCRIBE_PATTERN },
92 {
"view-file", OP_BROWSER_VIEW_FILE },
102 { OP_BROWSER_GOTO_FOLDER,
"=" },
103 { OP_BROWSER_NEW_FILE,
"N" },
104 { OP_BROWSER_SUBSCRIBE,
"s" },
105 { OP_BROWSER_TELL,
"@" },
106 { OP_BROWSER_TOGGLE_LSUB,
"T" },
107 { OP_BROWSER_UNSUBSCRIBE,
"u" },
108 { OP_BROWSER_VIEW_FILE,
" " },
109 { OP_CHANGE_DIRECTORY,
"c" },
110 { OP_CREATE_MAILBOX,
"C" },
111 { OP_DELETE_MAILBOX,
"d" },
112 { OP_ENTER_MASK,
"m" },
114 { OP_GOTO_PARENT,
"p" },
115 { OP_MAILBOX_LIST,
"." },
116 { OP_RENAME_MAILBOX,
"r" },
118 { OP_SORT_REVERSE,
"O" },
119 { OP_TOGGLE_MAILBOXES,
"\t" },
191 const int op =
event->op;
209 if (op == OP_BROWSER_SUBSCRIBE)
284 else if (S_ISDIR(ff->
mode) ||
326 if (event->
op == OP_CATCHUP)
335 if (index < priv->menu->max)
368 const int op =
event->op;
369 if (op == OP_CHANGE_DIRECTORY)
380 else if (op == OP_GOTO_PARENT)
420 struct stat st = { 0 };
423 if (S_ISDIR(st.st_mode))
466 mutt_error(
_(
"Create is only supported for IMAP mailboxes"));
495 mutt_error(
_(
"Delete is only supported for IMAP mailboxes"));
499 char msg[128] = { 0 };
506 mutt_error(
_(
"Can't delete currently selected mailbox"));
510 snprintf(msg,
sizeof(msg),
_(
"Really delete mailbox \"%s\"?"), ff->
name);
605 char **tfiles = NULL;
624 *priv->
files = tfiles;
632 *priv->
files = tfiles;
655 const int op =
event->op;
662 else if (S_ISDIR(ff->
mode) ||
701 p = strrchr(
LastDir.data + 1,
'/');
729 if (url && url->
path && (ff->
delim !=
'\0'))
783 else if (op == OP_DESCEND_DIRECTORY)
819 for (
size_t i = 0; i <
adata->groups_num; i++)
861 mutt_error(
_(
"Rename is only supported for IMAP mailboxes"));
890 const int op =
event->op;
891 int reverse = (op == OP_SORT_REVERSE);
895 _(
"Reverse sort by (d)ate, (a)lpha, si(z)e, d(e)scription, (c)ount, ne(w) count, or do(n)'t sort?") :
897 _(
"Sort by (d)ate, (a)lpha, si(z)e, d(e)scription, (c)ount, ne(w) count, or do(n)'t sort?"),
961 char tmp2[256] = { 0 };
963 const int op =
event->op;
965 if (op == OP_SUBSCRIBE_PATTERN)
966 snprintf(tmp2,
sizeof(tmp2),
_(
"Subscribe pattern: "));
968 snprintf(tmp2,
sizeof(tmp2),
_(
"Unsubscribe pattern: "));
980 regerror(err, &rx, buf->
data, buf->
dsize);
997 if (regexec(&rx, ff->
name, 0, NULL, 0) == 0)
999 if (op == OP_SUBSCRIBE_PATTERN)
1006 if (op == OP_SUBSCRIBE_PATTERN)
1008 for (
size_t j = 0; j < adata->
groups_num; j++)
1013 if (regexec(&rx,
mdata->group, 0, NULL, 0) == 0)
1045 const int op =
event->op;
1046 if (op == OP_TOGGLE_MAILBOXES)
1051 if (op == OP_BROWSER_GOTO_FOLDER)
1151 if (!dlg || !dlg->
wdata)
1163 if (fn->
op == event->
op)
#define ARRAY_REMOVE(head, elem)
Remove an entry from the array, shifting down the subsequent entries.
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
#define ARRAY_EMPTY(head)
Check if an array is empty.
#define ARRAY_FREE(head)
Release all memory.
#define ARRAY_FOREACH_FROM(elem, head, from)
Iterate from an index to the end.
#define ARRAY_GET(head, idx)
Return the element at index.
GUI display the mailboxes in a side panel.
int bool_str_toggle(struct ConfigSubset *sub, const char *name, struct Buffer *err)
Toggle the value of a bool.
int imap_browse(const char *path, struct BrowserState *state)
IMAP hook into the folder browser.
int imap_mailbox_create(const char *path)
Create a new IMAP mailbox.
int imap_mailbox_rename(const char *path)
Rename a mailbox.
const struct CompleteOps CompleteMailboxOps
Auto-Completion of Files / Mailboxes.
static const struct MenuOpSeq BrowserDefaultBindings[]
Key bindings for the file Browser Menu.
void browser_init_keys(struct SubMenu *sm_generic)
Initialise the Browser Keybindings - Implements ::init_keys_api.
static const struct MenuFuncOp OpBrowser[]
Functions for the file Browser Menu.
void destroy_state(struct BrowserState *state)
Free the BrowserState.
int browser_function_dispatcher(struct MuttWindow *win, const struct KeyEvent *event)
Perform a Browser function.
static const struct BrowserFunction BrowserFunctions[]
All the NeoMutt functions that the Browser supports.
Select a Mailbox from a list.
void browser_sort(struct BrowserState *state)
Sort the entries in the browser.
Private state data for the Browser.
Browser sorting functions.
@ BROWSER_SORT_ALPHA
Sort by name.
@ BROWSER_SORT_UNSORTED
Sort into the raw order.
@ BROWSER_SORT_COUNT
Sort by total message count.
@ BROWSER_SORT_DATE
Sort by date.
@ BROWSER_SORT_NEW
Sort by count of new messages.
@ BROWSER_SORT_SIZE
Sort by size.
@ BROWSER_SORT_DESC
Sort by description.
int buf_printf(struct Buffer *buf, const char *fmt,...)
Format a string overwriting a Buffer.
size_t buf_len(const struct Buffer *buf)
Calculate the length of a Buffer.
void buf_reset(struct Buffer *buf)
Reset an existing Buffer.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
void buf_fix_dptr(struct Buffer *buf)
Move the dptr to end of the Buffer.
size_t buf_addch(struct Buffer *buf, char c)
Add a single character to a Buffer.
size_t buf_addstr(struct Buffer *buf, const char *s)
Add a string to a Buffer.
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
size_t buf_copy(struct Buffer *dst, const struct Buffer *src)
Copy a Buffer's contents to another Buffer.
char * buf_strdup(const struct Buffer *buf)
Copy a Buffer's string.
size_t buf_concat_path(struct Buffer *buf, const char *dir, const char *fname)
Join a directory name and a filename.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
const struct Regex * cs_subset_regex(const struct ConfigSubset *sub, const char *name)
Get a regex config item by name.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
Convenience wrapper for the config headers.
#define CSR_RESULT(x)
Extract the result code from CSR_* flags.
#define CSR_SUCCESS
Action completed successfully.
#define SORT_REVERSE
Reverse the order of the sort.
Convenience wrapper for the core headers.
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
MailboxType
Supported mailbox formats.
@ MUTT_MAILBOX_ERROR
Error occurred examining Mailbox.
@ MUTT_IMAP
'IMAP' Mailbox type
@ MUTT_UNKNOWN
Mailbox wasn't recognised.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
@ FR_SUCCESS
Valid function - successfully performed.
@ FR_DONE
Exit the Dialog.
@ FR_UNKNOWN
Unknown function.
@ FR_ERROR
Valid function - error occurred.
@ FR_NOT_IMPL
Invalid function - feature not enabled.
@ FR_NO_ACTION
Valid function - no action performed.
int examine_directory(struct Mailbox *m, struct Menu *menu, struct BrowserState *state, const char *dirname, const char *prefix)
Get list of all files/newsgroups with mask.
void init_menu(struct BrowserState *state, struct Menu *menu, struct Mailbox *m, struct MuttWindow *sbar)
Set up a new menu.
struct Buffer LastDir
Browser: previous selected directory.
void init_state(struct BrowserState *state)
Initialise a browser state.
struct Buffer LastDirBackup
Browser: backup copy of the current directory.
void browser_add_folder(const struct Menu *menu, struct BrowserState *state, const char *name, const char *desc, const struct stat *st, struct Mailbox *m, void *data)
Add a folder to the browser list.
void browser_highlight_default(struct BrowserState *state, struct Menu *menu)
Decide which browser item should be highlighted.
int examine_mailboxes(struct Mailbox *m, struct Menu *menu, struct BrowserState *state)
Get list of mailboxes/subscribed newsgroups.
bool link_is_dir(const char *folder, const char *path)
Does this symlink point to a directory?
#define MUTT_COMP_NO_FLAGS
No flags are set.
void mutt_body_free(struct Body **ptr)
Free a Body.
Structs that make up an email.
void mutt_unget_op(int op)
Return an operation to the input buffer.
#define MFF_DEPRECATED
Redraw the pager.
bool OptNews
(pseudo) used to change reader mode
static int op_generic_select_entry(struct AliasMenuData *mdata, const struct KeyEvent *event)
select the current entry - Implements alias_function_t -
static int op_sort(struct AliasMenuData *mdata, const struct KeyEvent *event)
sort aliases - 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_browser_new_file(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Select a new file in this directory - Implements browser_function_t -.
static int op_rename_mailbox(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Rename the current mailbox (IMAP only) - Implements browser_function_t -.
static int op_create_mailbox(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Create a new mailbox (IMAP only) - Implements browser_function_t -.
static int op_browser_view_file(struct BrowserPrivateData *priv, const struct KeyEvent *event)
View file - Implements browser_function_t -.
static int op_mailbox_list(struct BrowserPrivateData *priv, const struct KeyEvent *event)
List mailboxes with new mail - Implements browser_function_t -.
static int op_catchup(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Mark all articles in newsgroup as read - Implements browser_function_t -.
static int op_browser_subscribe(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Subscribe to current mbox (IMAP/NNTP only) - Implements browser_function_t -.
static int op_delete_mailbox(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Delete the current mailbox (IMAP only) - Implements browser_function_t -.
static int op_load_active(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Load list of all newsgroups from NNTP server - Implements browser_function_t -.
static int op_enter_mask(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Enter a file mask - Implements browser_function_t -.
static int op_subscribe_pattern(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Subscribe to newsgroups matching a pattern - Implements browser_function_t -.
static int op_browser_tell(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Display the currently selected file's name - Implements browser_function_t -.
static int op_browser_toggle_lsub(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Toggle view all/subscribed mailboxes (IMAP only) - Implements browser_function_t -.
static int op_toggle_mailboxes(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Toggle whether to browse mailboxes or all files - Implements browser_function_t -.
static int op_change_directory(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Change directories - Implements browser_function_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_message(...)
#define mutt_debug(LEVEL,...)
enum MailboxType imap_path_probe(const char *path, const struct stat *st)
Is this an IMAP Mailbox?
Convenience wrapper for the gui headers.
Read/write command history from/to a file.
@ HC_OTHER
Miscellaneous strings.
int imap_subscribe(const char *path, bool subscribe)
Subscribe to a mailbox.
int imap_delete_mailbox(struct Mailbox *m, char *path)
Delete a mailbox.
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_DEBUG3
Log at debug level 3.
#define FREE(x)
Free memory and set the pointer to NULL.
#define MUTT_MEM_CALLOC(n, type)
Convenience wrapper for the library headers.
size_t mutt_path_realpath(struct Buffer *path)
Resolve path, unraveling symlinks.
bool mutt_str_equal(const char *a, const char *b)
Compare two strings.
size_t mutt_str_copy(char *dest, const char *src, size_t dsize)
Copy a string into a buffer (guaranteeing NUL-termination)
int mutt_view_attachment(FILE *fp, struct Body *b, enum ViewAttachMode mode, struct Email *e, struct AttachCtx *actx, struct MuttWindow *win)
View an attachment.
@ MUTT_VA_REGULAR
View using default method.
bool mutt_mailbox_list(void)
Show a message with the list of mailboxes with new mail.
Mailbox helper functions.
void mutt_get_parent_path(const char *path, char *buf, size_t buflen)
Find the parent of a path (or mailbox)
void expand_path(struct Buffer *buf, bool regex)
Create the canonical path.
Some miscellaneous functions.
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
Nntp-specific Account data.
Usenet network mailbox type; talk to an NNTP server.
void nntp_clear_cache(struct NntpAccountData *adata)
Clear the NNTP cache.
int nntp_active_fetch(struct NntpAccountData *adata, bool mark_new)
Fetch list of all newsgroups from server.
int nntp_newsrc_parse(struct NntpAccountData *adata)
Parse .newsrc file.
void nntp_newsrc_close(struct NntpAccountData *adata)
Unlock and close .newsrc file.
struct NntpMboxData * mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Catchup newsgroup.
int nntp_newsrc_update(struct NntpAccountData *adata)
Update .newsrc file.
struct NntpMboxData * mutt_newsgroup_subscribe(struct NntpAccountData *adata, char *group)
Subscribe newsgroup.
struct NntpMboxData * mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Uncatchup newsgroup.
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
struct NntpMboxData * mutt_newsgroup_unsubscribe(struct NntpAccountData *adata, char *group)
Unsubscribe newsgroup.
Nntp-specific Mailbox data.
const struct CompleteOps CompletePatternOps
Auto-Completion of Patterns.
Match patterns to emails.
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
@ MUTT_NO
User answered 'No', or assume 'No'.
@ MUTT_YES
User answered 'Yes', or assume 'Yes'.
enum QuadOption query_yesorno(const char *prompt, enum QuadOption def)
Ask the user a Yes/No question.
#define REG_COMP(preg, regex, cflags)
Compile a regular expression.
Convenience wrapper for the send headers.
struct Body * mutt_make_file_attach(const char *path, struct ConfigSubset *sub)
Create a file attachment.
void * adata
Private data (for Mailbox backends)
int op
Op code, e.g. OP_MAIN_LIMIT.
browser_function_t function
Function to call.
Private state data for the Browser.
char *** files
Array of selected files.
struct Buffer * prefix
Folder prefix string.
struct Buffer * old_last_dir
Previous to last dir.
bool kill_prefix
Prefix is in use.
bool done
Should we close the Dialog?
int last_selected_mailbox
Index of last selected Mailbox.
int * numfiles
Number of selected files.
struct Mailbox * mailbox
Mailbox.
struct BrowserState state
State containing list of files/dir/mailboxes.
struct Buffer * file
Buffer for the result.
bool multiple
Allow multiple selections.
struct MuttWindow * sbar
Status Bar.
char goto_swapper[PATH_MAX]
Saved path after <goto-folder>
State of the file/mailbox browser.
char * folder
Folder name.
bool is_mailbox_list
Viewing mailboxes.
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
bool imap_browse
IMAP folder.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
Input for the file completion function.
Browser entry representing a folder/dir.
bool selectable
Folder can be selected.
char delim
Path delimiter.
bool imap
This is an IMAP folder.
char * name
Name of file/dir/mailbox.
bool tagged
Folder is tagged.
char * desc
Description of mailbox.
mode_t mode
File permissions.
bool inferiors
Folder has children.
An event such as a keypress.
int op
Function opcode, e.g. OP_HELP.
void * mdata
Driver specific data.
void * wdata
Private data.
Container for Accounts, Notifications.
char * home_dir
User's home directory.
struct ConfigSubset * sub
Inherited config items.
NNTP-specific Account data -.
struct NntpMboxData ** groups_list
List of newsgroups.
unsigned int groups_num
Number of newsgroups.
NNTP-specific Mailbox data -.
bool deleted
Newsgroup is deleted.
struct NntpAccountData * adata
Account data.
Cached regular expression.
char * pattern
printable version
A parsed URL proto://user:password@host:port/path?a=1&b=2
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.
int cs_subset_str_string_set(const struct ConfigSubset *sub, const char *name, const char *value, struct Buffer *err)
Set a config item by string.
@ MENU_BROWSER
General file/mailbox browser.
struct Url * url_parse(const char *src)
Fill in Url.
void url_free(struct Url **ptr)
Free the contents of a URL.