OP_COMPOSE_NEW_MIME "compose new attachment using mailcap entry"
OP_COMPOSE_TOGGLE_RECODE "toggle recoding of this attachment"
OP_COMPOSE_POSTPONE_MESSAGE "save this message to send later"
+OP_COMPOSE_RENAME_ATTACHMENT "send attachment with a different name"
OP_COMPOSE_RENAME_FILE "rename/move an attached file"
OP_COMPOSE_SEND_MESSAGE "send the message"
OP_COMPOSE_TOGGLE_DISPOSITION "toggle disposition between inline/attachment"
/* No send2hook since this doesn't change the message. */
break;
-
+
+ case OP_COMPOSE_RENAME_ATTACHMENT:
+ {
+ char *src;
+ int ret;
+
+ CHECK_COUNT;
+ if (idx[menu->current]->content->d_filename)
+ src = idx[menu->current]->content->d_filename;
+ else
+ src = idx[menu->current]->content->filename;
+ strfcpy (fname, mutt_basename (NONULL (src)), sizeof (fname));
+ ret = mutt_get_field (_("Send attachment with name: "),
+ fname, sizeof (fname), MUTT_FILE);
+ if (ret == 0)
+ {
+ /*
+ * As opposed to RENAME_FILE, we don't check fname[0] because it's
+ * valid to set an empty string here, to erase what was set
+ */
+ mutt_str_replace (&idx[menu->current]->content->d_filename, fname);
+ menu->redraw = REDRAW_CURRENT;
+ }
+ }
+ break;
+
case OP_COMPOSE_RENAME_FILE:
CHECK_COUNT;
strfcpy (fname, idx[menu->current]->content->filename, sizeof (fname));
{ "new-mime", OP_COMPOSE_NEW_MIME, "n" },
{ "postpone-message", OP_COMPOSE_POSTPONE_MESSAGE, "P" },
{ "edit-reply-to", OP_COMPOSE_EDIT_REPLY_TO, "r" },
+ { "rename-attachment",OP_COMPOSE_RENAME_ATTACHMENT, "\017" },
{ "rename-file", OP_COMPOSE_RENAME_FILE, "R" },
{ "edit-subject", OP_COMPOSE_EDIT_SUBJECT, "s" },
{ "edit-to", OP_COMPOSE_EDIT_TO, "t" },