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

Browser functions. More...

#include "config.h"
#include <limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include "mutt/lib.h"
#include "config/lib.h"
#include "email/lib.h"
#include "core/lib.h"
#include "gui/lib.h"
#include "functions.h"
#include "lib.h"
#include "attach/lib.h"
#include "editor/lib.h"
#include "history/lib.h"
#include "imap/lib.h"
#include "key/lib.h"
#include "menu/lib.h"
#include "nntp/lib.h"
#include "pattern/lib.h"
#include "question/lib.h"
#include "send/lib.h"
#include "globals.h"
#include "module_data.h"
#include "mutt_mailbox.h"
#include "muttlib.h"
#include "mx.h"
#include "nntp/adata.h"
#include "nntp/mdata.h"
#include "private_data.h"
#include "sort.h"
+ Include dependency graph for functions.c:

Go to the source code of this file.

Functions

static int op_subscribe_pattern (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 Subscribe to newsgroups matching a pattern - Implements browser_function_t -.
 
void browser_init_keys (struct NeoMutt *n, struct SubMenu *sm_generic)
 Initialise the Browser Keybindings - Implements ::init_keys_api.
 
void destroy_state (struct BrowserState *state)
 Free the BrowserState.
 
static int browser_add_selection (struct FolderFilePtrArray *ffpa, struct BrowserState *state, struct Menu *menu, bool tagged, int count)
 Build a working set of FolderFile pointers for an action.
 
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 void browser_apply_subscribe_nntp (struct FolderFilePtrArray *ffpa, struct NntpAccountData *adata, bool subscribe)
 Subscribe/unsubscribe to NNTP newsgroups.
 
static void browser_apply_subscribe_imap (struct FolderFilePtrArray *ffpa, bool subscribe)
 Subscribe/unsubscribe to IMAP mailboxes.
 
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_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_browser_view_file (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 View file - Implements browser_function_t -.
 
static struct NntpMboxDatabrowser_apply_catchup (struct FolderFilePtrArray *ffpa, struct Mailbox *m, struct NntpAccountData *adata, bool up)
 (Un)catchup a working set of newsgroups
 
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_change_directory (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 Change directories - 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 browser_apply_delete_mailbox (struct FolderFilePtrArray *ffpa, struct BrowserState *state, struct Mailbox *m, int *num_failed)
 Delete a working set of IMAP mailboxes.
 
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_enter_mask (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 Enter a file mask - Implements browser_function_t -.
 
static int op_exit (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 Exit this menu - Implements browser_function_t -.
 
static int op_jump (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 Jump to an index number - Implements browser_function_t -.
 
static int op_generic_select_entry (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 Select the current entry - 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_mailbox_list (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 List mailboxes with new mail - 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_sort (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 Sort messages - 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 -.
 
int browser_function_dispatcher (struct MuttWindow *win, const struct KeyEvent *event)
 Perform a Browser function.
 

Variables

static const struct MenuFuncOp OpBrowser []
 Functions for the file Browser Menu.
 
static const struct MenuOpSeq BrowserDefaultBindings []
 Key bindings for the file Browser Menu.
 
static const struct BrowserFunction BrowserFunctions []
 All the NeoMutt functions that the Browser supports.
 

Detailed Description

Browser 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

◆ browser_init_keys()

void browser_init_keys ( struct NeoMutt * n,
struct SubMenu * sm_generic )

Initialise the Browser Keybindings - Implements ::init_keys_api.

Definition at line 129 of file functions.c.

130{
132 ASSERT(mod_data);
133
134 struct MenuDefinition *md = NULL;
135 struct SubMenu *sm = NULL;
136
138 md = km_register_menu(MENU_BROWSER, "browser");
139 km_menu_add_submenu(md, sm);
140 km_menu_add_submenu(md, sm_generic);
142
143 mod_data->menu_browser = md;
144}
static const struct MenuOpSeq BrowserDefaultBindings[]
Key bindings for the file Browser Menu.
Definition functions.c:103
static const struct MenuFuncOp OpBrowser[]
Functions for the file Browser Menu.
Definition functions.c:69
void km_menu_add_submenu(struct MenuDefinition *md, struct SubMenu *sm)
Add a SubMenu to a Menu Definition.
Definition init.c:121
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
Definition init.c:87
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
Definition init.c:104
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
Definition init.c:134
@ MODULE_ID_BROWSER
ModuleBrowser, Mailbox Browser
Definition module_api.h:52
void * neomutt_get_module_data(struct NeoMutt *n, enum ModuleId id)
Get the private data for a Module.
Definition neomutt.c:663
#define ASSERT(COND)
Definition signal2.h:59
Browser private Module data.
Definition module_data.h:32
struct MenuDefinition * menu_browser
Browser menu definition.
Definition module_data.h:34
Functions for a Dialog or Window.
Definition menu.h:77
Collection of related functions.
Definition menu.h:65
@ MENU_BROWSER
General file/mailbox browser.
Definition type.h:39
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ destroy_state()

void destroy_state ( struct BrowserState * state)

Free the BrowserState.

Parameters
stateState to free

Frees up the memory allocated for the local-global variables.

Definition at line 152 of file functions.c.

153{
154 struct FolderFile *ff = NULL;
155 ARRAY_FOREACH(ff, &state->entry)
156 {
157 FREE(&ff->name);
158 FREE(&ff->desc);
159 }
160 ARRAY_FREE(&state->entry);
161 FREE(&state->folder);
162}
#define ARRAY_FOREACH(elem, head)
Iterate over all elements of the array.
Definition array.h:223
#define ARRAY_FREE(head)
Release all memory.
Definition array.h:209
#define FREE(x)
Free memory and set the pointer to NULL.
Definition memory.h:68
char * folder
Folder name.
Definition lib.h:151
struct BrowserEntryArray entry
Array of files / dirs / mailboxes.
Definition lib.h:149
Browser entry representing a folder/dir.
Definition lib.h:82
char * name
Name of file/dir/mailbox.
Definition lib.h:90
char * desc
Description of mailbox.
Definition lib.h:91
+ Here is the caller graph for this function:

◆ browser_add_selection()

static int browser_add_selection ( struct FolderFilePtrArray * ffpa,
struct BrowserState * state,
struct Menu * menu,
bool tagged,
int count )
static

Build a working set of FolderFile pointers for an action.

Parameters
ffpaFolderFile Array to populate
stateBrowser state (source of entries)
menuMenu
taggedUse tagged entries (tag-prefix)
countRepeat-count (0 or 1 == just the current selection)
Return values
numNumber of entries added

If tagged is true, the array is filled with the tagged entries (in source order) and count is ignored.

Otherwise the array is filled with the current selection and the next count - 1 entries. Overruns are silently capped at the end of the list.

Definition at line 181 of file functions.c.

183{
184 if (!ffpa || !state || !menu)
185 return 0;
186
187 const int max = ARRAY_SIZE(&state->entry);
188
189 if (tagged)
190 {
191 struct FolderFile *ff = NULL;
192 ARRAY_FOREACH(ff, &state->entry)
193 {
194 if (ff->tagged)
195 ARRAY_ADD(ffpa, ff);
196 }
197 }
198 else
199 {
200 const int index = menu_get_index(menu);
201 if ((index < 0) || (index >= max))
202 return 0;
203
204 int n = (count > 1) ? count : 1;
205 if ((index + n) > max)
206 n = max - index;
207
208 for (int i = 0; i < n; i++)
209 {
210 struct FolderFile *ff = ARRAY_GET(&state->entry, index + i);
211 if (ff)
212 ARRAY_ADD(ffpa, ff);
213 }
214 }
215
216 return ARRAY_SIZE(ffpa);
217}
#define ARRAY_ADD(head, elem)
Add an element at the end of the array.
Definition array.h:157
#define ARRAY_SIZE(head)
The number of elements stored.
Definition array.h:87
#define ARRAY_GET(head, idx)
Return the element at index.
Definition array.h:109
int menu_get_index(struct Menu *menu)
Get the current selection in the Menu.
Definition menu.c:155
bool tagged
Folder is tagged.
Definition lib.h:106
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ browser_apply_subscribe_nntp()

static void browser_apply_subscribe_nntp ( struct FolderFilePtrArray * ffpa,
struct NntpAccountData * adata,
bool subscribe )
static

Subscribe/unsubscribe to NNTP newsgroups.

Parameters
ffpaWorking set of FolderFiles
adataNNTP account
subscribetrue to subscribe, false to unsubscribe

Definition at line 249 of file functions.c.

251{
252 if (!ffpa || !adata)
253 return;
254
255 struct FolderFile **ffp = NULL;
256 ARRAY_FOREACH(ffp, ffpa)
257 {
258 struct FolderFile *ff = *ffp;
259 if (!ff || !ff->name)
260 continue;
261 if (subscribe)
262 mutt_newsgroup_subscribe(adata, ff->name);
263 else
265 }
266}
struct NntpMboxData * mutt_newsgroup_subscribe(struct NntpAccountData *adata, char *group)
Subscribe newsgroup.
Definition newsrc.c:1183
struct NntpMboxData * mutt_newsgroup_unsubscribe(struct NntpAccountData *adata, char *group)
Unsubscribe newsgroup.
Definition newsrc.c:1207
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ browser_apply_subscribe_imap()

static void browser_apply_subscribe_imap ( struct FolderFilePtrArray * ffpa,
bool subscribe )
static

Subscribe/unsubscribe to IMAP mailboxes.

Parameters
ffpaWorking set of FolderFiles
subscribetrue to subscribe, false to unsubscribe

Definition at line 273 of file functions.c.

274{
275 if (!ffpa)
276 return;
277
278 struct Buffer *buf = buf_pool_get();
279 struct FolderFile **ffp = NULL;
280 ARRAY_FOREACH(ffp, ffpa)
281 {
282 struct FolderFile *ff = *ffp;
283 if (!ff || !ff->name)
284 continue;
285 buf_strcpy(buf, ff->name);
286 expand_path(buf, false);
287 imap_subscribe(buf_string(buf), subscribe);
288 }
289 buf_pool_release(&buf);
290}
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:395
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Definition buffer.h:96
int imap_subscribe(const char *path, bool subscribe)
Subscribe to a mailbox.
Definition imap.c:1413
void expand_path(struct Buffer *buf, bool regex)
Create the canonical path.
Definition muttlib.c:122
struct Buffer * buf_pool_get(void)
Get a Buffer from the pool.
Definition pool.c:91
void buf_pool_release(struct Buffer **ptr)
Return a Buffer to the pool.
Definition pool.c:111
String manipulation buffer.
Definition buffer.h:36
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ browser_apply_catchup()

static struct NntpMboxData * browser_apply_catchup ( struct FolderFilePtrArray * ffpa,
struct Mailbox * m,
struct NntpAccountData * adata,
bool up )
static

(Un)catchup a working set of newsgroups

Parameters
ffpaWorking set of FolderFiles
mMailbox
adataNNTP account
uptrue to catchup, false to uncatchup
Return values
ptrLast NntpMboxData touched (NULL if nothing changed)

Definition at line 438 of file functions.c.

441{
442 if (!ffpa || !adata)
443 return NULL;
444
445 struct NntpMboxData *mdata = NULL;
446 struct FolderFile **ffp = NULL;
447 ARRAY_FOREACH(ffp, ffpa)
448 {
449 struct FolderFile *ff = *ffp;
450 if (!ff || !ff->name)
451 continue;
452 if (up)
453 mdata = mutt_newsgroup_catchup(m, adata, ff->name);
454 else
455 mdata = mutt_newsgroup_uncatchup(m, adata, ff->name);
456 }
457 return mdata;
458}
struct NntpMboxData * mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Catchup newsgroup.
Definition newsrc.c:1234
struct NntpMboxData * mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Uncatchup newsgroup.
Definition newsrc.c:1273
void * mdata
Driver specific data.
Definition mailbox.h:134
NNTP-specific Mailbox data -.
Definition mdata.h:34
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ browser_apply_delete_mailbox()

static int browser_apply_delete_mailbox ( struct FolderFilePtrArray * ffpa,
struct BrowserState * state,
struct Mailbox * m,
int * num_failed )
static

Delete a working set of IMAP mailboxes.

Parameters
[in]ffpaWorking set of FolderFiles (ascending source order)
[in]stateBrowser state (source array)
[in]mCurrent mailbox
[out]num_failedNumber of mailbox deletions that failed
Return values
numNumber of mailboxes successfully deleted (and removed from state)

Iterates the working set in reverse so that ARRAY_REMOVE() does not invalidate the pointers we still need.

Definition at line 678 of file functions.c.

681{
682 int deleted = 0;
683 int failed = 0;
684
685 if (ffpa && state)
686 {
687 struct FolderFile **ffp = NULL;
688 ARRAY_FOREACH_REVERSE(ffp, ffpa)
689 {
690 struct FolderFile *ff = *ffp;
691 if (!ff || !ff->name)
692 continue;
693 if (imap_delete_mailbox(m, ff->name) != 0)
694 {
695 failed++;
696 continue;
697 }
698 FREE(&ff->name);
699 FREE(&ff->desc);
700 ARRAY_REMOVE(&state->entry, ff);
701 deleted++;
702 }
703 }
704
705 if (num_failed)
706 *num_failed = failed;
707 return deleted;
708}
#define ARRAY_FOREACH_REVERSE(elem, head)
Iterate backwards over all elements of the array.
Definition array.h:274
#define ARRAY_REMOVE(head, elem)
Remove an entry from the array, shifting down the subsequent entries.
Definition array.h:355
int imap_delete_mailbox(struct Mailbox *m, char *path)
Delete a mailbox.
Definition imap.c:611
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ browser_function_dispatcher()

int browser_function_dispatcher ( struct MuttWindow * win,
const struct KeyEvent * event )

Perform a Browser function.

Parameters
winWindow for the Browser
eventEvent to process
Return values
numFunctionRetval, e.g. FR_SUCCESS

Definition at line 1442 of file functions.c.

1443{
1444 // The Dispatcher may be called on any Window in the Dialog
1445 struct MuttWindow *dlg = dialog_find(win);
1446 if (!dlg || !dlg->wdata)
1447 return FR_ERROR;
1448
1449 struct Menu *menu = dlg->wdata;
1450 struct BrowserPrivateData *priv = menu->mdata;
1451 if (!priv)
1452 return FR_ERROR;
1453
1454 int rc = FR_UNKNOWN;
1455 for (size_t i = 0; BrowserFunctions[i].op != OP_NULL; i++)
1456 {
1457 const struct BrowserFunction *fn = &BrowserFunctions[i];
1458 if (fn->op == event->op)
1459 {
1460 rc = fn->function(priv, event);
1461 break;
1462 }
1463 }
1464
1465 return rc;
1466}
static const struct BrowserFunction BrowserFunctions[]
All the NeoMutt functions that the Browser supports.
Definition functions.c:1404
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
Definition dialog.c:89
@ FR_UNKNOWN
Unknown function.
Definition dispatcher.h:34
@ FR_ERROR
Valid function - error occurred.
Definition dispatcher.h:39
A NeoMutt function.
Definition functions.h:49
int op
Op code, e.g. OP_MAIN_LIMIT.
Definition functions.h:50
browser_function_t function
Function to call.
Definition functions.h:51
Private state data for the Browser.
struct Menu * menu
Menu.
int op
Function opcode, e.g. OP_HELP.
Definition get.h:77
Definition lib.h:86
void * mdata
Private data.
Definition lib.h:155
void * wdata
Private data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ OpBrowser

const struct MenuFuncOp OpBrowser[]
static
Initial value:
= {
{ "catchup", OP_CATCHUP },
{ "change-dir", OP_CHANGE_DIRECTORY },
{ "check-new", OP_CHECK_NEW },
{ "create-mailbox", OP_CREATE_MAILBOX },
{ "delete-mailbox", OP_DELETE_MAILBOX },
{ "descend-directory", OP_DESCEND_DIRECTORY },
{ "display-filename", OP_BROWSER_TELL },
{ "enter-mask", OP_ENTER_MASK },
{ "exit", OP_EXIT },
{ "goto-folder", OP_BROWSER_GOTO_FOLDER },
{ "goto-parent", OP_GOTO_PARENT },
{ "mailbox-list", OP_MAILBOX_LIST },
{ "reload-active", OP_LOAD_ACTIVE },
{ "rename-mailbox", OP_RENAME_MAILBOX },
{ "select-new", OP_BROWSER_NEW_FILE },
{ "sort", OP_SORT },
{ "sort-reverse", OP_SORT_REVERSE },
{ "subscribe", OP_BROWSER_SUBSCRIBE },
{ "subscribe-pattern", OP_SUBSCRIBE_PATTERN },
{ "toggle-mailboxes", OP_TOGGLE_MAILBOXES },
{ "toggle-subscribed", OP_BROWSER_TOGGLE_LSUB },
{ "uncatchup", OP_UNCATCHUP },
{ "unsubscribe", OP_BROWSER_UNSUBSCRIBE },
{ "unsubscribe-pattern", OP_UNSUBSCRIBE_PATTERN },
{ "view-file", OP_BROWSER_VIEW_FILE },
{ "buffy-list", OP_MAILBOX_LIST, MFF_DEPRECATED },
{ NULL, 0 },
}
@ MFF_DEPRECATED
Function is deprecated.
Definition get.h:67

Functions for the file Browser Menu.

Definition at line 69 of file functions.c.

69 { /* map: browser */
70 { "catchup", OP_CATCHUP },
71 { "change-dir", OP_CHANGE_DIRECTORY },
72 { "check-new", OP_CHECK_NEW },
73 { "create-mailbox", OP_CREATE_MAILBOX },
74 { "delete-mailbox", OP_DELETE_MAILBOX },
75 { "descend-directory", OP_DESCEND_DIRECTORY },
76 { "display-filename", OP_BROWSER_TELL },
77 { "enter-mask", OP_ENTER_MASK },
78 { "exit", OP_EXIT },
79 { "goto-folder", OP_BROWSER_GOTO_FOLDER },
80 { "goto-parent", OP_GOTO_PARENT },
81 { "mailbox-list", OP_MAILBOX_LIST },
82 { "reload-active", OP_LOAD_ACTIVE },
83 { "rename-mailbox", OP_RENAME_MAILBOX },
84 { "select-new", OP_BROWSER_NEW_FILE },
85 { "sort", OP_SORT },
86 { "sort-reverse", OP_SORT_REVERSE },
87 { "subscribe", OP_BROWSER_SUBSCRIBE },
88 { "subscribe-pattern", OP_SUBSCRIBE_PATTERN },
89 { "toggle-mailboxes", OP_TOGGLE_MAILBOXES },
90 { "toggle-subscribed", OP_BROWSER_TOGGLE_LSUB },
91 { "uncatchup", OP_UNCATCHUP },
92 { "unsubscribe", OP_BROWSER_UNSUBSCRIBE },
93 { "unsubscribe-pattern", OP_UNSUBSCRIBE_PATTERN },
94 { "view-file", OP_BROWSER_VIEW_FILE },
95 // Deprecated
96 { "buffy-list", OP_MAILBOX_LIST, MFF_DEPRECATED },
97 { NULL, 0 },
98};

◆ BrowserDefaultBindings

const struct MenuOpSeq BrowserDefaultBindings[]
static
Initial value:
= {
{ OP_BROWSER_GOTO_FOLDER, "=" },
{ OP_BROWSER_NEW_FILE, "N" },
{ OP_BROWSER_SUBSCRIBE, "s" },
{ OP_BROWSER_TELL, "@" },
{ OP_BROWSER_TOGGLE_LSUB, "T" },
{ OP_BROWSER_UNSUBSCRIBE, "u" },
{ OP_BROWSER_VIEW_FILE, " " },
{ OP_CHANGE_DIRECTORY, "c" },
{ OP_CREATE_MAILBOX, "C" },
{ OP_DELETE_MAILBOX, "d" },
{ OP_ENTER_MASK, "m" },
{ OP_EXIT, "q" },
{ OP_GOTO_PARENT, "p" },
{ OP_MAILBOX_LIST, "." },
{ OP_RENAME_MAILBOX, "r" },
{ OP_SORT, "o" },
{ OP_SORT_REVERSE, "O" },
{ OP_TOGGLE_MAILBOXES, "\t" },
{ 0, NULL },
}

Key bindings for the file Browser Menu.

Definition at line 103 of file functions.c.

103 { /* map: browser */
104 { OP_BROWSER_GOTO_FOLDER, "=" },
105 { OP_BROWSER_NEW_FILE, "N" },
106 { OP_BROWSER_SUBSCRIBE, "s" },
107 { OP_BROWSER_TELL, "@" },
108 { OP_BROWSER_TOGGLE_LSUB, "T" },
109 { OP_BROWSER_UNSUBSCRIBE, "u" },
110 { OP_BROWSER_VIEW_FILE, " " }, // <Space>
111 { OP_CHANGE_DIRECTORY, "c" },
112 { OP_CREATE_MAILBOX, "C" },
113 { OP_DELETE_MAILBOX, "d" },
114 { OP_ENTER_MASK, "m" },
115 { OP_EXIT, "q" },
116 { OP_GOTO_PARENT, "p" },
117 { OP_MAILBOX_LIST, "." },
118 { OP_RENAME_MAILBOX, "r" },
119 { OP_SORT, "o" },
120 { OP_SORT_REVERSE, "O" },
121 { OP_TOGGLE_MAILBOXES, "\t" }, // <Tab>
122 { 0, NULL },
123};

◆ BrowserFunctions

const struct BrowserFunction BrowserFunctions[]
static

All the NeoMutt functions that the Browser supports.

Definition at line 1404 of file functions.c.

1404 {
1405 // clang-format off
1406 { OP_BROWSER_GOTO_FOLDER, op_toggle_mailboxes },
1407 { OP_BROWSER_NEW_FILE, op_browser_new_file },
1408 { OP_BROWSER_SUBSCRIBE, op_browser_subscribe },
1409 { OP_BROWSER_TELL, op_browser_tell },
1410 { OP_BROWSER_TOGGLE_LSUB, op_browser_toggle_lsub },
1411 { OP_BROWSER_UNSUBSCRIBE, op_browser_subscribe },
1412 { OP_BROWSER_VIEW_FILE, op_browser_view_file },
1413 { OP_CATCHUP, op_catchup },
1414 { OP_CHANGE_DIRECTORY, op_change_directory },
1415 { OP_CHECK_NEW, op_toggle_mailboxes },
1416 { OP_CREATE_MAILBOX, op_create_mailbox },
1417 { OP_DELETE_MAILBOX, op_delete_mailbox },
1418 { OP_DESCEND_DIRECTORY, op_generic_select_entry },
1419 { OP_ENTER_MASK, op_enter_mask },
1420 { OP_EXIT, op_exit },
1421 { OP_GENERIC_SELECT_ENTRY, op_generic_select_entry },
1422 { OP_GOTO_PARENT, op_change_directory },
1423 { OP_LOAD_ACTIVE, op_load_active },
1424 { OP_MAILBOX_LIST, op_mailbox_list },
1425 { OP_RENAME_MAILBOX, op_rename_mailbox },
1426 { OP_SORT, op_sort },
1427 { OP_SORT_REVERSE, op_sort },
1428 { OP_SUBSCRIBE_PATTERN, op_subscribe_pattern },
1429 { OP_TOGGLE_MAILBOXES, op_toggle_mailboxes },
1430 { OP_UNCATCHUP, op_catchup },
1431 { OP_UNSUBSCRIBE_PATTERN, op_subscribe_pattern },
1432 { 0, NULL },
1433 // clang-format on
1434};
static int op_exit(struct AliasFunctionData *fdata, const struct KeyEvent *event)
exit this menu - Implements alias_function_t -
Definition functions.c:312
static int op_generic_select_entry(struct AliasFunctionData *fdata, const struct KeyEvent *event)
select the current entry - Implements alias_function_t -
Definition functions.c:392
static int op_sort(struct AliasFunctionData *fdata, const struct KeyEvent *event)
sort aliases - Implements alias_function_t -
Definition functions.c:561
static int op_browser_new_file(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Select a new file in this directory - Implements browser_function_t -.
Definition functions.c:222
static int op_rename_mailbox(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Rename the current mailbox (IMAP only) - Implements browser_function_t -.
Definition functions.c:1141
static int op_create_mailbox(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Create a new mailbox (IMAP only) - Implements browser_function_t -.
Definition functions.c:642
static int op_browser_view_file(struct BrowserPrivateData *priv, const struct KeyEvent *event)
View file - Implements browser_function_t -.
Definition functions.c:387
static int op_mailbox_list(struct BrowserPrivateData *priv, const struct KeyEvent *event)
List mailboxes with new mail - Implements browser_function_t -.
Definition functions.c:1132
static int op_catchup(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Mark all articles in newsgroup as read - Implements browser_function_t -.
Definition functions.c:470
static int op_browser_subscribe(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Subscribe to current mbox (IMAP/NNTP only) - Implements browser_function_t -.
Definition functions.c:302
static int op_delete_mailbox(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Delete the current mailbox (IMAP only) - Implements browser_function_t -.
Definition functions.c:716
static int op_load_active(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Load list of all newsgroups from NNTP server - Implements browser_function_t -.
Definition functions.c:1094
static int op_enter_mask(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Enter a file mask - Implements browser_function_t -.
Definition functions.c:790
static int op_subscribe_pattern(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Subscribe to newsgroups matching a pattern - Implements browser_function_t -.
Definition functions.c:1242
static int op_browser_tell(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Display the currently selected file's name - Implements browser_function_t -.
Definition functions.c:360
static int op_browser_toggle_lsub(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Toggle view all/subscribed mailboxes (IMAP only) - Implements browser_function_t -.
Definition functions.c:373
static int op_toggle_mailboxes(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Toggle whether to browse mailboxes or all files - Implements browser_function_t -.
Definition functions.c:1330
static int op_change_directory(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Change directories - Implements browser_function_t -.
Definition functions.c:523