- else
- addstr (_("missing filename.\n"));
- break;
- case 's':
- mutt_str_replace (&msg->env->subject, p);
- break;
- case 't':
- msg->env->to = rfc822_parse_adrlist (msg->env->to, p);
- msg->env->to = mutt_expand_aliases (msg->env->to);
- break;
- case 'u':
- if (buflen)
- {
- buflen--;
- strfcpy (tmp, buf[buflen], sizeof (tmp));
- tmp[mutt_strlen (tmp)-1] = 0;
- FREE (&buf[buflen]);
- buf[buflen] = NULL;
- continue;
- }
- else
- addstr (_("No lines in message.\n"));
- break;
-
- case 'e':
- case 'v':
- if (be_barf_file (path, buf, buflen) == 0)
- {
- char *tag, *err;
- be_free_memory (buf, buflen);
- buf = NULL;
- bufmax = buflen = 0;
-
- if (option (OPTEDITHDRS))
- {
- mutt_env_to_local (msg->env);
- mutt_edit_headers (NONULL(Visual), path, msg, NULL, 0);
- if (mutt_env_to_idna (msg->env, &tag, &err))
- printw (_("Bad IDN in %s: '%s'\n"), tag, err);
- }
- else
- mutt_edit_file (NONULL(Visual), path);
-
- buf = be_snarf_file (path, buf, &bufmax, &buflen, 0);
-
- addstr (_("(continue)\n"));
- }
- break;
- case 'w':
- be_barf_file (*p ? p : path, buf, buflen);
- break;
- case 'x':
- abort = 1;
- done = 1;
- break;
- default:
- printw (_("%s: unknown editor command (~? for help)\n"), tmp);
- break;
+ buf = be_include_messages (p, buf, &bufmax, &buflen,
+ (ascii_tolower (tmp[1]) == 'm'),
+ (ascii_isupper
+ ((unsigned char) tmp[1])));
+ }
+ else
+ addstr (_("No mailbox.\n"));
+ break;
+ case 'p':
+ addstr ("-----\n");
+ addstr (_("Message contains:\n"));
+ be_print_header (msg->env);
+ for (i = 0; i < buflen; i++)
+ addstr (buf[i]);
+ addstr (_("(continue)\n"));
+ break;
+ case 'q':
+ done = 1;
+ break;
+ case 'r':
+ if (*p) {
+ m_strcpy(tmp, sizeof(tmp), p);
+ mutt_expand_path (tmp, sizeof (tmp));
+ buf = be_snarf_file (tmp, buf, &bufmax, &buflen, 1);
+ }
+ else
+ addstr (_("missing filename.\n"));
+ break;
+ case 's':
+ str_replace (&msg->env->subject, p);
+ break;
+ case 't':
+ msg->env->to = rfc822_parse_adrlist (msg->env->to, p);
+ msg->env->to = mutt_expand_aliases (msg->env->to);
+ break;
+ case 'u':
+ if (buflen) {
+ buflen--;
+ m_strcpy(tmp, sizeof(tmp), buf[buflen]);
+ tmp[m_strlen(tmp) - 1] = 0;
+ p_delete(&buf[buflen]);
+ buf[buflen] = NULL;
+ continue;
+ }
+ else
+ addstr (_("No lines in message.\n"));
+ break;
+
+ case 'e':
+ case 'v':
+ if (be_barf_file (path, buf, buflen) == 0) {
+ const char *tag, *err;
+
+ be_free_memory (buf, buflen);
+ buf = NULL;
+ bufmax = buflen = 0;
+
+ if (option (OPTEDITHDRS)) {
+ mutt_env_to_local (msg->env);
+ mutt_edit_headers (NONULL (Visual), path, msg, NULL, 0);
+ if (mutt_env_to_idna (msg->env, &tag, &err))
+ printw (_("Bad IDN in %s: '%s'\n"), tag, err);
+ }
+ else
+ mutt_edit_file (NONULL (Visual), path);
+
+ buf = be_snarf_file (path, buf, &bufmax, &buflen, 0);
+
+ addstr (_("(continue)\n"));
+ }
+ break;
+ case 'w':
+ be_barf_file (*p ? p : path, buf, buflen);
+ break;
+ case 'x':
+ abort = 1;
+ done = 1;
+ break;
+ default:
+ printw (_("%s: unknown editor command (~? for help)\n"), tmp);
+ break;