mutt_check_rescore(Context);
break;
- case OP_EDIT_RAW_MESSAGE:
+ case OP_EDIT_OR_VIEW_RAW_MESSAGE: /* fall through */
+ case OP_EDIT_RAW_MESSAGE: /* fall through */
+ case OP_VIEW_RAW_MESSAGE:
+ /* TODO split this into 3 cases? */
CHECK_MSGCOUNT;
CHECK_VISIBLE;
- CHECK_READONLY;
CHECK_ATTACH;
- /* L10N: CHECK_ACL */
- CHECK_ACL(MUTT_ACL_INSERT, _("Cannot edit message"));
+ bool edit;
+ if (op == OP_EDIT_RAW_MESSAGE)
+ {
+ CHECK_READONLY;
+ /* L10N: CHECK_ACL */
+ CHECK_ACL(MUTT_ACL_INSERT, _("Cannot edit message"));
+ edit = true;
+ }
+ else if (op == OP_EDIT_OR_VIEW_RAW_MESSAGE)
+ edit = !Context->readonly && mutt_bit_isset(Context->rights, MUTT_ACL_INSERT);
+ else
+ edit = false;
if (option(OPT_PGP_AUTO_DECODE) &&
(tag || !(CURHDR->security & PGP_TRADITIONAL_CHECKED)))
mutt_check_traditional_pgp(tag ? NULL : CURHDR, &menu->redraw);
- mutt_edit_message(Context, tag ? NULL : CURHDR);
+ if (edit)
+ mutt_edit_message(Context, tag ? NULL : CURHDR);
+ else
+ mutt_view_message(Context, tag ? NULL : CURHDR);
menu->redraw = REDRAW_FULL;
break;
{ "delete-pattern", OP_MAIN_DELETE_PATTERN, "D" },
{ "delete-thread", OP_DELETE_THREAD, "\004" },
{ "delete-subthread", OP_DELETE_SUBTHREAD, "\033d" },
- { "edit", OP_EDIT_RAW_MESSAGE, "e" },
+ { "edit", OP_EDIT_RAW_MESSAGE, NULL },
+ { "edit-raw-message", OP_EDIT_RAW_MESSAGE, NULL },
{ "edit-label", OP_EDIT_LABEL, "Y" },
+ { "edit-or-view-raw-message", OP_EDIT_OR_VIEW_RAW_MESSAGE, "e" },
{ "edit-type", OP_EDIT_TYPE, "\005" },
{ "forward-message", OP_FORWARD_MESSAGE, "f" },
#ifdef USE_NNTP
{ "undelete-subthread", OP_UNDELETE_SUBTHREAD, "\033u" },
{ "undelete-thread", OP_UNDELETE_THREAD, "\025" },
{ "view-attachments", OP_VIEW_ATTACHMENTS, "v" },
+ { "view-raw-message", OP_VIEW_RAW_MESSAGE, NULL },
{ "show-version", OP_VERSION, "V" },
{ "set-flag", OP_MAIN_SET_FLAG, "w" },
{ "clear-flag", OP_MAIN_CLEAR_FLAG, "W" },
{ "delete-subthread", OP_DELETE_SUBTHREAD, "\033d" },
{ "set-flag", OP_MAIN_SET_FLAG, "w" },
{ "clear-flag", OP_MAIN_CLEAR_FLAG, "W" },
- { "edit", OP_EDIT_RAW_MESSAGE, "e" },
+ { "edit", OP_EDIT_RAW_MESSAGE, NULL },
+ { "edit-raw-message", OP_EDIT_RAW_MESSAGE, NULL },
{ "edit-label", OP_EDIT_LABEL, "Y" },
+ { "edit-or-view-raw-message", OP_EDIT_OR_VIEW_RAW_MESSAGE, "e" },
{ "edit-type", OP_EDIT_TYPE, "\005" },
#ifdef USE_NNTP
{ "followup-message", OP_FOLLOWUP, NULL },
{ "undelete-subthread", OP_UNDELETE_SUBTHREAD, "\033u" },
{ "undelete-thread", OP_UNDELETE_THREAD, "\025" },
{ "view-attachments", OP_VIEW_ATTACHMENTS, "v" },
+ { "view-raw-message", OP_VIEW_RAW_MESSAGE, NULL },
{ "show-version", OP_VERSION, "V" },
{ "search-toggle", OP_SEARCH_TOGGLE, "\\" },
{ "display-address", OP_DISPLAY_ADDRESS, "@" },
_fmt(OP_DISPLAY_HEADERS, N_("display message and toggle header weeding")) \
_fmt(OP_DISPLAY_MESSAGE, N_("display a message")) \
_fmt(OP_EDIT_LABEL, N_("add, change, or delete a message's label")) \
- _fmt(OP_EDIT_RAW_MESSAGE, N_("edit the raw message")) \
+ _fmt(OP_EDIT_RAW_MESSAGE, N_("edit the raw message (edit and edit-raw-message are synonyms)")) \
+ _fmt(OP_EDIT_OR_VIEW_RAW_MESSAGE, N_("edit the raw message if the mailbox is not read-only, otherwise view it")) \
_fmt(OP_EDITOR_BACKSPACE, N_("delete the char in front of the cursor")) \
_fmt(OP_EDITOR_BACKWARD_CHAR, N_("move the cursor one character to the left")) \
_fmt(OP_EDITOR_BACKWARD_WORD, N_("move the cursor to the beginning of the word")) \
_fmt(OP_VERSION, N_("show the NeoMutt version number and date")) \
_fmt(OP_VIEW_ATTACH, N_("view attachment using mailcap entry if necessary")) \
_fmt(OP_VIEW_ATTACHMENTS, N_("show MIME attachments")) \
+ _fmt(OP_VIEW_RAW_MESSAGE, N_("show the raw message")) \
_fmt(OP_WHAT_KEY, N_("display the keycode for a key press")) \
_fmt(OP_LIMIT_CURRENT_THREAD, N_("limit view to current thread")) \
_fmt(OP_MAIN_SHOW_LIMIT, N_("show currently active limit pattern")) \