diff options
author | Richard Russon <rich@flatcap.org> | 2023-09-23 14:07:04 +0100 |
---|---|---|
committer | Richard Russon <rich@flatcap.org> | 2023-09-23 14:07:04 +0100 |
commit | 79bf51efd019127fc34a02d89cf33d9ce409ba5f (patch) | |
tree | 2094d2de9484f3ce4172ec9c17f1afae9018d583 | |
parent | d41b592ed91e687f0dde578b0d2cf34c609640ef (diff) | |
parent | dee68232f4f846bc572c14d8c41f5fb23cb141a8 (diff) |
merge: reorganise opcodes/functions
* gui: move opcodes
* gui: move functions.c
* gui: split functions
71 files changed, 1506 insertions, 1437 deletions
diff --git a/Makefile.autosetup b/Makefile.autosetup index a3608c6cb..c60fc8e5a 100644 --- a/Makefile.autosetup +++ b/Makefile.autosetup @@ -65,13 +65,13 @@ default: all # neomutt NEOMUTT= neomutt$(EXEEXT) NEOMUTTOBJS= alternates.o commands.o conststrings.o copy.o editmsg.o \ - enriched.o external.o flags.o functions.o git_ver.o globals.o \ + enriched.o external.o flags.o git_ver.o globals.o \ handler.o hdrline.o help.o hook.o init.o mailcap.o \ maillist.o main.o muttlib.o mutt_account.o mutt_body.o \ mutt_config.o mutt_header.o mutt_logging.o mutt_mailbox.o \ mutt_signal.o mutt_socket.o mutt_thread.o mview.o mx.o \ - opcodes.o recvcmd.o rfc3676.o score.o sort.o status.o \ - subjectrx.o system.o version.o + recvcmd.o rfc3676.o score.o sort.o status.o subjectrx.o \ + system.o version.o @if USE_INOTIFY NEOMUTTOBJS+= monitor.o @@ -420,10 +420,11 @@ $(PWD)/envelope: ############################################################################### # libgui LIBGUI= libgui.a -LIBGUIOBJS= gui/curs_lib.o gui/dialog.o gui/global.o gui/msgcont.o \ - gui/msgwin.o gui/msgwin_wdata.o gui/mutt_curses.o \ - gui/mutt_window.o gui/reflow.o gui/resize.o gui/rootwin.o \ - gui/sbar.o gui/simple.o gui/terminal.o +LIBGUIOBJS= gui/curs_lib.o gui/dialog.o gui/functions.o gui/global.o \ + gui/msgcont.o gui/msgwin.o gui/msgwin_wdata.o \ + gui/mutt_curses.o gui/mutt_window.o gui/opcodes.o gui/reflow.o \ + gui/resize.o gui/rootwin.o gui/sbar.o gui/simple.o \ + gui/terminal.o CLEANFILES+= $(LIBGUI) $(LIBGUIOBJS) ALLOBJS+= $(LIBGUIOBJS) @@ -616,7 +617,7 @@ $(PWD)/mutt: # libncrypt LIBNCRYPT= libncrypt.a LIBNCRYPTOBJS= ncrypt/config.o ncrypt/crypt.o ncrypt/crypt_mod.o \ - ncrypt/cryptglue.o + ncrypt/cryptglue.o ncrypt/functions.o @if HAVE_PKG_GPGME LIBNCRYPTOBJS+= ncrypt/crypt_gpgme.o ncrypt/dlg_gpgme.o \ ncrypt/gpgme_functions.o ncrypt/crypt_mod_pgp_gpgme.o \ diff --git a/alias/complete.c b/alias/complete.c index b5d21706b..4e62d276a 100644 --- a/alias/complete.c +++ b/alias/complete.c @@ -30,10 +30,10 @@ #include <stddef.h> #include "mutt/lib.h" #include "core/lib.h" +#include "gui/lib.h" #include "lib.h" #include "complete/lib.h" #include "editor/lib.h" -#include "opcodes.h" /** * complete_alias_complete - Complete an Alias - Implements ::complete_function_t - @ingroup complete_api diff --git a/alias/dlg_alias.c b/alias/dlg_alias.c index ac2c5ff5f..f49640ebe 100644 --- a/alias/dlg_alias.c +++ b/alias/dlg_alias.c @@ -92,7 +92,6 @@ #include "gui.h" #include "mutt_logging.h" #include "muttlib.h" -#include "opcodes.h" /// Help Bar for the Alias dialog (address book) static const struct Mapping AliasHelp[] = { diff --git a/alias/dlg_query.c b/alias/dlg_query.c index 1ed9a710a..9c235dfb2 100644 --- a/alias/dlg_query.c +++ b/alias/dlg_query.c @@ -95,7 +95,6 @@ #include "gui.h" #include "mutt_logging.h" #include "muttlib.h" -#include "opcodes.h" /// Help Bar for the Address Query dialog static const struct Mapping QueryHelp[] = { diff --git a/alias/functions.c b/alias/functions.c index f671a249b..4bf06539f 100644 --- a/alias/functions.c +++ b/alias/functions.c @@ -27,6 +27,9 @@ */ #include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else #include <stddef.h> #include <stdbool.h> #include <stdio.h> @@ -36,16 +39,78 @@ #include "core/lib.h" #include "gui/lib.h" #include "mutt.h" -#include "functions.h" #include "lib.h" #include "editor/lib.h" #include "history/lib.h" +#include "key/lib.h" #include "menu/lib.h" #include "pattern/lib.h" #include "question/lib.h" #include "alias.h" +#include "functions.h" #include "gui.h" -#include "opcodes.h" +#endif + +// clang-format off +/** + * OpAlias - Functions for the Alias Menu + */ +const struct MenuFuncOp OpAlias[] = { /* map: alias */ + { "delete-entry", OP_DELETE }, + { "exit", OP_EXIT }, + { "limit", OP_MAIN_LIMIT }, + { "mail", OP_MAIL }, + { "sort-alias", OP_SORT }, + { "sort-alias-reverse", OP_SORT_REVERSE }, + { "undelete-entry", OP_UNDELETE }, + { NULL, 0 }, +}; + +/** + * OpQuery - Functions for the external Query Menu + */ +const struct MenuFuncOp OpQuery[] = { /* map: query */ + { "create-alias", OP_CREATE_ALIAS }, + { "exit", OP_EXIT }, + { "limit", OP_MAIN_LIMIT }, + { "mail", OP_MAIL }, + { "query", OP_QUERY }, + { "query-append", OP_QUERY_APPEND }, + { "sort", OP_SORT }, + { "sort-reverse", OP_SORT_REVERSE }, + { NULL, 0 }, +}; + +/** + * AliasDefaultBindings - Key bindings for the Alias Menu + */ +const struct MenuOpSeq AliasDefaultBindings[] = { /* map: alias */ + { OP_DELETE, "d" }, + { OP_EXIT, "q" }, + { OP_MAIL, "m" }, + { OP_MAIN_LIMIT, "l" }, + { OP_SORT, "o" }, + { OP_SORT_REVERSE, "O" }, + { OP_TAG, "<space>" }, + { OP_UNDELETE, "u" }, + { 0, NULL }, +}; + +/** + * QueryDefaultBindings - Key bindings for the external Query Menu + */ +const struct MenuOpSeq QueryDefaultBindings[] = { /* map: query */ + { OP_CREATE_ALIAS, "a" }, + { OP_EXIT, "q" }, + { OP_MAIL, "m" }, + { OP_MAIN_LIMIT, "l" }, + { OP_QUERY, "Q" }, + { OP_QUERY_APPEND, "A" }, + { OP_SORT, "o" }, + { OP_SORT_REVERSE, "O" }, + { 0, NULL }, +}; +// clang-format on /** * op_create_alias - create an alias from a message sender - Implements ::alias_function_t - @ingroup alias_function_api diff --git a/attach/dlg_attach.c b/attach/dlg_attach.c index bdd69a038..0f9976e4b 100644 --- a/attach/dlg_attach.c +++ b/attach/dlg_attach.c @@ -86,7 +86,6 @@ #include "mutt_logging.h" #include "muttlib.h" #include "mview.h" -#include "opcodes.h" #include "private_data.h" #include "recvattach.h" diff --git a/attach/functions.c b/attach/functions.c index e9a7ccd79..8b5bc6e3b 100644 --- a/attach/functions.c +++ b/attach/functions.c @@ -27,6 +27,9 @@ */ #include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else #include <stdbool.h> #include <stdio.h> #include "mutt/lib.h" @@ -34,18 +37,19 @@ #include "email/lib.h" #include "core/lib.h" #include "gui/lib.h" -#include "functions.h" +#include "key/lib.h" #include "menu/lib.h" #include "ncrypt/lib.h" #include "question/lib.h" #include "send/lib.h" #include "attach.h" +#include "functions.h" #include "globals.h" // IWYU pragma: keep #include "mutt_attach.h" -#include "opcodes.h" #include "private_data.h" #include "recvattach.h" #include "recvcmd.h" +#endif /// Error message for unavailable functions static const char *Not_available_in_this_menu = N_("Not available in this menu"); @@ -53,6 +57,78 @@ static const char *Not_available_in_this_menu = N_("Not available in this menu") static const char *Function_not_permitted_in_attach_message_mode = N_( "Function not permitted in attach-message mode"); +// clang-format off +/** + * OpAttachment - Functions for the Attachment Menu + */ +const struct MenuFuncOp OpAttachment[] = { /* map: attachment */ + { "bounce-message", OP_BOUNCE_MESSAGE }, + { "check-traditional-pgp", OP_CHECK_TRADITIONAL }, + { "collapse-parts", OP_ATTACHMENT_COLLAPSE }, + { "compose-to-sender", OP_COMPOSE_TO_SENDER }, + { "delete-entry", OP_ATTACHMENT_DELETE }, + { "display-toggle-weed", OP_DISPLAY_HEADERS }, + { "edit-type", OP_ATTACHMENT_EDIT_TYPE }, + { "exit", OP_EXIT }, + { "extract-keys", OP_EXTRACT_KEYS }, +#ifdef USE_NNTP + { "followup-message", OP_FOLLOWUP }, +#endif + { "forget-passphrase", OP_FORGET_PASSPHRASE }, + { "forward-message", OP_FORWARD_MESSAGE }, +#ifdef USE_NNTP + { "forward-to-group", OP_FORWARD_TO_GROUP }, +#endif + { "group-chat-reply", OP_GROUP_CHAT_REPLY }, + { "group-reply", OP_GROUP_REPLY }, + { "list-reply", OP_LIST_REPLY }, + { "list-subscribe", OP_LIST_SUBSCRIBE }, + { "list-unsubscribe", OP_LIST_UNSUBSCRIBE }, + { "pipe-entry", OP_PIPE }, + { "pipe-message", OP_PIPE }, + { "print-entry", OP_ATTACHMENT_PRINT }, + { "reply", OP_REPLY }, + { "resend-message", OP_RESEND }, + { "save-entry", OP_ATTACHMENT_SAVE }, + { "undelete-entry", OP_ATTACHMENT_UNDELETE }, + { "view-attach", OP_ATTACHMENT_VIEW }, + { "view-mailcap", OP_ATTACHMENT_VIEW_MAILCAP }, + { "view-pager", OP_ATTACHMENT_VIEW_PAGER }, + { "view-text", OP_ATTACHMENT_VIEW_TEXT }, + { NULL, 0 }, +}; + +/** + * AttachmentDefaultBindings - Key bindings for the Attachment Menu + */ +const struct MenuOpSeq AttachmentDefaultBindings[] = { /* map: attachment */ + { OP_ATTACHMENT_COLLAPSE, "v" }, + { OP_ATTACHMENT_DELETE, "d" }, + { OP_ATTACHMENT_EDIT_TYPE, "\005" }, // <Ctrl-E> + { OP_EXIT, "q" }, + { OP_PIPE, "|" }, + { OP_ATTACHMENT_PRINT, "p" }, + { OP_ATTACHMENT_SAVE, "s" }, + { OP_ATTACHMENT_UNDELETE, "u" }, + { OP_ATTACHMENT_VIEW, "<keypadenter>" }, + { OP_ATTACHMENT_VIEW, "\n" }, // <Enter> + { OP_ATTACHMENT_VIEW, "\r" }, // <Return> + { OP_ATTACHMENT_VIEW_MAILCAP, "m" }, + { OP_ATTACHMENT_VIEW_TEXT, "T" }, + { OP_BOUNCE_MESSAGE, "b" }, + { OP_CHECK_TRADITIONAL, "\033P" }, // <Alt-P> + { OP_DISPLAY_HEADERS, "h" }, + { OP_EXTRACT_KEYS, "\013" }, // <Ctrl-K> + { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F> + { OP_FORWARD_MESSAGE, "f" }, + { OP_GROUP_REPLY, "g" }, + { OP_LIST_REPLY, "L" }, + { OP_REPLY, "r" }, + { OP_RESEND, "\033e" }, // <Alt-e> + { 0, NULL }, +}; +// clang-format on + /** * attach_collapse - Close the tree of the current attachment * @param actx Attachment context diff --git a/attach/recvattach.c b/attach/recvattach.c index a06059d32..f3c9a1b74 100644 --- a/attach/recvattach.c +++ b/attach/recvattach.c @@ -57,7 +57,6 @@ #include "mutt_attach.h" #include "mutt_thread.h" #include "muttlib.h" -#include "opcodes.h" #include "rfc3676.h" #ifdef ENABLE_NLS #include <libintl.h> diff --git a/autocrypt/dlg_autocrypt.c b/autocrypt/dlg_autocrypt.c index cedd41e88..e27939e64 100644 --- a/autocrypt/dlg_autocrypt.c +++ b/autocrypt/dlg_autocrypt.c @@ -81,7 +81,6 @@ #include "functions.h" #include "mutt_logging.h" #include "muttlib.h" -#include "opcodes.h" /// Help Bar for the Autocrypt Account selection dialog static const struct Mapping AutocryptHelp[] = { diff --git a/autocrypt/functions.c b/autocrypt/functions.c index 98ee19fd0..bcc4e6ee8 100644 --- a/autocrypt/functions.c +++ b/autocrypt/functions.c @@ -27,6 +27,9 @@ */ #include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else #include <stdio.h> #include "private.h" #include "mutt/lib.h" @@ -34,11 +37,42 @@ #include "config/lib.h" #include "core/lib.h" #include "gui/lib.h" -#include "functions.h" #include "lib.h" +#include "key/lib.h" #include "menu/lib.h" #include "question/lib.h" -#include "opcodes.h" +#include "functions.h" +#endif + +// clang-format off +#ifdef USE_AUTOCRYPT +/** + * OpAutocrypt - Functions for the Autocrypt Account + */ +const struct MenuFuncOp OpAutocrypt[] = { /* map: autocrypt account */ + { "create-account", OP_AUTOCRYPT_CREATE_ACCT }, + { "delete-account", OP_AUTOCRYPT_DELETE_ACCT }, + { "exit", OP_EXIT }, + { "toggle-active", OP_AUTOCRYPT_TOGGLE_ACTIVE }, + { "toggle-prefer-encrypt", OP_AUTOCRYPT_TOGGLE_PREFER }, + { NULL, 0 } +}; +#endif + +#ifdef USE_AUTOCRYPT +/** + * AutocryptDefaultBindings - Key bindings for the Autocrypt Account + */ +const struct MenuOpSeq AutocryptDefaultBindings[] = { /* map: autocrypt account */ + { OP_AUTOCRYPT_CREATE_ACCT, "c" }, + { OP_AUTOCRYPT_DELETE_ACCT, "D" }, + { OP_AUTOCRYPT_TOGGLE_ACTIVE, "a" }, + { OP_AUTOCRYPT_TOGGLE_PREFER, "p" }, + { OP_EXIT, "q" }, + { 0, NULL } +}; +#endif +// clang-format on /** * toggle_active - Toggle whether an Autocrypt account is active diff --git a/browser/complete.c b/browser/complete.c index 1a31268f8..212aa29de 100644 --- a/browser/complete.c +++ b/browser/complete.c @@ -39,7 +39,6 @@ #include "history/lib.h" #include "mutt_mailbox.h" #include "muttlib.h" -#include "opcodes.h" /** * complete_file_mbox - Complete a Mailbox - Implements ::complete_function_t - @ingroup complete_api diff --git a/browser/dlg_browser.c b/browser/dlg_browser.c index d38721706..f959f2524 100644 --- a/browser/dlg_browser.c +++ b/browser/dlg_browser.c @@ -94,7 +94,6 @@ #include "mutt_mailbox.h" #include "muttlib.h" #include "mx.h" -#include "opcodes.h" #include "private_data.h" #ifdef USE_IMAP #include "imap/lib.h" diff --git a/browser/functions.c b/browser/functions.c index f82842ff8..d49abb510 100644 --- a/browser/functions.c +++ b/browser/functions.c @@ -27,6 +27,9 @@ */ #include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else #include <limits.h> #include <stdbool.h> #include <stdio.h> @@ -38,20 +41,20 @@ #include "core/lib.h" #include "gui/lib.h" #include "mutt.h" -#include "functions.h" #include "lib.h" #include "attach/lib.h" #include "editor/lib.h" #include "history/lib.h" +#include "key/lib.h" #include "menu/lib.h" #include "pattern/lib.h" #include "question/lib.h" #include "send/lib.h" +#include "functions.h" #include "globals.h" // IWYU pragma: keep #include "mutt_mailbox.h" #include "muttlib.h" #include "mx.h" -#include "opcodes.h" #include "private_data.h" #ifdef USE_IMAP #include "imap/lib.h" @@ -61,12 +64,106 @@ #include "nntp/adata.h" #include "nntp/mdata.h" #endif +#endif /// Error message for unavailable functions static const char *Not_available_in_this_menu = N_("Not available in this menu"); static int op_subscribe_pattern(struct BrowserPrivateData *priv, int op); +// clang-format off +/** + * OpBrowser - Functions for the file Browser Menu + */ +const struct MenuFuncOp OpBrowser[] = { /* map: browser */ +#ifdef USE_NNTP + { "catchup", OP_CATCHUP }, +#endif + { "change-dir", OP_CHANGE_DIRECTORY }, + { "check-new", OP_CHECK_NEW }, +#ifdef USE_IMAP + { "create-mailbox", OP_CREATE_MAILBOX }, + { "delete-mailbox", OP_DELETE_MAILBOX }, +#endif + { "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 }, +#ifdef USE_NNTP + { "reload-active", OP_LOAD_ACTIVE }, +#endif +#ifdef USE_IMAP + { "rename-mailbox", OP_RENAME_MAILBOX }, +#endif + { "select-new", OP_BROWSER_NEW_FILE }, + { "sort", OP_SORT }, + { "sort-reverse", OP_SORT_REVERSE }, +#if defined(USE_IMAP) || defined(USE_NNTP) + { "subscribe", OP_BROWSER_SUBSCRIBE }, +#endif +#ifdef USE_NNTP + { "subscribe-pattern", OP_SUBSCRIBE_PATTERN }, +#endif + { "toggle-mailboxes", OP_TOGGLE_MAILBOXES }, +#ifdef USE_IMAP + { "toggle-subscribed", OP_BROWSER_TOGGLE_LSUB }, +#endif +#ifdef USE_NNTP + { "uncatchup", OP_UNCATCHUP }, +#endif +#if defined(USE_IMAP) || defined(USE_NNTP) + { "unsubscribe", OP_BROWSER_UNSUBSCRIBE }, +#endif +#ifdef USE_NNTP + { "unsubscribe-pattern", OP_UNSUBSCRIBE_PATTERN }, +#endif + { "view-file", OP_BROWSER_VIEW_FILE }, + // Deprecated + { "buffy-list", OP_MAILBOX_LIST }, + { NULL, 0 }, +}; + +/** + * BrowserDefaultBindings - Key bindings for the file Browser Menu + */ +const struct MenuOpSeq BrowserDefaultBindings[] = { /* map: browser */ + { OP_BROWSER_GOTO_FOLDER, "=" }, + { OP_BROWSER_NEW_FILE, "N" }, +#if defined(USE_IMAP) || defined(USE_NNTP) + { OP_BROWSER_SUBSCRIBE, "s" }, +#endif + { OP_BROWSER_TELL, "@" }, +#ifdef USE_IMAP + { OP_BROWSER_TOGGLE_LSUB, "T" }, +#endif +#if defined(USE_IMAP) || defined(USE_NNTP) + { OP_BROWSER_UNSUBSCRIBE, "u" }, +#endif + { OP_BROWSER_VIEW_FILE, " " }, // <Space> + { OP_CHANGE_DIRECTORY, "c" }, +#ifdef USE_IMAP + { OP_CREATE_MAILBOX, "C" }, + { OP_DELETE_MAILBOX, "d" }, +#endif + { OP_ENTER_MASK, "m" }, + { OP_EXIT, "q" }, + { OP_GOTO_PARENT, "p" }, +#ifdef USE_NNTP +#endif + { OP_MAILBOX_LIST, "." }, +#ifdef USE_IMAP + { OP_RENAME_MAILBOX, "r" }, +#endif + { OP_SORT, "o" }, + { OP_SORT_REVERSE, "O" }, + { OP_TOGGLE_MAILBOXES, "\t" }, // <Tab> + { 0, NULL }, +}; +// clang-format on + /** * destroy_state - Free the BrowserState * @param state State to free diff --git a/color/command.c b/color/command.c index cb2d9032f..1d9b3fe20 100644 --- a/color/command.c +++ b/color/command.c @@ -52,7 +52,7 @@ #include "attr.h" #include "curses2.h" #include "merged.h" -#include "pager/private_data.h" +#include "pager/private_data.h" // IWYU pragma: keep #endif /** diff --git a/complete/helpers.c b/complete/helpers.c index 1fcede245..f3f404843 100644 --- a/complete/helpers.c +++ b/complete/helpers.c @@ -35,14 +35,14 @@ #include "mutt/lib.h" #include "config/lib.h" #include "core/lib.h" +#include "gui/lib.h" +#include "lib.h" #include "editor/lib.h" #include "index/lib.h" #include "key/lib.h" #include "menu/lib.h" #include "compapi.h" #include "data.h" -#include "functions.h" -#include "opcodes.h" /** * matches_ensure_morespace - Allocate more space for auto-completion diff --git a/compose/dlg_compose.c b/compose/dlg_compose.c index fc1f006c4..4156cfad3 100644 --- a/compose/dlg_compose.c +++ b/compose/dlg_compose.c @@ -87,7 +87,6 @@ #include "globals.h" // IWYU pragma: keep #include "hook.h" #include "mutt_logging.h" -#include "opcodes.h" #include "shared_data.h" /// Help Bar for the Compose dialog diff --git a/compose/functions.c b/compose/functions.c index 112207184..b10055d1e 100644 --- a/compose/functions.c +++ b/compose/functions.c @@ -27,6 +27,9 @@ */ #include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else #include <errno.h> #include <limits.h> #include <stdbool.h> @@ -42,19 +45,20 @@ #include "conn/lib.h" #include "gui/lib.h" #include "mutt.h" -#include "functions.h" #include "lib.h" #include "attach/lib.h" #include "browser/lib.h" #include "editor/lib.h" #include "history/lib.h" #include "index/lib.h" +#include "key/lib.h" #include "menu/lib.h" #include "ncrypt/lib.h" #include "question/lib.h" #include "send/lib.h" #include "attach_data.h" #include "external.h" +#include "functions.h" #include "globals.h" // IWYU pragma: keep #include "hook.h" #include "mutt_header.h" @@ -62,7 +66,6 @@ #include "muttlib.h" #include "mview.h" #include "mx.h" -#include "opcodes.h" #include "protos.h" #include "rfc3676.h" #include "shared_data.h" @@ -82,6 +85,149 @@ #ifdef USE_IMAP #include "imap/lib.h" #endif +#endif + +// clang-format off +/** + * OpCompose - Functions for the Compose Menu + */ +const struct MenuFuncOp OpCompose[] = { /* map: compose */ + { "attach-file", OP_ATTACHMENT_ATTACH_FILE }, + { "attach-key", OP_ATTACHMENT_ATTACH_KEY }, + { "attach-message", OP_ATTACHMENT_ATTACH_MESSAGE }, +#ifdef USE_NNTP + { "attach-news-message", OP_ATTACHMENT_ATTACH_NEWS_MESSAGE }, +#endif +#ifdef USE_AUTOCRYPT + { "autocrypt-menu", OP_COMPOSE_AUTOCRYPT_MENU }, +#endif + { "copy-file", OP_ATTACHMENT_SAVE }, + { "detach-file", OP_ATTACHMENT_DETACH }, + { "display-toggle-weed", OP_DISPLAY_HEADERS }, + { "edit-bcc", OP_ENVELOPE_EDIT_BCC }, + { "edit-cc", OP_ENVELOPE_EDIT_CC }, + { "edit-content-id", OP_ATTACHMENT_EDIT_CONTENT_ID }, + { "edit-description", OP_ATTACHMENT_EDIT_DESCRIPTION }, + { "edit-encoding", OP_ATTACHMENT_EDIT_ENCODING }, + { "edit-fcc", OP_ENVELOPE_EDIT_FCC }, + { "edit-file", OP_COMPOSE_EDIT_FILE }, +#ifdef USE_NNTP + { "edit-followup-to", OP_ENVELOPE_EDIT_FOLLOWUP_TO }, +#endif + { "edit-from", OP_ENVELOPE_EDIT_FROM }, + { "edit-headers", OP_ENVELOPE_EDIT_HEADERS }, + { "edit-language", OP_ATTACHMENT_EDIT_LANGUAGE }, + { "edit-message", OP_COMPOSE_EDIT_MESSAGE }, + { "edit-mime", OP_ATTACHMENT_EDIT_MIME }, +#ifdef USE_NNTP + { "edit-newsgroups", OP_ENVELOPE_EDIT_NEWSGROUPS }, +#endif + { "edit-reply-to", OP_ENVELOPE_EDIT_REPLY_TO }, + { "edit-subject", OP_ENVELOPE_EDIT_SUBJECT }, + { "edit-to", OP_ENVELOPE_EDIT_TO }, + { "edit-type", OP_ATTACHMENT_EDIT_TYPE }, +#ifdef USE_NNTP + { "edit-x-comment-to", OP_ENVELOPE_EDIT_X_COMMENT_TO }, +#endif + { "exit", OP_EXIT }, + { "filter-entry", OP_ATTACHMENT_FILTER }, + { "forget-passphrase", OP_FORGET_PASSPHRASE }, + { "get-attachment", OP_ATTACHMENT_GET_ATTACHMENT }, + { "group-alternatives", OP_ATTACHMENT_GROUP_ALTS }, + { "group-multilingual", OP_ATTACHMENT_GROUP_LINGUAL }, + { "group-related", OP_ATTACHMENT_GROUP_RELATED }, + { "ispell", OP_COMPOSE_ISPELL }, +#ifdef MIXMASTER + { "mix", OP_COMPOSE_MIX }, +#endif + { "move-down", OP_ATTACHMENT_MOVE_DOWN }, + { "move-up", OP_ATTACHMENT_MOVE_UP }, + { "new-mime", OP_ATTACHMENT_NEW_MIME }, + { "pgp-menu", OP_COMPOSE_PGP_MENU }, + { "pipe-entry", OP_PIPE }, + { "pipe-message", OP_PIPE }, + { "postpone-message", OP_COMPOSE_POSTPONE_MESSAGE }, + { "print-entry", OP_ATTACHMENT_PRINT }, + { "rename-attachment", OP_ATTACHMENT_RENAME_ATTACHMENT }, + { "rename-file", OP_COMPOSE_RENAME_FILE }, + { "send-message", OP_COMPOSE_SEND_MESSAGE }, + { "smime-menu", OP_COMPOSE_SMIME_MENU }, + { "toggle-disposition", OP_ATTACHMENT_TOGGLE_DISPOSITION }, + { "toggle-recode", OP_ATTACHMENT_TOGGLE_RECODE }, + { "toggle-unlink", OP_ATTACHMENT_TOGGLE_UNLINK }, + { "ungroup-attachment", OP_ATTACHMENT_UNGROUP }, + { "update-encoding", OP_ATTACHMENT_UPDATE_ENCODING }, + { "view-attach", OP_ATTACHMENT_VIEW }, + { "view-mailcap", OP_ATTACHMENT_VIEW_MAILCAP }, + { "view-pager", OP_ATTACHMENT_VIEW_PAGER }, + { "view-text", OP_ATTACHMENT_VIEW_TEXT }, + { "write-fcc", OP_COMPOSE_WRITE_MESSAGE }, + { NULL, 0 }, +}; + +/** + * ComposeDefaultBindings - Key bindings for the Compose Menu + */ +const struct MenuOpSeq ComposeDefaultBindings[] = { /* map: compose */ + { OP_ATTACHMENT_ATTACH_FILE, "a" }, + { OP_ATTACHMENT_ATTACH_KEY, "\033k" }, // <Alt-k> + { OP_ATTACHMENT_ATTACH_MESSAGE, "A" }, + { OP_ATTACHMENT_DETACH, "D" }, + { OP_ATTACHMENT_EDIT_CONTENT_ID, "\033i" }, // <Alt-i> + { OP_ATTACHMENT_EDIT_DESCRIPTION, "d" }, + { OP_ATTACHMENT_EDIT_ENCODING, "\005" }, // <Ctrl-E> + { OP_ATTACHMENT_EDIT_LANGUAGE, "\014" }, // <Ctrl-L> + { OP_ATTACHMENT_EDIT_MIME, "m" }, + { OP_ATTACHMENT_EDIT_TYPE, "\024" }, // <Ctrl-T> + { OP_ATTACHMENT_FILTER, "F" }, + { OP_ATTACHMENT_GET_ATTACHMENT, "G" }, + { OP_ATTACHMENT_GROUP_ALTS, "&" }, + { OP_ATTACHMENT_GROUP_LINGUAL, "^" }, + { OP_ATTACHMENT_GROUP_RELATED, "%" }, + { OP_ATTACHMENT_MOVE_DOWN, "+" }, + { OP_ATTACHMENT_MOVE_UP, "-" }, + { OP_ATTACHMENT_NEW_MIME, "n" }, + { OP_EXIT, "q" }, + { OP_PIPE, "|" }, + { OP_ATTACHMENT_PRINT, "l" }, + { OP_ATTACHMENT_RENAME_ATTACHMENT, "\017" }, // <Ctrl-O> + { OP_ATTACHMENT_SAVE, "C" }, + { OP_ATTACHMENT_TOGGLE_DISPOSITION, "\004" }, // <Ctrl-D> + { OP_ATTACHMENT_TOGGLE_UNLINK, "u" }, + { OP_ATTACHMENT_UNGROUP, "#" }, + { OP_ATTACHMENT_UPDATE_ENCODING, "U" }, + { OP_ATTACHMENT_VIEW, "<keypadenter>" }, + { OP_ATTACHMENT_VIEW, "\n" }, // <Enter> + { OP_ATTACHMENT_VIEW, "\r" }, // <Return> +#ifdef USE_AUTOCRYPT + { OP_COMPOSE_AUTOCRYPT_MENU, "o" }, +#endif + { OP_COMPOSE_EDIT_FILE, "\033e" }, // <Alt-e> + { OP_COMPOSE_EDIT_MESSAGE, "e" }, + { OP_COMPOSE_ISPELL, "i" }, +#ifdef MIXMASTER + { OP_COMPOSE_MIX, "M" }, +#endif + { OP_COMPOSE_PGP_MENU, "p" }, + { OP_COMPOSE_POSTPONE_MESSAGE, "P" }, + { OP_COMPOSE_RENAME_FILE, "R" }, + { OP_COMPOSE_SEND_MESSAGE, "y" }, + { OP_COMPOSE_SMIME_MENU, "S" }, + { OP_COMPOSE_WRITE_MESSAGE, "w" }, + { OP_DISPLAY_HEADERS, "h" }, + { OP_ENVELOPE_EDIT_BCC, "b" }, + { OP_ENVELOPE_EDIT_CC, "c" }, + { OP_ENVELOPE_EDIT_FCC, "f" }, + { OP_ENVELOPE_EDIT_FROM, "\033f" }, // <Alt-f> + { OP_ENVELOPE_EDIT_HEADERS, "E" }, + { OP_ENVELOPE_EDIT_REPLY_TO, "r" }, + { OP_ENVELOPE_EDIT_SUBJECT, "s" }, + { OP_ENVELOPE_EDIT_TO, "t" }, + { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F> + { OP_TAG, "T" }, + { 0, NULL }, +}; +// clang-format on /** * check_count - Check if there are any attachments diff --git a/conn/dlg_verifycert.c b/conn/dlg_verifycert.c index 8a295619b..6b2c76677 100644 --- a/conn/dlg_verifycert.c +++ b/conn/dlg_verifycert.c @@ -59,7 +59,6 @@ #include "color/lib.h" #include "key/lib.h" #include "menu/lib.h" -#include "opcodes.h" #include "ssl.h" /// Help Bar for the Certificate Verification dialog diff --git a/conn/gnutls.c b/conn/gnutls.c index f7cc913d1..a90d9a6d7 100644 --- a/conn/gnutls.c +++ b/conn/gnutls.c @@ -46,6 +46,8 @@ #include "muttlib.h" #include "ssl.h" +int gnutls_protocol_set_priority(gnutls_session_t session, const int *list); + // clang-format off /* certificate error bitmap values */ #define CERTERR_VALID 0 diff --git a/debug/keymap.c b/debug/keymap.c index b9406b946..57a63f893 100644 --- a/debug/keymap.c +++ b/debug/keymap.c @@ -30,10 +30,9 @@ #include <stdio.h> #include "mutt/lib.h" #include "config/lib.h" +#include "gui/lib.h" #include "key/lib.h" #include "menu/lib.h" -#include "functions.h" -#include "opcodes.h" /** * log_bind - Dumps all the binds maps of a menu into a buffer diff --git a/docs/Makefile.autosetup b/docs/Makefile.autosetup index 4eab2d61b..c99927a56 100644 --- a/docs/Makefile.autosetup +++ b/docs/Makefile.autosetup @@ -1,4 +1,11 @@ -MAKEDOC_CPP = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -D_MAKEDOC -E -C -I. +MAKEDOC_CPP = $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -D_MAKEDOC -E -C -I. -I$(SRCDIR) + +FUNCTION_SRC = $(SRCDIR)/gui/functions.c $(SRCDIR)/alias/functions.c \ + $(SRCDIR)/attach/functions.c $(SRCDIR)/autocrypt/functions.c \ + $(SRCDIR)/browser/functions.c $(SRCDIR)/compose/functions.c \ + $(SRCDIR)/editor/functions.c $(SRCDIR)/index/functions.c \ + $(SRCDIR)/mixmaster/functions.c $(SRCDIR)/ncrypt/functions.c \ + $(SRCDIR)/pager/functions.c $(SRCDIR)/postpone/functions.c docs/makedoc$(EXEEXT): $(SRCDIR)/docs/makedoc.c $(CC_FOR_BUILD) -I. $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \ @@ -68,14 +75,14 @@ docs/neomutt.1: ) > $@ docs/manual.xml: docs docs/makedoc$(EXEEXT) $(SRCDIR)/docs/gen-map-doc \ - $(SRCDIR)/docs/manual.xml.head $(SRCDIR)/docs/manual.xml.tail\ - $(SRCDIR)/functions.c $(SRCDIR)/docs/config.c $(SRCDIR)/opcodes.h + $(SRCDIR)/docs/manual.xml.head $(SRCDIR)/docs/manual.xml.tail \ + $(FUNCTION_SRC) $(SRCDIR)/docs/config.c $(SRCDIR)/gui/opcodes.h ( sed -e "s/@VERSION@/$(PACKAGE_DATE)/; s!/usr/libexec!$(libexecdir)!g" \ $(SRCDIR)/docs/manual.xml.head && \ $(MAKEDOC_CPP) $(SRCDIR)/docs/config.c | docs/makedoc$(EXEEXT) -s && \ - $(MAKEDOC_CPP) $(SRCDIR)/functions.c | \ + $(MAKEDOC_CPP) $(FUNCTION_SRC) | \ perl $(SRCDIR)/docs/gen-map-doc $(SRCDIR)/docs/manual.xml.tail \ - $(SRCDIR)/opcodes.h \ + $(SRCDIR)/gui/opcodes.h \ ) > $@ install-docs: all-docs diff --git a/editor/functions.c b/editor/functions.c index 274bf27f9..a8d59f3e0 100644 --- a/editor/functions.c +++ b/editor/functions.c @@ -27,21 +27,101 @@ */ #include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else #include <string.h> #include "mutt/lib.h" #include "config/lib.h" #include "core/lib.h" #include "gui/lib.h" -#include "functions.h" #include "complete/lib.h" #include "history/lib.h" #include "key/lib.h" #include "menu/lib.h" #include "enter.h" -#include "opcodes.h" +#include "functions.h" #include "protos.h" #include "state.h" // IWYU pragma: keep #include "wdata.h" +#endif + +// clang-format off +/** + * OpEditor - Functions for the Editor Menu + */ +const struct MenuFuncOp OpEditor[] = { /* map: editor */ + { "backspace", OP_EDITOR_BACKSPACE }, + { "backward-char", OP_EDITOR_BACKWARD_CHAR }, + { "backward-word", OP_EDITOR_BACKWARD_WORD }, + { "bol", OP_EDITOR_BOL }, + { "capitalize-word", OP_EDITOR_CAPITALIZE_WORD }, + { "complete", OP_EDITOR_COMPLETE }, + { "complete-query", OP_EDITOR_COMPLETE_QUERY }, + { "delete-char", OP_EDITOR_DELETE_CHAR }, + { "downcase-word", OP_EDITOR_DOWNCASE_WORD }, + { "eol", OP_EDITOR_EOL }, + { "forward-char", OP_EDITOR_FORWARD_CHAR }, + { "forward-word", OP_EDITOR_FORWARD_WORD }, + { "help", OP_HELP }, + { "history-down", OP_EDITOR_HISTORY_DOWN }, + { "history-search", OP_EDITOR_HISTORY_SEARCH }, + { "history-up", OP_EDITOR_HISTORY_UP }, + { "kill-eol", OP_EDITOR_KILL_EOL }, + { "kill-eow", OP_EDITOR_KILL_EOW }, + { "kill-line", OP_EDITOR_KILL_LINE }, + { "kill-whole-line", OP_EDITOR_KILL_WHOLE_LINE }, + { "kill-word", OP_EDITOR_KILL_WORD }, + { "mailbox-cycle", OP_EDITOR_MAILBOX_CYCLE }, + { "quote-char", OP_EDITOR_QUOTE_CHAR }, + { "redraw-screen", OP_REDRAW }, + { "transpose-chars", OP_EDITOR_TRANSPOSE_CHARS }, + { "upcase-word", OP_EDITOR_UPCASE_WORD }, + // Deprecated + { "buffy-cycle", OP_EDITOR_MAILBOX_CYCLE }, + { NULL, 0 }, +}; + +/** + * EditorDefaultBindings - Key bindings for the Editor Menu + */ +const struct MenuOpSeq EditorDefaultBindings[] = { /* map: editor */ + { OP_EDITOR_BACKSPACE, "<backspace>" }, + { OP_EDITOR_BACKSPACE, "\010" }, // <Ctrl-H> + { OP_EDITOR_BACKSPACE, "\177" }, // <Backspace> + { OP_EDITOR_BACKWARD_CHAR, "<left>" }, + { OP_EDITOR_BACKWARD_CHAR, "\002" }, // <Ctrl-B> + { OP_EDITOR_BACKWARD_WORD, "\033b" }, // <Alt-b> + { OP_EDITOR_BOL, "<home>" }, + { OP_EDITOR_BOL, "\001" }, // <Ctrl-A> + { OP_EDITOR_CAPITALIZE_WORD, "\033c" }, // <Alt-c> + { OP_EDITOR_COMPLETE, "\t" }, // <Tab> + { OP_EDITOR_COMPLETE_QUERY, "\024" }, // <Ctrl-T> + { OP_EDITOR_DELETE_CHAR, "<delete>" }, + { OP_EDITOR_DELETE_CHAR, "\004" }, // <Ctrl-D> + { OP_EDITOR_DOWNCASE_WORD, "\033l" }, // <Alt-l> + { OP_EDITOR_EOL, "<end>" }, + { OP_EDITOR_EOL, "\005" }, // <Ctrl-E> + { OP_EDITOR_FORWARD_CHAR, "<right>" }, + { OP_EDITOR_FORWARD_CHAR, "\006" }, // <Ctrl-F> + { OP_EDITOR_FORWARD_WORD, "\033f" }, // <Alt-f> + { OP_EDITOR_HISTORY_DOWN, "<down>" }, + { OP_EDITOR_HISTORY_DOWN, "\016" }, // <Ctrl-N> + { OP_EDITOR_HISTORY_SEARCH, "\022" }, // <Ctrl-R> + { OP_EDITOR_HISTORY_UP, "<up>" }, + { OP_EDITOR_HISTORY_UP, "\020" }, // <Ctrl-P> + { OP_EDITOR_KILL_EOL, "\013" }, // <Ctrl-K> + { OP_EDITOR_KILL_EOW, "\033d" }, // <Alt-d> + { OP_EDITOR_KILL_LINE, "\025" }, // <Ctrl-U> + { OP_EDITOR_KILL_WORD, "\027" }, // <Ctrl-W> + { OP_EDITOR_MAILBOX_CYCLE, " " }, // <Space> + { OP_EDITOR_QUOTE_CHAR, "\026" }, // <Ctrl-V> + { OP_EDITOR_UPCASE_WORD, "\033u" }, // <Alt-u> + { OP_HELP, "\033?" }, // <Alt-?> + { OP_REDRAW, "\014" }, // <Ctrl-L> + { 0, NULL }, +}; +// clang-format on /** * replace_part - Search and replace on a buffer diff --git a/editor/window.c b/editor/window.c index 10cbd5263..265cf04c3 100644 --- a/editor/window.c +++ b/editor/window.c @@ -43,7 +43,6 @@ #include "menu/lib.h" #include "functions.h" #include "muttlib.h" -#include "opcodes.h" #include "state.h" // IWYU pragma: keep #include "wdata.h" diff --git a/envelope/functions.c b/envelope/functions.c index d74dc17c4..f1314a423 100644 --- a/envelope/functions.c +++ b/envelope/functions.c @@ -48,7 +48,6 @@ #include "hook.h" #include "mutt_logging.h" #include "muttlib.h" -#include "opcodes.h" #include "wdata.h" #ifdef MIXMASTER #include "mixmaster/lib.h" @@ -40,7 +40,6 @@ #include "index/lib.h" #include "key/lib.h" #include "mutt_thread.h" -#include "opcodes.h" #include "protos.h" /** diff --git a/functions.c b/functions.c deleted file mode 100644 index 79929d2cd..000000000 --- a/functions.c +++ /dev/null @@ -1,1277 +0,0 @@ -/** - * @file - * Definitions of user functions - * - * @authors - * Copyright (C) 1996-2000,2002 Michael R. Elkins <me@mutt.org> - * - * @copyright - * This program is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation, either version 2 of the License, or (at your option) any later - * version. - * - * 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/>. - */ - -/** - * @page neo_functions Definitions of user functions - * - * Definitions of user functions - * - * This file contains the structures needed to parse "bind" commands, as well - * as the default bindings for each menu. - * - * Notes: - * - * - If you need to bind a control char, use the octal value because the `\cX` - * construct does not work at this level. - * - * - The magic "map:" comments define how the map will be called in the manual. - * Lines starting with "**" will be included in the manual. - * - * - For "enter" bindings, add entries for "\n" and "\r" and "<keypadenter>". - */ - -#include "config.h" -#ifdef _MAKEDOC -#include "docs/makedoc_defs.h" -#else -#include <stddef.h> -#include "key/lib.h" -#include "opcodes.h" -#endif - -// clang-format off -/** - * OpAlias - Functions for the Alias Menu - */ -const struct MenuFuncOp OpAlias[] = { /* map: alias */ - { "delete-entry", OP_DELETE }, - { "exit", OP_EXIT }, - { "limit", OP_MAIN_LIMIT }, - { "mail", OP_MAIL }, - { "sort-alias", OP_SORT }, - { "sort-alias-reverse", OP_SORT_REVERSE }, - { "undelete-entry", OP_UNDELETE }, - { NULL, 0 }, -}; - -/** - * OpAttachment - Functions for the Attachment Menu - */ -const struct MenuFuncOp OpAttachment[] = { /* map: attachment */ - { "bounce-message", OP_BOUNCE_MESSAGE }, - { "check-traditional-pgp", OP_CHECK_TRADITIONAL }, - { "collapse-parts", OP_ATTACHMENT_COLLAPSE }, - { "compose-to-sender", OP_COMPOSE_TO_SENDER }, - { "delete-entry", OP_ATTACHMENT_DELETE }, - { "display-toggle-weed", OP_DISPLAY_HEADERS }, - { "edit-type", OP_ATTACHMENT_EDIT_TYPE }, - { "exit", OP_EXIT }, - { "extract-keys", OP_EXTRACT_KEYS }, -#ifdef USE_NNTP - { "followup-message", OP_FOLLOWUP }, -#endif - { "forget-passphrase", OP_FORGET_PASSPHRASE }, - { "forward-message", OP_FORWARD_MESSAGE }, -#ifdef USE_NNTP - { "forward-to-group", OP_FORWARD_TO_GROUP }, -#endif - { "group-chat-reply", OP_GROUP_CHAT_REPLY }, - { "group-reply", OP_GROUP_REPLY }, - { "list-reply", OP_LIST_REPLY }, - { "list-subscribe", OP_LIST_SUBSCRIBE }, - { "list-unsubscribe", OP_LIST_UNSUBSCRIBE }, - { "pipe-entry", OP_PIPE }, - { "pipe-message", OP_PIPE }, - { "print-entry", OP_ATTACHMENT_PRINT }, - { "reply", OP_REPLY }, - { "resend-message", OP_RESEND }, - { "save-entry", OP_ATTACHMENT_SAVE }, - { "undelete-entry", OP_ATTACHMENT_UNDELETE }, - { "view-attach", OP_ATTACHMENT_VIEW }, - { "view-mailcap", OP_ATTACHMENT_VIEW_MAILCAP }, - { "view-pager", OP_ATTACHMENT_VIEW_PAGER }, - { "view-text", OP_ATTACHMENT_VIEW_TEXT }, - { NULL, 0 }, -}; - -#ifdef USE_AUTOCRYPT -/** - * OpAutocrypt - Functions for the Autocrypt Account - */ -const struct MenuFuncOp OpAutocrypt[] = { /* map: autocrypt account */ - { "create-account", OP_AUTOCRYPT_CREATE_ACCT }, - { "delete-account", OP_AUTOCRYPT_DELETE_ACCT }, - { "exit", OP_EXIT }, - { "toggle-active", OP_AUTOCRYPT_TOGGLE_ACTIVE }, - { "toggle-prefer-encrypt", OP_AUTOCRYPT_TOGGLE_PREFER }, - { NULL, 0 } -}; -#endif - -/** - * OpBrowser - Functions for the file Browser Menu - */ -const struct MenuFuncOp OpBrowser[] = { /* map: browser */ -#ifdef USE_NNTP - { "catchup", OP_CATCHUP }, -#endif - { "change-dir", OP_CHANGE_DIRECTORY }, - { "check-new", OP_CHECK_NEW }, -#ifdef USE_IMAP - { "create-mailbox", OP_CREATE_MAILBOX }, - { "delete-mailbox", OP_DELETE_MAILBOX }, -#endif - { "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 }, -#ifdef USE_NNTP - { "reload-active", OP_LOAD_ACTIVE }, -#endif -#ifdef USE_IMAP - { "rename-mailbox", OP_RENAME_MAILBOX }, -#endif - { "select-new", OP_BROWSER_NEW_FILE }, - { "sort", OP_SORT }, - { "sort-reverse", OP_SORT_REVERSE }, -#if defined(USE_IMAP) || defined(USE_NNTP) - { "subscribe", OP_BROWSER_SUBSCRIBE }, -#endif -#ifdef USE_NNTP - { "subscribe-pattern", OP_SUBSCRIBE_PATTERN }, -#endif - { "toggle-mailboxes", OP_TOGGLE_MAILBOXES }, -#ifdef USE_IMAP - { "toggle-subscribed", OP_BROWSER_TOGGLE_LSUB }, -#endif -#ifdef USE_NNTP - { "uncatchup", OP_UNCATCHUP }, -#endif -#if defined(USE_IMAP) || defined(USE_NNTP) - { "unsubscribe", OP_BROWSER_UNSUBSCRIBE }, -#endif -#ifdef USE_NNTP - { "unsubscribe-pattern", OP_UNSUBSCRIBE_PATTERN }, -#endif - { "view-file", OP_BROWSER_VIEW_FILE }, - // Deprecated - { "buffy-list", OP_MAILBOX_LIST }, - { NULL, 0 }, -}; - -/** - * OpCompose - Functions for the Compose Menu - */ -const struct MenuFuncOp OpCompose[] = { /* map: compose */ - { "attach-file", OP_ATTACHMENT_ATTACH_FILE }, - { "attach-key", OP_ATTACHMENT_ATTACH_KEY }, - { "attach-message", OP_ATTACHMENT_ATTACH_MESSAGE }, -#ifdef USE_NNTP - { "attach-news-message", OP_ATTACHMENT_ATTACH_NEWS_MESSAGE }, -#endif -#ifdef USE_AUTOCRYPT - { "autocrypt-menu", OP_COMPOSE_AUTOCRYPT_MENU }, -#endif - { "copy-file", OP_ATTACHMENT_SAVE }, - { "detach-file", OP_ATTACHMENT_DETACH }, - { "display-toggle-weed", OP_DISPLAY_HEADERS }, - { "edit-bcc", OP_ENVELOPE_EDIT_BCC }, - { "edit-cc", OP_ENVELOPE_EDIT_CC }, - { "edit-content-id", OP_ATTACHMENT_EDIT_CONTENT_ID }, - { "edit-description", OP_ATTACHMENT_EDIT_DESCRIPTION }, - { "edit-encoding", OP_ATTACHMENT_EDIT_ENCODING }, - { "edit-fcc", OP_ENVELOPE_EDIT_FCC }, - { "edit-file", OP_COMPOSE_EDIT_FILE }, -#ifdef USE_NNTP - { "edit-followup-to", OP_ENVELOPE_EDIT_FOLLOWUP_TO }, -#endif - { "edit-from", OP_ENVELOPE_EDIT_FROM }, - { "edit-headers", OP_ENVELOPE_EDIT_HEADERS }, - { "edit-language", OP_ATTACHMENT_EDIT_LANGUAGE }, - { "edit-message", OP_COMPOSE_EDIT_MESSAGE }, - { "edit-mime", OP_ATTACHMENT_EDIT_MIME }, -#ifdef USE_NNTP - { "edit-newsgroups", OP_ENVELOPE_EDIT_NEWSGROUPS }, -#endif - { "edit-reply-to", OP_ENVELOPE_EDIT_REPLY_TO }, - { "edit-subject", OP_ENVELOPE_EDIT_SUBJECT }, - { "edit-to", OP_ENVELOPE_EDIT_TO }, - { "edit-type", OP_ATTACHMENT_EDIT_TYPE }, -#ifdef USE_NNTP - { "edit-x-comment-to", OP_ENVELOPE_EDIT_X_COMMENT_TO }, -#endif - { "exit", OP_EXIT }, - { "filter-entry", OP_ATTACHMENT_FILTER }, - { "forget-passphrase", OP_FORGET_PASSPHRASE }, - { "get-attachment", OP_ATTACHMENT_GET_ATTACHMENT }, - { "group-alternatives", OP_ATTACHMENT_GROUP_ALTS }, - { "group-multilingual", OP_ATTACHMENT_GROUP_LINGUAL }, - { "group-related", OP_ATTACHMENT_GROUP_RELATED }, - { "ispell", OP_COMPOSE_ISPELL }, -#ifdef MIXMASTER - { "mix", OP_COMPOSE_MIX }, -#endif - { "move-down", OP_ATTACHMENT_MOVE_DOWN }, - { "move-up", OP_ATTACHMENT_MOVE_UP }, - { "new-mime", OP_ATTACHMENT_NEW_MIME }, - { "pgp-menu", OP_COMPOSE_PGP_MENU }, - { "pipe-entry", OP_PIPE }, - { "pipe-message", OP_PIPE }, - { "postpone-message", OP_COMPOSE_POSTPONE_MESSAGE }, - { "print-entry", OP_ATTACHMENT_PRINT }, - { "rename-attachment", OP_ATTACHMENT_RENAME_ATTACHMENT }, - { "rename-file", OP_COMPOSE_RENAME_FILE }, - { "send-message", OP_COMPOSE_SEND_MESSAGE }, - { "smime-menu", OP_COMPOSE_SMIME_MENU }, - { "toggle-disposition", OP_ATTACHMENT_TOGGLE_DISPOSITION }, - { "toggle-recode", OP_ATTACHMENT_TOGGLE_RECODE }, - { "toggle-unlink", OP_ATTACHMENT_TOGGLE_UNLINK }, - { "ungroup-attachment", OP_ATTACHMENT_UNGROUP }, - { "update-encoding", OP_ATTACHMENT_UPDATE_ENCODING }, - { "view-attach", OP_ATTACHMENT_VIEW }, - { "view-mailcap", OP_ATTACHMENT_VIEW_MAILCAP }, - { "view-pager", OP_ATTACHMENT_VIEW_PAGER }, - { "view-text", OP_ATTACHMENT_VIEW_TEXT }, - { "write-fcc", OP_COMPOSE_WRITE_MESSAGE }, - { NULL, 0 }, -}; - -/** - * OpDialog - Functions for Simple Dialogs - */ -const struct MenuFuncOp OpDialog[] = { - { "exit", OP_EXIT }, - { NULL, 0 }, -}; - -/** - * OpEditor - Functions for the Editor Menu - */ -const struct MenuFuncOp OpEditor[] = { /* map: editor */ - { "backspace", OP_EDITOR_BACKSPACE }, - { "backward-char", OP_EDITOR_BACKWARD_CHAR }, - { "backward-word", OP_EDITOR_BACKWARD_WORD }, - { "bol", OP_EDITOR_BOL }, - { "capitalize-word", OP_EDITOR_CAPITALIZE_WORD }, - { "complete", OP_EDITOR_COMPLETE }, - { "complete-query", OP_EDITOR_COMPLETE_QUERY }, - { "delete-char", OP_EDITOR_DELETE_CHAR }, - { "downcase-word", OP_EDITOR_DOWNCASE_WORD }, - { "eol", OP_EDITOR_EOL }, - { "forward-char", OP_EDITOR_FORWARD_CHAR }, - { "forward-word", OP_EDITOR_FORWARD_WORD }, - { "help", OP_HELP }, - { "history-down", OP_EDITOR_HISTORY_DOWN }, - { "history-search", OP_EDITOR_HISTORY_SEARCH }, - { "history-up", OP_EDITOR_HISTORY_UP }, - { "kill-eol", OP_EDITOR_KILL_EOL }, - { "kill-eow", OP_EDITOR_KILL_EOW }, - { "kill-line", OP_EDITOR_KILL_LINE }, - { "kill-whole-line", OP_EDITOR_KILL_WHOLE_LINE }, - { "kill-word", OP_EDITOR_KILL_WORD }, - { "mailbox-cycle", OP_EDITOR_MAILBOX_CYCLE }, - { "quote-char", OP_EDITOR_QUOTE_CHAR }, - { "redraw-screen", OP_REDRAW }, - { "transpose-chars", OP_EDITOR_TRANSPOSE_CHARS }, - { "upcase-word", OP_EDITOR_UPCASE_WORD }, - // Deprecated - { "buffy-cycle", OP_EDITOR_MAILBOX_CYCLE }, - { NULL, 0 }, -}; - -/** - * OpGeneric - Functions for the Generic Menu - */ -const struct MenuFuncOp OpGeneric[] = { /* map: generic */ - /* - ** <para> - ** The <emphasis>generic</emphasis> menu is not a real menu, but specifies common functions - ** (such as movement) available in all menus except for <emphasis>pager</emphasis> and - ** <emphasis>editor</emphasis>. Changing settings for this menu will affect the default - ** bindings for all menus (except as noted). - ** </para> - */ - { "bottom-page", OP_BOTTOM_PAGE }, - { "check-stats", OP_CHECK_STATS }, - { "current-bottom", OP_CURRENT_BOTTOM }, - { "current-middle", OP_CURRENT_MIDDLE }, - { "current-top", OP_CURRENT_TOP }, - { "end-cond", OP_END_COND }, - { "enter-command", OP_ENTER_COMMAND }, - { "exit", OP_EXIT }, - { "first-entry", OP_FIRST_ENTRY }, - { "half-down", OP_HALF_DOWN }, - { "half-up", OP_HALF_UP }, - { "help", OP_HELP }, - { "jump", OP_JUMP }, - { "jump", OP_JUMP_1 }, - { "jump", OP_JUMP_2 }, - { "jump", OP_JUMP_3 }, - { "jump", OP_JUMP_4 }, - { "jump", OP_JUMP_5 }, - { "jump", OP_JUMP_6 }, - { "jump", OP_JUMP_7 }, - { "jump", OP_JUMP_8 }, - { "jump", OP_JUMP_9 }, - { "last-entry", OP_LAST_ENTRY }, - { "middle-page", OP_MIDDLE_PAGE }, - { "next-entry", OP_NEXT_ENTRY }, - { "next-line", OP_NEXT_LINE }, - { "next-page", OP_NEXT_PAGE }, - { "previous-entry", OP_PREV_ENTRY }, - { "previous-line", OP_PREV_LINE }, - { "previous-page", OP_PREV_PAGE }, - { "redraw-screen", OP_REDRAW }, - { "search", OP_SEARCH }, - { "search-next", OP_SEARCH_NEXT }, - { "search-opposite", OP_SEARCH_OPPOSITE }, - { "search-reverse", OP_SEARCH_REVERSE }, - { "select-entry", OP_GENERIC_SELECT_ENTRY }, - { "shell-escape", OP_SHELL_ESCAPE }, - { "show-log-messages", OP_SHOW_LOG_MESSAGES }, - { "show-version", OP_VERSION }, - { "tag-entry", OP_TAG }, - { "tag-prefix", OP_TAG_PREFIX }, - { "tag-prefix-cond", OP_TAG_PREFIX_COND }, - { "top-page", OP_TOP_PAGE }, - { "what-key", OP_WHAT_KEY }, - // Deprecated - { "error-history", OP_SHOW_LOG_MESSAGES }, - { "refresh", OP_REDRAW }, - { NULL, 0 }, -}; - -/** - * OpIndex - Functions for the Index Menu - */ -const struct MenuFuncOp OpIndex[] = { /* map: index */ - { "alias-dialog", OP_ALIAS_DIALOG }, -#ifdef USE_AUTOCRYPT - { "autocrypt-acct-menu", OP_AUTOCRYPT_ACCT_MENU }, -#endif - { "bounce-message", OP_BOUNCE_MESSAGE }, - { "break-thread", OP_MAIN_BREAK_THREAD }, -#ifdef USE_NNTP - { "catchup", OP_CATCHUP }, -#endif - { "change-folder", OP_MAIN_CHANGE_FOLDER }, - { "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY }, -#ifdef USE_NNTP - { "change-newsgroup", OP_MAIN_CHANGE_GROUP }, - { "change-newsgroup-readonly", OP_MAIN_CHANGE_GROUP_READONLY }, -#endif -#ifdef USE_NOTMUCH - { "change-vfolder", OP_MAIN_CHANGE_VFOLDER }, -#endif - { "check-traditional-pgp", OP_CHECK_TRADITIONAL }, - { "clear-flag", OP_MAIN_CLEAR_FLAG }, - { "collapse-all", OP_MAIN_COLLAPSE_ALL }, - { "collapse-thread", OP_MAIN_COLLAPSE_THREAD }, - { "compose-to-sender", OP_COMPOSE_TO_SENDER }, - { "copy-message", OP_COPY_MESSAGE }, - { "create-alias", OP_CREATE_ALIAS }, - { "decode-copy", OP_DECODE_COPY }, - { "decode-save", OP_DECODE_SAVE }, - { "decrypt-copy", OP_DECRYPT_COPY }, - { "decrypt-save", OP_DECRYPT_SAVE }, - { "delete-message", OP_DELETE }, - { "delete-pattern", OP_MAIN_DELETE_PATTERN }, - { "delete-subthread", OP_DELETE_SUBTHREAD }, - { "delete-thread", OP_DELETE_THREAD }, - { "display-address", OP_DISPLAY_ADDRESS }, - { "display-message", OP_DISPLAY_MESSAGE }, - { "display-toggle-weed", OP_DISPLAY_HEADERS }, - { "edit", OP_EDIT_RAW_MESSAGE }, - { "edit-label", OP_EDIT_LABEL }, - { "edit-or-view-raw-message", OP_EDIT_OR_VIEW_RAW_MESSAGE }, - { "edit-raw-message", OP_EDIT_RAW_MESSAGE }, - { "edit-type", OP_ATTACHMENT_EDIT_TYPE }, -#ifdef USE_NOTMUCH - { "entire-thread", OP_MAIN_ENTIRE_THREAD }, -#endif - { "exit", OP_EXIT }, - { "extract-keys", OP_EXTRACT_KEYS }, -#ifdef USE_POP - { "fetch-mail", OP_MAIN_FETCH_MAIL }, -#endif - { "flag-message", OP_FLAG_MESSAGE }, -#ifdef USE_NNTP - { "followup-message", OP_FOLLOWUP }, -#endif - { "forget-passphrase", OP_FORGET_PASSPHRASE }, - { "forward-message", OP_FORWARD_MESSAGE }, -#ifdef USE_NNTP - { "forward-to-group", OP_FORWARD_TO_GROUP }, - { "get-children", OP_GET_CHILDREN }, - { "get-message", OP_GET_MESSAGE }, - { "get-parent", OP_GET_PARENT }, -#endif - { "group-chat-reply", OP_GROUP_CHAT_REPLY }, - { "group-reply", OP_GROUP_REPLY }, -#ifdef USE_IMAP - { "imap-fetch-mail", OP_MAIN_IMAP_FETCH }, - { "imap-logout-all", OP_MAIN_IMAP_LOGOUT_ALL }, -#endif - { "limit", OP_MAIN_LIMIT }, - { "limit-current-thread", OP_LIMIT_CURRENT_THREAD }, - { "link-threads", OP_MAIN_LINK_THREADS }, - { "list-reply", OP_LIST_REPLY }, - { "list-subscribe", OP_LIST_SUBSCRIBE }, - { "list-unsubscribe", OP_LIST_UNSUBSCRIBE }, - { "mail", OP_MAIL }, - { "mail-key", OP_MAIL_KEY }, - { "mailbox-list", OP_MAILBOX_LIST }, - { "mark-message", OP_MARK_MSG }, - { "modify-labels", OP_MAIN_MODIFY_TAGS }, - { "modify-labels-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE }, - { "modify-tags", OP_MAIN_MODIFY_TAGS }, - { "modify-tags-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE }, - { "next-new", OP_MAIN_NEXT_NEW }, - { "next-new-then-unread", OP_MAIN_NEXT_NEW_THEN_UNREAD }, - { "next-subthread", OP_MAIN_NEXT_SUBTHREAD }, - { "next-thread", OP_MAIN_NEXT_THREAD }, - { "next-undeleted", OP_MAIN_NEXT_UNDELETED }, - { "next-unread", OP_MAIN_NEXT_UNREAD }, - { "next-unread-mailbox", OP_MAIN_NEXT_UNREAD_MAILBOX }, - { "parent-message", OP_MAIN_PARENT_MESSAGE }, - { "pipe-entry", OP_PIPE }, - { "pipe-message", OP_PIPE }, -#ifdef USE_NNTP - { "post-message", OP_POST }, -#endif - { "previous-new", OP_MAIN_PREV_NEW }, - { "previous-new-then-unread", OP_MAIN_PREV_NEW_THEN_UNREAD }, - { "previous-subthread", OP_MAIN_PREV_SUBTHREAD }, - { "previous-thread", OP_MAIN_PREV_THREAD }, - { "previous-undeleted", OP_MAIN_PREV_UNDELETED }, - { "previous-unread", OP_MAIN_PREV_UNREAD }, - { "print-message", OP_PRINT }, - { "purge-message", OP_PURGE_MESSAGE }, - { "purge-thread", OP_PURGE_THREAD }, - { "quasi-delete", OP_MAIN_QUASI_DELETE }, - { "query", OP_QUERY }, - { "quit", OP_QUIT }, - { "read-subthread", OP_MAIN_READ_SUBTHREAD }, - { "read-thread", OP_MAIN_READ_THREAD }, - { "recall-message", OP_RECALL_MESSAGE }, -#ifdef USE_NNTP - { "reconstruct-thread", OP_RECONSTRUCT_THREAD }, -#endif - { "reply", OP_REPLY }, - { "resend-message", OP_RESEND }, - { "root-message", OP_MAIN_ROOT_MESSAGE }, - { "save-message", OP_SAVE }, - { "set-flag", OP_MAIN_SET_FLAG }, - { "show-limit", OP_MAIN_SHOW_LIMIT }, -#ifdef USE_SIDEBAR - { "sidebar-first", OP_SIDEBAR_FIRST }, - { "sidebar-last", OP_SIDEBAR_LAST }, - { "sidebar-next", OP_SIDEBAR_NEXT }, - { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW }, - { "sidebar-open", OP_SIDEBAR_OPEN }, - { "sidebar-page-down", OP_SIDEBAR_PAGE_DOWN }, - { "sidebar-page-up", OP_SIDEBAR_PAGE_UP }, - { "sidebar-prev", OP_SIDEBAR_PREV }, - { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW }, - { "sidebar-toggle-virtual", OP_SIDEBAR_TOGGLE_VIRTUAL }, - { "sidebar-toggle-visible", OP_SIDEBAR_TOGGLE_VISIBLE }, -#endif - { "sort-mailbox", OP_SORT }, - { "sort-reverse", OP_SORT_REVERSE }, - { "sync-mailbox", OP_MAIN_SYNC_FOLDER }, - { "tag-pattern", OP_MAIN_TAG_PATTERN }, - { "tag-subthread", OP_TAG_SUBTHREAD }, - { "tag-thread", OP_TAG_THREAD }, - { "toggle-new", OP_TOGGLE_NEW }, - { "toggle-read", OP_TOGGLE_READ }, - { "toggle-write", OP_TOGGLE_WRITE }, - { "undelete-message", OP_UNDELETE }, - { "undelete-pattern", OP_MAIN_UNDELETE_PATTERN }, - { "undelete-subthread", OP_UNDELETE_SUBTHREAD }, - { "undelete-thread", OP_UNDELETE_THREAD }, - { "untag-pattern", OP_MAIN_UNTAG_PATTERN }, -#ifdef USE_NOTMUCH - { "vfolder-from-query", OP_MAIN_VFOLDER_FROM_QUERY }, - { "vfolder-from-query-readonly", OP_MAIN_VFOLDER_FROM_QUERY_READONLY }, - { "vfolder-window-backward", OP_MAIN_WINDOWED_VFOLDER_BACKWARD }, - { "vfolder-window-forward", OP_MAIN_WINDOWED_VFOLDER_FORWARD }, - { "vfolder-window-reset", OP_MAIN_WINDOWED_VFOLDER_RESET }, -#endif - { "view-attachments", OP_VIEW_ATTACHMENTS }, - { "view-raw-message", OP_VIEW_RAW_MESSAGE }, - // Deprecated - { "buffy-list", OP_MAILBOX_LIST }, - { NULL, 0 }, -}; - -#ifdef MIXMASTER -/** - * OpMixmaster - Functions for the Mixmaster Menu - */ -const struct MenuFuncOp OpMixmaster[] = { /* map: mixmaster */ - { "accept", OP_MIX_USE }, - { "append", OP_MIX_APPEND }, - { "chain-next", OP_MIX_CHAIN_NEXT }, - { "chain-prev", OP_MIX_CHAIN_PREV }, - { "delete", OP_MIX_DELETE }, - { "exit", OP_EXIT }, - { "insert", OP_MIX_INSERT }, - { NULL, 0 }, -}; -#endif /* MIXMASTER */ - -/** - * OpPager - Functions for the Pager Menu - */ -const struct MenuFuncOp OpPager[] = { /* map: pager */ - { "bottom", OP_PAGER_BOTTOM }, - { "bounce-message", OP_BOUNCE_MESSAGE }, - { "break-thread", OP_MAIN_BREAK_THREAD }, - { "change-folder", OP_MAIN_CHANGE_FOLDER }, - { "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY }, -#ifdef USE_NNTP - { "change-newsgroup", OP_MAIN_CHANGE_GROUP }, - { "change-newsgroup-readonly", OP_MAIN_CHANGE_GROUP_READONLY }, -#endif -#ifdef USE_NOTMUCH - { "change-vfolder", OP_MAIN_CHANGE_VFOLDER }, -#endif - { "check-stats", OP_CHECK_STATS }, - { "check-traditional-pgp", OP_CHECK_TRADITIONAL }, - { "clear-flag", OP_MAIN_CLEAR_FLAG }, - { "compose-to-sender", OP_COMPOSE_TO_SENDER }, - { "copy-message", OP_COPY_MESSAGE }, - { "create-alias", OP_CREATE_ALIAS }, - { "decode-copy", OP_DECODE_COPY }, - { "decode-save", OP_DECODE_SAVE }, - { "decrypt-copy", OP_DECRYPT_COPY }, - { "decrypt-save", OP_DECRYPT_SAVE }, - { "delete-message", OP_DELETE }, - { "delete-subthread", OP_DELETE_SUBTHREAD }, - { "delete-thread", OP_DELETE_THREAD }, - { "display-address", OP_DISPLAY_ADDRESS }, - { "display-toggle-weed", OP_DISPLAY_HEADERS }, - { "edit", OP_EDIT_RAW_MESSAGE }, - { "edit-label", OP_EDIT_LABEL }, - { "edit-or-view-raw-message", OP_EDIT_OR_VIEW_RAW_MESSAGE }, - { "edit-raw-message", OP_EDIT_RAW_MESSAGE }, - { "edit-type", OP_ATTACHMENT_EDIT_TYPE }, - { "enter-command", OP_ENTER_COMMAND }, -#ifdef USE_NOTMUCH - { "entire-thread", OP_MAIN_ENTIRE_THREAD }, -#endif - { "exit", OP_EXIT }, - { "extract-keys", OP_EXTRACT_KEYS }, - { "flag-message", OP_FLAG_MESSAGE }, -#ifdef USE_NNTP - { "followup-message", OP_FOLLOWUP }, -#endif - { "forget-passphrase", OP_FORGET_PASSPHRASE }, - { "forward-message", OP_FORWARD_MESSAGE }, -#ifdef USE_NNTP - { "forward-to-group", OP_FORWARD_TO_GROUP }, -#endif - { "group-chat-reply", OP_GROUP_CHAT_REPLY }, - { "group-reply", OP_GROUP_REPLY }, - { "half-down", OP_HALF_DOWN }, - { "half-up", OP_HALF_UP }, - { "help", OP_HELP }, -#ifdef USE_IMAP - { "imap-fetch-mail", OP_MAIN_IMAP_FETCH }, - { "imap-logout-all", OP_MAIN_IMAP_LOGOUT_ALL }, -#endif - { "jump", OP_JUMP }, - { "jump", OP_JUMP_1 }, - { "jump", OP_JUMP_2 }, - { "jump", OP_JUMP_3 }, - { "jump", OP_JUMP_4 }, - { "jump", OP_JUMP_5 }, - { "jump", OP_JUMP_6 }, - { "jump", OP_JUMP_7 }, - { "jump", OP_JUMP_8 }, - { "jump", OP_JUMP_9 }, - { "link-threads", OP_MAIN_LINK_THREADS }, - { "list-reply", OP_LIST_REPLY }, - { "list-subscribe", OP_LIST_SUBSCRIBE }, - { "list-unsubscribe", OP_LIST_UNSUBSCRIBE }, - { "mail", OP_MAIL }, - { "mail-key", OP_MAIL_KEY }, - { "mailbox-list", OP_MAILBOX_LIST }, - { "mark-as-new", OP_TOGGLE_NEW }, - { "modify-labels", OP_MAIN_MODIFY_TAGS }, - { "modify-labels-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE }, - { "modify-tags", OP_MAIN_MODIFY_TAGS }, - { "modify-tags-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE }, - { "next-entry", OP_NEXT_ENTRY }, - { "next-line", OP_NEXT_LINE }, - { "next-new", OP_MAIN_NEXT_NEW }, - { "next-new-then-unread", OP_MAIN_NEXT_NEW_THEN_UNREAD }, - { "next-page", OP_NEXT_PAGE }, - { "next-subthread", OP_MAIN_NEXT_SUBTHREAD }, - { "next-thread", OP_MAIN_NEXT_THREAD }, - { "next-undeleted", OP_MAIN_NEXT_UNDELETED }, - { "next-unread", OP_MAIN_NEXT_UNREAD }, - { "next-unread-mailbox", OP_MAIN_NEXT_UNREAD_MAILBOX }, - { "parent-message", OP_MAIN_PARENT_MESSAGE }, - { "pipe-entry", OP_PIPE }, - { "pipe-message", OP_PIPE }, -#ifdef USE_NNTP - { "post-message", OP_POST }, -#endif - { "previous-entry", OP_PREV_ENTRY }, - { "previous-line", OP_PREV_LINE }, - { "previous-new", OP_MAIN_PREV_NEW }, - { "previous-new-then-unread", OP_MAIN_PREV_NEW_THEN_UNREAD }, - { "previous-page", OP_PREV_PAGE }, - { "previous-subthread", OP_MAIN_PREV_SUBTHREAD }, - { "previous-thread", OP_MAIN_PREV_THREAD }, - { "previous-undeleted", OP_MAIN_PREV_UNDELETED }, - { "previous-unread", OP_MAIN_PREV_UNREAD }, - { "print-entry", OP_ATTACHMENT_PRINT }, - { "print-message", OP_PRINT }, - { "purge-message", OP_PURGE_MESSAGE }, - { "purge-thread", OP_PURGE_THREAD }, - { "quasi-delete", OP_MAIN_QUASI_DELETE }, - { "quit", OP_QUIT }, - { "read-subthread", OP_MAIN_READ_SUBTHREAD }, - { "read-thread", OP_MAIN_READ_THREAD }, - { "recall-message", OP_RECALL_MESSAGE }, -#ifdef USE_NNTP - { "reconstruct-thread", OP_RECONSTRUCT_THREAD }, -#endif - { "redraw-screen", OP_REDRAW }, - { "reply", OP_REPLY }, - { "resend-message", OP_RESEND }, - { "root-message", OP_MAIN_ROOT_MESSAGE }, - { "save-entry", OP_ATTACHMENT_SAVE }, - { "save-message", OP_SAVE }, - { "search", OP_SEARCH }, - { "search-next", OP_SEARCH_NEXT }, - { "search-opposite", OP_SEARCH_OPPOSITE }, - { "search-reverse", OP_SEARCH_REVERSE }, - { "search-toggle", OP_SEARCH_TOGGLE }, - { "set-flag", OP_MAIN_SET_FLAG }, - { "shell-escape", OP_SHELL_ESCAPE }, - { "show-log-messages", OP_SHOW_LOG_MESSAGES }, - { "show-version", OP_VERSION }, -#ifdef USE_SIDEBAR - { "sidebar-first", OP_SIDEBAR_FIRST }, - { "sidebar-last", OP_SIDEBAR_LAST }, - { "sidebar-next", OP_SIDEBAR_NEXT }, - { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW }, - { "sidebar-open", OP_SIDEBAR_OPEN }, - { "sidebar-page-down", OP_SIDEBAR_PAGE_DOWN }, - { "sidebar-page-up", OP_SIDEBAR_PAGE_UP }, - { "sidebar-prev", OP_SIDEBAR_PREV }, - { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW }, - { "sidebar-toggle-virtual", OP_SIDEBAR_TOGGLE_VIRTUAL }, - { "sidebar-toggle-visible", OP_SIDEBAR_TOGGLE_VISIBLE }, -#endif - { "skip-headers", OP_PAGER_SKIP_HEADERS }, - { "skip-quoted", OP_PAGER_SKIP_QUOTED }, - { "sort-mailbox", OP_SORT }, - { "sort-reverse", OP_SORT_REVERSE }, - { "sync-mailbox", OP_MAIN_SYNC_FOLDER }, - { "tag-message", OP_TAG }, - { "toggle-quoted", OP_PAGER_HIDE_QUOTED }, - { "toggle-write", OP_TOGGLE_WRITE }, - { "top", OP_PAGER_TOP }, - { "undelete-message", OP_UNDELETE }, - { "undelete-subthread", OP_UNDELETE_SUBTHREAD }, - { "undelete-thread", OP_UNDELETE_THREAD }, -#ifdef USE_NOTMUCH - { "vfolder-from-query", OP_MAIN_VFOLDER_FROM_QUERY }, - { "vfolder-from-query-readonly", OP_MAIN_VFOLDER_FROM_QUERY_READONLY }, -#endif - { "view-attachments", OP_VIEW_ATTACHMENTS }, - { "view-raw-message", OP_VIEW_RAW_MESSAGE }, - { "what-key", OP_WHAT_KEY }, - // Deprecated - { "buffy-list", OP_MAILBOX_LIST }, - { "error-history", OP_SHOW_LOG_MESSAGES }, - { NULL, 0 }, -}; - -/** - * OpPgp - Functions for the Pgp Menu - */ -const struct MenuFuncOp OpPgp[] = { /* map: pgp */ - { "exit", OP_EXIT }, - { "verify-key", OP_VERIFY_KEY }, - { "view-name", OP_VIEW_ID }, - { NULL, 0 }, -}; - -/** - * OpPostponed - Functions for the Postpone Menu - */ -const struct MenuFuncOp OpPostponed[] = { /* map: postpone */ - { "exit", OP_EXIT }, - { "delete-entry", OP_DELETE }, - { "undelete-entry", OP_UNDELETE }, - { NULL, 0 }, -}; - -/** - * OpQuery - Functions for the external Query Menu - */ -const struct MenuFuncOp OpQuery[] = { /* map: query */ - { "create-alias", OP_CREATE_ALIAS }, - { "exit", OP_EXIT }, - { "limit", OP_MAIN_LIMIT }, - { "mail", OP_MAIL }, - { "query", OP_QUERY }, - { "query-append", OP_QUERY_APPEND }, - { "sort", OP_SORT }, - { "sort-reverse", OP_SORT_REVERSE }, - { NULL, 0 }, -}; - -/** - * OpSmime - Functions for the Smime Menu - */ -const struct MenuFuncOp OpSmime[] = { /* map: smime */ - { "exit", OP_EXIT }, -#ifdef CRYPT_BACKEND_GPGME - { "verify-key", OP_VERIFY_KEY }, - { "view-name", OP_VIEW_ID }, -#endif - { NULL, 0 }, -}; - -/** - * AliasDefaultBindings - Key bindings for the Alias Menu - */ -const struct MenuOpSeq AliasDefaultBindings[] = { /* map: alias */ - { OP_DELETE, "d" }, - { OP_EXIT, "q" }, - { OP_MAIL, "m" }, - { OP_MAIN_LIMIT, "l" }, - { OP_SORT, "o" }, - { OP_SORT_REVERSE, "O" }, - { OP_TAG, "<space>" }, - { OP_UNDELETE, "u" }, - { 0, NULL }, -}; - -/** - * AttachmentDefaultBindings - Key bindings for the Attachment Menu - */ -const struct MenuOpSeq AttachmentDefaultBindings[] = { /* map: attachment */ - { OP_ATTACHMENT_COLLAPSE, "v" }, - { OP_ATTACHMENT_DELETE, "d" }, - { OP_ATTACHMENT_EDIT_TYPE, "\005" }, // <Ctrl-E> - { OP_EXIT, "q" }, - { OP_PIPE, "|" }, - { OP_ATTACHMENT_PRINT, "p" }, - { OP_ATTACHMENT_SAVE, "s" }, - { OP_ATTACHMENT_UNDELETE, "u" }, - { OP_ATTACHMENT_VIEW, "<keypadenter>" }, - { OP_ATTACHMENT_VIEW, "\n" }, // <Enter> - { OP_ATTACHMENT_VIEW, "\r" }, // <Return> - { OP_ATTACHMENT_VIEW_MAILCAP, "m" }, - { OP_ATTACHMENT_VIEW_TEXT, "T" }, - { OP_BOUNCE_MESSAGE, "b" }, - { OP_CHECK_TRADITIONAL, "\033P" }, // <Alt-P> - { OP_DISPLAY_HEADERS, "h" }, - { OP_EXTRACT_KEYS, "\013" }, // <Ctrl-K> - { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F> - { OP_FORWARD_MESSAGE, "f" }, - { OP_GROUP_REPLY, "g" }, - { OP_LIST_REPLY, "L" }, - { OP_REPLY, "r" }, - { OP_RESEND, "\033e" }, // <Alt-e> - { 0, NULL }, -}; - -#ifdef USE_AUTOCRYPT -/** - * AutocryptDefaultBindings - Key bindings for the Autocrypt Account - */ -const struct MenuOpSeq AutocryptDefaultBindings[] = { /* map: autocrypt account */ - { OP_AUTOCRYPT_CREATE_ACCT, "c" }, - { OP_AUTOCRYPT_DELETE_ACCT, "D" }, - { OP_AUTOCRYPT_TOGGLE_ACTIVE, "a" }, - { OP_AUTOCRYPT_TOGGLE_PREFER, "p" }, - { OP_EXIT, "q" }, - { 0, NULL } -}; -#endif - -/** - * BrowserDefaultBindings - Key bindings for the file Browser Menu - */ -const struct MenuOpSeq BrowserDefaultBindings[] = { /* map: browser */ - { OP_BROWSER_GOTO_FOLDER, "=" }, - { OP_BROWSER_NEW_FILE, "N" }, -#if defined(USE_IMAP) || defined(USE_NNTP) - { OP_BROWSER_SUBSCRIBE, "s" }, -#endif - { OP_BROWSER_TELL, "@" }, -#ifdef USE_IMAP - { OP_BROWSER_TOGGLE_LSUB, "T" }, -#endif -#if defined(USE_IMAP) || defined(USE_NNTP) - { OP_BROWSER_UNSUBSCRIBE, "u" }, -#endif - { OP_BROWSER_VIEW_FILE, " " }, // <Space> - { OP_CHANGE_DIRECTORY, "c" }, -#ifdef USE_IMAP - { OP_CREATE_MAILBOX, "C" }, - { OP_DELETE_MAILBOX, "d" }, -#endif - { OP_ENTER_MASK, "m" }, - { OP_EXIT, "q" }, - { OP_GOTO_PARENT, "p" }, -#ifdef USE_NNTP -#endif - { OP_MAILBOX_LIST, "." }, -#ifdef USE_IMAP - { OP_RENAME_MAILBOX, "r" }, -#endif - { OP_SORT, "o" }, - { OP_SORT_REVERSE, "O" }, - { OP_TOGGLE_MAILBOXES, "\t" }, // <Tab> - { 0, NULL }, -}; - -/** - * ComposeDefaultBindings - Key bindings for the Compose Menu - */ -const struct MenuOpSeq ComposeDefaultBindings[] = { /* map: compose */ - { OP_ATTACHMENT_ATTACH_FILE, "a" }, - { OP_ATTACHMENT_ATTACH_KEY, "\033k" }, // <Alt-k> - { OP_ATTACHMENT_ATTACH_MESSAGE, "A" }, - { OP_ATTACHMENT_DETACH, "D" }, - { OP_ATTACHMENT_EDIT_CONTENT_ID, "\033i" }, // <Alt-i> - { OP_ATTACHMENT_EDIT_DESCRIPTION, "d" }, - { OP_ATTACHMENT_EDIT_ENCODING, "\005" }, // <Ctrl-E> - { OP_ATTACHMENT_EDIT_LANGUAGE, "\014" }, // <Ctrl-L> - { OP_ATTACHMENT_EDIT_MIME, "m" }, - { OP_ATTACHMENT_EDIT_TYPE, "\024" }, // <Ctrl-T> - { OP_ATTACHMENT_FILTER, "F" }, - { OP_ATTACHMENT_GET_ATTACHMENT, "G" }, - { OP_ATTACHMENT_GROUP_ALTS, "&" }, - { OP_ATTACHMENT_GROUP_LINGUAL, "^" }, - { OP_ATTACHMENT_GROUP_RELATED, "%" }, - { OP_ATTACHMENT_MOVE_DOWN, "+" }, - { OP_ATTACHMENT_MOVE_UP, "-" }, - { OP_ATTACHMENT_NEW_MIME, "n" }, - { OP_EXIT, "q" }, - { OP_PIPE, "|" }, - { OP_ATTACHMENT_PRINT, "l" }, - { OP_ATTACHMENT_RENAME_ATTACHMENT, "\017" }, // <Ctrl-O> - { OP_ATTACHMENT_SAVE, "C" }, - { OP_ATTACHMENT_TOGGLE_DISPOSITION, "\004" }, // <Ctrl-D> - { OP_ATTACHMENT_TOGGLE_UNLINK, "u" }, - { OP_ATTACHMENT_UNGROUP, "#" }, - { OP_ATTACHMENT_UPDATE_ENCODING, "U" }, - { OP_ATTACHMENT_VIEW, "<keypadenter>" }, - { OP_ATTACHMENT_VIEW, "\n" }, // <Enter> - { OP_ATTACHMENT_VIEW, "\r" }, // <Return> -#ifdef USE_AUTOCRYPT - { OP_COMPOSE_AUTOCRYPT_MENU, "o" }, -#endif - { OP_COMPOSE_EDIT_FILE, "\033e" }, // <Alt-e> - { OP_COMPOSE_EDIT_MESSAGE, "e" }, - { OP_COMPOSE_ISPELL, "i" }, -#ifdef MIXMASTER - { OP_COMPOSE_MIX, "M" }, -#endif - { OP_COMPOSE_PGP_MENU, "p" }, - { OP_COMPOSE_POSTPONE_MESSAGE, "P" }, - { OP_COMPOSE_RENAME_FILE, "R" }, - { OP_COMPOSE_SEND_MESSAGE, "y" }, - { OP_COMPOSE_SMIME_MENU, "S" }, - { OP_COMPOSE_WRITE_MESSAGE, "w" }, - { OP_DISPLAY_HEADERS, "h" }, - { OP_ENVELOPE_EDIT_BCC, "b" }, - { OP_ENVELOPE_EDIT_CC, "c" }, - { OP_ENVELOPE_EDIT_FCC, "f" }, - { OP_ENVELOPE_EDIT_FROM, "\033f" }, // <Alt-f> - { OP_ENVELOPE_EDIT_HEADERS, "E" }, - { OP_ENVELOPE_EDIT_REPLY_TO, "r" }, - { OP_ENVELOPE_EDIT_SUBJECT, "s" }, - { OP_ENVELOPE_EDIT_TO, "t" }, - { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F> - { OP_TAG, "T" }, - { 0, NULL }, -}; - -/** - * DialogDefaultBindings - Key bindings for Simple Dialogs - */ -const struct MenuOpSeq DialogDefaultBindings[] = { - { OP_QUIT, "q" }, - { 0, NULL }, -}; - -/** - * EditorDefaultBindings - Key bindings for the Editor Menu - */ -const struct MenuOpSeq EditorDefaultBindings[] = { /* map: editor */ - { OP_EDITOR_BACKSPACE, "<backspace>" }, - { OP_EDITOR_BACKSPACE, "\010" }, // <Ctrl-H> - { OP_EDITOR_BACKSPACE, "\177" }, // <Backspace> - { OP_EDITOR_BACKWARD_CHAR, "<left>" }, - { OP_EDITOR_BACKWARD_CHAR, "\002" }, // <Ctrl-B> - { OP_EDITOR_BACKWARD_WORD, "\033b" }, // <Alt-b> - { OP_EDITOR_BOL, "<home>" }, - { OP_EDITOR_BOL, "\001" }, // <Ctrl-A> - { OP_EDITOR_CAPITALIZE_WORD, "\033c" }, // <Alt-c> - { OP_EDITOR_COMPLETE, "\t" }, // <Tab> - { OP_EDITOR_COMPLETE_QUERY, "\024" }, // <Ctrl-T> - { OP_EDITOR_DELETE_CHAR, "<delete>" }, - { OP_EDITOR_DELETE_CHAR, "\004" }, // <Ctrl-D> - { OP_EDITOR_DOWNCASE_WORD, "\033l" }, // <Alt-l> - { OP_EDITOR_EOL, "<end>" }, - { OP_EDITOR_EOL, "\005" }, // <Ctrl-E> - { OP_EDITOR_FORWARD_CHAR, "<right>" }, - { OP_EDITOR_FORWARD_CHAR, "\006" }, // <Ctrl-F> - { OP_EDITOR_FORWARD_WORD, "\033f" }, // <Alt-f> - { OP_EDITOR_HISTORY_DOWN, "<down>" }, - { OP_EDITOR_HISTORY_DOWN, "\016" }, // <Ctrl-N> - { OP_EDITOR_HISTORY_SEARCH, "\022" }, // <Ctrl-R> - { OP_EDITOR_HISTORY_UP, "<up>" }, - { OP_EDITOR_HISTORY_UP, "\020" }, // <Ctrl-P> - { OP_EDITOR_KILL_EOL, "\013" }, // <Ctrl-K> - { OP_EDITOR_KILL_EOW, "\033d" }, // <Alt-d> - { OP_EDITOR_KILL_LINE, "\025" }, // <Ctrl-U> - { OP_EDITOR_KILL_WORD, "\027" }, // <Ctrl-W> - { OP_EDITOR_MAILBOX_CYCLE, " " }, // <Space> - { OP_EDITOR_QUOTE_CHAR, "\026" }, // <Ctrl-V> - { OP_EDITOR_UPCASE_WORD, "\033u" }, // <Alt-u> - { OP_HELP, "\033?" }, // <Alt-?> - { OP_REDRAW, "\014" }, // <Ctrl-L> - { 0, NULL }, -}; - -/** - * GenericDefaultBindings - Key bindings for the Generic Menu - */ -const struct MenuOpSeq GenericDefaultBindings[] = { /* map: generic */ - { OP_BOTTOM_PAGE, "L" }, - { OP_ENTER_COMMAND, ":" }, - { OP_FIRST_ENTRY, "<home>" }, - { OP_FIRST_ENTRY, "=" }, - { OP_GENERIC_SELECT_ENTRY, "<keypadenter>" }, - { OP_GENERIC_SELECT_ENTRY, "\n" }, // <Enter> - { OP_GENERIC_SELECT_ENTRY, "\r" }, // <Return> - { OP_HALF_DOWN, "]" }, - { OP_HALF_UP, "[" }, - { OP_HELP, "?" }, - { OP_JUMP_1, "1" }, - { OP_JUMP_2, "2" }, - { OP_JUMP_3, "3" }, - { OP_JUMP_4, "4" }, - { OP_JUMP_5, "5" }, - { OP_JUMP_6, "6" }, - { OP_JUMP_7, "7" }, - { OP_JUMP_8, "8" }, - { OP_JUMP_9, "9" }, - { OP_LAST_ENTRY, "*" }, - { OP_LAST_ENTRY, "<end>" }, - { OP_MIDDLE_PAGE, "M" }, - { OP_NEXT_ENTRY, "<down>" }, - { OP_NEXT_ENTRY, "j" }, - { OP_NEXT_LINE, ">" }, - { OP_NEXT_PAGE, "<pagedown>" }, - { OP_NEXT_PAGE, "<right>" }, - { OP_NEXT_PAGE, "z" }, - { OP_PREV_ENTRY, "<up>" }, - { OP_PREV_ENTRY, "k" }, - { OP_PREV_LINE, "<" }, - { OP_PREV_PAGE, "<left>" }, - { OP_PREV_PAGE, "<pageup>" }, - { OP_PREV_PAGE, "Z" }, - { OP_REDRAW, "\014" }, // <Ctrl-L> - { OP_SEARCH, "/" }, - { OP_SEARCH_NEXT, "n" }, - { OP_SEARCH_REVERSE, "\033/" }, // <Alt-/> - { OP_SHELL_ESCAPE, "!" }, - { OP_TAG, "t" }, - { OP_TAG_PREFIX, ";" }, - { OP_TOP_PAGE, "H" }, - { OP_VERSION, "V" }, - { 0, NULL }, -}; - -/** - * IndexDefaultBindings - Key bindings for the Index Menu - */ -const struct MenuOpSeq IndexDefaultBindings[] = { /* map: index */ - { OP_ATTACHMENT_EDIT_TYPE, "\005" }, // <Ctrl-E> -#ifdef USE_AUTOCRYPT - { OP_AUTOCRYPT_ACCT_MENU, "A" }, -#endif - { OP_BOUNCE_MESSAGE, "b" }, - { OP_CHECK_TRADITIONAL, "\033P" }, // <Alt-P> - { OP_COPY_MESSAGE, "C" }, - { OP_CREATE_ALIAS, "a" }, - { OP_DECODE_COPY, "\033C" }, // <Alt-C> - { OP_DECODE_SAVE, "\033s" }, // <Alt-s> - { OP_DELETE, "d" }, - { OP_DELETE_SUBTHREAD, "\033d" }, // <Alt-d> - { OP_DELETE_THREAD, "\004" }, // <Ctrl-D> - { OP_DISPLAY_ADDRESS, "@" }, - { OP_DISPLAY_HEADERS, "h" }, - { OP_DISPLAY_MESSAGE, " " }, // <Space> - { OP_DISPLAY_MESSAGE, "<keypadenter>" }, - { OP_DISPLAY_MESSAGE, "\n" }, // <Enter> - { OP_DISPLAY_MESSAGE, "\r" }, // <Return> - { OP_EDIT_LABEL, "Y" }, - { OP_EDIT_OR_VIEW_RAW_MESSAGE, "e" }, - { OP_EXIT, "x" }, - { OP_EXTRACT_KEYS, "\013" }, // <Ctrl-K> - { OP_FLAG_MESSAGE, "F" }, - { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F> - { OP_FORWARD_MESSAGE, "f" }, - { OP_GROUP_REPLY, "g" }, - { OP_LIST_REPLY, "L" }, - { OP_MAIL, "m" }, - { OP_MAILBOX_LIST, "." }, - { OP_MAIL_KEY, "\033k" }, // <Alt-k> - { OP_MAIN_BREAK_THREAD, "#" }, - { OP_MAIN_CHANGE_FOLDER, "c" }, - { OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" }, // <Alt-c> -#ifdef USE_NNTP - { OP_MAIN_CHANGE_GROUP, "i" }, - { OP_MAIN_CHANGE_GROUP_READONLY, "\033i" }, // <Alt-i> -#endif - { OP_MAIN_CLEAR_FLAG, "W" }, - { OP_MAIN_COLLAPSE_ALL, "\033V" }, // <Alt-V> - { OP_MAIN_COLLAPSE_THREAD, "\033v" }, // <Alt-v> - { OP_MAIN_DELETE_PATTERN, "D" }, -#ifdef USE_POP - { OP_MAIN_FETCH_MAIL, "G" }, -#endif - { OP_MAIN_LIMIT, "l" }, - { OP_MAIN_LINK_THREADS, "&" }, - { OP_MAIN_NEXT_NEW_THEN_UNREAD, "\t" }, // <Tab> - { OP_MAIN_NEXT_SUBTHREAD, "\033n" }, // <Alt-n> - { OP_MAIN_NEXT_THREAD, "\016" }, // <Ctrl-N> - { OP_MAIN_NEXT_UNDELETED, "<down>" }, - { OP_MAIN_NEXT_UNDELETED, "j" }, - { OP_MAIN_PARENT_MESSAGE, "P" }, - { OP_MAIN_PREV_NEW_THEN_UNREAD, "\033\t" }, // <Alt-\> - { OP_MAIN_PREV_SUBTHREAD, "\033p" }, // <Alt-p> - { OP_MAIN_PREV_THREAD, "\020" }, // <Ctrl-P> - { OP_MAIN_PREV_UNDELETED, "<up>" }, - { OP_MAIN_PREV_UNDELETED, "k" }, - { OP_MAIN_READ_SUBTHREAD, "\033r" }, // <Alt-r> - { OP_MAIN_READ_THREAD, "\022" }, // <Ctrl-R> - { OP_MAIN_SET_FLAG, "w" }, - { OP_MAIN_SHOW_LIMIT, "\033l" }, // <Alt-l> - { OP_MAIN_SYNC_FOLDER, "$" }, - { OP_MAIN_TAG_PATTERN, "T" }, - { OP_MAIN_UNDELETE_PATTERN, "U" }, - { OP_MAIN_UNTAG_PATTERN, "\024" }, // <Ctrl-T> - { OP_MARK_MSG, "~" }, - { OP_NEXT_ENTRY, "J" }, - { OP_PIPE, "|" }, - { OP_PREV_ENTRY, "K" }, - { OP_PRINT, "p" }, - { OP_QUERY, "Q" }, - { OP_QUIT, "q" }, - { OP_RECALL_MESSAGE, "R" }, - { OP_REPLY, "r" }, - { OP_RESEND, "\033e" }, // <Alt-e> - { OP_SAVE, "s" }, - { OP_SHOW_LOG_MESSAGES, "M" }, - { OP_SORT, "o" }, - { OP_SORT_REVERSE, "O" }, - { OP_TAG_THREAD, "\033t" }, // <Alt-t> - { OP_TOGGLE_NEW, "N" }, - { OP_TOGGLE_WRITE, "%" }, - { OP_UNDELETE, "u" }, - { OP_UNDELETE_SUBTHREAD, "\033u" }, // <Alt-u> - { OP_UNDELETE_THREAD, "\025" }, // <Ctrl-U> - { OP_VIEW_ATTACHMENTS, "v" }, - { 0, NULL }, -}; - -#ifdef MIXMASTER -/** - * MixmasterDefaultBindings - Key bindings for the Mixmaster Menu - */ -const struct MenuOpSeq MixmasterDefaultBindings[] = { /* map: mixmaster */ - { OP_EXIT, "q" }, - { OP_GENERIC_SELECT_ENTRY, "<space>" }, - { OP_MIX_APPEND, "a" }, - { OP_MIX_CHAIN_NEXT, "<right>" }, - { OP_MIX_CHAIN_NEXT, "l" }, - { OP_MIX_CHAIN_PREV, "<left>" }, - { OP_MIX_CHAIN_PREV, "h" }, - { OP_MIX_DELETE, "d" }, - { OP_MIX_INSERT, "i" }, - { OP_MIX_USE, "<keypadenter>" }, - { OP_MIX_USE, "\n" }, // <Enter> - { OP_MIX_USE, "\r" }, // <Return> - { 0, NULL }, -}; -#endif /* MIXMASTER */ - -/** - * PagerDefaultBindings - Key bindings for the Pager Menu - */ -const struct MenuOpSeq PagerDefaultBindings[] = { /* map: pager */ - { OP_ATTACHMENT_EDIT_TYPE, "\005" }, // <Ctrl-E> - { OP_BOUNCE_MESSAGE, "b" }, - { OP_CHECK_TRADITIONAL, "\033P" }, // <Alt-P> - { OP_COPY_MESSAGE, "C" }, - { OP_CREATE_ALIAS, "a" }, - { OP_DECODE_COPY, "\033C" }, // <Alt-C> - { OP_DECODE_SAVE, "\033s" }, // <Alt-s> - { OP_DELETE, "d" }, - { OP_DELETE_SUBTHREAD, "\033d" }, // <Alt-d> - { OP_DELETE_THREAD, "\004" }, // <Ctrl-D> - { OP_DISPLAY_ADDRESS, "@" }, - { OP_DISPLAY_HEADERS, "h" }, - { OP_EDIT_LABEL, "Y" }, - { OP_EDIT_OR_VIEW_RAW_MESSAGE, "e" }, - { OP_ENTER_COMMAND, ":" }, - { OP_EXIT, "i" }, - { OP_EXIT, "q" }, - { OP_EXIT, "x" }, - { OP_EXTRACT_KEYS, "\013" }, // <Ctrl-K> - { OP_FLAG_MESSAGE, "F" }, - { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F> - { OP_FORWARD_MESSAGE, "f" }, - { OP_GROUP_REPLY, "g" }, - { OP_HELP, "?" }, - { OP_JUMP_1, "1" }, - { OP_JUMP_2, "2" }, - { OP_JUMP_3, "3" }, - { OP_JUMP_4, "4" }, - { OP_JUMP_5, "5" }, - { OP_JUMP_6, "6" }, - { OP_JUMP_7, "7" }, - { OP_JUMP_8, "8" }, - { OP_JUMP_9, "9" }, - { OP_LIST_REPLY, "L" }, - { OP_MAIL, "m" }, - { OP_MAILBOX_LIST, "." }, - { OP_MAIL_KEY, "\033k" }, // <Alt-k> - { OP_MAIN_BREAK_THREAD, "#" }, - { OP_MAIN_CHANGE_FOLDER, "c" }, - { OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" }, // <Alt-c> - { OP_MAIN_CLEAR_FLAG, "W" }, - { OP_MAIN_LINK_THREADS, "&" }, - { OP_MAIN_NEXT_NEW_THEN_UNREAD, "\t" }, // <Tab> - { OP_MAIN_NEXT_SUBTHREAD, "\033n" }, // <Alt-n> - { OP_MAIN_NEXT_THREAD, "\016" }, // <Ctrl-N> - { OP_MAIN_NEXT_UNDELETED, "<down>" }, - { OP_MAIN_NEXT_UNDELETED, "<right>" }, - { OP_MAIN_NEXT_UNDELETED, "j" }, - { OP_MAIN_PARENT_MESSAGE, "P" }, - { OP_MAIN_PREV_SUBTHREAD, "\033p" }, // <Alt-p> - { OP_MAIN_PREV_THREAD, "\020" }, // <Ctrl-P> - { OP_MAIN_PREV_UNDELETED, "<left>" }, - { OP_MAIN_PREV_UNDELETED, "<up>" }, - { OP_MAIN_PREV_UNDELETED, "k" }, - { OP_MAIN_READ_SUBTHREAD, "\033r" }, // <Alt-r> - { OP_MAIN_READ_THREAD, "\022" }, // <Ctrl-R> - { OP_MAIN_SET_FLAG, "w" }, - { OP_MAIN_SYNC_FOLDER, "$" }, - { OP_NEXT_ENTRY, "J" }, - { OP_NEXT_LINE, "<keypadenter>" }, - { OP_NEXT_LINE, "\n" }, // <Enter> - { OP_NEXT_LINE, "\r" }, // <Return> - { OP_NEXT_PAGE, " " }, // <Space> - { OP_NEXT_PAGE, "<pagedown>" }, - { OP_PAGER_BOTTOM, "<end>" }, - { OP_PAGER_HIDE_QUOTED, "T" }, - { OP_PAGER_SKIP_HEADERS, "H" }, - { OP_PAGER_SKIP_QUOTED, "S" }, - { OP_PAGER_TOP, "<home>" }, - { OP_PAGER_TOP, "^" }, - { OP_PIPE, "|" }, - { OP_PREV_ENTRY, "K" }, - { OP_PREV_LINE, "<backspace>" }, - { OP_PREV_PAGE, "-" }, - { OP_PREV_PAGE, "<pageup>" }, - { OP_PRINT, "p" }, - { OP_QUIT, "Q" }, - { OP_RECALL_MESSAGE, "R" }, - { OP_REDRAW, "\014" }, // <Ctrl-L> - { OP_REPLY, "r" }, - { OP_RESEND, "\033e" }, // <Alt-e> - { OP_SAVE, "s" }, - { OP_SEARCH, "/" }, - { OP_SEARCH_NEXT, "n" }, - { OP_SEARCH_REVERSE, "\033/" }, // <Alt-/> - { OP_SEARCH_TOGGLE, "\\" }, // <Backslash> - { OP_SHELL_ESCAPE, "!" }, - { OP_SORT, "o" }, - { OP_SORT_REVERSE, "O" }, - { OP_TAG, "t" }, - { OP_TOGGLE_NEW, "N" }, - { OP_TOGGLE_WRITE, "%" }, - { OP_UNDELETE, "u" }, - { OP_UNDELETE_SUBTHREAD, "\033u" }, // <Alt-u> - { OP_UNDELETE_THREAD, "\025" }, // <Ctrl-U> - { OP_VERSION, "V" }, - { OP_VIEW_ATTACHMENTS, "v" }, - { 0, NULL }, -}; - -/** - * PgpDefaultBindings - Key bindings for the Pgp Menu - */ -const struct MenuOpSeq PgpDefaultBindings[] = { /* map: pgp */ - { OP_EXIT, "q" }, - { OP_VERIFY_KEY, "c" }, - { OP_VIEW_ID, "%" }, - { 0, NULL }, -}; - -/** - * PostponedDefaultBindings - Key bindings for the Postpone Menu - */ -const struct MenuOpSeq PostponedDefaultBindings[] = { /* map: postpone */ - { OP_DELETE, "d" }, - { OP_EXIT, "q" }, - { OP_UNDELETE, "u" }, - { 0, NULL }, -}; - -/** - * QueryDefaultBindings - Key bindings for the external Query Menu - */ -const struct MenuOpSeq QueryDefaultBindings[] = { /* map: query */ - { OP_CREATE_ALIAS, "a" }, - { OP_EXIT, "q" }, - { OP_MAIL, "m" }, - { OP_MAIN_LIMIT, "l" }, - { OP_QUERY, "Q" }, - { OP_QUERY_APPEND, "A" }, - { OP_SORT, "o" }, - { OP_SORT_REVERSE, "O" }, - { 0, NULL }, -}; - -/** - * SmimeDefaultBindings - Key bindings for the Smime Menu - */ -const struct MenuOpSeq SmimeDefaultBindings[] = { /* map: smime */ - { OP_EXIT, "q" }, -#ifdef CRYPT_BACKEND_GPGME - { OP_VERIFY_KEY, "c" }, - { OP_VIEW_ID, "%" }, -#endif - { 0, NULL }, -}; - -// clang-format on diff --git a/functions.h b/functions.h deleted file mode 100644 index eb6512a6b..000000000 --- a/functions.h +++ /dev/null @@ -1,69 +0,0 @@ -/** - * @file - * Definitions of user functions - * - * @authors - * Copyright (C) 1996-2000,2002 Michael R. Elkins <me@mutt.org> - * - * @copyright - * This program is free software: you can redistribute it and/or modify it under - * the terms of the GNU General Public License as published by the Free Software - * Foundation, either version 2 of the License, or (at your option) any later - * version. - * - * 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/>. - */ - -#ifndef MUTT_FUNCTIONS_H -#define MUTT_FUNCTIONS_H - -#include "config.h" -#include "key/lib.h" - -extern struct MenuFuncOp OpAlias[]; -extern struct MenuFuncOp OpAttachment[]; -#ifdef USE_AUTOCRYPT -extern struct MenuFuncOp OpAutocrypt[]; -#endif -extern struct MenuFuncOp OpBrowser[]; -extern struct MenuFuncOp OpCompose[]; -extern struct MenuFuncOp OpDialog[]; -extern struct MenuFuncOp OpEditor[]; -extern struct MenuFuncOp OpGeneric[]; -extern struct MenuFuncOp OpIndex[]; -#ifdef MIXMASTER -extern struct MenuFuncOp OpMixmaster[]; -#endif -extern struct MenuFuncOp OpPager[]; -extern struct MenuFuncOp OpPgp[]; -extern struct MenuFuncOp OpPostponed[]; -extern struct MenuFuncOp OpQuery[]; -extern struct MenuFuncOp OpSmime[]; - -extern const struct MenuOpSeq AliasDefaultBindings[]; -extern const struct MenuOpSeq AttachmentDefaultBindings[]; -#ifdef USE_AUTOCRYPT -extern const struct MenuOpSeq AutocryptDefaultBindings[]; -#endif -extern const struct MenuOpSeq BrowserDefaultBindings[]; -extern const struct MenuOpSeq ComposeDefaultBindings[]; -extern const struct MenuOpSeq DialogDefaultBindings[]; -extern const struct MenuOpSeq EditorDefaultBindings[]; -extern const struct MenuOpSeq GenericDefaultBindings[]; -extern const struct MenuOpSeq IndexDefaultBindings[]; -#ifdef MIXMASTER -extern const struct MenuOpSeq MixmasterDefaultBindings[]; -#endif -extern const struct MenuOpSeq PagerDefaultBindings[]; -extern const struct MenuOpSeq PgpDefaultBindings[]; -extern const struct MenuOpSeq PostponedDefaultBindings[]; -extern const struct MenuOpSeq QueryDefaultBindings[]; -extern const struct MenuOpSeq SmimeDefaultBindings[]; - -#endif /* MUTT_FUNCTIONS_H */ diff --git a/gui/functions.c b/gui/functions.c new file mode 100644 index 000000000..8fe381447 --- /dev/null +++ b/gui/functions.c @@ -0,0 +1,183 @@ +/** + * @file + * Definitions of user functions + * + * @authors + * Copyright (C) 1996-2000,2002 Michael R. Elkins <me@mutt.org> + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * 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/>. + */ + +/** + * @page gui_functions Definitions of user functions + * + * Definitions of user functions + * + * This file contains the structures needed to parse "bind" commands, as well + * as the default bindings for each menu. + * + * Notes: + * + * - If you need to bind a control char, use the octal value because the `\cX` + * construct does not work at this level. + * + * - The magic "map:" comments define how the map will be called in the manual. + * Lines starting with "**" will be included in the manual. + * + * - For "enter" bindings, add entries for "\n" and "\r" and "<keypadenter>". + */ + +#include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else +#include <stddef.h> +#include "key/lib.h" +#include "opcodes.h" +#endif +#endif + +// clang-format off +/** + * OpDialog - Functions for Simple Dialogs + */ +const struct MenuFuncOp OpDialog[] = { + { "exit", OP_EXIT }, + { NULL, 0 }, +}; + +/** + * OpGeneric - Functions for the Generic Menu + */ +const struct MenuFuncOp OpGeneric[] = { /* map: generic */ + /* + ** <para> + ** The <emphasis>generic</emphasis> menu is not a real menu, but specifies common functions + ** (such as movement) available in all menus except for <emphasis>pager</emphasis> and + ** <emphasis>editor</emphasis>. Changing settings for this menu will affect the default + ** bindings for all menus (except as noted). + ** </para> + */ + { "bottom-page", OP_BOTTOM_PAGE }, + { "check-stats", OP_CHECK_STATS }, + { "current-bottom", OP_CURRENT_BOTTOM }, + { "current-middle", OP_CURRENT_MIDDLE }, + { "current-top", OP_CURRENT_TOP }, + { "end-cond", OP_END_COND }, + { "enter-command", OP_ENTER_COMMAND }, + { "exit", OP_EXIT }, + { "first-entry", OP_FIRST_ENTRY }, + { "half-down", OP_HALF_DOWN }, + { "half-up", OP_HALF_UP }, + { "help", OP_HELP }, + { "jump", OP_JUMP }, + { "jump", OP_JUMP_1 }, + { "jump", OP_JUMP_2 }, + { "jump", OP_JUMP_3 }, + { "jump", OP_JUMP_4 }, + { "jump", OP_JUMP_5 }, + { "jump", OP_JUMP_6 }, + { "jump", OP_JUMP_7 }, + { "jump", OP_JUMP_8 }, + { "jump", OP_JUMP_9 }, + { "last-entry", OP_LAST_ENTRY }, + { "middle-page", OP_MIDDLE_PAGE }, + { "next-entry", OP_NEXT_ENTRY }, + { "next-line", OP_NEXT_LINE }, + { "next-page", OP_NEXT_PAGE }, + { "previous-entry", OP_PREV_ENTRY }, + { "previous-line", OP_PREV_LINE }, + { "previous-page", OP_PREV_PAGE }, + { "redraw-screen", OP_REDRAW }, + { "search", OP_SEARCH }, + { "search-next", OP_SEARCH_NEXT }, + { "search-opposite", OP_SEARCH_OPPOSITE }, + { "search-reverse", OP_SEARCH_REVERSE }, + { "select-entry", OP_GENERIC_SELECT_ENTRY }, + { "shell-escape", OP_SHELL_ESCAPE }, + { "show-log-messages", OP_SHOW_LOG_MESSAGES }, + { "show-version", OP_VERSION }, + { "tag-entry", OP_TAG }, + { "tag-prefix", OP_TAG_PREFIX }, + { "tag-prefix-cond", OP_TAG_PREFIX_COND }, + { "top-page", OP_TOP_PAGE }, + { "what-key", OP_WHAT_KEY }, + // Deprecated + { "error-history", OP_SHOW_LOG_MESSAGES }, + { "refresh", OP_REDRAW }, + { NULL, 0 }, +}; + +/** + * DialogDefaultBindings - Key bindings for Simple Dialogs + */ +const struct MenuOpSeq DialogDefaultBindings[] = { + { OP_QUIT, "q" }, + { 0, NULL }, +}; + +/** + * GenericDefaultBindings - Key bindings for the Generic Menu + */ +const struct MenuOpSeq GenericDefaultBindings[] = { /* map: generic */ + { OP_BOTTOM_PAGE, "L" }, + { OP_ENTER_COMMAND, ":" }, + { OP_FIRST_ENTRY, "<home>" }, + { OP_FIRST_ENTRY, "=" }, + { OP_GENERIC_SELECT_ENTRY, "<keypadenter>" }, + { OP_GENERIC_SELECT_ENTRY, "\n" }, // <Enter> + { OP_GENERIC_SELECT_ENTRY, "\r" }, // <Return> + { OP_HALF_DOWN, "]" }, + { OP_HALF_UP, "[" }, + { OP_HELP, "?" }, + { OP_JUMP_1, "1" }, + { OP_JUMP_2, "2" }, + { OP_JUMP_3, "3" }, + { OP_JUMP_4, "4" }, + { OP_JUMP_5, "5" }, + { OP_JUMP_6, "6" }, + { OP_JUMP_7, "7" }, + { OP_JUMP_8, "8" }, + { OP_JUMP_9, "9" }, + { OP_LAST_ENTRY, "*" }, + { OP_LAST_ENTRY, "<end>" }, + { OP_MIDDLE_PAGE, "M" }, + { OP_NEXT_ENTRY, "<down>" }, + { OP_NEXT_ENTRY, "j" }, + { OP_NEXT_LINE, ">" }, + { OP_NEXT_PAGE, "<pagedown>" }, + { OP_NEXT_PAGE, "<right>" }, + { OP_NEXT_PAGE, "z" }, + { OP_PREV_ENTRY, "<up>" }, + { OP_PREV_ENTRY, "k" }, + { OP_PREV_LINE, "<" }, + { OP_PREV_PAGE, "<left>" }, + { OP_PREV_PAGE, "<pageup>" }, + { OP_PREV_PAGE, "Z" }, + { OP_REDRAW, "\014" }, // <Ctrl-L> + { OP_SEARCH, "/" }, + { OP_SEARCH_NEXT, "n" }, + { OP_SEARCH_REVERSE, "\033/" }, // <Alt-/> + { OP_SHELL_ESCAPE, "!" }, + { OP_TAG, "t" }, + { OP_TAG_PREFIX, ";" }, + { OP_TOP_PAGE, "H" }, + { OP_VERSION, "V" }, + { 0, NULL }, +}; +// clang-format on diff --git a/gui/functions.h b/gui/functions.h new file mode 100644 index 000000000..a913e06b1 --- /dev/null +++ b/gui/functions.h @@ -0,0 +1,35 @@ +/** + * @file + * Definitions of user functions + * + * @authors + * Copyright (C) 1996-2000,2002 Michael R. Elkins <me@mutt.org> + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * 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/>. + */ + +#ifndef MUTT_FUNCTIONS_H +#define MUTT_FUNCTIONS_H + +#include "config.h" +#include "key/lib.h" + +extern const struct MenuFuncOp OpDialog[]; +extern const struct MenuFuncOp OpGeneric[]; + +extern const struct MenuOpSeq DialogDefaultBindings[]; +extern const struct MenuOpSeq GenericDefaultBindings[]; + +#endif /* MUTT_FUNCTIONS_H */ @@ -29,12 +29,14 @@ * | :------------------ | :------------------------- | * | gui/curs_lib.c | @subpage gui_curs_lib | * | gui/dialog.c | @subpage gui_dialog | + * | gui/functions.c | @subpage gui_functions | * | gui/global.c | @subpage gui_global | * | gui/msgcont.c | @subpage gui_msgcont | * | gui/msgwin.c | @subpage gui_msgwin | * | gui/msgwin_wdata.c | @subpage gui_msgwin_wdata | * | gui/mutt_curses.c | @subpage gui_curses | * | gui/mutt_window.c | @subpage gui_window | + * | gui/opcodes.c | @subpage gui_opcode | * | gui/reflow.c | @subpage gui_reflow | * | gui/resize.c | @subpage gui_resize | * | gui/rootwin.c | @subpage gui_rootwin | @@ -49,11 +51,13 @@ // IWYU pragma: begin_keep #include "curs_lib.h" #include "dialog.h" +#include "functions.h" #include "global.h" #include "msgcont.h" #include "msgwin.h" #include "mutt_curses.h" #include "mutt_window.h" +#include "opcodes.h" #include "reflow.h" #include "rootwin.h" #include "sbar.h" diff --git a/opcodes.c b/gui/opcodes.c index ef4e8c72f..e6fba0f1c 100644 --- a/opcodes.c +++ b/gui/opcodes.c @@ -21,7 +21,7 @@ */ /** - * @page neo_opcode All user-callable functions + * @page gui_opcode All user-callable functions * * All user-callable functions */ diff --git a/opcodes.h b/gui/opcodes.h index 52b0fa556..52b0fa556 100644 --- a/opcodes.h +++ b/gui/opcodes.h @@ -39,6 +39,7 @@ #include "config/lib.h" #include "email/lib.h" #include "core/lib.h" +#include "gui/lib.h" #include "mutt.h" #include "handler.h" #include "attach/lib.h" @@ -52,7 +53,6 @@ #include "mailcap.h" #include "mutt_logging.h" #include "muttlib.h" -#include "opcodes.h" #include "rfc3676.h" #ifdef ENABLE_NLS #include <libintl.h> @@ -40,9 +40,7 @@ #include "key/lib.h" #include "menu/lib.h" #include "pager/lib.h" -#include "functions.h" #include "hdrline.h" -#include "opcodes.h" #include "protos.h" /** diff --git a/history/dlg_history.c b/history/dlg_history.c index fa17ff0b2..046235ccc 100644 --- a/history/dlg_history.c +++ b/history/dlg_history.c @@ -69,7 +69,6 @@ #include "functions.h" #include "mutt_logging.h" #include "muttlib.h" -#include "opcodes.h" /// Help Bar for the History Selection dialog static const struct Mapping HistoryHelp[] = { diff --git a/history/functions.c b/history/functions.c index 7e99f9acb..6e92e0664 100644 --- a/history/functions.c +++ b/history/functions.c @@ -32,7 +32,6 @@ #include "gui/lib.h" #include "functions.h" #include "menu/lib.h" -#include "opcodes.h" /** * op_generic_select_entry - Select the current entry - Implements ::history_function_t - @ingroup history_function_api diff --git a/index/dlg_index.c b/index/dlg_index.c index 35661c822..dcf40e45a 100644 --- a/index/dlg_index.c +++ b/index/dlg_index.c @@ -79,7 +79,6 @@ #include "mutt_thread.h" #include "mview.h" #include "mx.h" -#include "opcodes.h" #include "private_data.h" #include "protos.h" #include "shared_data.h" diff --git a/index/functions.c b/index/functions.c index f3a446f58..05e3c423f 100644 --- a/index/functions.c +++ b/index/functions.c @@ -27,6 +27,9 @@ */ #include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else #include <limits.h> #include <stdbool.h> #include <stdio.h> @@ -38,7 +41,6 @@ #include "alias/lib.h" #include "gui/lib.h" #include "mutt.h" -#include "functions.h" #include "lib.h" #include "attach/lib.h" #include "browser/lib.h" @@ -53,6 +55,7 @@ #include "question/lib.h" #include "send/lib.h" #include "external.h" +#include "functions.h" #include "globals.h" // IWYU pragma: keep #include "hook.h" #include "mutt_header.h" @@ -61,7 +64,6 @@ #include "muttlib.h" #include "mview.h" #include "mx.h" -#include "opcodes.h" #include "private_data.h" #include "protos.h" #include "shared_data.h" @@ -85,10 +87,270 @@ #ifdef ENABLE_NLS #include <libintl.h> #endif +#endif /// Error message for unavailable functions static const char *Not_available_in_this_menu = N_("Not available in this menu"); +// clang-format off +/** + * OpIndex - Functions for the Index Menu + */ +const struct MenuFuncOp OpIndex[] = { /* map: index */ + { "alias-dialog", OP_ALIAS_DIALOG }, +#ifdef USE_AUTOCRYPT + { "autocrypt-acct-menu", OP_AUTOCRYPT_ACCT_MENU }, +#endif + { "bounce-message", OP_BOUNCE_MESSAGE }, + { "break-thread", OP_MAIN_BREAK_THREAD }, +#ifdef USE_NNTP + { "catchup", OP_CATCHUP }, +#endif + { "change-folder", OP_MAIN_CHANGE_FOLDER }, + { "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY }, +#ifdef USE_NNTP + { "change-newsgroup", OP_MAIN_CHANGE_GROUP }, + { "change-newsgroup-readonly", OP_MAIN_CHANGE_GROUP_READONLY }, +#endif +#ifdef USE_NOTMUCH + { "change-vfolder", OP_MAIN_CHANGE_VFOLDER }, +#endif + { "check-traditional-pgp", OP_CHECK_TRADITIONAL }, + { "clear-flag", OP_MAIN_CLEAR_FLAG }, + { "collapse-all", OP_MAIN_COLLAPSE_ALL }, + { "collapse-thread", OP_MAIN_COLLAPSE_THREAD }, + { "compose-to-sender", OP_COMPOSE_TO_SENDER }, + { "copy-message", OP_COPY_MESSAGE }, + { "create-alias", OP_CREATE_ALIAS }, + { "decode-copy", OP_DECODE_COPY }, + { "decode-save", OP_DECODE_SAVE }, + { "decrypt-copy", OP_DECRYPT_COPY }, + { "decrypt-save", OP_DECRYPT_SAVE }, + { "delete-message", OP_DELETE }, + { "delete-pattern", OP_MAIN_DELETE_PATTERN }, + { "delete-subthread", OP_DELETE_SUBTHREAD }, + { "delete-thread", OP_DELETE_THREAD }, + { "display-address", OP_DISPLAY_ADDRESS }, + { "display-message", OP_DISPLAY_MESSAGE }, + { "display-toggle-weed", OP_DISPLAY_HEADERS }, + { "edit", OP_EDIT_RAW_MESSAGE }, + { "edit-label", OP_EDIT_LABEL }, + { "edit-or-view-raw-message", OP_EDIT_OR_VIEW_RAW_MESSAGE }, + { "edit-raw-message", OP_EDIT_RAW_MESSAGE }, + { "edit-type", OP_ATTACHMENT_EDIT_TYPE }, +#ifdef USE_NOTMUCH + { "entire-thread", OP_MAIN_ENTIRE_THREAD }, +#endif + { "exit", OP_EXIT }, + { "extract-keys", OP_EXTRACT_KEYS }, +#ifdef USE_POP + { "fetch-mail", OP_MAIN_FETCH_MAIL }, +#endif + { "flag-message", OP_FLAG_MESSAGE }, +#ifdef USE_NNTP + { "followup-message", OP_FOLLOWUP }, +#endif + { "forget-passphrase", OP_FORGET_PASSPHRASE }, + { "forward-message", OP_FORWARD_MESSAGE }, +#ifdef USE_NNTP + { "forward-to-group", OP_FORWARD_TO_GROUP }, + { "get-children", OP_GET_CHILDREN }, + { "get-message", OP_GET_MESSAGE }, + { "get-parent", OP_GET_PARENT }, +#endif + { "group-chat-reply", OP_GROUP_CHAT_REPLY }, + { "group-reply", OP_GROUP_REPLY }, +#ifdef USE_IMAP + { "imap-fetch-mail", OP_MAIN_IMAP_FETCH }, + { "imap-logout-all", OP_MAIN_IMAP_LOGOUT_ALL }, +#endif + { "limit", OP_MAIN_LIMIT }, + { "limit-current-thread", OP_LIMIT_CURRENT_THREAD }, + { "link-threads", OP_MAIN_LINK_THREADS }, + { "list-reply", OP_LIST_REPLY }, + { "list-subscribe", OP_LIST_SUBSCRIBE }, + { "list-unsubscribe", OP_LIST_UNSUBSCRIBE }, + { "mail", OP_MAIL }, + { "mail-key", OP_MAIL_KEY }, + { "mailbox-list", OP_MAILBOX_LIST }, + { "mark-message", OP_MARK_MSG }, + { "modify-labels", OP_MAIN_MODIFY_TAGS }, + { "modify-labels-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE }, + { "modify-tags", OP_MAIN_MODIFY_TAGS }, + { "modify-tags-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE }, + { "next-new", OP_MAIN_NEXT_NEW }, + { "next-new-then-unread", OP_MAIN_NEXT_NEW_THEN_UNREAD }, + { "next-subthread", OP_MAIN_NEXT_SUBTHREAD }, + { "next-thread", OP_MAIN_NEXT_THREAD }, + { "next-undeleted", OP_MAIN_NEXT_UNDELETED }, + { "next-unread", OP_MAIN_NEXT_UNREAD }, + { "next-unread-mailbox", OP_MAIN_NEXT_UNREAD_MAILBOX }, + { "parent-message", OP_MAIN_PARENT_MESSAGE }, + { "pipe-entry", OP_PIPE }, + { "pipe-message", OP_PIPE }, +#ifdef USE_NNTP + { "post-message", OP_POST }, +#endif + { "previous-new", OP_MAIN_PREV_NEW }, + { "previous-new-then-unread", OP_MAIN_PREV_NEW_THEN_UNREAD }, + { "previous-subthread", OP_MAIN_PREV_SUBTHREAD }, + { "previous-thread", OP_MAIN_PREV_THREAD }, + { "previous-undeleted", OP_MAIN_PREV_UNDELETED }, + { "previous-unread", OP_MAIN_PREV_UNREAD }, + { "print-message", OP_PRINT }, + { "purge-message", OP_PURGE_MESSAGE }, + { "purge-thread", OP_PURGE_THREAD }, + { "quasi-delete", OP_MAIN_QUASI_DELETE }, + { "query", OP_QUERY }, + { "quit", OP_QUIT }, + { "read-subthread", OP_MAIN_READ_SUBTHREAD }, + { "read-thread", OP_MAIN_READ_THREAD }, + { "recall-message", OP_RECALL_MESSAGE }, +#ifdef USE_NNTP + { "reconstruct-thread", OP_RECONSTRUCT_THREAD }, +#endif + { "reply", OP_REPLY }, + { "resend-message", OP_RESEND }, + { "root-message", OP_MAIN_ROOT_MESSAGE }, + { "save-message", OP_SAVE }, + { "set-flag", OP_MAIN_SET_FLAG }, + { "show-limit", OP_MAIN_SHOW_LIMIT }, +#ifdef USE_SIDEBAR + { "sidebar-first", OP_SIDEBAR_FIRST }, + { "sidebar-last", OP_SIDEBAR_LAST }, + { "sidebar-next", OP_SIDEBAR_NEXT }, + { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW }, + { "sidebar-open", OP_SIDEBAR_OPEN }, + { "sidebar-page-down", OP_SIDEBAR_PAGE_DOWN }, + { "sidebar-page-up", OP_SIDEBAR_PAGE_UP }, + { "sidebar-prev", OP_SIDEBAR_PREV }, + { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW }, + { "sidebar-toggle-virtual", OP_SIDEBAR_TOGGLE_VIRTUAL }, + { "sidebar-toggle-visible", OP_SIDEBAR_TOGGLE_VISIBLE }, +#endif + { "sort-mailbox", OP_SORT }, + { "sort-reverse", OP_SORT_REVERSE }, + { "sync-mailbox", OP_MAIN_SYNC_FOLDER }, + { "tag-pattern", OP_MAIN_TAG_PATTERN }, + { "tag-subthread", OP_TAG_SUBTHREAD }, + { "tag-thread", OP_TAG_THREAD }, + { "toggle-new", OP_TOGGLE_NEW }, + { "toggle-read", OP_TOGGLE_READ }, + { "toggle-write", OP_TOGGLE_WRITE }, + { "undelete-message", OP_UNDELETE }, + { "undelete-pattern", OP_MAIN_UNDELETE_PATTERN }, + { "undelete-subthread", OP_UNDELETE_SUBTHREAD }, + { "undelete-thread", OP_UNDELETE_THREAD }, + { "untag-pattern", OP_MAIN_UNTAG_PATTERN }, +#ifdef USE_NOTMUCH + { "vfolder-from-query", OP_MAIN_VFOLDER_FROM_QUERY }, + { "vfolder-from-query-readonly", OP_MAIN_VFOLDER_FROM_QUERY_READONLY }, + { "vfolder-window-backward", OP_MAIN_WINDOWED_VFOLDER_BACKWARD }, + { "vfolder-window-forward", OP_MAIN_WINDOWED_VFOLDER_FORWARD }, + { "vfolder-window-reset", OP_MAIN_WINDOWED_VFOLDER_RESET }, +#endif + { "view-attachments", OP_VIEW_ATTACHMENTS }, + { "view-raw-message", OP_VIEW_RAW_MESSAGE }, + // Deprecated + { "buffy-list", OP_MAILBOX_LIST }, + { NULL, 0 }, +}; + +/** + * IndexDefaultBindings - Key bindings for the Index Menu + */ +const struct MenuOpSeq IndexDefaultBindings[] = { /* map: index */ + { OP_ATTACHMENT_EDIT_TYPE, "\005" }, // <Ctrl-E> +#ifdef USE_AUTOCRYPT + { OP_AUTOCRYPT_ACCT_MENU, "A" }, +#endif + { OP_BOUNCE_MESSAGE, "b" }, + { OP_CHECK_TRADITIONAL, "\033P" }, // <Alt-P> + { OP_COPY_MESSAGE, "C" }, + { OP_CREATE_ALIAS, "a" }, + { OP_DECODE_COPY, "\033C" }, // <Alt-C> + { OP_DECODE_SAVE, "\033s" }, // <Alt-s> + { OP_DELETE, "d" }, + { OP_DELETE_SUBTHREAD, "\033d" }, // <Alt-d> + { OP_DELETE_THREAD, "\004" }, // <Ctrl-D> + { OP_DISPLAY_ADDRESS, "@" }, + { OP_DISPLAY_HEADERS, "h" }, + { OP_DISPLAY_MESSAGE, " " }, // <Space> + { OP_DISPLAY_MESSAGE, "<keypadenter>" }, + { OP_DISPLAY_MESSAGE, "\n" }, // <Enter> + { OP_DISPLAY_MESSAGE, "\r" }, // <Return> + { OP_EDIT_LABEL, "Y" }, + { OP_EDIT_OR_VIEW_RAW_MESSAGE, "e" }, + { OP_EXIT, "x" }, + { OP_EXTRACT_KEYS, "\013" }, // <Ctrl-K> + { OP_FLAG_MESSAGE, "F" }, + { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F> + { OP_FORWARD_MESSAGE, "f" }, + { OP_GROUP_REPLY, "g" }, + { OP_LIST_REPLY, "L" }, + { OP_MAIL, "m" }, + { OP_MAILBOX_LIST, "." }, + { OP_MAIL_KEY, "\033k" }, // <Alt-k> + { OP_MAIN_BREAK_THREAD, "#" }, + { OP_MAIN_CHANGE_FOLDER, "c" }, + { OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" }, // <Alt-c> +#ifdef USE_NNTP + { OP_MAIN_CHANGE_GROUP, "i" }, + { OP_MAIN_CHANGE_GROUP_READONLY, "\033i" }, // <Alt-i> +#endif + { OP_MAIN_CLEAR_FLAG, "W" }, + { OP_MAIN_COLLAPSE_ALL, "\033V" }, // <Alt-V> + { OP_MAIN_COLLAPSE_THREAD, "\033v" }, // <Alt-v> + { OP_MAIN_DELETE_PATTERN, "D" }, +#ifdef USE_POP + { OP_MAIN_FETCH_MAIL, "G" }, +#endif + { OP_MAIN_LIMIT, "l" }, + { OP_MAIN_LINK_THREADS, "&" }, + { OP_MAIN_NEXT_NEW_THEN_UNREAD, "\t" }, // <Tab> + { OP_MAIN_NEXT_SUBTHREAD, "\033n" }, // <Alt-n> + { OP_MAIN_NEXT_THREAD, "\016" }, // <Ctrl-N> + { OP_MAIN_NEXT_UNDELETED, "<down>" }, + { OP_MAIN_NEXT_UNDELETED, "j" }, + { OP_MAIN_PARENT_MESSAGE, "P" }, + { OP_MAIN_PREV_NEW_THEN_UNREAD, "\033\t" }, // <Alt-\> + { OP_MAIN_PREV_SUBTHREAD, "\033p" }, // <Alt-p> + { OP_MAIN_PREV_THREAD, "\020" }, // <Ctrl-P> + { OP_MAIN_PREV_UNDELETED, "<up>" }, + { OP_MAIN_PREV_UNDELETED, "k" }, + { OP_MAIN_READ_SUBTHREAD, "\033r" }, // <Alt-r> + { OP_MAIN_READ_THREAD, "\022" }, // <Ctrl-R> + { OP_MAIN_SET_FLAG, "w" }, + { OP_MAIN_SHOW_LIMIT, "\033l" }, // <Alt-l> + { OP_MAIN_SYNC_FOLDER, "$" }, + { OP_MAIN_TAG_PATTERN, "T" }, + { OP_MAIN_UNDELETE_PATTERN, "U" }, + { OP_MAIN_UNTAG_PATTERN, "\024" }, // <Ctrl-T> + { OP_MARK_MSG, "~" }, + { OP_NEXT_ENTRY, "J" }, + { OP_PIPE, "|" }, + { OP_PREV_ENTRY, "K" }, + { OP_PRINT, "p" }, + { OP_QUERY, "Q" }, + { OP_QUIT, "q" }, + { OP_RECALL_MESSAGE, "R" }, + { OP_REPLY, "r" }, + { OP_RESEND, "\033e" }, // <Alt-e> + { OP_SAVE, "s" }, + { OP_SHOW_LOG_MESSAGES, "M" }, + { OP_SORT, "o" }, + { OP_SORT_REVERSE, "O" }, + { OP_TAG_THREAD, "\033t" }, // <Alt-t> + { OP_TOGGLE_NEW, "N" }, + { OP_TOGGLE_WRITE, "%" }, + { OP_UNDELETE, "u" }, + { OP_UNDELETE_SUBTHREAD, "\033u" }, // <Alt-u> + { OP_UNDELETE_THREAD, "\025" }, // <Ctrl-U> + { OP_VIEW_ATTACHMENTS, "v" }, + { 0, NULL }, +}; +// clang-format on + /** * enum ResolveMethod - How to advance the cursor */ diff --git a/key/dump.c b/key/dump.c index 19370cf04..9c3017bb2 100644 --- a/key/dump.c +++ b/key/dump.c @@ -33,12 +33,11 @@ #include "mutt/lib.h" #include "config/lib.h" #include "core/lib.h" +#include "gui/lib.h" #include "key/lib.h" #include "menu/lib.h" #include "pager/lib.h" #include "parse/lib.h" -#include "functions.h" -#include "opcodes.h" /** * dump_bind - Dumps all the binds maps of a menu into a buffer @@ -35,9 +35,7 @@ #include "gui/lib.h" #include "key/lib.h" #include "menu/lib.h" -#include "functions.h" #include "globals.h" -#include "opcodes.h" #ifdef USE_INOTIFY #include "monitor.h" #endif diff --git a/key/init.c b/key/init.c index f26d9cd17..76b8faf5b 100644 --- a/key/init.c +++ b/key/init.c @@ -38,8 +38,24 @@ #include "key/lib.h" #include "menu/lib.h" #include "ncrypt/lib.h" -#include "functions.h" -#include "opcodes.h" + +extern const struct MenuOpSeq AliasDefaultBindings[]; +extern const struct MenuOpSeq AttachmentDefaultBindings[]; +#ifdef USE_AUTOCRYPT +extern const struct MenuOpSeq AutocryptDefaultBindings[]; +#endif +extern const struct MenuOpSeq BrowserDefaultBindings[]; +extern const struct MenuOpSeq ComposeDefaultBindings[]; +extern const struct MenuOpSeq EditorDefaultBindings[]; +extern const struct MenuOpSeq IndexDefaultBindings[]; +#ifdef MIXMASTER +extern const struct MenuOpSeq MixmasterDefaultBindings[]; +#endif +extern const struct MenuOpSeq PagerDefaultBindings[]; +extern const struct MenuOpSeq PgpDefaultBindings[]; +extern const struct MenuOpSeq PostponedDefaultBindings[]; +extern const struct MenuOpSeq QueryDefaultBindings[]; +extern const struct MenuOpSeq SmimeDefaultBindings[]; /** * struct Extkey - Map key names from NeoMutt's style to Curses style @@ -39,8 +39,24 @@ #include "key/lib.h" #include "menu/lib.h" #include "ncrypt/lib.h" -#include "functions.h" -#include "opcodes.h" + +extern const struct MenuFuncOp OpAlias[]; +extern const struct MenuFuncOp OpAttachment[]; +#ifdef USE_AUTOCRYPT +extern const struct MenuFuncOp OpAutocrypt[]; +#endif +extern const struct MenuFuncOp OpBrowser[]; +extern const struct MenuFuncOp OpCompose[]; +extern const struct MenuFuncOp OpEditor[]; +extern const struct MenuFuncOp OpIndex[]; +#ifdef MIXMASTER +extern const struct MenuFuncOp OpMixmaster[]; +#endif +extern const struct MenuFuncOp OpPager[]; +extern const struct MenuFuncOp OpPgp[]; +extern const struct MenuFuncOp OpPostponed[]; +extern const struct MenuFuncOp OpQuery[]; +extern const struct MenuFuncOp OpSmime[]; /** * KeyNames - Key name lookup table diff --git a/key/parse.c b/key/parse.c index cab40e4ca..502de4eda 100644 --- a/key/parse.c +++ b/key/parse.c @@ -38,8 +38,6 @@ #include "key/lib.h" #include "menu/lib.h" #include "parse/lib.h" -#include "functions.h" -#include "opcodes.h" /// Maximum length of a key binding sequence used for buffer in km_bindkey #define MAX_SEQ 8 @@ -73,7 +73,6 @@ * | enriched.c | @subpage neo_enriched | * | external.c | @subpage neo_external | * | flags.c | @subpage neo_flags | - * | functions.c | @subpage neo_functions | * | globals.c | @subpage neo_globals | * | handler.c | @subpage neo_handler | * | hdrline.c | @subpage neo_hdrline | @@ -97,7 +96,6 @@ * | mutt_thread.c | @subpage neo_mutt_thread | * | mview.c | @subpage neo_mview | * | mx.c | @subpage neo_mx | - * | opcodes.c | @subpage neo_opcode | * | recvcmd.c | @subpage neo_recvcmd | * | rfc3676.c | @subpage neo_rfc3676 | * | score.c | @subpage neo_score | diff --git a/menu/draw.c b/menu/draw.c index 65e032b0f..f5abc2143 100644 --- a/menu/draw.c +++ b/menu/draw.c @@ -41,7 +41,6 @@ #include "pattern/lib.h" #include "mutt_thread.h" #include "mview.h" -#include "opcodes.h" /** * get_color - Choose a colour for a line of the index diff --git a/menu/functions.c b/menu/functions.c index f3dbbe6b6..9e6955233 100644 --- a/menu/functions.c +++ b/menu/functions.c @@ -39,7 +39,6 @@ #include "lib.h" #include "editor/lib.h" #include "history/lib.h" -#include "opcodes.h" #include "protos.h" #include "type.h" diff --git a/menu/tagging.c b/menu/tagging.c index 321e81f81..1081e0a16 100644 --- a/menu/tagging.c +++ b/menu/tagging.c @@ -36,7 +36,6 @@ #include "lib.h" #include "color/lib.h" #include "key/lib.h" -#include "opcodes.h" /** * menu_set_prefix - Set tag_prefix on $auto_tag diff --git a/mixmaster/dlg_mixmaster.c b/mixmaster/dlg_mixmaster.c index a3d4fee3a..13bba1076 100644 --- a/mixmaster/dlg_mixmaster.c +++ b/mixmaster/dlg_mixmaster.c @@ -70,7 +70,6 @@ #include "menu/lib.h" #include "functions.h" #include "mutt_logging.h" -#include "opcodes.h" #include "private_data.h" #include "remailer.h" #include "win_chain.h" diff --git a/mixmaster/functions.c b/mixmaster/functions.c index 8b7009763..1083ef4f0 100644 --- a/mixmaster/functions.c +++ b/mixmaster/functions.c @@ -27,15 +27,58 @@ */ #include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else #include <stddef.h> #include "mutt/lib.h" #include "core/lib.h" #include "gui/lib.h" +#include "key/lib.h" #include "functions.h" -#include "opcodes.h" #include "private_data.h" #include "win_chain.h" #include "win_hosts.h" +#endif + +// clang-format off +#ifdef MIXMASTER +/** + * OpMixmaster - Functions for the Mixmaster Menu + */ +const struct MenuFuncOp OpMixmaster[] = { /* map: mixmaster */ + { "accept", OP_MIX_USE }, + { "append", OP_MIX_APPEND }, + { "chain-next", OP_MIX_CHAIN_NEXT }, + { "chain-prev", OP_MIX_CHAIN_PREV }, + { "delete", OP_MIX_DELETE }, + { "exit", OP_EXIT }, + { "insert", OP_MIX_INSERT }, + { NULL, 0 }, +}; +#endif /* MIXMASTER */ + +#ifdef MIXMASTER +/** + * MixmasterDefaultBindings - Key bindings for the Mixmaster Menu + */ +const struct MenuOpSeq MixmasterDefaultBindings[] = { /* map: mixmaster */ + { OP_EXIT, "q" }, + { OP_GENERIC_SELECT_ENTRY, "<space>" }, + { OP_MIX_APPEND, "a" }, + { OP_MIX_CHAIN_NEXT, "<right>" }, + { OP_MIX_CHAIN_NEXT, "l" }, + { OP_MIX_CHAIN_PREV, "<left>" }, + { OP_MIX_CHAIN_PREV, "h" }, + { OP_MIX_DELETE, "d" }, + { OP_MIX_INSERT, "i" }, + { OP_MIX_USE, "<keypadenter>" }, + { OP_MIX_USE, "\n" }, // <Enter> + { OP_MIX_USE, "\r" }, // <Return> + { 0, NULL }, +}; +#endif /* MIXMASTER */ +// clang-format on /** * op_exit - exit this menu - Implements ::mixmaster_function_t - @ingroup mixmaster_function_api @@ -41,6 +41,7 @@ #include "email/lib.h" #include "core/lib.h" #include "alias/lib.h" +#include "gui/lib.h" #include "mutt.h" #include "mx.h" #include "key/lib.h" @@ -56,7 +57,6 @@ #include "mutt_logging.h" #include "mutt_mailbox.h" #include "muttlib.h" -#include "opcodes.h" #include "protos.h" #ifdef USE_COMP_MBOX #include "compmbox/lib.h" diff --git a/ncrypt/dlg_gpgme.c b/ncrypt/dlg_gpgme.c index b0dafd821..0d6329c7a 100644 --- a/ncrypt/dlg_gpgme.c +++ b/ncrypt/dlg_gpgme.c @@ -87,7 +87,6 @@ #include "gpgme_functions.h" #include "mutt_logging.h" #include "muttlib.h" -#include "opcodes.h" #include "sort.h" /// Help Bar for the GPGME key selection dialog diff --git a/ncrypt/dlg_pgp.c b/ncrypt/dlg_pgp.c index 957e024f9..466dc030c 100644 --- a/ncrypt/dlg_pgp.c +++ b/ncrypt/dlg_pgp.c @@ -83,7 +83,6 @@ #include "format_flags.h" #include "mutt_logging.h" #include "muttlib.h" -#include "opcodes.h" #include "pgp.h" #include "pgp_functions.h" #include "pgpkey.h" diff --git a/ncrypt/dlg_smime.c b/ncrypt/dlg_smime.c index 2fb503706..e02a25aa5 100644 --- a/ncrypt/dlg_smime.c +++ b/ncrypt/dlg_smime.c @@ -65,7 +65,6 @@ #include "key/lib.h" #include "menu/lib.h" #include "mutt_logging.h" -#include "opcodes.h" #include "smime.h" #include "smime_functions.h" diff --git a/ncrypt/functions.c b/ncrypt/functions.c new file mode 100644 index 000000000..7cf2dd025 --- /dev/null +++ b/ncrypt/functions.c @@ -0,0 +1,82 @@ +/** + * @file + * PGP/Smime functions + * + * @authors + * Copyright (C) 2022 Richard Russon <rich@flatcap.org> + * + * @copyright + * This program is free software: you can redistribute it and/or modify it under + * the terms of the GNU General Public License as published by the Free Software + * Foundation, either version 2 of the License, or (at your option) any later + * version. + * + * 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/>. + */ + +/** + * @page crypt_functions PGP/Smime functions + * + * PGP/Smime functions + */ + +#include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else +#include <stddef.h> +#include "gui/lib.h" +#include "key/lib.h" +#endif + +// clang-format off +/** + * OpPgp - Functions for the Pgp Menu + */ +const struct MenuFuncOp OpPgp[] = { /* map: pgp */ + { "exit", OP_EXIT }, + { "verify-key", OP_VERIFY_KEY }, + { "view-name", OP_VIEW_ID }, + { NULL, 0 }, +}; + +/** + * OpSmime - Functions for the Smime Menu + */ +const struct MenuFuncOp OpSmime[] = { /* map: smime */ + { "exit", OP_EXIT }, +#ifdef CRYPT_BACKEND_GPGME + { "verify-key", OP_VERIFY_KEY }, + { "view-name", OP_VIEW_ID }, +#endif + { NULL, 0 }, +}; + +/** + * PgpDefaultBindings - Key bindings for the Pgp Menu + */ +const struct MenuOpSeq PgpDefaultBindings[] = { /* map: pgp */ + { OP_EXIT, "q" }, + { OP_VERIFY_KEY, "c" }, + { OP_VIEW_ID, "%" }, + { 0, NULL }, +}; + +/** + * SmimeDefaultBindings - Key bindings for the Smime Menu + */ +const struct MenuOpSeq SmimeDefaultBindings[] = { /* map: smime */ + { OP_EXIT, "q" }, +#ifdef CRYPT_BACKEND_GPGME + { OP_VERIFY_KEY, "c" }, + { OP_VIEW_ID, "%" }, +#endif + { 0, NULL }, +}; +// clang-format on diff --git a/ncrypt/gpgme_functions.c b/ncrypt/gpgme_functions.c index 14a09cf0b..1337dba68 100644 --- a/ncrypt/gpgme_functions.c +++ b/ncrypt/gpgme_functions.c @@ -46,7 +46,6 @@ #include "crypt_gpgme.h" #include "globals.h" #include "mutt_logging.h" -#include "opcodes.h" #ifdef ENABLE_NLS #include <libintl.h> #endif diff --git a/ncrypt/lib.h b/ncrypt/lib.h index cde54e12f..d316387d6 100644 --- a/ncrypt/lib.h +++ b/ncrypt/lib.h @@ -41,6 +41,7 @@ * | ncrypt/dlg_gpgme.c | @subpage crypt_dlg_gpgme | * | ncrypt/dlg_pgp.c | @subpage crypt_dlg_pgp | * | ncrypt/dlg_smime.c | @subpage crypt_dlg_smime | + * | ncrypt/functions.c | @subpage crypt_functions | * | ncrypt/gnupgparse.c | @subpage crypt_gnupg | * | ncrypt/gpgme_functions.c | @subpage crypt_gpgme_functions | * | ncrypt/pgp.c | @subpage crypt_pgp | diff --git a/ncrypt/pgp_functions.c b/ncrypt/pgp_functions.c index ac651e348..d7515fe49 100644 --- a/ncrypt/pgp_functions.c +++ b/ncrypt/pgp_functions.c @@ -40,7 +40,6 @@ #include "question/lib.h" #include "globals.h" #include "mutt_logging.h" -#include "opcodes.h" #include "pgp.h" #include "pgpinvoke.h" #include "pgpkey.h" diff --git a/ncrypt/smime_functions.c b/ncrypt/smime_functions.c index 45919569c..2470aef06 100644 --- a/ncrypt/smime_functions.c +++ b/ncrypt/smime_functions.c @@ -36,7 +36,6 @@ #include "menu/lib.h" #include "question/lib.h" #include "mutt_logging.h" -#include "opcodes.h" #include "smime.h" /** diff --git a/notmuch/complete.c b/notmuch/complete.c index 796113380..6568131e6 100644 --- a/notmuch/complete.c +++ b/notmuch/complete.c @@ -32,11 +32,11 @@ #include <string.h> #include "mutt/lib.h" #include "core/lib.h" +#include "gui/lib.h" #include "complete/lib.h" #include "editor/lib.h" #include "index/lib.h" #include "notmuch/lib.h" -#include "opcodes.h" /** * complete_all_nm_tags - Pass a list of Notmuch tags to the completion code diff --git a/pager/dlg_pager.c b/pager/dlg_pager.c index 03a39eaca..703df9bf8 100644 --- a/pager/dlg_pager.c +++ b/pager/dlg_pager.c @@ -58,7 +58,6 @@ #include "mutt_mailbox.h" #include "mview.h" #include "mx.h" -#include "opcodes.h" #include "private_data.h" #include "protos.h" #include "status.h" diff --git a/pager/functions.c b/pager/functions.c index 9eb791e9b..366e5ec95 100644 --- a/pager/functions.c +++ b/pager/functions.c @@ -27,6 +27,9 @@ */ #include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else #include <stddef.h> #include <inttypes.h> #include <stdbool.h> @@ -37,19 +40,20 @@ #include "core/lib.h" #include "gui/lib.h" #include "mutt.h" -#include "functions.h" #include "lib.h" #include "attach/lib.h" #include "color/lib.h" #include "editor/lib.h" #include "history/lib.h" #include "index/lib.h" +#include "key/lib.h" #include "menu/lib.h" #include "pattern/lib.h" #include "display.h" -#include "opcodes.h" +#include "functions.h" #include "private_data.h" #include "protos.h" +#endif /// Error message for unavailable functions static const char *Not_available_in_this_menu = N_("Not available in this menu"); @@ -57,6 +61,284 @@ static const char *Not_available_in_this_menu = N_("Not available in this menu") static int op_pager_search_next(struct IndexSharedData *shared, struct PagerPrivateData *priv, int op); +// clang-format off +/** + * OpPager - Functions for the Pager Menu + */ +const struct MenuFuncOp OpPager[] = { /* map: pager */ + { "bottom", OP_PAGER_BOTTOM }, + { "bounce-message", OP_BOUNCE_MESSAGE }, + { "break-thread", OP_MAIN_BREAK_THREAD }, + { "change-folder", OP_MAIN_CHANGE_FOLDER }, + { "change-folder-readonly", OP_MAIN_CHANGE_FOLDER_READONLY }, +#ifdef USE_NNTP + { "change-newsgroup", OP_MAIN_CHANGE_GROUP }, + { "change-newsgroup-readonly", OP_MAIN_CHANGE_GROUP_READONLY }, +#endif +#ifdef USE_NOTMUCH + { "change-vfolder", OP_MAIN_CHANGE_VFOLDER }, +#endif + { "check-stats", OP_CHECK_STATS }, + { "check-traditional-pgp", OP_CHECK_TRADITIONAL }, + { "clear-flag", OP_MAIN_CLEAR_FLAG }, + { "compose-to-sender", OP_COMPOSE_TO_SENDER }, + { "copy-message", OP_COPY_MESSAGE }, + { "create-alias", OP_CREATE_ALIAS }, + { "decode-copy", OP_DECODE_COPY }, + { "decode-save", OP_DECODE_SAVE }, + { "decrypt-copy", OP_DECRYPT_COPY }, + { "decrypt-save", OP_DECRYPT_SAVE }, + { "delete-message", OP_DELETE }, + { "delete-subthread", OP_DELETE_SUBTHREAD }, + { "delete-thread", OP_DELETE_THREAD }, + { "display-address", OP_DISPLAY_ADDRESS }, + { "display-toggle-weed", OP_DISPLAY_HEADERS }, + { "edit", OP_EDIT_RAW_MESSAGE }, + { "edit-label", OP_EDIT_LABEL }, + { "edit-or-view-raw-message", OP_EDIT_OR_VIEW_RAW_MESSAGE }, + { "edit-raw-message", OP_EDIT_RAW_MESSAGE }, + { "edit-type", OP_ATTACHMENT_EDIT_TYPE }, + { "enter-command", OP_ENTER_COMMAND }, +#ifdef USE_NOTMUCH + { "entire-thread", OP_MAIN_ENTIRE_THREAD }, +#endif + { "exit", OP_EXIT }, + { "extract-keys", OP_EXTRACT_KEYS }, + { "flag-message", OP_FLAG_MESSAGE }, +#ifdef USE_NNTP + { "followup-message", OP_FOLLOWUP }, +#endif + { "forget-passphrase", OP_FORGET_PASSPHRASE }, + { "forward-message", OP_FORWARD_MESSAGE }, +#ifdef USE_NNTP + { "forward-to-group", OP_FORWARD_TO_GROUP }, +#endif + { "group-chat-reply", OP_GROUP_CHAT_REPLY }, + { "group-reply", OP_GROUP_REPLY }, + { "half-down", OP_HALF_DOWN }, + { "half-up", OP_HALF_UP }, + { "help", OP_HELP }, +#ifdef USE_IMAP + { "imap-fetch-mail", OP_MAIN_IMAP_FETCH }, + { "imap-logout-all", OP_MAIN_IMAP_LOGOUT_ALL }, +#endif + { "jump", OP_JUMP }, + { "jump", OP_JUMP_1 }, + { "jump", OP_JUMP_2 }, + { "jump", OP_JUMP_3 }, + { "jump", OP_JUMP_4 }, + { "jump", OP_JUMP_5 }, + { "jump", OP_JUMP_6 }, + { "jump", OP_JUMP_7 }, + { "jump", OP_JUMP_8 }, + { "jump", OP_JUMP_9 }, + { "link-threads", OP_MAIN_LINK_THREADS }, + { "list-reply", OP_LIST_REPLY }, + { "list-subscribe", OP_LIST_SUBSCRIBE }, + { "list-unsubscribe", OP_LIST_UNSUBSCRIBE }, + { "mail", OP_MAIL }, + { "mail-key", OP_MAIL_KEY }, + { "mailbox-list", OP_MAILBOX_LIST }, + { "mark-as-new", OP_TOGGLE_NEW }, + { "modify-labels", OP_MAIN_MODIFY_TAGS }, + { "modify-labels-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE }, + { "modify-tags", OP_MAIN_MODIFY_TAGS }, + { "modify-tags-then-hide", OP_MAIN_MODIFY_TAGS_THEN_HIDE }, + { "next-entry", OP_NEXT_ENTRY }, + { "next-line", OP_NEXT_LINE }, + { "next-new", OP_MAIN_NEXT_NEW }, + { "next-new-then-unread", OP_MAIN_NEXT_NEW_THEN_UNREAD }, + { "next-page", OP_NEXT_PAGE }, + { "next-subthread", OP_MAIN_NEXT_SUBTHREAD }, + { "next-thread", OP_MAIN_NEXT_THREAD }, + { "next-undeleted", OP_MAIN_NEXT_UNDELETED }, + { "next-unread", OP_MAIN_NEXT_UNREAD }, + { "next-unread-mailbox", OP_MAIN_NEXT_UNREAD_MAILBOX }, + { "parent-message", OP_MAIN_PARENT_MESSAGE }, + { "pipe-entry", OP_PIPE }, + { "pipe-message", OP_PIPE }, +#ifdef USE_NNTP + { "post-message", OP_POST }, +#endif + { "previous-entry", OP_PREV_ENTRY }, + { "previous-line", OP_PREV_LINE }, + { "previous-new", OP_MAIN_PREV_NEW }, + { "previous-new-then-unread", OP_MAIN_PREV_NEW_THEN_UNREAD }, + { "previous-page", OP_PREV_PAGE }, + { "previous-subthread", OP_MAIN_PREV_SUBTHREAD }, + { "previous-thread", OP_MAIN_PREV_THREAD }, + { "previous-undeleted", OP_MAIN_PREV_UNDELETED }, + { "previous-unread", OP_MAIN_PREV_UNREAD }, + { "print-entry", OP_ATTACHMENT_PRINT }, + { "print-message", OP_PRINT }, + { "purge-message", OP_PURGE_MESSAGE }, + { "purge-thread", OP_PURGE_THREAD }, + { "quasi-delete", OP_MAIN_QUASI_DELETE }, + { "quit", OP_QUIT }, + { "read-subthread", OP_MAIN_READ_SUBTHREAD }, + { "read-thread", OP_MAIN_READ_THREAD }, + { "recall-message", OP_RECALL_MESSAGE }, +#ifdef USE_NNTP + { "reconstruct-thread", OP_RECONSTRUCT_THREAD }, +#endif + { "redraw-screen", OP_REDRAW }, + { "reply", OP_REPLY }, + { "resend-message", OP_RESEND }, + { "root-message", OP_MAIN_ROOT_MESSAGE }, + { "save-entry", OP_ATTACHMENT_SAVE }, + { "save-message", OP_SAVE }, + { "search", OP_SEARCH }, + { "search-next", OP_SEARCH_NEXT }, + { "search-opposite", OP_SEARCH_OPPOSITE }, + { "search-reverse", OP_SEARCH_REVERSE }, + { "search-toggle", OP_SEARCH_TOGGLE }, + { "set-flag", OP_MAIN_SET_FLAG }, + { "shell-escape", OP_SHELL_ESCAPE }, + { "show-log-messages", OP_SHOW_LOG_MESSAGES }, + { "show-version", OP_VERSION }, +#ifdef USE_SIDEBAR + { "sidebar-first", OP_SIDEBAR_FIRST }, + { "sidebar-last", OP_SIDEBAR_LAST }, + { "sidebar-next", OP_SIDEBAR_NEXT }, + { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW }, + { "sidebar-open", OP_SIDEBAR_OPEN }, + { "sidebar-page-down", OP_SIDEBAR_PAGE_DOWN }, + { "sidebar-page-up", OP_SIDEBAR_PAGE_UP }, + { "sidebar-prev", OP_SIDEBAR_PREV }, + { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW }, + { "sidebar-toggle-virtual", OP_SIDEBAR_TOGGLE_VIRTUAL }, + { "sidebar-toggle-visible", OP_SIDEBAR_TOGGLE_VISIBLE }, +#endif + { "skip-headers", OP_PAGER_SKIP_HEADERS }, + { "skip-quoted", OP_PAGER_SKIP_QUOTED }, + { "sort-mailbox", OP_SORT }, + { "sort-reverse", OP_SORT_REVERSE }, + { "sync-mailbox", OP_MAIN_SYNC_FOLDER }, + { "tag-message", OP_TAG }, + { "toggle-quoted", OP_PAGER_HIDE_QUOTED }, + { "toggle-write", OP_TOGGLE_WRITE }, + { "top", OP_PAGER_TOP }, + { "undelete-message", OP_UNDELETE }, + { "undelete-subthread", OP_UNDELETE_SUBTHREAD }, + { "undelete-thread", OP_UNDELETE_THREAD }, +#ifdef USE_NOTMUCH + { "vfolder-from-query", OP_MAIN_VFOLDER_FROM_QUERY }, + { "vfolder-from-query-readonly", OP_MAIN_VFOLDER_FROM_QUERY_READONLY }, +#endif + { "view-attachments", OP_VIEW_ATTACHMENTS }, + { "view-raw-message", OP_VIEW_RAW_MESSAGE }, + { "what-key", OP_WHAT_KEY }, + // Deprecated + { "buffy-list", OP_MAILBOX_LIST }, + { "error-history", OP_SHOW_LOG_MESSAGES }, + { NULL, 0 }, +}; + +/** + * PagerDefaultBindings - Key bindings for the Pager Menu + */ +const struct MenuOpSeq PagerDefaultBindings[] = { /* map: pager */ + { OP_ATTACHMENT_EDIT_TYPE, "\005" }, // <Ctrl-E> + { OP_BOUNCE_MESSAGE, "b" }, + { OP_CHECK_TRADITIONAL, "\033P" }, // <Alt-P> + { OP_COPY_MESSAGE, "C" }, + { OP_CREATE_ALIAS, "a" }, + { OP_DECODE_COPY, "\033C" }, // <Alt-C> + { OP_DECODE_SAVE, "\033s" }, // <Alt-s> + { OP_DELETE, "d" }, + { OP_DELETE_SUBTHREAD, "\033d" }, // <Alt-d> + { OP_DELETE_THREAD, "\004" }, // <Ctrl-D> + { OP_DISPLAY_ADDRESS, "@" }, + { OP_DISPLAY_HEADERS, "h" }, + { OP_EDIT_LABEL, "Y" }, + { OP_EDIT_OR_VIEW_RAW_MESSAGE, "e" }, + { OP_ENTER_COMMAND, ":" }, + { OP_EXIT, "i" }, + { OP_EXIT, "q" }, + { OP_EXIT, "x" }, + { OP_EXTRACT_KEYS, "\013" }, // <Ctrl-K> + { OP_FLAG_MESSAGE, "F" }, + { OP_FORGET_PASSPHRASE, "\006" }, // <Ctrl-F> + { OP_FORWARD_MESSAGE, "f" }, + { OP_GROUP_REPLY, "g" }, + { OP_HELP, "?" }, + { OP_JUMP_1, "1" }, + { OP_JUMP_2, "2" }, + { OP_JUMP_3, "3" }, + { OP_JUMP_4, "4" }, + { OP_JUMP_5, "5" }, + { OP_JUMP_6, "6" }, + { OP_JUMP_7, "7" }, + { OP_JUMP_8, "8" }, + { OP_JUMP_9, "9" }, + { OP_LIST_REPLY, "L" }, + { OP_MAIL, "m" }, + { OP_MAILBOX_LIST, "." }, + { OP_MAIL_KEY, "\033k" }, // <Alt-k> + { OP_MAIN_BREAK_THREAD, "#" }, + { OP_MAIN_CHANGE_FOLDER, "c" }, + { OP_MAIN_CHANGE_FOLDER_READONLY, "\033c" }, // <Alt-c> + { OP_MAIN_CLEAR_FLAG, "W" }, + { OP_MAIN_LINK_THREADS, "&" }, + { OP_MAIN_NEXT_NEW_THEN_UNREAD, "\t" }, // <Tab> + { OP_MAIN_NEXT_SUBTHREAD, "\033n" }, // <Alt-n> + { OP_MAIN_NEXT_THREAD, "\016" }, // <Ctrl-N> + { OP_MAIN_NEXT_UNDELETED, "<down>" }, + { OP_MAIN_NEXT_UNDELETED, "<right>" }, + { OP_MAIN_NEXT_UNDELETED, "j" }, + { OP_MAIN_PARENT_MESSAGE, "P" }, + { OP_MAIN_PREV_SUBTHREAD, "\033p" }, // <Alt-p> + { OP_MAIN_PREV_THREAD, "\020" }, // <Ctrl-P> + { OP_MAIN_PREV_UNDELETED, "<left>" }, + { OP_MAIN_PREV_UNDELETED, "<up>" }, + { OP_MAIN_PREV_UNDELETED, "k" }, + { OP_MAIN_READ_SUBTHREAD, "\033r" }, // <Alt-r> + { OP_MAIN_READ_THREAD, "\022" }, // <Ctrl-R> + { OP_MAIN_SET_FLAG, "w" }, + { OP_MAIN_SYNC_FOLDER, "$" }, + { OP_NEXT_ENTRY, "J" }, + { OP_NEXT_LINE, "<keypadenter>" }, + { OP_NEXT_LINE, "\n" }, // <Enter> + { OP_NEXT_LINE, "\r" }, // <Return> + { OP_NEXT_PAGE, " " }, // <Space> + { OP_NEXT_PAGE, "<pagedown>" }, + { OP_PAGER_BOTTOM, "<end>" }, + { OP_PAGER_HIDE_QUOTED, "T" }, + { OP_PAGER_SKIP_HEADERS, "H" }, + { OP_PAGER_SKIP_QUOTED, "S" }, + { OP_PAGER_TOP, "<home>" }, + { OP_PAGER_TOP, "^" }, + { OP_PIPE, "|" }, + { OP_PREV_ENTRY, "K" }, + { OP_PREV_LINE, "<backspace>" }, + { OP_PREV_PAGE, "-" }, + { OP_PREV_PAGE, "<pageup>" }, + { OP_PRINT, "p" }, + { OP_QUIT, "Q" }, + { OP_RECALL_MESSAGE, "R" }, + { OP_REDRAW, "\014" }, // <Ctrl-L> + { OP_REPLY, "r" }, + { OP_RESEND, "\033e" }, // <Alt-e> + { OP_SAVE, "s" }, + { OP_SEARCH, "/" }, + { OP_SEARCH_NEXT, "n" }, + { OP_SEARCH_REVERSE, "\033/" }, // <Alt-/> + { OP_SEARCH_TOGGLE, "\\" }, // <Backslash> + { OP_SHELL_ESCAPE, "!" }, + { OP_SORT, "o" }, + { OP_SORT_REVERSE, "O" }, + { OP_TAG, "t" }, + { OP_TOGGLE_NEW, "N" }, + { OP_TOGGLE_WRITE, "%" }, + { OP_UNDELETE, "u" }, + { OP_UNDELETE_SUBTHREAD, "\033u" }, // <Alt-u> + { OP_UNDELETE_THREAD, "\025" }, // <Ctrl-U> + { OP_VERSION, "V" }, + { OP_VIEW_ATTACHMENTS, "v" }, + { 0, NULL }, +}; +// clang-format on + /** * assert_pager_mode - Check that pager is in correct mode * @param test Test condition diff --git a/pager/pager.c b/pager/pager.c index 309ac6be2..7dfa3d5b6 100644 --- a/pager/pager.c +++ b/pager/pager.c @@ -71,7 +71,6 @@ #include "color/lib.h" #include "index/lib.h" #include "display.h" -#include "opcodes.h" #include "private_data.h" /** diff --git a/pattern/complete.c b/pattern/complete.c index 1c51a000c..1b21820ff 100644 --- a/pattern/complete.c +++ b/pattern/complete.c @@ -30,10 +30,10 @@ #include <stddef.h> #include "mutt/lib.h" #include "core/lib.h" +#include "gui/lib.h" #include "lib.h" #include "complete/lib.h" #include "editor/lib.h" -#include "opcodes.h" /** * complete_pattern - Complete a NeoMutt Pattern - Implements ::complete_function_t - @ingroup complete_api diff --git a/pattern/dlg_pattern.c b/pattern/dlg_pattern.c index fb0b3355a..11729959c 100644 --- a/pattern/dlg_pattern.c +++ b/pattern/dlg_pattern.c @@ -83,7 +83,6 @@ #include "functions.h" #include "mutt_logging.h" #include "muttlib.h" -#include "opcodes.h" /// Help Bar for the Pattern selection dialog static const struct Mapping PatternHelp[] = { diff --git a/pattern/functions.c b/pattern/functions.c index 5e4cd0ee8..8a735695f 100644 --- a/pattern/functions.c +++ b/pattern/functions.c @@ -33,7 +33,6 @@ #include "gui/lib.h" #include "functions.h" #include "menu/lib.h" -#include "opcodes.h" /** * op_generic_select_entry - Select the current entry - Implements ::pattern_function_t - @ingroup pattern_function_api diff --git a/pattern/pattern.c b/pattern/pattern.c index 1868be450..16f43063d 100644 --- a/pattern/pattern.c +++ b/pattern/pattern.c @@ -38,6 +38,7 @@ #include "core/lib.h" #include "alias/gui.h" // IWYU pragma: keep #include "alias/lib.h" +#include "gui/lib.h" #include "mutt.h" #include "lib.h" #include "editor/lib.h" @@ -48,7 +49,6 @@ #include "mutt_logging.h" #include "mview.h" #include "mx.h" -#include "opcodes.h" #include "protos.h" #include "search_state.h" #ifndef USE_FMEMOPEN diff --git a/postpone/dlg_postpone.c b/postpone/dlg_postpone.c index fe6f64c7e..49d4126b9 100644 --- a/postpone/dlg_postpone.c +++ b/postpone/dlg_postpone.c @@ -84,7 +84,6 @@ #include "hdrline.h" #include "mutt_logging.h" #include "mview.h" -#include "opcodes.h" /// Help Bar for the Postponed email selection dialog static const struct Mapping PostponedHelp[] = { diff --git a/postpone/functions.c b/postpone/functions.c index 0564a7945..d606dd539 100644 --- a/postpone/functions.c +++ b/postpone/functions.c @@ -27,18 +27,44 @@ */ #include "config.h" +#ifdef _MAKEDOC +#include "docs/makedoc_defs.h" +#else #include <stddef.h> #include "mutt/lib.h" #include "config/lib.h" #include "core/lib.h" #include "gui/lib.h" #include "mutt.h" -#include "functions.h" +#include "key/lib.h" #include "menu/lib.h" #include "pattern/lib.h" +#include "functions.h" #include "mview.h" -#include "opcodes.h" #include "protos.h" +#endif + +// clang-format off +/** + * OpPostponed - Functions for the Postpone Menu + */ +const struct MenuFuncOp OpPostponed[] = { /* map: postpone */ + { "exit", OP_EXIT }, + { "delete-entry", OP_DELETE }, + { "undelete-entry", OP_UNDELETE }, + { NULL, 0 }, +}; + +/** + * PostponedDefaultBindings - Key bindings for the Postpone Menu + */ +const struct MenuOpSeq PostponedDefaultBindings[] = { /* map: postpone */ + { OP_DELETE, "d" }, + { OP_EXIT, "q" }, + { OP_UNDELETE, "u" }, + { 0, NULL }, +}; +// clang-format on /** * op_delete - Delete the current entry - Implements ::postpone_function_t - @ingroup postpone_function_api diff --git a/question/question.c b/question/question.c index c25914b06..6981b11ff 100644 --- a/question/question.c +++ b/question/question.c @@ -40,7 +40,6 @@ #include "gui/lib.h" #include "color/lib.h" #include "key/lib.h" -#include "opcodes.h" /** * mw_multi_choice - Offer the user a multiple choice question - @ingroup gui_mw diff --git a/sidebar/functions.c b/sidebar/functions.c index a3b537fbe..9e1dc960d 100644 --- a/sidebar/functions.c +++ b/sidebar/functions.c @@ -37,7 +37,6 @@ #include "functions.h" #include "lib.h" #include "index/lib.h" -#include "opcodes.h" /** * sb_next - Find the next unhidden Mailbox diff --git a/test/pattern/dummy.c b/test/pattern/dummy.c index 97630e715..53ad124e6 100644 --- a/test/pattern/dummy.c +++ b/test/pattern/dummy.c @@ -91,7 +91,6 @@ const struct MenuFuncOp OpAutocrypt = { 0 }; const struct MenuFuncOp OpBrowser = { 0 }; const struct MenuFuncOp OpCompose = { 0 }; const struct MenuFuncOp OpDialog = { 0 }; -const struct MenuFuncOp OpEditor = { 0 }; const struct MenuFuncOp OpGeneric[] = { 0 }; const struct MenuFuncOp OpIndex = { 0 }; const struct MenuFuncOp OpMixmaster = { 0 }; |