NeoMutt  2025-12-11-980-ge38c27
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_quit (struct BrowserPrivateData *priv, const struct KeyEvent *event)
 Save changes and exit this dialog - 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 127 of file functions.c.

128{
130 ASSERT(mod_data);
131
132 struct MenuDefinition *md = NULL;
133 struct SubMenu *sm = NULL;
134
136 md = km_register_menu(MENU_BROWSER, "browser");
137 km_menu_add_submenu(md, sm);
138 km_menu_add_submenu(md, sm_generic);
140
141 mod_data->menu_browser = md;
142}
static const struct MenuOpSeq BrowserDefaultBindings[]
Key bindings for the file Browser Menu.
Definition functions.c:102
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:123
struct SubMenu * km_register_submenu(const struct MenuFuncOp functions[])
Register a submenu.
Definition init.c:88
struct MenuDefinition * km_register_menu(int menu, const char *name)
Register a menu.
Definition init.c:105
void km_menu_add_bindings(struct MenuDefinition *md, const struct MenuOpSeq bindings[])
Add Keybindings to a Menu.
Definition init.c:136
@ 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:666
#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 menudef.h:44
Collection of related functions.
Definition menudef.h:33
@ 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 150 of file functions.c.

151{
152 struct FolderFile *ff = NULL;
153 ARRAY_FOREACH(ff, &state->entry)
154 {
155 FREE(&ff->name);
156 FREE(&ff->desc);
157 }
158 ARRAY_FREE(&state->entry);
159 FREE(&state->folder);
160}
#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 179 of file functions.c.

181{
182 if (!ffpa || !state || !menu)
183 return 0;
184
185 const int max = ARRAY_SIZE(&state->entry);
186
187 if (tagged)
188 {
189 struct FolderFile *ff = NULL;
190 ARRAY_FOREACH(ff, &state->entry)
191 {
192 if (ff->tagged)
193 ARRAY_ADD(ffpa, ff);
194 }
195 }
196 else
197 {
198 const int index = menu_get_index(menu);
199 if ((index < 0) || (index >= max))
200 return 0;
201
202 int n = (count > 1) ? count : 1;
203 if ((index + n) > max)
204 n = max - index;
205
206 for (int i = 0; i < n; i++)
207 {
208 struct FolderFile *ff = ARRAY_GET(&state->entry, index + i);
209 if (ff)
210 ARRAY_ADD(ffpa, ff);
211 }
212 }
213
214 return ARRAY_SIZE(ffpa);
215}
#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:153
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 247 of file functions.c.

249{
250 if (!ffpa || !adata)
251 return;
252
253 struct FolderFile **ffp = NULL;
254 ARRAY_FOREACH(ffp, ffpa)
255 {
256 struct FolderFile *ff = *ffp;
257 if (!ff || !ff->name)
258 continue;
259 if (subscribe)
260 mutt_newsgroup_subscribe(adata, ff->name);
261 else
263 }
264}
struct NntpMboxData * mutt_newsgroup_subscribe(struct NntpAccountData *adata, char *group)
Subscribe newsgroup.
Definition newsrc.c:1188
struct NntpMboxData * mutt_newsgroup_unsubscribe(struct NntpAccountData *adata, char *group)
Unsubscribe newsgroup.
Definition newsrc.c:1212
+ 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 271 of file functions.c.

272{
273 if (!ffpa)
274 return;
275
276 struct Buffer *buf = buf_pool_get();
277 struct FolderFile **ffp = NULL;
278 ARRAY_FOREACH(ffp, ffpa)
279 {
280 struct FolderFile *ff = *ffp;
281 if (!ff || !ff->name)
282 continue;
283 buf_strcpy(buf, ff->name);
284 expand_path(buf, false);
285 imap_subscribe(buf_string(buf), subscribe);
286 }
287 buf_pool_release(&buf);
288}
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
Definition buffer.c:401
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 436 of file functions.c.

439{
440 if (!ffpa || !adata)
441 return NULL;
442
443 struct NntpMboxData *mdata = NULL;
444 struct FolderFile **ffp = NULL;
445 ARRAY_FOREACH(ffp, ffpa)
446 {
447 struct FolderFile *ff = *ffp;
448 if (!ff || !ff->name)
449 continue;
450 if (up)
451 mdata = mutt_newsgroup_catchup(m, adata, ff->name);
452 else
453 mdata = mutt_newsgroup_uncatchup(m, adata, ff->name);
454 }
455 return mdata;
456}
struct NntpMboxData * mutt_newsgroup_catchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Catchup newsgroup.
Definition newsrc.c:1239
struct NntpMboxData * mutt_newsgroup_uncatchup(struct Mailbox *m, struct NntpAccountData *adata, char *group)
Uncatchup newsgroup.
Definition newsrc.c:1278
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 676 of file functions.c.

679{
680 int deleted = 0;
681 int failed = 0;
682
683 if (ffpa && state)
684 {
685 struct FolderFile **ffp = NULL;
686 ARRAY_FOREACH_REVERSE(ffp, ffpa)
687 {
688 struct FolderFile *ff = *ffp;
689 if (!ff || !ff->name)
690 continue;
691 if (imap_delete_mailbox(m, ff->name) != 0)
692 {
693 failed++;
694 continue;
695 }
696 FREE(&ff->name);
697 FREE(&ff->desc);
698 ARRAY_REMOVE(&state->entry, ff);
699 deleted++;
700 }
701 }
702
703 if (num_failed)
704 *num_failed = failed;
705 return deleted;
706}
#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 1441 of file functions.c.

1442{
1443 // The Dispatcher may be called on any Window in the Dialog
1444 struct MuttWindow *dlg = dialog_find(win);
1445 if (!dlg || !dlg->wdata)
1446 return FR_ERROR;
1447
1448 struct Menu *menu = dlg->wdata;
1449 struct BrowserPrivateData *priv = menu->mdata;
1450 if (!priv)
1451 return FR_ERROR;
1452
1453 int rc = FR_UNKNOWN;
1454 for (size_t i = 0; BrowserFunctions[i].op != OP_NULL; i++)
1455 {
1456 const struct BrowserFunction *fn = &BrowserFunctions[i];
1457 if (fn->op == event->op)
1458 {
1459 rc = fn->function(priv, event);
1460 break;
1461 }
1462 }
1463
1464 return rc;
1465}
static const struct BrowserFunction BrowserFunctions[]
All the NeoMutt functions that the Browser supports.
Definition functions.c:1402
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 },
{ "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 { "goto-folder", OP_BROWSER_GOTO_FOLDER },
79 { "goto-parent", OP_GOTO_PARENT },
80 { "mailbox-list", OP_MAILBOX_LIST },
81 { "reload-active", OP_LOAD_ACTIVE },
82 { "rename-mailbox", OP_RENAME_MAILBOX },
83 { "select-new", OP_BROWSER_NEW_FILE },
84 { "sort", OP_SORT },
85 { "sort-reverse", OP_SORT_REVERSE },
86 { "subscribe", OP_BROWSER_SUBSCRIBE },
87 { "subscribe-pattern", OP_SUBSCRIBE_PATTERN },
88 { "toggle-mailboxes", OP_TOGGLE_MAILBOXES },
89 { "toggle-subscribed", OP_BROWSER_TOGGLE_LSUB },
90 { "uncatchup", OP_UNCATCHUP },
91 { "unsubscribe", OP_BROWSER_UNSUBSCRIBE },
92 { "unsubscribe-pattern", OP_UNSUBSCRIBE_PATTERN },
93 { "view-file", OP_BROWSER_VIEW_FILE },
94 // Deprecated
95 { "buffy-list", OP_MAILBOX_LIST, MFF_DEPRECATED },
96 { NULL, 0 },
97};

◆ 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_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 102 of file functions.c.

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

◆ BrowserFunctions

const struct BrowserFunction BrowserFunctions[]
static

All the NeoMutt functions that the Browser supports.

Definition at line 1402 of file functions.c.

1402 {
1403 // clang-format off
1404 { OP_BROWSER_GOTO_FOLDER, op_toggle_mailboxes },
1405 { OP_BROWSER_NEW_FILE, op_browser_new_file },
1406 { OP_BROWSER_SUBSCRIBE, op_browser_subscribe },
1407 { OP_BROWSER_TELL, op_browser_tell },
1408 { OP_BROWSER_TOGGLE_LSUB, op_browser_toggle_lsub },
1409 { OP_BROWSER_UNSUBSCRIBE, op_browser_subscribe },
1410 { OP_BROWSER_VIEW_FILE, op_browser_view_file },
1411 { OP_CATCHUP, op_catchup },
1412 { OP_CHANGE_DIRECTORY, op_change_directory },
1413 { OP_CHECK_NEW, op_toggle_mailboxes },
1414 { OP_CREATE_MAILBOX, op_create_mailbox },
1415 { OP_DELETE_MAILBOX, op_delete_mailbox },
1416 { OP_DESCEND_DIRECTORY, op_generic_select_entry },
1417 { OP_ENTER_MASK, op_enter_mask },
1418 { OP_EXIT, op_quit },
1419 { OP_GENERIC_SELECT_ENTRY, op_generic_select_entry },
1420 { OP_GOTO_PARENT, op_change_directory },
1421 { OP_LOAD_ACTIVE, op_load_active },
1422 { OP_MAILBOX_LIST, op_mailbox_list },
1423 { OP_QUIT, op_quit },
1424 { OP_RENAME_MAILBOX, op_rename_mailbox },
1425 { OP_SORT, op_sort },
1426 { OP_SORT_REVERSE, op_sort },
1427 { OP_SUBSCRIBE_PATTERN, op_subscribe_pattern },
1428 { OP_TOGGLE_MAILBOXES, op_toggle_mailboxes },
1429 { OP_UNCATCHUP, op_catchup },
1430 { OP_UNSUBSCRIBE_PATTERN, op_subscribe_pattern },
1431 { 0, NULL },
1432 // clang-format on
1433};
static int op_quit(struct AliasFunctionData *fdata, const struct KeyEvent *event)
Save changes and exit this dialog - Implements alias_function_t -.
Definition functions.c:308
static int op_generic_select_entry(struct AliasFunctionData *fdata, const struct KeyEvent *event)
select the current entry - Implements alias_function_t -
Definition functions.c:388
static int op_sort(struct AliasFunctionData *fdata, const struct KeyEvent *event)
sort aliases - Implements alias_function_t -
Definition functions.c:557
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:220
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:1139
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:640
static int op_browser_view_file(struct BrowserPrivateData *priv, const struct KeyEvent *event)
View file - Implements browser_function_t -.
Definition functions.c:385
static int op_mailbox_list(struct BrowserPrivateData *priv, const struct KeyEvent *event)
List mailboxes with new mail - Implements browser_function_t -.
Definition functions.c:1130
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:468
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:300
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:714
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:1092
static int op_enter_mask(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Enter a file mask - Implements browser_function_t -.
Definition functions.c:788
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:1240
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:358
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:371
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:1328
static int op_change_directory(struct BrowserPrivateData *priv, const struct KeyEvent *event)
Change directories - Implements browser_function_t -.
Definition functions.c:521