105 {
N_(
"Quit"), OP_QUIT },
106 {
N_(
"Del"), OP_DELETE },
107 {
N_(
"Undel"), OP_UNDELETE },
108 {
N_(
"Save"), OP_SAVE },
109 {
N_(
"Mail"), OP_MAIL },
110 {
N_(
"Reply"), OP_REPLY },
111 {
N_(
"Group"), OP_GROUP_REPLY },
112 {
N_(
"Help"), OP_HELP },
120 {
N_(
"Quit"), OP_QUIT },
121 {
N_(
"Del"), OP_DELETE },
122 {
N_(
"Undel"), OP_UNDELETE },
123 {
N_(
"Save"), OP_SAVE },
124 {
N_(
"Post"), OP_POST },
125 {
N_(
"Followup"), OP_FOLLOWUP },
126 {
N_(
"Catchup"), OP_CATCHUP },
127 {
N_(
"Help"), OP_HELP },
147 mutt_error(
_(
"%s: Operation not permitted by ACL"), msg);
250 for (
int i = msgno + 1; i < m->
vcount; i++)
284 for (
int i = msgno - 1; i >= 0; i--)
320 for (
int i = 0; i < m->
vcount; i++)
343 bool reverse =
false;
359 if (reverse || (m->
vcount == 0))
372 if (!mv || !mv->
mailbox || !menu)
383 for (
int i = 0; i < m->
vcount; i++)
414 struct Email **save_new = NULL;
423 (lmt || c_uncollapse_new) && (num_new > 0))
426 for (
int i = oldcount; i < m->
msg_count; i++)
427 save_new[i - oldcount] = m->
emails[i];
465 if (c_uncollapse_new)
473 else if (oldcount > 0)
475 for (
int j = 0; j < num_new; j++)
561 for (
int i = 0; i < m->
vcount; i++)
627 char *new_last_folder = NULL;
649 if (monitor_remove_rc == 0)
655 FREE(&new_last_folder);
799 if (!menu || !menu->
mdata)
808 if (!m || (line < 0) || (line >= m->
email_max))
833 edgemsgno = m->
v2r[menu->
max - 1];
839 edgemsgno = m->
v2r[menu->
top];
873 flags &= ~MUTT_FORMAT_FORCESUBJ;
891 return mutt_make_string(buf, max_cols, c_index_format, m, msg_in_pager, e, flags, NULL);
902 if (!m || (line < 0))
963 regmatch_t pmatch[cl->
match + 1];
964 memset(pmatch, 0, (cl->
match + 1) *
sizeof(regmatch_t));
966 if (regexec(&cl->
regex, buf + offset, cl->
match + 1, pmatch, 0) != 0)
969 int first = pmatch[cl->
match].rm_so + offset;
970 int last = pmatch[cl->
match].rm_eo + offset;
982 if (!found || (first < syntax[i].first) ||
983 ((first == syntax[i].first) && (last > syntax[i].last)))
987 syntax[i].attr_color = ac_merge;
988 syntax[i].first = first;
989 syntax[i].last = last;
996 offset = syntax[i].last;
1005 if ((chunks > 0) && (syntax[0].first > 0))
1010 if (len <= syntax[0].first)
1013 offset = syntax[0].first;
1016 for (i = 0; i < chunks; i++)
1021 if (len <= syntax[i].last)
1025 if ((i + 1) == chunks)
1031 next =
MIN(len, syntax[i + 1].first);
1035 offset = syntax[i].last;
1051 if (width < max_cols)
1121 if (priv->
tag_prefix && (op != OP_TAG_PREFIX) &&
1122 (op != OP_TAG_PREFIX_COND) && (op !=
OP_TIMEOUT))
1166 mutt_error(
_(
"Mailbox was externally modified. Flags may be wrong."));
1179 const struct Expando *c_new_mail_command =
1181 if (c_new_mail_command)
1226 if (c_new_mail_command)
1251 const bool c_braille_friendly =
cs_subset_bool(shared->
sub,
"braille_friendly");
1259 else if (c_braille_friendly)
1294 if ((op == OP_TAG_PREFIX) || (op == OP_TAG_PREFIX_COND))
1312 if (op == OP_TAG_PREFIX)
1316 else if (op == OP_TAG_PREFIX_COND)
1381 const struct AttrColor *ac_merge = NULL;
1395 ac_merge = ac_normal;
1413 dlg->
wdata = shared;
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Color and attribute parsing.
struct RegexColorList * regex_colors_get_list(enum ColorId cid)
Return the RegexColorList for a colour id.
struct AttrColor * simple_color_get(enum ColorId cid)
Get the colour of an object by its ID.
@ MT_COLOR_STATUS
Status bar (takes a pattern)
@ MT_COLOR_NORMAL
Plain text.
@ MT_COLOR_INDEX
Index: default colour.
void mutt_pattern_free(struct PatternList **pat)
Free a Pattern.
const char * cs_subset_string(const struct ConfigSubset *sub, const char *name)
Get a string config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
short cs_subset_sort(const struct ConfigSubset *sub, const char *name)
Get a sort config item by name.
const struct Expando * cs_subset_expando(const struct ConfigSubset *sub, const char *name)
Get an Expando config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
void mailbox_gc_run(void)
Run the garbage-collection.
void mailbox_free(struct Mailbox **ptr)
Free a Mailbox.
struct Mailbox * mailbox_find_name(const char *name)
Find the mailbox with a given name.
@ NT_MAILBOX_DELETE
Mailbox is about to be deleted.
static const char * mailbox_path(const struct Mailbox *m)
Get the Mailbox's path string.
uint16_t AclFlags
ACL Rights - These show permission to...
MailboxType
Supported mailbox formats.
@ MUTT_MAILBOX_ERROR
Error occurred examining Mailbox.
@ MUTT_NNTP
'NNTP' (Usenet) Mailbox type
@ MUTT_UNKNOWN
Mailbox wasn't recognised.
size_t mutt_wstr_trunc(const char *src, size_t maxlen, size_t maxwid, size_t *width)
Work out how to truncate a widechar string.
void mutt_paddstr(struct MuttWindow *win, int n, const char *s)
Display a string on screen, padded if necessary.
void mutt_refresh(void)
Force a refresh of the screen.
void mutt_beep(bool force)
Irritate the user.
size_t mutt_strwidth(const char *s)
Measure a string's width in screen cells.
@ FR_DONE
Exit the Dialog.
@ FR_UNKNOWN
Unknown function.
bool check_acl(struct Mailbox *m, AclFlags acl, const char *msg)
Check the ACLs for a function.
const struct Mapping IndexNewsHelp[]
Help Bar for the News Index dialog.
void change_folder_mailbox(struct Menu *menu, struct Mailbox *m, int *oldcount, struct IndexSharedData *shared, bool read_only)
Change to a different Mailbox by pointer.
struct Mailbox * change_folder_notmuch(struct Menu *menu, char *buf, int buflen, int *oldcount, struct IndexSharedData *shared, bool read_only)
Change to a different Notmuch Mailbox by string.
void mutt_draw_statusline(struct MuttWindow *win, int max_cols, const char *buf, size_t buflen)
Draw a highlighted status bar.
void update_index(struct Menu *menu, struct MailboxView *mv, enum MxStatus check, int oldcount, const struct IndexSharedData *shared)
Update the index.
void mutt_set_header_color(struct Mailbox *m, struct Email *e)
Select a colour for a message.
void index_change_folder(struct MuttWindow *dlg, struct Mailbox *m)
Change the current folder, cautiously.
int find_first_message(struct MailboxView *mv)
Get index of first new message.
static const struct Mapping IndexHelp[]
Help Bar for the Index dialog.
static void update_index_threaded(struct MailboxView *mv, enum MxStatus check, int oldcount)
Update the index (if threaded)
void resort_index(struct MailboxView *mv, struct Menu *menu)
Resort the index.
int find_next_undeleted(struct MailboxView *mv, int msgno, bool uncollapse)
Find the next undeleted email.
static void update_index_unthreaded(struct MailboxView *mv, enum MxStatus check)
Update the index (if unthreaded)
void collapse_all(struct MailboxView *mv, struct Menu *menu, int toggle)
Collapse/uncollapse all threads.
void change_folder_string(struct Menu *menu, struct Buffer *buf, int *oldcount, struct IndexSharedData *shared, bool read_only)
Change to a different Mailbox by string.
int find_previous_undeleted(struct MailboxView *mv, int msgno, bool uncollapse)
Find the previous undeleted email.
struct MuttWindow * index_pager_init(void)
Allocate the Windows for the Index/Pager.
static void uncollapse_thread(struct MailboxView *mv, int index)
Open a collapsed thread.
Structs that make up an email.
bool mutt_pattern_exec(struct Pattern *pat, PatternExecFlags flags, struct Mailbox *m, struct Email *e, struct PatternCache *cache)
Match a pattern against an email header.
int km_dokey(enum MenuType mtype, GetChFlags flags)
Determine what a keypress should do.
void mutt_flush_macro_to_endcond(void)
Drop a macro from the input buffer.
void km_error_key(enum MenuType mtype)
Handle an unbound key sequence.
bool OptNews
(pseudo) used to change reader mode
char * LastFolder
Previously selected mailbox.
char * CurrentFolder
Currently selected mailbox.
bool OptNeedResort
(pseudo) used to force a re-sort
int sb_function_dispatcher(struct MuttWindow *win, int op)
Perform a Sidebar function - Implements function_dispatcher_t -.
int global_function_dispatcher(struct MuttWindow *win, int op)
Perform a Global function - Implements function_dispatcher_t -.
int menu_function_dispatcher(struct MuttWindow *win, int op)
Perform a Menu function - Implements function_dispatcher_t -.
int index_function_dispatcher(struct MuttWindow *win, int op)
Perform an Index function - Implements function_dispatcher_t -.
struct Mailbox * dlg_index(struct MuttWindow *dlg, struct Mailbox *m_init)
Display a list of emails -.
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
static int index_mailbox_observer(struct NotifyCallback *nc)
Notification that a Mailbox has changed - Implements observer_t -.
void index_shared_data_free(struct MuttWindow *win, void **ptr)
Free Shared Index Data - Implements MuttWindow::wdata_free() -.
Convenience wrapper for the gui headers.
int mutt_make_string(struct Buffer *buf, size_t max_cols, const struct Expando *exp, struct Mailbox *m, int inpgr, struct Email *e, MuttFormatFlags flags, const char *progress)
Create formatted strings using mailbox expandos.
String processing routines to generate the mail index.
void mutt_folder_hook(const char *path, const char *desc)
Perform a folder hook.
Parse and execute user-defined hooks.
void index_shared_data_set_email(struct IndexSharedData *shared, struct Email *e)
Set the current Email for the Index and friends.
bool index_shared_data_is_cur_email(const struct IndexSharedData *shared, const struct Email *e)
Check whether an email is the currently selected Email.
struct IndexSharedData * index_shared_data_new(void)
Create new Index Data.
void index_shared_data_set_mview(struct IndexSharedData *shared, struct MailboxView *mv)
Set the MailboxView for the Index and friends.
Data shared between Index, Pager and Sidebar.
void index_adjust_sort_threads(const struct ConfigSubset *sub)
Adjust use_threads/sort/sort_aux.
struct MuttWindow * ipanel_new(bool status_on_top, struct IndexSharedData *shared)
Create the Windows for the Index panel.
#define GETCH_NO_FLAGS
No flags are set.
@ LL_DEBUG5
Log at debug level 5.
@ LL_DEBUG1
Log at debug level 1.
void * mutt_mem_malloc(size_t size)
Allocate memory on the heap.
void mutt_mem_realloc(void *ptr, size_t size)
Resize a block of memory on the heap.
const struct AttrColor * merged_color_overlay(const struct AttrColor *base, const struct AttrColor *over)
Combine two colours.
int mutt_monitor_add(struct Mailbox *m)
Add a watch for a mailbox.
int mutt_monitor_remove(struct Mailbox *m)
Remove a watch for a mailbox.
Monitor files for changes.
void msgwin_clear_text(struct MuttWindow *win)
Clear the text in the Message Window.
void msgwin_set_text(struct MuttWindow *win, const char *text, enum ColorId color)
Set the text for the Message Window.
Convenience wrapper for the library headers.
bool notify_observer_remove(struct Notify *notify, const observer_t callback, const void *global_data)
Remove an observer from an object.
bool notify_observer_add(struct Notify *notify, enum NotifyType type, observer_t callback, void *global_data)
Add an observer to an object.
void notify_set_parent(struct Notify *notify, struct Notify *parent)
Set the parent notification handler.
char * mutt_str_dup(const char *str)
Copy a string, safely.
char * mutt_str_replace(char **p, const char *s)
Replace one string with another.
void mutt_curses_set_color(const struct AttrColor *ac)
Set the colour and attributes for text.
void mutt_clear_error(void)
Clear the message line (bottom line of screen)
int mutt_mailbox_check(struct Mailbox *m_cur, CheckStatsFlags flags)
Check all all Mailboxes for new mail.
bool mutt_mailbox_notify(struct Mailbox *m_cur)
Notify the user if there's new mail.
Mailbox helper functions.
void mutt_thread_collapse(struct ThreadsContext *tctx, bool collapse)
Toggle collapse.
enum UseThreads mutt_thread_style(void)
Which threading style is active?
off_t mutt_set_vnum(struct Mailbox *m)
Set the virtual index number of all the messages in a mailbox.
bool mutt_thread_can_collapse(struct Email *e)
Check whether a thread can be collapsed.
int mutt_parent_message(struct Email *e, bool find_root)
Find the parent of a message.
Create/manipulate threading in emails.
UseThreads
Which threading style is active, $use_threads.
@ UT_THREADS
Normal threading (root above subthreads)
@ UT_REVERSE
Reverse threading (subthreads above root)
#define mutt_using_threads()
#define mutt_uncollapse_thread(e)
#define mutt_collapse_thread(e)
void window_redraw(struct MuttWindow *win)
Reflow, recalc and repaint a tree of Windows.
void mutt_window_reflow(struct MuttWindow *win)
Resize a Window and its children.
void mutt_window_add_child(struct MuttWindow *parent, struct MuttWindow *child)
Add a child to Window.
struct MuttWindow * mutt_window_new(enum WindowType type, enum MuttWindowOrientation orient, enum MuttWindowSize size, int cols, int rows)
Create a new Window.
int mutt_window_move(struct MuttWindow *win, int col, int row)
Move the cursor in a Window.
struct MuttWindow * window_set_focus(struct MuttWindow *win)
Set the Window focus.
struct MuttWindow * window_find_child(struct MuttWindow *win, enum WindowType type)
Recursively find a child Window of a given type.
int mutt_window_addnstr(struct MuttWindow *win, const char *str, int num)
Write a partial string to a Window.
@ WT_DLG_INDEX
Index Dialog, dlg_index()
@ WT_INDEX
A panel containing the Index Window.
@ WT_SIDEBAR
Side panel containing Accounts or groups of data.
@ WT_MENU
An Window containing a Menu.
@ MUTT_WIN_ORIENT_HORIZONTAL
Window uses all available horizontal space.
#define MUTT_WIN_SIZE_UNLIMITED
Use as much space as possible.
@ MUTT_WIN_SIZE_MAXIMISE
Window wants as much space as possible.
struct Email * mutt_get_virt_email(struct Mailbox *m, int vnum)
Get a virtual Email.
void mview_free(struct MailboxView **ptr)
Free a MailboxView.
bool mview_has_limit(const struct MailboxView *mv)
Is a limit active?
struct MailboxView * mview_new(struct Mailbox *m, struct Notify *parent)
Create a new MailboxView.
int mx_msg_padding_size(struct Mailbox *m)
Bytes of padding between messages - Wrapper for MxOps::msg_padding_size()
int mx_path_canon(struct Buffer *path, const char *folder, enum MailboxType *type)
Canonicalise a mailbox path - Wrapper for MxOps::path_canon()
bool mx_mbox_open(struct Mailbox *m, OpenMailboxFlags flags)
Open a mailbox and parse it.
enum MailboxType mx_path_probe(const char *path)
Find a mailbox that understands a path.
struct Mailbox * mx_path_resolve(const char *path)
Get a Mailbox for a path.
enum MxStatus mx_mbox_check(struct Mailbox *m)
Check for new mail - Wrapper for MxOps::mbox_check()
enum MxStatus mx_mbox_close(struct Mailbox *m)
Save changes and close mailbox.
#define MUTT_READONLY
Open in read-only mode.
uint8_t OpenMailboxFlags
Flags for mutt_open_mailbox(), e.g. MUTT_NOSORT.
#define MUTT_MAILBOX_CHECK_NO_FLAGS
No flags are set.
#define MUTT_OPEN_NO_FLAGS
No flags are set.
#define MUTT_MAILBOX_CHECK_POSTPONED
Make sure the number of postponed messages is updated.
MxStatus
Return values from mbox_check(), mbox_check_stats(), mbox_sync(), and mbox_close()
@ MX_STATUS_ERROR
An error occurred.
@ MX_STATUS_OK
No changes.
@ MX_STATUS_FLAGS
Nondestructive flags change (IMAP)
@ MX_STATUS_REOPENED
Mailbox was reopened.
@ MX_STATUS_NEW_MAIL
New mail received in Mailbox.
Nntp-specific Account data.
Usenet network mailbox type; talk to an NNTP server.
void nntp_expand_path(char *buf, size_t buflen, struct ConnAccount *acct)
Make fully qualified url from newsgroup name.
struct NntpAccountData * CurrentNewsSrv
Current NNTP news server.
@ NT_MAILBOX
Mailbox has changed, NotifyMailbox, EventMailbox.
void nm_db_debug_check(struct Mailbox *m)
Check if the database is open.
Notmuch virtual mailbox type.
char * nm_url_from_query(struct Mailbox *m, char *buf, size_t buflen)
Turn a query into a URL.
const char * opcodes_get_name(int op)
Get the name of an opcode.
#define OP_TIMEOUT
1 second with no events
#define OP_REPAINT
Repaint is needed.
Match patterns to emails.
#define MUTT_MATCH_FULL_ADDRESS
Match the full address.
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.
Prototypes for many functions.
int mutt_system(const char *cmd)
Run an external command.
#define STAILQ_FOREACH(var, head, field)
#define SLIST_FIRST(head)
#define MUTT_FORMAT_FORCESUBJ
Print the subject even if unchanged.
#define MUTT_FORMAT_INDEX
This is a main index entry.
#define MUTT_FORMAT_TREE
Draw the thread tree.
#define MUTT_FORMAT_ARROWCURSOR
Reserve space for arrow_cursor.
uint8_t MuttFormatFlags
Flags for expando_render(), e.g. MUTT_FORMAT_FORCESUBJ.
#define SORT_MASK
Mask for the sort id.
SortType
Methods for sorting.
@ SORT_THREADS
Sort by email threads.
#define SORT_REVERSE
Reverse the order of the sort.
void mutt_sort_headers(struct MailboxView *mv, bool init)
Sort emails by their headers.
Assorted sorting methods.
void menu_status_line(struct Buffer *buf, struct IndexSharedData *shared, struct Menu *menu, int max_cols, const struct Expando *exp)
Create the status line.
GUI display a user-configurable status line.
A curses colour and its attributes.
LOFF_T offset
offset where the actual data begins
LOFF_T length
length (in bytes) of attachment
long hdr_offset
Offset in stream where the headers begin.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
struct ConnAccount account
Account details: username, password, etc.
The envelope/body of an email.
bool display_subject
Used for threading.
bool visible
Is this message part of the view?
bool limit_visited
Has the limit pattern been applied to this message?
bool collapsed
Is this message part of a collapsed thread?
struct Body * body
List of MIME parts.
char * tree
Character string to print thread tree.
bool old
Email is seen, but unread.
LOFF_T offset
Where in the stream does this message begin?
const struct AttrColor * attr_color
Color-pair to use when displaying in the index.
int vnum
Virtual message number.
int msgno
Number displayed to the user.
bool deleted
Email is deleted.
int index
The absolute (unsorted) message number.
struct MuttThread * thread
Thread of Emails.
An Event that happened to a Mailbox.
struct Mailbox * mailbox
The Mailbox this Event relates to.
Private state data for the Index.
struct MuttWindow * win_index
Window for the Index.
struct IndexSharedData * shared
Shared Index data.
bool tag_prefix
tag-prefix has been pressed
bool do_mailbox_notify
Do we need to notify the user of new mail?
struct Menu * menu
Menu controlling the index.
int oldcount
Old count of mails in the mailbox.
Data shared between Index, Pager and Sidebar.
struct Mailbox * mailbox
Current Mailbox.
bool attach_msg
Are we in "attach message" mode?
struct ConfigSubset * sub
Config set to use.
struct MailboxView * mailbox_view
Current Mailbox view.
struct SearchState * search_state
State of the current search.
struct Notify * notify
Notifications: NotifyIndex, IndexSharedData.
bool collapsed
Are all threads collapsed?
struct Menu * menu
Needed for pattern compilation.
off_t vsize
Size (in bytes) of the messages shown.
struct PatternList * limit_pattern
Compiled limit pattern.
struct ThreadsContext * threads
Threads context.
int msg_in_pager
Message currently shown in the pager.
struct Mailbox * mailbox
Current Mailbox.
int vcount
The number of virtual messages.
char * realpath
Used for duplicate detection, context comparison, and the sidebar.
int * v2r
Mapping from virtual to real msgno.
int msg_count
Total number of messages.
AclFlags rights
ACL bits, see AclFlags.
int email_max
Size of emails array.
enum MailboxType type
Mailbox type.
struct Email ** emails
Array of Emails.
char * name
A short name for the Mailbox.
struct Notify * notify
Notifications: NotifyMailbox, EventMailbox.
struct Buffer pathbuf
Path of the Mailbox.
void * compress_info
Compressed mbox module private data.
int msg_tagged
How many messages are tagged?
bool verbose
Display status messages?
struct ConfigSubset * sub
Inherited config items.
Mapping between user-readable string and a constant.
struct MuttThread * parent
Parent of this Thread.
struct MuttThread * prev
Previous sibling Thread.
struct Email * message
Email this Thread refers to.
const struct Mapping * help_data
Data for the Help Bar.
struct WindowState state
Current state of the Window.
void * wdata
Private data.
struct Notify * notify
Notifications: NotifyWindow, EventWindow.
void(* wdata_free)(struct MuttWindow *win, void **ptr)
int help_menu
Menu for key bindings, e.g. MENU_PAGER.
Container for Accounts, Notifications.
struct Notify * notify
Notifications handler.
struct ConfigSubset * sub
Inherited config items.
struct Connection * conn
Connection to NNTP Server.
Data passed to a notification function.
enum NotifyType event_type
Send: Event type, e.g. NT_ACCOUNT.
int event_subtype
Send: Event subtype, e.g. NT_ACCOUNT_ADD.
void * global_data
Data from notify_observer_add()
Cache commonly-used patterns.
A regular expression and a color to highlight a line.
regex_t regex
Compiled regex.
struct PatternList * color_pattern
Compiled pattern to speed up index color calculation.
struct AttrColor attr_color
Colour and attributes to apply.
int match
Substring to match, 0 for old behaviour.
struct PatternList * pattern
compiled search pattern
short cols
Number of columns, can be MUTT_WIN_SIZE_UNLIMITED.
@ MENU_INDEX
Index panel (list of emails)