drop the builtin so called editor and the mailx feature we really dont
authorPierre Habouzit <madcoder@debian.org>
Sun, 5 Nov 2006 01:52:38 +0000 (02:52 +0100)
committerPierre Habouzit <madcoder@debian.org>
Sun, 5 Nov 2006 01:52:38 +0000 (02:52 +0100)
care about.

remove associated settings as well.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Makefile.am
compose.c
edit.c [deleted file]
globals.h
init.c
init.h
main.c
mutt.h
protos.h
send.c

index a0cf9fe..c3a287f 100644 (file)
@@ -22,7 +22,7 @@ muttng_SOURCES = $(BUILT_SOURCES) \
        alias.c attach.c base64.c browser.c buffy.c \
        charset.c color.c compress.c commands.c complete.c \
        compose.c copy.c curs_lib.c curs_main.c \
-       date.c edit.c editmsg.c enter.c \
+       date.c editmsg.c enter.c \
        flags.c filter.c from.c getdomain.c \
        handler.c hcache.c hdrline.c headers.c help.c history.c hook.c \
        init.c keymap.c lib.c \
index d99a850..44c7f4d 100644 (file)
--- a/compose.c
+++ b/compose.c
@@ -686,8 +686,7 @@ int mutt_compose_menu (HEADER * msg,    /* structure for new message */
       mutt_message_hook (NULL, msg, M_SEND2HOOK);
       break;
     case OP_COMPOSE_EDIT_MESSAGE:
-      if (Editor && (m_strcmp("builtin", Editor) != 0)
-          && !option (OPTEDITHDRS)) {
+      if (Editor && !option (OPTEDITHDRS)) {
         mutt_edit_file (Editor, msg->content->filename);
         mutt_update_encoding (msg->content);
         menu->redraw = REDRAW_CURRENT | REDRAW_STATUS;
@@ -696,8 +695,7 @@ int mutt_compose_menu (HEADER * msg,    /* structure for new message */
       }
       /* fall through */
     case OP_COMPOSE_EDIT_HEADERS:
-      if (m_strcmp("builtin", Editor) != 0 &&
-          (op == OP_COMPOSE_EDIT_HEADERS ||
+      if ((op == OP_COMPOSE_EDIT_HEADERS ||
            (op == OP_COMPOSE_EDIT_MESSAGE && option (OPTEDITHDRS)))) {
         const char *tag = NULL;
         const char *err = NULL;
@@ -710,13 +708,6 @@ int mutt_compose_menu (HEADER * msg,    /* structure for new message */
           p_delete(&err);
         }
       }
-      else {
-        /* this is grouped with OP_COMPOSE_EDIT_HEADERS because the
-           attachment list could change if the user invokes ~v to edit
-           the message with headers, in which we need to execute the
-           code below to regenerate the index array */
-        mutt_builtin_editor (msg->content->filename, msg, cur);
-      }
       mutt_update_encoding (msg->content);
 
       /* attachments may have been added */
diff --git a/edit.c b/edit.c
deleted file mode 100644 (file)
index 93fcfa1..0000000
--- a/edit.c
+++ /dev/null
@@ -1,456 +0,0 @@
-/*
- * Copyright notice from original mutt:
- * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
- *
- * This file is part of mutt-ng, see http://www.muttng.org/.
- * It's licensed under the GNU General Public License,
- * please see the file GPL in the top level source directory.
- */
-
-/* Close approximation of the mailx(1) builtin editor for sending mail. */
-
-#if HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include <lib-lib/mem.h>
-#include <lib-lib/ascii.h>
-#include <lib-lib/str.h>
-#include <lib-lib/macros.h>
-#include <lib-lib/file.h>
-
-#include "mutt.h"
-#include "enter.h"
-#include "mutt_curses.h"
-#include "mutt_idna.h"
-
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <errno.h>
-
-/*
- * SLcurses_waddnstr() can't take a "const char *", so this is only
- * declared "static" (sigh)
- */
-static const char *EditorHelp = N_("\
-~~             insert a line begining with a single ~\n\
-~b users       add users to the Bcc: field\n\
-~c users       add users to the Cc: field\n\
-~f messages    include messages\n\
-~F messages    same as ~f, except also include headers\n\
-~h             edit the message header\n\
-~m messages    include and quote messages\n\
-~M messages    same as ~m, except include headers\n\
-~p             print the message\n\
-~q             write file and quit editor\n\
-~r file                read a file into the editor\n\
-~t users       add users to the To: field\n\
-~u             recall the previous line\n\
-~v             edit message with the $visual editor\n\
-~w file                write message to file\n\
-~x             abort changes and quit editor\n\
-~?             this message\n\
-.              on a line by itself ends input\n");
-
-static char **be_snarf_data (FILE * f, char **buf, int *bufmax, int *buflen,
-                             off_t offset, int bytes, int prefix)
-{
-  char tmp[HUGE_STRING];
-  char *p = tmp;
-  int tmplen = sizeof (tmp);
-
-  tmp[sizeof (tmp) - 1] = 0;
-  if (prefix) {
-    m_strcpy(tmp, sizeof(tmp), NONULL(Prefix));
-    tmplen = m_strlen(tmp);
-    p = tmp + tmplen;
-    tmplen = sizeof (tmp) - tmplen;
-  }
-
-  fseeko (f, offset, 0);
-  while (bytes > 0) {
-    if (fgets (p, tmplen - 1, f) == NULL)
-      break;
-    bytes -= m_strlen(p);
-    if (*bufmax == *buflen)
-      p_realloc(&buf, *bufmax += 25);
-    buf[(*buflen)++] = m_strdup(tmp);
-  }
-  if (buf && *bufmax == *buflen) {      /* Do not smash memory past buf */
-    p_realloc(&buf, ++*bufmax);
-  }
-  if (buf)
-    buf[*buflen] = NULL;
-  return (buf);
-}
-
-static char **be_snarf_file (const char *path, char **buf, int *max, int *len,
-                             int verbose)
-{
-  FILE *f;
-  char tmp[LONG_STRING];
-  struct stat sb;
-
-  if ((f = fopen (path, "r"))) {
-    fstat (fileno (f), &sb);
-    buf = be_snarf_data (f, buf, max, len, 0, sb.st_size, 0);
-    if (verbose) {
-      snprintf (tmp, sizeof (tmp), "\"%s\" %lu bytes\n", path,
-                (unsigned long) sb.st_size);
-      addstr (tmp);
-    }
-    fclose (f);
-  }
-  else {
-    snprintf (tmp, sizeof (tmp), "%s: %s\n", path, strerror (errno));
-    addstr (tmp);
-  }
-  return (buf);
-}
-
-static int be_barf_file (const char *path, char **buf, int buflen)
-{
-  FILE *f;
-  int i;
-
-  if ((f = safe_fopen (path, "w")) == NULL) {   /* __FOPEN_CHECKED__ */
-    addstr (strerror (errno));
-    addch ('\n');
-    return (-1);
-  }
-  for (i = 0; i < buflen; i++)
-    fputs (buf[i], f);
-  if (fclose (f) == 0)
-    return 0;
-  printw ("fclose: %s\n", strerror (errno));
-  return (-1);
-}
-
-static void be_free_memory (char **buf, int buflen)
-{
-  while (buflen-- > 0)
-    p_delete(&buf[buflen]);
-  if (buf)
-    p_delete(&buf);
-}
-
-static char **be_include_messages (char *msg, char **buf, int *bufmax,
-                                   int *buflen, int pfx, int inc_hdrs)
-{
-  int offset, bytes, n;
-  char tmp[LONG_STRING];
-
-  while ((msg = strtok (msg, " ,")) != NULL) {
-    n = atoi (msg);
-    if (n > 0 && n <= Context->msgcount) {
-      n--;
-
-      /* add the attribution */
-      if (Attribution) {
-        mutt_make_string (tmp, sizeof (tmp) - 1, Attribution, Context,
-                          Context->hdrs[n]);
-        strcat (tmp, "\n");     /* __STRCAT_CHECKED__ */
-      }
-
-      if (*bufmax == *buflen)
-        p_realloc(&buf, *bufmax += 25);
-      buf[(*buflen)++] = m_strdup(tmp);
-
-      bytes = Context->hdrs[n]->content->length;
-      if (inc_hdrs) {
-        offset = Context->hdrs[n]->offset;
-        bytes += Context->hdrs[n]->content->offset - offset;
-      }
-      else
-        offset = Context->hdrs[n]->content->offset;
-      buf = be_snarf_data (Context->fp, buf, bufmax, buflen, offset, bytes,
-                           pfx);
-
-      if (*bufmax == *buflen)
-        p_realloc(&buf, *bufmax += 25);
-      buf[(*buflen)++] = m_strdup("\n");
-    }
-    else
-      printw (_("%d: invalid message number.\n"), n);
-    msg = NULL;
-  }
-  return (buf);
-}
-
-static void be_print_header (ENVELOPE * env)
-{
-  char tmp[HUGE_STRING];
-
-  if (env->to) {
-    addstr ("To: ");
-    tmp[0] = 0;
-    rfc822_write_address (tmp, sizeof (tmp), env->to, 1);
-    addstr (tmp);
-    addch ('\n');
-  }
-  if (env->cc) {
-    addstr ("Cc: ");
-    tmp[0] = 0;
-    rfc822_write_address (tmp, sizeof (tmp), env->cc, 1);
-    addstr (tmp);
-    addch ('\n');
-  }
-  if (env->bcc) {
-    addstr ("Bcc: ");
-    tmp[0] = 0;
-    rfc822_write_address (tmp, sizeof (tmp), env->bcc, 1);
-    addstr (tmp);
-    addch ('\n');
-  }
-  if (env->subject) {
-    addstr ("Subject: ");
-    addstr (env->subject);
-    addch ('\n');
-  }
-  addch ('\n');
-}
-
-/* args:
- *     force   override the $ask* vars (used for the ~h command)
- */
-static void be_edit_header (ENVELOPE * e, int force)
-{
-  char tmp[HUGE_STRING];
-
-  move (LINES - 1, 0);
-
-  addstr ("To: ");
-  tmp[0] = 0;
-  mutt_addrlist_to_local (e->to);
-  rfc822_write_address (tmp, sizeof (tmp), e->to, 0);
-  if (!e->to || force) {
-    if (mutt_enter_string (tmp, sizeof (tmp), LINES - 1, 4, 0) == 0) {
-      address_delete (&e->to);
-      e->to = mutt_parse_adrlist (e->to, tmp);
-      e->to = mutt_expand_aliases (e->to);
-      mutt_addrlist_to_idna (e->to, NULL);      /* XXX - IDNA error reporting? */
-      tmp[0] = 0;
-      rfc822_write_address (tmp, sizeof (tmp), e->to, 1);
-      mvaddstr (LINES - 1, 4, tmp);
-    }
-  }
-  else {
-    mutt_addrlist_to_idna (e->to, NULL);        /* XXX - IDNA error reporting? */
-    addstr (tmp);
-  }
-  addch ('\n');
-
-  if (!e->subject || force) {
-    addstr ("Subject: ");
-    m_strcpy(tmp, sizeof(tmp), NONULL(e->subject));
-    if (mutt_enter_string (tmp, sizeof (tmp), LINES - 1, 9, 0) == 0)
-      m_strreplace(&e->subject, tmp);
-    addch ('\n');
-  }
-
-  if ((!e->cc && option (OPTASKCC)) || force) {
-    addstr ("Cc: ");
-    tmp[0] = 0;
-    mutt_addrlist_to_local (e->cc);
-    rfc822_write_address (tmp, sizeof (tmp), e->cc, 0);
-    if (mutt_enter_string (tmp, sizeof (tmp), LINES - 1, 4, 0) == 0) {
-      address_delete (&e->cc);
-      e->cc = mutt_parse_adrlist (e->cc, tmp);
-      e->cc = mutt_expand_aliases (e->cc);
-      tmp[0] = 0;
-      mutt_addrlist_to_idna (e->cc, NULL);
-      rfc822_write_address (tmp, sizeof (tmp), e->cc, 1);
-      mvaddstr (LINES - 1, 4, tmp);
-    }
-    else
-      mutt_addrlist_to_idna (e->cc, NULL);
-    addch ('\n');
-  }
-
-  if (option (OPTASKBCC) || force) {
-    addstr ("Bcc: ");
-    tmp[0] = 0;
-    mutt_addrlist_to_local (e->bcc);
-    rfc822_write_address (tmp, sizeof (tmp), e->bcc, 0);
-    if (mutt_enter_string (tmp, sizeof (tmp), LINES - 1, 5, 0) == 0) {
-      address_delete (&e->bcc);
-      e->bcc = mutt_parse_adrlist (e->bcc, tmp);
-      e->bcc = mutt_expand_aliases (e->bcc);
-      mutt_addrlist_to_idna (e->bcc, NULL);
-      tmp[0] = 0;
-      rfc822_write_address (tmp, sizeof (tmp), e->bcc, 1);
-      mvaddstr (LINES - 1, 5, tmp);
-    }
-    else
-      mutt_addrlist_to_idna (e->bcc, NULL);
-    addch ('\n');
-  }
-}
-
-int mutt_builtin_editor (const char *path, HEADER * msg, HEADER * cur)
-{
-  char **buf = NULL;
-  int bufmax = 0, buflen = 0;
-  char tmp[LONG_STRING];
-  int aborted = 0;
-  int done = 0;
-  int i;
-  char *p;
-
-  scrollok (stdscr, TRUE);
-
-  be_edit_header (msg->env, 0);
-
-  addstr (_("(End message with a . on a line by itself)\n"));
-
-  buf = be_snarf_file (path, buf, &bufmax, &buflen, 0);
-
-  tmp[0] = 0;
-  while (!done) {
-    if (mutt_enter_string (tmp, sizeof (tmp), LINES - 1, 0, 0) == -1) {
-      tmp[0] = 0;
-      continue;
-    }
-    addch ('\n');
-
-    if (EscChar && tmp[0] == EscChar[0] && tmp[1] != EscChar[0]) {
-      /* remove trailing whitespace from the line */
-      p = tmp + m_strlen(tmp) - 1;
-      while (p >= tmp && ISSPACE (*p))
-        *p-- = 0;
-
-      p = vskipspaces(tmp + 2);
-
-      switch (tmp[1]) {
-      case '?':
-        addstr (_(EditorHelp));
-        break;
-      case 'b':
-        msg->env->bcc = mutt_parse_adrlist (msg->env->bcc, p);
-        msg->env->bcc = mutt_expand_aliases (msg->env->bcc);
-        break;
-      case 'c':
-        msg->env->cc = mutt_parse_adrlist (msg->env->cc, p);
-        msg->env->cc = mutt_expand_aliases (msg->env->cc);
-        break;
-      case 'h':
-        be_edit_header (msg->env, 1);
-        break;
-      case 'F':
-      case 'f':
-      case 'm':
-      case 'M':
-        if (Context) {
-          if (!*p && cur) {
-            /* include the current message */
-            p = tmp + m_strlen(tmp) + 1;
-            snprintf (tmp + m_strlen(tmp),
-                      sizeof (tmp) - m_strlen(tmp), " %d",
-                      cur->msgno + 1);
-          }
-          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':
-        m_strreplace(&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':
-        aborted = 1;
-        done = 1;
-        break;
-      default:
-        printw (_("%s: unknown editor command (~? for help)\n"), tmp);
-        break;
-      }
-    }
-    else if (m_strcmp(".", tmp) == 0)
-      done = 1;
-    else {
-      m_strcat(tmp, sizeof(tmp), "\n");
-      if (buflen == bufmax)
-        p_realloc(&buf, bufmax += 25);
-      buf[buflen++] = m_strdup(tmp[1] == '~' ? tmp + 1 : tmp);
-    }
-
-    tmp[0] = 0;
-  }
-
-  if (!aborted)
-    be_barf_file (path, buf, buflen);
-  be_free_memory (buf, buflen);
-
-  return (aborted ? -1 : 0);
-}
index db96096..5bec12e 100644 (file)
--- a/globals.h
+++ b/globals.h
@@ -47,7 +47,6 @@ WHERE char *DsnNotify;
 WHERE char *DsnReturn;
 WHERE char *Editor;
 WHERE char *EditorHeaders;
-WHERE char *EscChar;
 WHERE char *FileCharset;
 WHERE char *FolderFormat;
 WHERE char *ForwFmt;
@@ -168,7 +167,6 @@ WHERE char *Tempdir;
 WHERE char *Tochars;
 WHERE char *TrashPath;
 WHERE char *Username;
-WHERE char *Visual;
 WHERE char *XtermTitle;
 WHERE char *XtermLeave;
 WHERE char *XtermIcon;
diff --git a/init.c b/init.c
index fd047b6..f86e465 100644 (file)
--- a/init.c
+++ b/init.c
@@ -2702,7 +2702,6 @@ void mutt_init (int skip_sys_rc, LIST * commands)
       p = "vi";
   }
   Editor = m_strdup(p);
-  Visual = m_strdup(p);
 
   if ((p = getenv ("REPLYTO")) != NULL) {
     BUFFER buf, token;
diff --git a/init.h b/init.h
index 3906a33..ac29376 100644 (file)
--- a/init.h
+++ b/init.h
@@ -697,11 +697,6 @@ struct option_t MuttVars[] = {
   ** Manually sets the \fIenvelope\fP sender for outgoing messages.
   ** This value is ignored if ``$$use_envelope_from'' is unset.
   */
-  {"escape", DT_STR, R_NONE, UL &EscChar, "~"},
-  /*
-   ** .pp
-   ** Escape character to use for functions in the builtin editor.
-   */
   {"fast_reply", DT_BOOL, R_NONE, OPTFASTREPLY, "no" },
   /*
    ** .pp
@@ -3662,12 +3657,6 @@ struct option_t MuttVars[] = {
    ** messages, indicating which version of Mutt-ng was used for composing
    ** them.
    */
-  {"visual", DT_PATH, R_NONE, UL &Visual, "" },
-  /*
-   ** .pp
-   ** Specifies the visual editor to invoke when the \fI~v\fP command is
-   ** given in the builtin editor.
-   */
   {"wait_key", DT_BOOL, R_NONE, OPTWAITKEY, "yes" },
   /*
    ** .pp
diff --git a/main.c b/main.c
index 32669b1..56030ee 100644 (file)
--- a/main.c
+++ b/main.c
@@ -185,7 +185,6 @@ options:\n\
   -t\t\tprint the value of all variables to stdout\n\
   -T\t\tprint the value of all changed variables to stdout\n\
   -v\t\tshow version and compile-time definitions\n\
-  -x\t\tsimulate the mailx send mode\n\
   -y\t\tselect a mailbox specified in your `mailboxes' list\n\
   -z\t\texit immediately if there are no messages in the mailbox\n\
   -Z\t\topen the first folder with new message, exit immediately if none\n\
@@ -559,10 +558,10 @@ int main (int argc, char **argv)
 #ifdef USE_NNTP
   while ((i =
           getopt (argc, argv,
-                  "A:a:b:F:f:c:d:e:g:GH:s:i:hm:npQ:RTtvxyzZ")) != EOF)
+                  "A:a:b:F:f:c:d:e:g:GH:s:i:hm:npQ:RTtvyzZ")) != EOF)
 #else
   while ((i =
-          getopt (argc, argv, "A:a:b:F:f:c:d:e:H:s:i:hm:npQ:RTtvxyzZ")) != EOF)
+          getopt (argc, argv, "A:a:b:F:f:c:d:e:H:s:i:hm:npQ:RTtvyzZ")) != EOF)
 #endif
     switch (i) {
     case 'A':
@@ -658,10 +657,6 @@ int main (int argc, char **argv)
       version++;
       break;
 
-    case 'x':                  /* mailx compatible send mode */
-      sendflags |= SENDMAILX;
-      break;
-
     case 'y':                  /* My special hack mode */
       flags |= M_SELECT;
       break;
diff --git a/mutt.h b/mutt.h
index 188205f..27b1239 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -264,10 +264,9 @@ enum {
 #define SENDFORWARD    (1<<3)
 #define SENDPOSTPONED  (1<<4)
 #define SENDBATCH      (1<<5)
-#define SENDMAILX      (1<<6)
-#define SENDKEY                (1<<7)
-#define SENDRESEND     (1<<8)
-#define SENDNEWS       (1<<9)
+#define SENDKEY                (1<<6)
+#define SENDRESEND     (1<<7)
+#define SENDNEWS       (1<<8)
 
 /* flags to _mutt_select_file() */
 #define M_SEL_BUFFY    (1<<0)
index d4b6bea..95fa295 100644 (file)
--- a/protos.h
+++ b/protos.h
@@ -203,7 +203,6 @@ void mutt_write_address_list (address_t * adr, FILE * fp, int linelen,
 int mutt_addwch (wchar_t);
 int mutt_alloc_color (int fg, int bg);
 int mutt_any_key_to_continue (const char *);
-int mutt_builtin_editor (const char *, HEADER *, HEADER *);
 int mutt_can_decode (BODY *);
 int mutt_change_flag (HEADER *, int);
 int mutt_check_encoding (const char *);
diff --git a/send.c b/send.c
index cf15950..82fd71a 100644 (file)
--- a/send.c
+++ b/send.c
@@ -1261,8 +1261,7 @@ int ci_send_message (int flags, /* send mode */
       msg->env->newsgroups = m_strdup(((NNTP_DATA *) ctx->data)->group);
 #endif
 
-    if (!(flags & SENDMAILX) &&
-        !(option (OPTAUTOEDIT) && option (OPTEDITHDRS)) &&
+    if (!(option (OPTAUTOEDIT) && option (OPTEDITHDRS)) &&
         !((flags & SENDREPLY) && option (OPTFASTREPLY))) {
       if (edit_envelope (msg->env, flags) == -1)
         goto cleanup;
@@ -1311,9 +1310,7 @@ int ci_send_message (int flags, /* send mode */
       process_user_header (msg->env);
 
 
-    if (option (OPTSIGONTOP)
-        && (!(flags & (SENDMAILX | SENDKEY)) && Editor
-            && m_strcmp(Editor, "builtin") != 0))
+    if (option (OPTSIGONTOP) && (!(flags & SENDKEY) && Editor))
       append_signature (tempfp);
 
     /* include replies/forwarded messages, unless we are given a template */
@@ -1321,9 +1318,7 @@ int ci_send_message (int flags, /* send mode */
         && generate_body (tempfp, msg, flags, ctx, cur) == -1)
       goto cleanup;
 
-    if (!option (OPTSIGONTOP)
-        && (!(flags & (SENDMAILX | SENDKEY)) && Editor
-            && m_strcmp(Editor, "builtin") != 0))
+    if (!option (OPTSIGONTOP) && (!(flags & SENDKEY) && Editor))
       append_signature (tempfp);
 
     /* 
@@ -1331,24 +1326,22 @@ int ci_send_message (int flags, /* send mode */
      * can take effect.
      */
 
-    if (!(flags & SENDMAILX)) {
-      if (option (OPTCRYPTAUTOSIGN))
-        msg->security |= SIGN;
-      if (option (OPTCRYPTAUTOENCRYPT))
-        msg->security |= ENCRYPT;
-      if (option (OPTCRYPTREPLYENCRYPT) && cur && (cur->security & ENCRYPT))
-        msg->security |= ENCRYPT;
-      if (option (OPTCRYPTREPLYSIGN) && cur && (cur->security & SIGN))
-        msg->security |= SIGN;
-      if (option (OPTCRYPTREPLYSIGNENCRYPTED) && cur
-          && (cur->security & ENCRYPT))
-        msg->security |= SIGN;
-      if (msg->security & (ENCRYPT | SIGN)) {
-        if (option (OPTPGPAUTOINLINE))
-          msg->security |= INLINE;
-        if (option (OPTPGPREPLYINLINE) && cur && (cur->security & INLINE))
-          msg->security |= INLINE;
-      }
+    if (option (OPTCRYPTAUTOSIGN))
+      msg->security |= SIGN;
+    if (option (OPTCRYPTAUTOENCRYPT))
+      msg->security |= ENCRYPT;
+    if (option (OPTCRYPTREPLYENCRYPT) && cur && (cur->security & ENCRYPT))
+      msg->security |= ENCRYPT;
+    if (option (OPTCRYPTREPLYSIGN) && cur && (cur->security & SIGN))
+      msg->security |= SIGN;
+    if (option (OPTCRYPTREPLYSIGNENCRYPTED) && cur
+        && (cur->security & ENCRYPT))
+      msg->security |= SIGN;
+    if (msg->security & (ENCRYPT | SIGN)) {
+      if (option (OPTPGPAUTOINLINE))
+        msg->security |= INLINE;
+      if (option (OPTPGPREPLYINLINE) && cur && (cur->security & INLINE))
+        msg->security |= INLINE;
     }
 
     if (msg->security) {
@@ -1404,11 +1397,7 @@ int ci_send_message (int flags, /* send mode */
   if (!(flags & SENDKEY))
     safe_fclose (&tempfp);
 
-  if (flags & SENDMAILX) {
-    if (mutt_builtin_editor (msg->content->filename, msg, cur) == -1)
-      goto cleanup;
-  }
-  else if (!(flags & SENDBATCH)) {
+  if (!(flags & SENDBATCH)) {
     struct stat st;
     time_t mtime = mutt_decrease_mtime (msg->content->filename, NULL);
 
@@ -1433,9 +1422,7 @@ int ci_send_message (int flags, /* send mode */
       if (mutt_needs_mailcap (msg->content)) {
         if (!mutt_edit_attachment (msg->content))
           goto cleanup;
-      } else if (!Editor || m_strcmp("builtin", Editor) == 0)
-        mutt_builtin_editor (msg->content->filename, msg, cur);
-      else if (option (OPTEDITHDRS)) {
+      } else if (option (OPTEDITHDRS)) {
         mutt_env_to_local (msg->env);
         mutt_edit_headers (Editor, msg->content->filename, msg, fcc,
                            sizeof (fcc));
@@ -1494,7 +1481,7 @@ int ci_send_message (int flags, /* send mode */
 
   mutt_update_encoding (msg->content);
 
-  if (!(flags & (SENDMAILX | SENDBATCH))) {
+  if (!(flags & SENDBATCH)) {
   main_loop:
 
     fcc_error = 0;              /* reset value since we may have failed before */
@@ -1659,7 +1646,7 @@ int ci_send_message (int flags, /* send mode */
       && (msg->content->parts != clear_content))
     free_clear_content = 1;
 
-  if (!option (OPTNOCURSES) && !(flags & SENDMAILX))
+  if (!option (OPTNOCURSES))
     mutt_message _("Sending message...");
 
   mutt_prepare_envelope (msg->env, 1);
@@ -1786,15 +1773,15 @@ int ci_send_message (int flags, /* send mode */
       goto cleanup;
     }
   }
-  else if (!option (OPTNOCURSES) && !(flags & SENDMAILX))
+  else if (!option (OPTNOCURSES))
     mutt_message (i != 0 ? _("Sending in background.") :
 #ifdef USE_NNTP
                   (flags & SENDNEWS) ? _("Article posted.") :
-                  _("Mail sent."));
+                  _("Mail sent.")
 #else
-                  _("Mail sent."));
+                  _("Mail sent.")
 #endif
-
+    );
   if (msg->security & ENCRYPT)
     p_delete(&pgpkeylist);