31#include "docs/makedoc_defs.h"
72 {
"bottom", OP_PAGER_BOTTOM },
73 {
"bounce-message", OP_BOUNCE_MESSAGE },
74 {
"break-thread", OP_MAIN_BREAK_THREAD },
75 {
"change-folder", OP_MAIN_CHANGE_FOLDER },
76 {
"change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY },
77 {
"change-newsgroup", OP_MAIN_CHANGE_GROUP },
78 {
"change-newsgroup-readonly", OP_MAIN_CHANGE_GROUP_READONLY },
80 {
"change-vfolder", OP_MAIN_CHANGE_VFOLDER },
82 {
"check-stats", OP_CHECK_STATS },
83 {
"check-traditional-pgp", OP_CHECK_TRADITIONAL },
84 {
"clear-flag", OP_MAIN_CLEAR_FLAG },
85 {
"compose-to-sender", OP_COMPOSE_TO_SENDER },
86 {
"copy-message", OP_COPY_MESSAGE },
87 {
"create-alias", OP_CREATE_ALIAS },
88 {
"decode-copy", OP_DECODE_COPY },
89 {
"decode-save", OP_DECODE_SAVE },
90 {
"decrypt-copy", OP_DECRYPT_COPY },
91 {
"decrypt-save", OP_DECRYPT_SAVE },
92 {
"delete-message", OP_DELETE },
93 {
"delete-subthread", OP_DELETE_SUBTHREAD },
94 {
"delete-thread", OP_DELETE_THREAD },
95 {
"display-address", OP_DISPLAY_ADDRESS },
96 {
"display-toggle-weed", OP_DISPLAY_HEADERS },
97 {
"edit", OP_EDIT_RAW_MESSAGE },
98 {
"edit-label", OP_EDIT_LABEL },
99 {
"edit-or-view-raw-message", OP_EDIT_OR_VIEW_RAW_MESSAGE },
100 {
"edit-raw-message", OP_EDIT_RAW_MESSAGE },
101 {
"edit-type", OP_ATTACHMENT_EDIT_TYPE },
102 {
"enter-command", OP_ENTER_COMMAND },
104 {
"entire-thread", OP_MAIN_ENTIRE_THREAD },
107 {
"extract-keys", OP_EXTRACT_KEYS },
108 {
"flag-message", OP_FLAG_MESSAGE },
109 {
"followup-message", OP_FOLLOWUP },
110 {
"forget-passphrase", OP_FORGET_PASSPHRASE },
111 {
"forward-message", OP_FORWARD_MESSAGE },
112 {
"forward-to-group", OP_FORWARD_TO_GROUP },
113 {
"group-chat-reply", OP_GROUP_CHAT_REPLY },
114 {
"group-reply", OP_GROUP_REPLY },
115 {
"half-down", OP_HALF_DOWN },
116 {
"half-up", OP_HALF_UP },
118 {
"imap-fetch-mail", OP_MAIN_IMAP_FETCH },
119 {
"imap-logout-all", OP_MAIN_IMAP_LOGOUT_ALL },
121 {
"jump", OP_JUMP_1 },
122 {
"jump", OP_JUMP_2 },
123 {
"jump", OP_JUMP_3 },
124 {
"jump", OP_JUMP_4 },
125 {
"jump", OP_JUMP_5 },
126 {
"jump", OP_JUMP_6 },
127 {
"jump", OP_JUMP_7 },
128 {
"jump", OP_JUMP_8 },
129 {
"jump", OP_JUMP_9 },
130 {
"link-threads", OP_MAIN_LINK_THREADS },
131 {
"list-reply", OP_LIST_REPLY },
132 {
"list-subscribe", OP_LIST_SUBSCRIBE },
133 {
"list-unsubscribe", OP_LIST_UNSUBSCRIBE },
135 {
"mail-key", OP_MAIL_KEY },
136 {
"mailbox-list", OP_MAILBOX_LIST },
137 {
"mark-as-new", OP_TOGGLE_NEW },
138 {
"modify-labels", OP_MAIN_MODIFY_TAGS },
139 {
"modify-labels-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE },
140 {
"modify-tags", OP_MAIN_MODIFY_TAGS },
141 {
"modify-tags-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE },
142 {
"next-entry", OP_NEXT_ENTRY },
143 {
"next-line", OP_NEXT_LINE },
144 {
"next-new", OP_MAIN_NEXT_NEW },
145 {
"next-new-then-unread", OP_MAIN_NEXT_NEW_THEN_UNREAD },
146 {
"next-page", OP_NEXT_PAGE },
147 {
"next-subthread", OP_MAIN_NEXT_SUBTHREAD },
148 {
"next-thread", OP_MAIN_NEXT_THREAD },
149 {
"next-undeleted", OP_MAIN_NEXT_UNDELETED },
150 {
"next-unread", OP_MAIN_NEXT_UNREAD },
151 {
"next-unread-mailbox", OP_MAIN_NEXT_UNREAD_MAILBOX },
152 {
"parent-message", OP_MAIN_PARENT_MESSAGE },
153 {
"pipe-entry", OP_PIPE },
154 {
"pipe-message", OP_PIPE },
155 {
"post-message", OP_POST },
156 {
"previous-entry", OP_PREV_ENTRY },
157 {
"previous-line", OP_PREV_LINE },
158 {
"previous-new", OP_MAIN_PREV_NEW },
159 {
"previous-new-then-unread", OP_MAIN_PREV_NEW_THEN_UNREAD },
160 {
"previous-page", OP_PREV_PAGE },
161 {
"previous-subthread", OP_MAIN_PREV_SUBTHREAD },
162 {
"previous-thread", OP_MAIN_PREV_THREAD },
163 {
"previous-undeleted", OP_MAIN_PREV_UNDELETED },
164 {
"previous-unread", OP_MAIN_PREV_UNREAD },
165 {
"print-entry", OP_ATTACHMENT_PRINT },
166 {
"print-message", OP_PRINT },
167 {
"purge-message", OP_PURGE_MESSAGE },
168 {
"purge-thread", OP_PURGE_THREAD },
169 {
"quasi-delete", OP_MAIN_QUASI_DELETE },
171 {
"read-subthread", OP_MAIN_READ_SUBTHREAD },
172 {
"read-thread", OP_MAIN_READ_THREAD },
173 {
"recall-message", OP_RECALL_MESSAGE },
174 {
"reconstruct-thread", OP_RECONSTRUCT_THREAD },
175 {
"redraw-screen", OP_REDRAW },
176 {
"reply", OP_REPLY },
177 {
"resend-message", OP_RESEND },
178 {
"root-message", OP_MAIN_ROOT_MESSAGE },
179 {
"save-entry", OP_ATTACHMENT_SAVE },
180 {
"save-message", OP_SAVE },
181 {
"search", OP_SEARCH },
182 {
"search-next", OP_SEARCH_NEXT },
183 {
"search-opposite", OP_SEARCH_OPPOSITE },
184 {
"search-reverse", OP_SEARCH_REVERSE },
185 {
"search-toggle", OP_SEARCH_TOGGLE },
186 {
"set-flag", OP_MAIN_SET_FLAG },
187 {
"shell-escape", OP_SHELL_ESCAPE },
188 {
"show-log-messages", OP_SHOW_LOG_MESSAGES },
189 {
"show-version", OP_VERSION },
190 {
"sidebar-first", OP_SIDEBAR_FIRST },
191 {
"sidebar-last", OP_SIDEBAR_LAST },
192 {
"sidebar-next", OP_SIDEBAR_NEXT },
193 {
"sidebar-next-new", OP_SIDEBAR_NEXT_NEW },
194 {
"sidebar-open", OP_SIDEBAR_OPEN },
195 {
"sidebar-page-down", OP_SIDEBAR_PAGE_DOWN },
196 {
"sidebar-page-up", OP_SIDEBAR_PAGE_UP },
197 {
"sidebar-prev", OP_SIDEBAR_PREV },
198 {
"sidebar-prev-new", OP_SIDEBAR_PREV_NEW },
199 {
"sidebar-toggle-virtual", OP_SIDEBAR_TOGGLE_VIRTUAL },
200 {
"sidebar-toggle-visible", OP_SIDEBAR_TOGGLE_VISIBLE },
201 {
"skip-headers", OP_PAGER_SKIP_HEADERS },
202 {
"skip-quoted", OP_PAGER_SKIP_QUOTED },
203 {
"sort-mailbox", OP_SORT },
204 {
"sort-reverse", OP_SORT_REVERSE },
205 {
"sync-mailbox", OP_MAIN_SYNC_FOLDER },
206 {
"tag-message", OP_TAG },
207 {
"toggle-quoted", OP_PAGER_HIDE_QUOTED },
208 {
"toggle-write", OP_TOGGLE_WRITE },
209 {
"top", OP_PAGER_TOP },
210 {
"undelete-message", OP_UNDELETE },
211 {
"undelete-subthread", OP_UNDELETE_SUBTHREAD },
212 {
"undelete-thread", OP_UNDELETE_THREAD },
214 {
"vfolder-from-query", OP_MAIN_VFOLDER_FROM_QUERY },
215 {
"vfolder-from-query-readonly", OP_MAIN_VFOLDER_FROM_QUERY_READONLY },
217 {
"view-attachments", OP_VIEW_ATTACHMENTS },
218 {
"view-raw-message", OP_VIEW_RAW_MESSAGE },
219 {
"what-key", OP_WHAT_KEY },
221 {
"buffy-list", OP_MAILBOX_LIST },
222 {
"error-history", OP_SHOW_LOG_MESSAGES },
230 { OP_ATTACHMENT_EDIT_TYPE,
"\005" },
231 { OP_BOUNCE_MESSAGE,
"b" },
232 { OP_CHECK_TRADITIONAL,
"\033P" },
233 { OP_COPY_MESSAGE,
"C" },
234 { OP_CREATE_ALIAS,
"a" },
235 { OP_DECODE_COPY,
"\033C" },
236 { OP_DECODE_SAVE,
"\033s" },
238 { OP_DELETE_SUBTHREAD,
"\033d" },
239 { OP_DELETE_THREAD,
"\004" },
240 { OP_DISPLAY_ADDRESS,
"@" },
241 { OP_DISPLAY_HEADERS,
"h" },
242 { OP_EDIT_LABEL,
"Y" },
243 { OP_EDIT_OR_VIEW_RAW_MESSAGE,
"e" },
244 { OP_ENTER_COMMAND,
":" },
248 { OP_EXTRACT_KEYS,
"\013" },
249 { OP_FLAG_MESSAGE,
"F" },
250 { OP_FORGET_PASSPHRASE,
"\006" },
251 { OP_FORWARD_MESSAGE,
"f" },
252 { OP_GROUP_REPLY,
"g" },
263 { OP_LIST_REPLY,
"L" },
265 { OP_MAILBOX_LIST,
"." },
266 { OP_MAIL_KEY,
"\033k" },
267 { OP_MAIN_BREAK_THREAD,
"#" },
268 { OP_MAIN_CHANGE_FOLDER,
"c" },
269 { OP_MAIN_CHANGE_FOLDER_READONLY,
"\033c" },
270 { OP_MAIN_CLEAR_FLAG,
"W" },
271 { OP_MAIN_LINK_THREADS,
"&" },
272 { OP_MAIN_NEXT_NEW_THEN_UNREAD,
"\t" },
273 { OP_MAIN_NEXT_SUBTHREAD,
"\033n" },
274 { OP_MAIN_NEXT_THREAD,
"\016" },
275 { OP_MAIN_NEXT_UNDELETED,
"<down>" },
276 { OP_MAIN_NEXT_UNDELETED,
"<right>" },
277 { OP_MAIN_NEXT_UNDELETED,
"j" },
278 { OP_MAIN_PARENT_MESSAGE,
"P" },
279 { OP_MAIN_PREV_SUBTHREAD,
"\033p" },
280 { OP_MAIN_PREV_THREAD,
"\020" },
281 { OP_MAIN_PREV_UNDELETED,
"<left>" },
282 { OP_MAIN_PREV_UNDELETED,
"<up>" },
283 { OP_MAIN_PREV_UNDELETED,
"k" },
284 { OP_MAIN_READ_SUBTHREAD,
"\033r" },
285 { OP_MAIN_READ_THREAD,
"\022" },
286 { OP_MAIN_SET_FLAG,
"w" },
287 { OP_MAIN_SYNC_FOLDER,
"$" },
288 { OP_NEXT_ENTRY,
"J" },
289 { OP_NEXT_LINE,
"<keypadenter>" },
290 { OP_NEXT_LINE,
"\n" },
291 { OP_NEXT_LINE,
"\r" },
292 { OP_NEXT_PAGE,
" " },
293 { OP_NEXT_PAGE,
"<pagedown>" },
294 { OP_PAGER_BOTTOM,
"<end>" },
295 { OP_PAGER_HIDE_QUOTED,
"T" },
296 { OP_PAGER_SKIP_HEADERS,
"H" },
297 { OP_PAGER_SKIP_QUOTED,
"S" },
298 { OP_PAGER_TOP,
"<home>" },
299 { OP_PAGER_TOP,
"^" },
301 { OP_PREV_ENTRY,
"K" },
302 { OP_PREV_LINE,
"<backspace>" },
303 { OP_PREV_PAGE,
"-" },
304 { OP_PREV_PAGE,
"<pageup>" },
307 { OP_RECALL_MESSAGE,
"R" },
308 { OP_REDRAW,
"\014" },
310 { OP_RESEND,
"\033e" },
313 { OP_SEARCH_NEXT,
"n" },
314 { OP_SEARCH_REVERSE,
"\033/" },
315 { OP_SEARCH_TOGGLE,
"\\" },
316 { OP_SHELL_ESCAPE,
"!" },
318 { OP_SORT_REVERSE,
"O" },
320 { OP_TOGGLE_NEW,
"N" },
321 { OP_TOGGLE_WRITE,
"%" },
322 { OP_UNDELETE,
"u" },
323 { OP_UNDELETE_SUBTHREAD,
"\033u" },
324 { OP_UNDELETE_THREAD,
"\025" },
326 { OP_VIEW_ATTACHMENTS,
"v" },
359 while ((cur > 0) && (nlines > 0))
426 else if (c_pager_stop)
520 else if (c_pager_stop)
587 if (
mw_get_field(((op == OP_SEARCH) || (op == OP_SEARCH_NEXT)) ?
_(
"Search for: ") :
_(
"Reverse search for: "),
601 op = OP_SEARCH_OPPOSITE;
616 else if (op == OP_SEARCH_REVERSE)
635 for (
size_t i = 0; i < priv->
lines_max; i++)
663 for (i = priv->
top_line; i >= 0; i--)
679 for (i = priv->
top_line; i < priv->lines_used; i++)
688 if (i < priv->lines_used)
734 if (c_search_context < priv->pview->win_pager->state.rows)
740 if ((!priv->
search_back && (op == OP_SEARCH_NEXT)) ||
746 i < priv->lines_used; i++)
756 if (i < priv->lines_used)
760 else if (priv->
wrapped || !c_wrap_search)
791 else if (priv->
wrapped || !c_wrap_search)
833 while (((new_topline < priv->lines_used) ||
877 while (((new_topline < priv->lines_used) ||
893 if (c_pager_skip_quoted_context > 0)
895 while (((new_topline < priv->lines_used) ||
909 mutt_error(
_(
"No more unquoted text after quoted text"));
914 if (num_quoted <= c_pager_skip_quoted_context)
918 while (((new_topline < priv->lines_used) ||
935 while (((new_topline < priv->lines_used) ||
949 mutt_error(
_(
"No more unquoted text after quoted text"));
953 priv->
top_line = new_topline -
MIN(c_pager_skip_quoted_context, num_quoted);
1011 FILE *fp_save = NULL;
1015 long pos = ftell(priv->
fp);
1139 if (!dlg || !dlg->
wdata)
1149 rc = fn->
function(shared, priv, op);
GUI display the mailboxes in a side panel.
const struct CompleteOps CompleteFileOps
Auto-Completion of Files.
Select a Mailbox from a list.
bool buf_is_empty(const struct Buffer *buf)
Is the Buffer empty?
size_t buf_strcpy(struct Buffer *buf, const char *s)
Copy a string into a Buffer.
static const char * buf_string(const struct Buffer *buf)
Convert a buffer to a const char * "string".
Color and attribute parsing.
short cs_subset_number(const struct ConfigSubset *sub, const char *name)
Get a number config item by name.
bool cs_subset_bool(const struct ConfigSubset *sub, const char *name)
Get a boolean config item by name.
Convenience wrapper for the config headers.
Convenience wrapper for the core headers.
void mutt_flushinp(void)
Empty all the keyboard buffers.
struct MuttWindow * dialog_find(struct MuttWindow *win)
Find the parent Dialog of a Window.
const char * dispatcher_get_retval_name(int rv)
Get the name of a return value.
@ 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.
bool color_is_header(enum ColorId cid)
Colour is for an Email header.
int display_line(FILE *fp, LOFF_T *bytes_read, struct Line **lines, int line_num, int *lines_used, int *lines_max, PagerFlags flags, struct QuoteStyle **quote_list, int *q_level, bool *force_redraw, regex_t *search_re, struct MuttWindow *win_pager, struct AttrColorList *ansi_list)
Print a line on screen.
Structs that make up an email.
int mutt_file_copy_stream(FILE *fp_in, FILE *fp_out)
Copy the contents of one file into another.
bool mutt_file_seek(FILE *fp, LOFF_T offset, int whence)
Wrapper for fseeko with error handling.
#define mutt_file_fclose(FP)
#define mutt_file_fopen(PATH, MODE)
static int op_exit(struct AliasMenuData *mdata, int op)
exit this menu - Implements alias_function_t -
int pager_function_dispatcher(struct MuttWindow *win, int op)
Perform a Pager function - Implements function_dispatcher_t -.
static int op_help(struct EnterWindowData *wdata, int op)
Display Help - Implements enter_function_t -.
void dlg_attachment(struct ConfigSubset *sub, struct MailboxView *mv, struct Email *e, FILE *fp, bool attach_msg)
Show the attachments in a Menu -.
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 -.
static int op_view_attachments(struct IndexSharedData *shared, struct IndexPrivateData *priv, int op)
Show MIME attachments - Implements index_function_t -.
static int op_save(struct IndexSharedData *shared, struct IndexPrivateData *priv, int op)
Make decrypted copy - Implements index_function_t -.
#define mutt_warning(...)
#define mutt_message(...)
#define mutt_debug(LEVEL,...)
Convenience wrapper for the gui headers.
void mutt_help(enum MenuType menu)
Display the help menu.
Read/write command history from/to a file.
bool index_next_undeleted(struct MuttWindow *win_index)
Select the next undeleted Email (if possible)
GUI manage the main index (list of emails)
@ LL_DEBUG1
Log at debug level 1.
bool mutt_mb_is_lower(const char *s)
Does a multi-byte string contain only lowercase characters?
Convenience wrapper for the library headers.
bool notify_send(struct Notify *notify, enum NotifyType event_type, int event_subtype, void *event_data)
Send out a notification message.
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)
Many unsorted constants and some structs.
#define MUTT_COMP_CLEAR
Clear input if printable character is pressed.
void buf_expand_path(struct Buffer *buf)
Create the canonical path.
Some miscellaneous functions.
@ NT_PAGER
Pager data has changed, NotifyPager, PagerPrivateData.
const char * opcodes_get_name(int op)
Get the name of an opcode.
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.
Prototypes for many functions.
#define COLOR_QUOTED(cid)
#define REG_COMP(preg, regex, cflags)
Compile a regular expression.
String manipulation buffer.
size_t dsize
Length of data.
char * data
Pointer to data.
bool attach_del
Has an attachment marked for deletion.
Input for the file completion function.
Data shared between Index, Pager and Sidebar.
struct Email * email
Currently selected Email.
struct Mailbox * mailbox
Current Mailbox.
bool attach_msg
Are we in "attach message" mode?
struct MailboxView * mailbox_view
Current Mailbox view.
A line of text in the pager.
short search_arr_size
Number of items in search array.
struct TextSyntax * search
Array of search text in the line.
bool cont_line
Continuation of a previous line (wrapped by NeoMutt)
short cid
Default line colour, e.g. MT_COLOR_SIGNATURE.
LOFF_T offset
Offset into Email file (PagerPrivateData->fp)
bool changed
Mailbox has been modified.
struct WindowState state
Current state of the Window.
void * wdata
Private data.
struct MuttWindow * parent
Parent Window.
Container for Accounts, Notifications.
struct ConfigSubset * sub
Inherited config items.
short rows
Number of rows, can be MUTT_WIN_SIZE_UNLIMITED.
@ MENU_PAGER
Pager pager (email viewer)