--- orig-OPS	Tue Feb 15 08:28:45 2000
+++ OPS	Sun Nov 26 00:17:06 2000
@@ -8,10 +8,11 @@
 OP_BROWSER_TELL "display the currently selected file's name"
 OP_BROWSER_SUBSCRIBE "subscribe to current mailbox (IMAP only)"
 OP_BROWSER_UNSUBSCRIBE "unsubscribe to current mailbox (IMAP only)"
 OP_BROWSER_TOGGLE_LSUB "toggle view all/subscribed mailboxes (IMAP only)"
 OP_CHANGE_DIRECTORY "change directories"
+OP_CHOOSE_DIRECTORY "prompt for a new directory"
 OP_CHECK_NEW "check mailboxes for new mail"
 OP_COMPOSE_ATTACH_FILE "attach a file(s) to this message"
 OP_COMPOSE_ATTACH_MESSAGE "attach message(s) to this message"
 OP_COMPOSE_CHANGE_CHARSET "change an attachment's character set"
 OP_COMPOSE_EDIT_BCC "edit the BCC list"
@@ -64,10 +65,11 @@
 OP_EDITOR_DELETE_CHAR "delete the char under the cursor"
 OP_EDITOR_EOL "jump to the end of the line"
 OP_EDITOR_FORWARD_CHAR "move the cursor one character to the right"
 OP_EDITOR_HISTORY_DOWN "scroll up through the history list"
 OP_EDITOR_HISTORY_UP "scroll up through the history list"
+OP_EDITOR_KILL_BOL "delete chars from cursor to beginning of line"
 OP_EDITOR_KILL_EOL "delete chars from cursor to end of line"
 OP_EDITOR_KILL_LINE "delete all chars on the line"
 OP_EDITOR_KILL_WORD "delete the word in front of the cursor"
 OP_EDITOR_QUOTE_CHAR "quote the next typed key"
 OP_ENTER_COMMAND "enter a muttrc command"
--- orig-OPS.PGP	Sat Dec 12 00:05:36 1998
+++ OPS.PGP	Sun Nov 26 00:17:06 2000
@@ -1,7 +1,9 @@
 OP_COMPOSE_ATTACH_KEY "attach a PGP public key"
 OP_COMPOSE_PGP_MENU "show PGP options"
+OP_COMPOSE_TOGGLE_SIGN "sign/don't sign current message"
+OP_COMPOSE_TOGGLE_ENCRYPT "encrypt/don't encrypt current message"
 OP_EXTRACT_KEYS "extract PGP public keys"
 OP_FORGET_PASSPHRASE "wipe PGP passphrase from memory"
 OP_MAIL_KEY "mail a PGP public key"
 OP_VERIFY_KEY "verify a PGP public key"
 OP_VIEW_ID "view the key's user id"
--- orig-browser.c	Mon Jul 10 03:33:16 2000
+++ browser.c	Sun Nov 26 00:17:06 2000
@@ -38,10 +38,11 @@
 #include <grp.h>
 
 static struct mapping_t FolderHelp[] = {
   { N_("Exit"),  OP_EXIT },
   { N_("Chdir"), OP_CHANGE_DIRECTORY },
+  { N_("Newdir"), OP_CHOOSE_DIRECTORY },
   { N_("Mask"),  OP_ENTER_MASK },
   { N_("Help"),  OP_HELP },
   { NULL }
 };
 
@@ -178,11 +179,12 @@
 #endif
       strfcpy (fn, folder->ff->name, sizeof(fn));
       if (folder->ff->st != NULL)
       {
 	strcat (fn, S_ISLNK (folder->ff->st->st_mode) ? "@" : 
-		(S_ISDIR (folder->ff->st->st_mode) ? "/" : 
+		(S_ISDIR (folder->ff->st->st_mode) ?
+		 (fn[strlen(fn)-1]=='/'?"":"/") : 
 		 ((folder->ff->st->st_mode & S_IXUSR) != 0 ? "*" : "")));
       }
       snprintf (tmp, sizeof (tmp), "%%%ss", fmt);
       snprintf (dest, destlen, tmp, fn);
       break;
@@ -515,11 +517,11 @@
   char helpstr[SHORT_STRING];
   char title[STRING];
   struct browser_state state;
   MUTTMENU *menu;
   struct stat st;
-  int i, killPrefix = 0;
+  int i, killPrefix = 0, len;
 
   memset (&state, 0, sizeof (struct browser_state));
 
   if (*f)
   {
@@ -612,10 +614,12 @@
 
   FOREVER
   {
     switch (i = mutt_menuLoop (menu))
     {
+      case OP_CHANGE_DIRECTORY:
+	/* Fall through to OP_GENERIC_SELECT_ENTRY */
       case OP_GENERIC_SELECT_ENTRY:
 
 	if (!state.entrylen)
 	{
 	  mutt_error _("No files match the file mask");
@@ -640,15 +644,20 @@
 	  else if (state.imap_browse)
 	  {
             strfcpy (buf, state.entry[menu->current].name, sizeof (buf));
 	  }
 #endif
-	  else
-	    snprintf (buf, sizeof (buf), "%s/%s", LastDir, 
+	  else {
+	    /* Pretend a trailing '/' in LastDir doesn't exist */
+	    len = mutt_strlen (LastDir);
+	    if (len>1 && LastDir[len-1]=='/')
+	      len--;
+	    snprintf (buf, sizeof (buf), "%.*s/%s", len, LastDir, 
 		      state.entry[menu->current].name);
+	  }
 
-	  if ((mx_get_magic (buf) <= 0)
+	  if ((i == OP_CHANGE_DIRECTORY) || (mx_get_magic (buf) <= 0)
 #ifdef USE_IMAP
 	    || state.entry[menu->current].inferiors
 #endif
 	    )
 	  {
@@ -657,25 +666,21 @@
 	    /* save the old directory */
 	    strfcpy (OldLastDir, LastDir, sizeof (OldLastDir));
 
 	    if (mutt_strcmp (state.entry[menu->current].name, "..") == 0)
 	    {
-	      if (mutt_strcmp ("..", LastDir + mutt_strlen (LastDir) - 2) == 0)
-		strcat (LastDir, "/..");
-	      else
-	      {
-		char *p = strrchr (LastDir + 1, '/');
-
-		if (p)
-		  *p = 0;
-		else
-		{
-		  if (LastDir[0] == '/')
-		    LastDir[1] = 0;
-		  else
-		    strcat (LastDir, "/..");
-		}
+	      char *p;
+	      len = mutt_strlen (LastDir);
+	      if (len > 1 && LastDir[len-1] == '/')
+		LastDir[--len] = 0;
+
+	      p = strrchr (LastDir + 1, '/');
+	      if (p)
+		*++p = 0;
+	      else {
+		LastDir[0] = '/';
+		LastDir[1] = 0;
 	      }
 	    }
 	    else if (buffy)
 	    {
 	      sprintf (LastDir, "%s", state.entry[menu->current].name);
@@ -699,13 +704,18 @@
 		LastDir[n] = '\0';
 		LastDir[n-1] = state.entry[menu->current].delim;
 	      }
 	    }
 #endif
-	    else
-	      sprintf (LastDir + mutt_strlen (LastDir), "/%s",
+	    else {
+	      /* Chop off a trailing '/' */
+	      len = mutt_strlen (LastDir);
+	      if (len>1 && LastDir[len-1]=='/')
+		LastDir[--len] = 0;
+	      sprintf (LastDir + mutt_strlen (LastDir), "/%s/",
 		       state.entry[menu->current].name);
+	    }
 
 	    destroy_state (&state);
 	    if (killPrefix)
 	    {
 	      prefix[0] = 0;
@@ -854,27 +864,54 @@
 	    mutt_message _("Mailbox not deleted.");
         }
         break;
 #endif
       
-      case OP_CHANGE_DIRECTORY:
+      case OP_CHOOSE_DIRECTORY:
 
 	strfcpy (buf, LastDir, sizeof (buf));
 #ifdef USE_IMAP
 	if (!state.imap_browse)
 #endif
 	{
 	  /* add '/' at the end of the directory name */
-	  int len=mutt_strlen(LastDir);
-	  if (sizeof (buf) > len)
+	  len=mutt_strlen(buf);
+	  if (sizeof (buf) > len+1 && buf[len-1] != '/') {
 	    buf[len]='/';
+	    buf[++len]=0;
+	  }
 	}
 
 	if (mutt_get_field (_("Chdir to: "), buf, sizeof (buf), M_FILE) == 0 &&
 	    buf[0])
 	{
 	  buffy = 0;	  
+#ifdef USE_IMAP
+	  if (!state.imap_browse)
+#endif
+	  {
+	    /* add '/' at the end of the directory name */
+	    len=mutt_strlen(buf);
+	    if (sizeof (buf) > len+1 && buf[len-1] != '/') {
+	      buf[len]='/';
+	      buf[++len]=0;
+	    }
+	    /* manually take care of trailing ".." */
+	    if (len>3 && 0 == mutt_strcmp (&buf[len-4], "/../")) {
+	      char *p;
+
+	      buf[len-4] = 0;
+	      p = strrchr (buf, '/');
+	      if (p)
+		len = p - buf + 1;
+	      else {
+		buf[0] = '/';
+		len = 1;
+	      }
+	      buf[len] = 0;
+	    }
+	  }
 	  mutt_expand_path (buf, sizeof (buf));
 #ifdef USE_IMAP
 	  if (mx_is_imap (buf))
 	  {
 	    strfcpy (LastDir, buf, sizeof (LastDir));
--- orig-compose.c	Fri Mar  3 02:10:07 2000
+++ compose.c	Sun Nov 26 00:17:06 2000
@@ -1160,10 +1160,22 @@
       case OP_COMPOSE_PGP_MENU:
 
 	msg->pgp = pgp_send_menu (msg->pgp, &menu->redraw);
 	break;
 
+      case OP_COMPOSE_TOGGLE_SIGN:
+
+	msg->pgp ^= PGPSIGN;
+	redraw_pgp_lines (msg->pgp);
+	break;
+
+      case OP_COMPOSE_TOGGLE_ENCRYPT:
+
+	msg->pgp ^= PGPENCRYPT;
+	redraw_pgp_lines (msg->pgp);
+	break;
+
       case OP_FORGET_PASSPHRASE:
 
 	mutt_forget_passphrase ();
 	break;
 
--- orig-copy.c	Thu Jun 15 14:06:40 2000
+++ copy.c	Tue Dec 19 12:37:19 2000
@@ -29,11 +29,11 @@
 #endif
 
 #include <string.h>
 #include <stdlib.h>
 #include <ctype.h>
-#include <unistd.h> /* needed for SEEK_SET under SunOS 4.1.4 */
+#include <unistd.h>
 
 static int copy_delete_attach (BODY *b, FILE *fpin, FILE *fpout, char *date);
 
 /* Ok, the only reason for not merging this with mutt_copy_header()
  * below is to avoid creating a HEADER structure in message_handler().
@@ -475,11 +475,12 @@
 
 	if (fail)
 	{
 	  mutt_error ("The length calculation was wrong by %ld bytes", fail);
 	  new_length += fail;
-	  sleep (5);
+	  if (ErrorDelay)
+	    usleep (1000UL * ErrorDelay);
 	}
       }
 #endif
 
       /* Update original message if we are sync'ing a mailfolder */ 
--- orig-curs_main.c	Tue Jul 25 01:02:26 2000
+++ curs_main.c	Tue Dec 19 12:37:41 2000
@@ -968,11 +968,12 @@
 	    break;
 	  }
 	  safe_free ((void **) &Context);
 	}
 
-	sleep (1); /* give a second to read the mailbox status */
+	if (InfoDelay)
+	  usleep (1000UL * InfoDelay); /* let the user read the mailbox status */
 
 	mutt_folder_hook (buf);
 
 	if ((Context = mx_open_mailbox (buf, 
 					(option (OPTREADONLY) || op == OP_MAIN_CHANGE_FOLDER_READONLY) ?
--- orig-enter.c	Fri Mar  3 02:10:08 2000
+++ enter.c	Sun Nov 26 00:17:06 2000
@@ -232,10 +232,32 @@
 	case OP_EDITOR_KILL_EOL:
 	  lastchar = curpos;
 	  if (!pass)
 	    clrtoeol ();
 	  break;
+	case OP_EDITOR_KILL_BOL:
+	  /* delete to begining of line */
+	  if (curpos != 0)
+	  {
+	    j = 0;
+	    while (curpos < lastchar)
+	      buf[j++] = buf[curpos++];
+	    lastchar = j;
+	    curpos = 0;
+	    /* update screen */
+	    if (!pass)
+	    {
+	      if (curpos < begin)
+	      {
+		begin = curpos - width / 2;
+		redraw = M_REDRAW_LINE;
+	      }
+	      else
+		redraw = M_REDRAW_EOL;
+	    }
+	  }
+	  break;
 	case OP_EDITOR_BACKWARD_CHAR:
 	  if (curpos == 0)
 	  {
 	    BEEP ();
 	  }
--- orig-functions.h	Fri Mar  3 02:10:08 2000
+++ functions.h	Sun Nov 26 00:17:06 2000
@@ -46,22 +46,22 @@
   { "first-entry",	OP_FIRST_ENTRY,		"=" },
   { "enter-command",	OP_ENTER_COMMAND,	":" },
   { "next-line",	OP_NEXT_LINE,		">" },
   { "previous-line",	OP_PREV_LINE,		"<" },
   { "half-up",		OP_HALF_UP,		"[" },
-  { "half-down", 	OP_HALF_DOWN,		"]" },
+  { "half-down",	OP_HALF_DOWN,		"]" },
   { "help",		OP_HELP,		"?" },
   { "tag-prefix",	OP_TAG_PREFIX,		";" },
   { "shell-escape",	OP_SHELL_ESCAPE,	"!" },
   { "select-entry",	OP_GENERIC_SELECT_ENTRY,M_ENTER_S },
   { "search",		OP_SEARCH,		"/" },
   { "search-reverse",	OP_SEARCH_REVERSE,	"\033/" },
   { "search-opposite",	OP_SEARCH_OPPOSITE,	NULL },
   { "jump",		OP_JUMP,		NULL },
-  { "current-top",      OP_CURRENT_TOP,		NULL },
-  { "current-middle",   OP_CURRENT_MIDDLE,	NULL },
-  { "current-bottom",   OP_CURRENT_BOTTOM,	NULL },
+  { "current-top",	OP_CURRENT_TOP,		NULL },
+  { "current-middle",	OP_CURRENT_MIDDLE,	NULL },
+  { "current-bottom",	OP_CURRENT_BOTTOM,	NULL },
   { NULL,		0,			NULL }
 };
 
 struct binding_t OpMain[] = {
   { "create-alias",		OP_CREATE_ALIAS,		"a" },
@@ -83,11 +83,11 @@
   { "flag-message",		OP_FLAG_MESSAGE,		"F" },
   { "group-reply",		OP_GROUP_REPLY,			"g" },
 #ifdef USE_POP
   { "fetch-mail",		OP_MAIN_FETCH_MAIL,		"G" },
 #endif
-  { "display-toggle-weed",		OP_DISPLAY_HEADERS,		"h" },
+  { "display-toggle-weed",	OP_DISPLAY_HEADERS,		"h" },
   { "next-undeleted",		OP_MAIN_NEXT_UNDELETED,		"j" },
   { "previous-undeleted",	OP_MAIN_PREV_UNDELETED,		"k" },
   { "limit",			OP_MAIN_LIMIT,			"l" },
   { "list-reply",		OP_LIST_REPLY,			"L" },
   { "mail",			OP_MAIL,			"m" },
@@ -112,11 +112,11 @@
   { "tag-pattern",		OP_MAIN_TAG_PATTERN,		"T" },
   { "tag-subthread",		OP_TAG_SUBTHREAD,		NULL },
   { "tag-thread",		OP_TAG_THREAD,			"\033t" },
   { "untag-pattern",		OP_MAIN_UNTAG_PATTERN,		"\024" },
   { "undelete-message",		OP_UNDELETE,			"u" },
-  { "undelete-pattern",		OP_MAIN_UNDELETE_PATTERN,	"U"},
+  { "undelete-pattern",		OP_MAIN_UNDELETE_PATTERN,	"U" },
   { "undelete-subthread",	OP_UNDELETE_SUBTHREAD,		"\033u" },
   { "undelete-thread",		OP_UNDELETE_THREAD,		"\025" },
   { "view-attachments",		OP_VIEW_ATTACHMENTS,		"v" },
   { "show-version",		OP_VERSION,			"V" },
   { "set-flag",			OP_MAIN_SET_FLAG,		"w" },
@@ -128,22 +128,17 @@
   { "next-new",			OP_MAIN_NEXT_NEW,		"\t" },
   { "previous-new",		OP_MAIN_PREV_NEW,		"\033\t" },
   { "next-unread",		OP_MAIN_NEXT_UNREAD,		NULL },
   { "previous-unread",		OP_MAIN_PREV_UNREAD,		NULL },
   { "parent-message",		OP_MAIN_PARENT_MESSAGE,		"P" },
-
-
 #ifdef HAVE_PGP
   { "extract-keys",		OP_EXTRACT_KEYS,		"\013" },
   { "forget-passphrase",	OP_FORGET_PASSPHRASE,		"\006" },
   { "mail-key",			OP_MAIL_KEY,			"\033k" },
   { "decrypt-copy",		OP_DECRYPT_COPY,		NULL },
   { "decrypt-save",		OP_DECRYPT_SAVE,		NULL },
 #endif
-
-
-
   { NULL,			0,				NULL }
 };
 
 struct binding_t OpPager[] = {
   { "create-alias",	OP_CREATE_ALIAS,		"a" },
@@ -158,11 +153,11 @@
   { "edit",		OP_EDIT_MESSAGE,		"e" },
   { "edit-type",	OP_EDIT_TYPE,			"\005" },
   { "forward-message",	OP_FORWARD_MESSAGE,		"f" },
   { "flag-message",	OP_FLAG_MESSAGE,		"F" },
   { "group-reply",	OP_GROUP_REPLY,			"g" },
-  { "display-toggle-weed",	OP_DISPLAY_HEADERS,		"h" },
+  { "display-toggle-weed",OP_DISPLAY_HEADERS,		"h" },
   { "next-undeleted",	OP_MAIN_NEXT_UNDELETED,		"j" },
   { "next-entry",	OP_NEXT_ENTRY,			"J" },
   { "previous-undeleted",OP_MAIN_PREV_UNDELETED,	"k" },
   { "previous-entry",	OP_PREV_ENTRY,			"K" },
   { "list-reply",	OP_LIST_REPLY,			"L" },
@@ -213,31 +208,23 @@
   { "previous-unread",	OP_MAIN_PREV_UNREAD,		NULL },
   { "half-up",		OP_HALF_UP,			NULL },
   { "half-down",	OP_HALF_DOWN,			NULL },
   { "previous-line",	OP_PREV_LINE,			NULL },
   { "parent-message",	OP_MAIN_PARENT_MESSAGE,		"P" },
-
-
-
-
 #ifdef HAVE_PGP
   { "extract-keys",	OP_EXTRACT_KEYS,		"\013" },
   { "forget-passphrase",OP_FORGET_PASSPHRASE,		"\006" },
   { "mail-key",		OP_MAIL_KEY,			"\033k" },
-  { "decrypt-copy",		OP_DECRYPT_COPY,		NULL },
-  { "decrypt-save",		OP_DECRYPT_SAVE,		NULL },
+  { "decrypt-copy",	OP_DECRYPT_COPY,		NULL },
+  { "decrypt-save",	OP_DECRYPT_SAVE,		NULL },
 #endif
-
-
-
-
   { NULL,		0,				NULL }
 };
 
 struct binding_t OpAttach[] = {
   { "bounce-message",	OP_BOUNCE_MESSAGE,		"b" },
-  { "display-toggle-weed",	OP_DISPLAY_HEADERS,		"h" },
+  { "display-toggle-weed",OP_DISPLAY_HEADERS,		"h" },
   { "edit-type",	OP_EDIT_TYPE,			"\005" },
   { "print-entry",	OP_PRINT,			"p" },
   { "save-entry",	OP_SAVE,			"s" },
   { "pipe-entry",	OP_PIPE,			"|" },
   { "view-mailcap",	OP_ATTACH_VIEW_MAILCAP,		"m" },
@@ -248,19 +235,13 @@
   { "forward-message",	OP_FORWARD_MESSAGE,		"f" },
   { "view-text",	OP_ATTACH_VIEW_TEXT,		"T" },
   { "view-attach",	OP_VIEW_ATTACH,			M_ENTER_S },
   { "delete-entry",	OP_DELETE,			"d" },
   { "undelete-entry",	OP_UNDELETE,			"u" },
-
-
-
 #ifdef HAVE_PGP
   { "extract-keys",	OP_EXTRACT_KEYS,		"\013" },
 #endif
-
-
-
   { NULL,		0,				NULL }
 };
 
 struct binding_t OpCompose[] = {
   { "attach-file",	OP_COMPOSE_ATTACH_FILE,		"a" },
@@ -278,11 +259,11 @@
   { "edit-encoding",	OP_COMPOSE_EDIT_ENCODING,	"\005" },
   { "edit-from",	OP_COMPOSE_EDIT_FROM,		"\033f" },
   { "edit-fcc",		OP_COMPOSE_EDIT_FCC,		"f" },
   { "filter-entry",	OP_FILTER,			"F" },
   { "get-attachment",	OP_COMPOSE_GET_ATTACHMENT,	"G" },
-  { "display-toggle-weed",	OP_DISPLAY_HEADERS,		"h" },
+  { "display-toggle-weed",OP_DISPLAY_HEADERS,		"h" },
   { "ispell",		OP_COMPOSE_ISPELL,		"i" },
   { "print-entry",	OP_PRINT,			"l" },
   { "edit-mime",	OP_COMPOSE_EDIT_MIME,		"m" },
   { "new-mime",		OP_COMPOSE_NEW_MIME,		"n" },
   { "postpone-message",	OP_COMPOSE_POSTPONE_MESSAGE,	"P" },
@@ -292,26 +273,25 @@
   { "edit-to",		OP_COMPOSE_EDIT_TO,		"t" },
   { "edit-type",	OP_EDIT_TYPE,			"\024" },
   { "write-fcc",	OP_COMPOSE_WRITE_MESSAGE,	"w" },
   { "recode-attachment",OP_COMPOSE_RECODE,		NULL },
   { "toggle-unlink",	OP_COMPOSE_TOGGLE_UNLINK,	"u" },
-  { "toggle-recode",    OP_COMPOSE_TOGGLE_RECODE,	NULL },
+  { "toggle-recode",	OP_COMPOSE_TOGGLE_RECODE,	NULL },
   { "update-encoding",	OP_COMPOSE_UPDATE_ENCODING,	"U" },
   { "view-attach",	OP_VIEW_ATTACH,			M_ENTER_S },
   { "send-message",	OP_COMPOSE_SEND_MESSAGE,	"y" },
   { "pipe-entry",	OP_PIPE,			"|" },
-
 #ifdef HAVE_PGP
   { "attach-key",	OP_COMPOSE_ATTACH_KEY,		"\033k" },
-  { "forget-passphrase",OP_FORGET_PASSPHRASE,		"\006"  },
-  { "pgp-menu",		OP_COMPOSE_PGP_MENU,		"p" 	},
+  { "forget-passphrase",OP_FORGET_PASSPHRASE,		"\006" },
+  { "pgp-menu",		OP_COMPOSE_PGP_MENU,		"p" },
+  { "toggle-sign",	OP_COMPOSE_TOGGLE_SIGN,		"[" },
+  { "toggle-encrypt",	OP_COMPOSE_TOGGLE_ENCRYPT,	"]" },
 #endif
-
 #ifdef MIXMASTER
   { "mix",		OP_COMPOSE_MIX,			"M" },
 #endif
-  
   { NULL,		0,				NULL }
 };
 
 struct binding_t OpPost[] = {
   { "delete-entry",	OP_DELETE,	"d" },
@@ -322,22 +302,23 @@
 /* The file browser */
 struct binding_t OpBrowser[] = {
   { "change-dir",	OP_CHANGE_DIRECTORY,	"c" },
   { "display-filename",	OP_BROWSER_TELL,	"@" },
   { "enter-mask",	OP_ENTER_MASK,		"m" },
+  { "choose-dir",	OP_CHOOSE_DIRECTORY,	"C" },
   { "sort",		OP_SORT,		"o" },
   { "sort-reverse",	OP_SORT_REVERSE,	"O" },
   { "select-new",	OP_BROWSER_NEW_FILE,	"N" },
   { "check-new",	OP_CHECK_NEW,		NULL },
-  { "toggle-mailboxes", OP_TOGGLE_MAILBOXES, 	"\t" },
+  { "toggle-mailboxes",	OP_TOGGLE_MAILBOXES,	"\t" },
   { "view-file",	OP_BROWSER_VIEW_FILE,	" " },
 #ifdef USE_IMAP
-  { "new-mailbox",      OP_NEW_MAILBOX,         "n" },
-  { "delete-mailbox",   OP_DELETE_MAILBOX,      "d" },
+  { "new-mailbox",	OP_NEW_MAILBOX,		"n" },
+  { "delete-mailbox",	OP_DELETE_MAILBOX,	"d" },
   { "subscribe",	OP_BROWSER_SUBSCRIBE,	"s" },
   { "unsubscribe",	OP_BROWSER_UNSUBSCRIBE,	"u" },
-  { "toggle-subscribed", OP_BROWSER_TOGGLE_LSUB, "T" },
+  { "toggle-subscribed",OP_BROWSER_TOGGLE_LSUB,	"T" },
 #endif
   { NULL,		0,			NULL }
 };
 
 /* External Query Menu */
@@ -354,11 +335,12 @@
   { "backward-char",	OP_EDITOR_BACKWARD_CHAR,	"\002" },
   { "delete-char",	OP_EDITOR_DELETE_CHAR,		"\004" },
   { "eol",		OP_EDITOR_EOL,			"\005" },
   { "forward-char",	OP_EDITOR_FORWARD_CHAR,		"\006" },
   { "backspace",	OP_EDITOR_BACKSPACE,		"\010" },
-  { "kill-eol",		OP_EDITOR_KILL_EOL,		"\013" },
+  { "kill-bol",		OP_EDITOR_KILL_BOL,		"\013" },
+  { "kill-eol",		OP_EDITOR_KILL_EOL,		NULL },
   { "kill-line",	OP_EDITOR_KILL_LINE,		"\025" },
   { "quote-char",	OP_EDITOR_QUOTE_CHAR,		"\026" },
   { "kill-word",	OP_EDITOR_KILL_WORD,		"\027" },
   { "complete",		OP_EDITOR_COMPLETE,		"\t" },
   { "complete-query",	OP_EDITOR_COMPLETE_QUERY,	"\024" },
@@ -366,27 +348,24 @@
   { "history-up",	OP_EDITOR_HISTORY_UP,		NULL },
   { "history-down",	OP_EDITOR_HISTORY_DOWN,		NULL },
   { NULL,		0,				NULL }
 };
 
-
-
 #ifdef HAVE_PGP
 struct binding_t OpPgp[] = {
   { "verify-key",	OP_VERIFY_KEY,		"c" },
   { "view-name",	OP_VIEW_ID,		"%" },
-  { NULL,		0,				NULL }
+  { NULL,		0,			NULL }
 };
 #endif /* HAVE_PGP */
 
-
 #ifdef MIXMASTER
 struct binding_t OpMix[] = {
-  { "accept",		OP_MIX_USE,	M_ENTER_S },
-  { "append",		OP_MIX_APPEND,	"a"       },
-  { "insert",		OP_MIX_INSERT,	"i"       },
-  { "delete",		OP_MIX_DELETE,  "d"	  },
-  { "chain-prev",	OP_MIX_CHAIN_PREV, "<left>" },
-  { "chain-next",	OP_MIX_CHAIN_NEXT, "<right>" },
-  { NULL, 		0, 		NULL }
+  { "accept",		OP_MIX_USE,		M_ENTER_S },
+  { "append",		OP_MIX_APPEND,		"a" },
+  { "insert",		OP_MIX_INSERT,		"i" },
+  { "delete",		OP_MIX_DELETE,		"d" },
+  { "chain-prev",	OP_MIX_CHAIN_PREV,	"<left>" },
+  { "chain-next",	OP_MIX_CHAIN_NEXT,	"<right>" },
+  { NULL,		0,			NULL }
 };
 #endif /* MIXMASTER */
--- orig-globals.h	Fri Mar  3 02:10:08 2000
+++ globals.h	Sun Nov 26 00:17:06 2000
@@ -119,10 +119,13 @@
 #else
 extern unsigned char QuadOptions[];
 #endif
 
 WHERE unsigned short Counter INITVAL (0);
+WHERE unsigned short InfoDelay INITVAL (1000);
+WHERE unsigned short WarnDelay INITVAL (2000);
+WHERE unsigned short ErrorDelay INITVAL (5000);
 
 WHERE short HistSize;
 WHERE short PagerContext;
 WHERE short PagerIndexLines;
 WHERE short PopPort;
--- orig-hdrline.c	Fri Mar  3 02:10:08 2000
+++ hdrline.c	Sun Nov 26 00:17:06 2000
@@ -357,11 +357,12 @@
 		len -= 2;
 	      }
 	      else
 		break; /* not enough space */
 	    }
-	    cp++;
+	    if(*cp)
+	      cp++;
 	  }
 	  else
 	  {
 	    *p++ = *cp++;
 	    len--;
@@ -397,11 +398,11 @@
 	if (do_locales)
 	  setlocale (LC_TIME, "C");
 
 	snprintf (fmt, sizeof (fmt), "%%%ss", prefix);
 	snprintf (dest, destlen, fmt, buf2);
-	if (len > 0 && op != 'd')
+	if (len > 0 && op != 'd' && op != 'D')
 	  src = cp + 1;
       }
       break;
 
     case 'f':
--- orig-hook.c	Tue May 16 08:23:12 2000
+++ hook.c	Sun Nov 26 13:24:28 2000
@@ -268,11 +268,12 @@
       {
 	if (mutt_parse_rc_line (tmp->command, &token, &err) == -1)
 	{
 	  mutt_error ("%s", err.data);
 	  FREE (&token.data);
-	  sleep (1);	/* pause a moment to let the user see the error */
+	  if (WarnDelay)
+	    usleep (1000UL * WarnDelay);	/* pause a moment to let the user see the error */
 	  return;
 	}
       }
     }
   }
@@ -310,11 +311,12 @@
       if ((mutt_pattern_exec (hook->pattern, 0, NULL, hdr) > 0) ^ hook->rx.not)
 	if (mutt_parse_rc_line (hook->command, &token, &err) != 0)
 	{
 	  FREE (&token.data);
 	  mutt_error ("%s", err.data);
-	  sleep (1);
+	  if (WarnDelay)
+	    usleep (1000UL * WarnDelay);
 	  return;
 	}
   }
   FREE (&token.data);
 }
--- orig-init.c	Sat Apr 22 02:27:07 2000
+++ init.c	Sun Nov 26 13:23:03 2000
@@ -1147,11 +1147,14 @@
       }
       s->dptr++;
       mutt_extract_token (tmp, s , 0);
 
       if (parse_sort ((short *) MuttVars[idx].data, tmp->data, map, err) == -1)
+      {
+	r = -1;
 	break;
+      }
     }
     else
     {
       snprintf (err->data, err->dsize, _("%s: unknown type"), MuttVars[idx].option);
       r = -1;
@@ -1193,10 +1196,12 @@
   while ((linebuf = mutt_read_line (linebuf, &buflen, f, &line)) != NULL)
   {
     if (mutt_parse_rc_line (linebuf, &token, err) == -1)
     {
       mutt_error (_("Error in %s, line %d: %s"), rcfile, line, err->data);
+      if (InfoDelay)
+	usleep (1000UL * InfoDelay);
       if (--rc < -MAXERRS)
         break;
     }
     else
       if (rc < 0)
@@ -1210,10 +1215,12 @@
   if (rc)
   {
     /* the muttrc source keyword */
     snprintf (err->data, err->dsize, rc >= -MAXERRS ? _("source: errors in %s")
       : _("source: reading aborted due too many errors in %s"), rcfile);
+    if (WarnDelay)
+      usleep (1000UL * WarnDelay);
     rc = -1;
   }
   return (rc);
 }
 
--- orig-init.h	Tue Jul 18 00:47:08 2000
+++ init.h	Sun Nov 26 00:17:06 2000
@@ -420,10 +420,19 @@
   ** to sendmail command using the "-f" command line switch, so don't set this
   ** option if you are using that switch in $$sendmail yourself,
   ** or if the sendmail on your machine doesn't support that command
   ** line switch.
   */
+  { "error_delay",	DT_NUM,	 R_NONE, UL &ErrorDelay, 5000 },
+  /*
+  ** .pp
+  ** If set to a value greater than 0, Mutt will sleep for that many
+  ** thousandths of a second after showing an error message.  If set
+  ** to 0, Mutt is allowed to optimize the error message away entirely.
+  ** .pp
+  ** Also see the ``$$info_delay'' and ``$$warn_delay'' variables.
+  */
   { "escape",		DT_STR,	 R_NONE, UL &EscChar, UL "~" },
   /*
   ** .pp
   ** Escape character to use for functions in the builtin editor.
   */
@@ -832,10 +841,20 @@
   ** .       character "X"
   ** .te
   ** .pp
   ** See also: ``$$to_chars''.
   */
+  { "info_delay",	DT_NUM,	 R_NONE, UL &InfoDelay, 1000 },
+  /*
+  ** .pp
+  ** If set to a value greater than 0, Mutt will sleep for that many
+  ** thousandths of a second after showing an informational message.
+  ** If set to 0, Mutt is allowed to optimize the informational message
+  ** away entirely.
+  ** .pp
+  ** Also see the ``$$error_delay'' and ``$$warn_delay'' variables.
+  */
   { "ispell",		DT_PATH, R_NONE, UL &Ispell, UL ISPELL },
   /*
   ** .pp
   ** How to invoke ispell (GNU's spell-checking software).
   */
@@ -2092,10 +2111,19 @@
   ** that the corresponding mailcap entry has a \fIneedsterminal\fP flag,
   ** and the external program is interactive.
   ** .pp
   ** When set, Mutt will always ask for a key. When unset, Mutt will wait
   ** for a key only if the external command returned a non-zero status.
+  */
+  { "warn_delay",	DT_NUM,	 R_NONE, UL &WarnDelay, 2000 },
+  /*
+  ** .pp
+  ** If set to a value greater than 0, Mutt will sleep for that many
+  ** thousandths of a second after showing a warning message.  If set
+  ** to 0, Mutt is allowed to optimize the warning message away entirely.
+  ** .pp
+  ** Also see the ``$$error_delay'' and ``$$info_delay'' variables.
   */
   { "weed",		DT_BOOL, R_NONE, OPTWEED, 1 },
   /*
   ** .pp
   ** When set, mutt will weed headers when when displaying, forwarding,
--- orig-keymap.c	Sat Mar 25 10:22:09 2000
+++ keymap.c	Sun Nov 26 00:17:06 2000
@@ -516,49 +516,46 @@
 }
 
 void km_init (void)
 {
   memset (Keymaps, 0, sizeof (struct keymap_t *) * MENU_MAX);
+}
 
+void km_init_bind (void)
+{
+  /* basic bindings for each menu */
   create_bindings (OpAttach, MENU_ATTACH);
   create_bindings (OpBrowser, MENU_FOLDER);
   create_bindings (OpCompose, MENU_COMPOSE);
   create_bindings (OpMain, MENU_MAIN);
   create_bindings (OpPager, MENU_PAGER);
   create_bindings (OpPost, MENU_POST);
   create_bindings (OpQuery, MENU_QUERY);
-
-
-
 #ifdef HAVE_PGP
   create_bindings (OpPgp, MENU_PGP);
 #endif
-
 #ifdef MIXMASTER
   create_bindings (OpMix, MENU_MIX);
-  
   km_bindkey ("<space>", MENU_MIX, OP_GENERIC_SELECT_ENTRY);
   km_bindkey ("h", MENU_MIX, OP_MIX_CHAIN_PREV);
   km_bindkey ("l", MENU_MIX, OP_MIX_CHAIN_NEXT);
 #endif
-  
+
   /* bindings for the line editor */
   create_bindings (OpEditor, MENU_EDITOR);
-  
   km_bindkey ("<up>", MENU_EDITOR, OP_EDITOR_HISTORY_UP);
   km_bindkey ("<down>", MENU_EDITOR, OP_EDITOR_HISTORY_DOWN);
   km_bindkey ("<left>", MENU_EDITOR, OP_EDITOR_BACKWARD_CHAR);
   km_bindkey ("<right>", MENU_EDITOR, OP_EDITOR_FORWARD_CHAR);
   km_bindkey ("<home>", MENU_EDITOR, OP_EDITOR_BOL);
   km_bindkey ("<end>", MENU_EDITOR, OP_EDITOR_EOL);
   km_bindkey ("<backspace>", MENU_EDITOR, OP_EDITOR_BACKSPACE);
   km_bindkey ("<delete>", MENU_EDITOR, OP_EDITOR_BACKSPACE);
   km_bindkey ("\177", MENU_EDITOR, OP_EDITOR_BACKSPACE);
-  
+
   /* generic menu keymap */
   create_bindings (OpGeneric, MENU_GENERIC);
-  
   km_bindkey ("<home>", MENU_GENERIC, OP_FIRST_ENTRY);
   km_bindkey ("<end>", MENU_GENERIC, OP_LAST_ENTRY);
   km_bindkey ("<pagedown>", MENU_GENERIC, OP_NEXT_PAGE);
   km_bindkey ("<pageup>", MENU_GENERIC, OP_PREV_PAGE);
   km_bindkey ("<right>", MENU_GENERIC, OP_NEXT_PAGE);
@@ -572,24 +569,22 @@
   km_bindkey ("5", MENU_GENERIC, OP_JUMP);
   km_bindkey ("6", MENU_GENERIC, OP_JUMP);
   km_bindkey ("7", MENU_GENERIC, OP_JUMP);
   km_bindkey ("8", MENU_GENERIC, OP_JUMP);
   km_bindkey ("9", MENU_GENERIC, OP_JUMP);
-
   km_bindkey ("<enter>", MENU_GENERIC, OP_GENERIC_SELECT_ENTRY);
 
-  /* Miscellaneous extra bindings */
-  
+  /* index menu keymap */
   km_bindkey (" ", MENU_MAIN, OP_DISPLAY_MESSAGE);
   km_bindkey ("<up>", MENU_MAIN, OP_MAIN_PREV_UNDELETED);
   km_bindkey ("<down>", MENU_MAIN, OP_MAIN_NEXT_UNDELETED);
   km_bindkey ("J", MENU_MAIN, OP_NEXT_ENTRY);
   km_bindkey ("K", MENU_MAIN, OP_PREV_ENTRY);
   km_bindkey ("x", MENU_MAIN, OP_EXIT);
-
   km_bindkey ("<enter>", MENU_MAIN, OP_DISPLAY_MESSAGE);
 
+  /* pager menu keymap */
   km_bindkey ("x", MENU_PAGER, OP_EXIT);
   km_bindkey ("i", MENU_PAGER, OP_EXIT);
   km_bindkey ("<backspace>", MENU_PAGER, OP_PREV_LINE);
   km_bindkey ("<pagedown>", MENU_PAGER, OP_NEXT_PAGE);
   km_bindkey ("<pageup>", MENU_PAGER, OP_PREV_PAGE);
@@ -606,20 +601,22 @@
   km_bindkey ("5", MENU_PAGER, OP_JUMP);
   km_bindkey ("6", MENU_PAGER, OP_JUMP);
   km_bindkey ("7", MENU_PAGER, OP_JUMP);
   km_bindkey ("8", MENU_PAGER, OP_JUMP);
   km_bindkey ("9", MENU_PAGER, OP_JUMP);
-
   km_bindkey ("<enter>", MENU_PAGER, OP_NEXT_LINE);
   
+  /* alias menu keymap */
   km_bindkey ("<return>", MENU_ALIAS, OP_GENERIC_SELECT_ENTRY);
   km_bindkey ("<enter>",  MENU_ALIAS, OP_GENERIC_SELECT_ENTRY);
   km_bindkey ("<space>", MENU_ALIAS, OP_TAG);
 
+  /* attach menu keymap */
   km_bindkey ("<enter>", MENU_ATTACH, OP_VIEW_ATTACH);
-  km_bindkey ("<enter>", MENU_COMPOSE, OP_VIEW_ATTACH);
 
+  /* compose menu keymap */
+  km_bindkey ("<enter>", MENU_COMPOSE, OP_VIEW_ATTACH);
   /* edit-to (default "t") hides generic tag-entry in Compose menu
      This will bind tag-entry to  "T" in the Compose menu */
   km_bindkey ("T", MENU_COMPOSE, OP_TAG);
 }
 
--- orig-keymap.h	Fri Mar  3 02:10:09 2000
+++ keymap.h	Sun Nov 26 00:17:06 2000
@@ -43,10 +43,11 @@
 
 char *km_keyname (int);
 int km_expand_key (char *, size_t, struct keymap_t *);
 struct keymap_t *km_find_func (int, int);
 void km_init (void);
+void km_init_bind (void);
 void km_error_key (int);
 
 enum
 {
   MENU_ALIAS,
--- orig-lib.c	Tue May 16 08:23:12 2000
+++ lib.c	Sun Nov 26 00:17:06 2000
@@ -343,11 +343,12 @@
 int safe_open (const char *path, int flags)
 {
   struct stat osb, nsb;
   int fd;
 
-  if ((fd = open (path, flags, 0600)) < 0)
+/* This should differentiate between temporary files and truly-saved files, and be 0600 in the first case and 0666 in the latter */
+  if ((fd = open (path, flags, 0666)) < 0)
     return fd;
 
   /* make sure the file is not symlink */
   if (lstat (path, &osb) < 0 || fstat (fd, &nsb) < 0 ||
       compare_stat(&osb, &nsb) == -1)
--- orig-main.c	Tue Jun 20 23:28:20 2000
+++ main.c	Sun Nov 26 00:17:06 2000
@@ -98,13 +98,13 @@
 
 static void mutt_usage (void)
 {
   printf ("Mutt %s (%s)\n", MUTT_VERSION, ReleaseDate);
   puts _(
-"usage: mutt [ -nRzZ ] [ -e <cmd> ] [ -F <file> ] [ -m <type> ] [ -f <file> ]\n\
-       mutt [ -nx ] [ -e <cmd> ] [ -a <file> ] [ -F <file> ] [ -H <file> ] [ -i <file> ] [ -s <subj> ] [ -b <addr> ] [ -c <addr> ] <addr> [ ... ]\n\
-       mutt [ -n ] [ -e <cmd> ] [ -F <file> ] -p\n\
+"usage: mutt [ -nNRzZ ] [ -e <cmd> ] [ -F <file> ] [ -m <type> ] [ -f <file> ]\n\
+       mutt [ -nNx ] [ -e <cmd> ] [ -a <file> ] [ -F <file> ] [ -H <file> ] [ -i <file> ] [ -s <subj> ] [ -b <addr> ] [ -c <addr> ] <addr> [ ... ]\n\
+       mutt [ -nN ] [ -e <cmd> ] [ -F <file> ] -p\n\
        mutt -v[v]\n\
 \n\
 options:\n\
   -a <file>\tattach a file to the message\n\
   -b <address>\tspecify a blind carbon-copy (BCC) address\n\
@@ -114,10 +114,11 @@
   -F <file>\tspecify an alternate muttrc file\n\
   -H <file>\tspecify a draft file to read header from\n\
   -i <file>\tspecify a file which Mutt should include in the reply\n\
   -m <type>\tspecify a default mailbox type\n\
   -n\t\tcauses Mutt not to read the system Muttrc\n\
+  -N\t\tcauses Mutt not to apply the standard keybindings\n\
   -p\t\trecall a postponed message\n\
   -R\t\topen mailbox in read-only mode\n\
   -s <subj>\tspecify a subject (must be in quotes if it has spaces)\n\
   -v\t\tshow version and compile-time definitions\n\
   -x\t\tsimulate the mailx send mode\n\
@@ -163,15 +164,12 @@
 #ifdef DEBUG
   puts ("+DEBUG");
 #else
   puts ("-DEBUG");
 #endif
-  
 
-  
   puts (
-
 #ifdef HOMESPOOL
 	"+HOMESPOOL  "
 #else
 	"-HOMESPOOL  "
 #endif
@@ -234,13 +232,12 @@
 #ifdef USE_GNU_REGEX
 	"+USE_GNU_REGEX  "
 #else
 	"-USE_GNU_REGEX  "
 #endif
-
-	"\n"
-	
+	);
+  puts (
 #ifdef HAVE_COLOR
 	"+HAVE_COLOR  "
 #else
 	"-HAVE_COLOR  "
 #endif
@@ -250,26 +247,26 @@
 #else
 	"-HAVE_PGP  "
 #endif
 
 #ifdef BUFFY_SIZE
-	"+BUFFY_SIZE "
+	"+BUFFY_SIZE  "
 #else
-	"-BUFFY_SIZE "
+	"-BUFFY_SIZE  "
 #endif
+
 #ifdef EXACT_ADDRESS
-	"+"
+	"+EXACT_ADDRESS  "
 #else
-	"-"
+	"-EXACT_ADDRESS  "
 #endif
-	"EXACT_ADDRESS  "
+
 #ifdef ENABLE_NLS
-	"+"
+	"+ENABLE_NLS"
 #else
-	"-"
+	"-ENABLE_NLS"
 #endif
-	"ENABLE_NLS"
 	);
 
   printf ("SENDMAIL=\"%s\"\n", SENDMAIL);
   printf ("MAILPATH=\"%s\"\n", MAILPATH);
   printf ("SHAREDIR=\"%s\"\n", SHAREDIR);
@@ -286,12 +283,10 @@
   exit (0);
 }
 
 static void start_curses (void)
 {
-  km_init (); /* must come before mutt_init */
-
 #ifdef USE_SLANG_CURSES
   SLtt_Ignore_Beep = 1; /* don't do that #*$@^! annoying visual beep! */
   SLsmg_Display_Eight_Bit = 128; /* characters above this are printable */
 #else
   /* should come before initscr() so that ncurses 4.2 doesn't try to install
@@ -322,10 +317,11 @@
 #define M_IGNORE  (1<<0)	/* -z */
 #define M_BUFFY   (1<<1)	/* -Z */
 #define M_NOSYSRC (1<<2)	/* -n */
 #define M_RO      (1<<3)	/* -R */
 #define M_SELECT  (1<<4)	/* -y */
+#define M_NOBIND  (1<<5)	/* -N */
 
 int main (int argc, char **argv)
 {
   char folder[_POSIX_PATH_MAX] = "";
   char *subject = NULL;
@@ -361,31 +357,21 @@
 
   setlocale (LC_CTYPE, "");
 
   mutt_error = mutt_nocurses_error;
   SRAND (time (NULL));
-  umask (077);
 
   memset (Options, 0, sizeof (Options));
   memset (QuadOptions, 0, sizeof (QuadOptions));
   
-  while ((i = getopt (argc, argv, "a:b:F:f:c:d:e:H:s:i:hm:npRvxyzZ")) != EOF)
+  while ((i = getopt (argc, argv, "a:b:c:d:e:f:F:H:i:hm:nNpRs:vxyzZ")) != EOF)
     switch (i)
     {
       case 'a':
 	attach = mutt_add_list (attach, optarg);
 	break;
 
-      case 'F':
-	mutt_str_replace (&Muttrc, optarg);
-	break;
-
-      case 'f':
-	strfcpy (folder, optarg, sizeof (folder));
-        explicit_folder = 1;
-	break;
-
       case 'b':
       case 'c':
 	if (!msg)
 	  msg = mutt_new_header ();
 	if (!msg->env)
@@ -407,10 +393,19 @@
 
       case 'e':
 	commands = mutt_add_list (commands, optarg);
 	break;
 
+      case 'f':
+	strfcpy (folder, optarg, sizeof (folder));
+	explicit_folder = 1;
+	break;
+
+      case 'F':
+	mutt_str_replace (&Muttrc, optarg);
+	break;
+
       case 'H':
 	draftFile = optarg;
 	break;
 
       case 'i':
@@ -424,10 +419,14 @@
 
       case 'n':
 	flags |= M_NOSYSRC;
 	break;
 
+      case 'N':
+	flags |= M_NOBIND;
+	break;
+
       case 'p':
 	sendflags |= SENDPOSTPONED;
 	break;
 
       case 'R':
@@ -487,11 +486,16 @@
   }
 
   /* This must come before mutt_init() because curses needs to be started
      before calling the init_pair() function to set the color scheme.  */
   if (!option (OPTNOCURSES))
+  {
+    km_init ();
+    if (!(flags & M_NOBIND))
+      km_init_bind ();
     start_curses ();
+  }
 
   /* set defaults and read init files */
   mutt_init (flags & M_NOSYSRC, commands);
   mutt_free_list (&commands);
 
@@ -707,11 +711,13 @@
        || !explicit_folder)
     {
       mutt_index_menu ();
       if (Context)
 	safe_free ((void **)&Context);
+      mutt_endwin (NULL);
     }
-    mutt_endwin (Errorbuf);
+    else
+      mutt_endwin (Errorbuf);
   }
 
   exit (0);
 }
--- orig-mbox.c	Wed Jun 21 04:52:20 2000
+++ mbox.c	Tue Dec 19 12:46:10 2000
@@ -730,12 +730,15 @@
     if (-1 != i)
     {
       close (i);
       unlink (tempfile);
     }
-    mutt_error _("Could not create temporary file!");
-    sleep (5);
+    if (ErrorDelay)
+    {
+      mutt_error _("Could not create temporary file!");
+      usleep (1000UL * ErrorDelay);
+    }
     goto bail;
   }
 
   /* find the first deleted/changed message.  we save a lot of time by only
    * rewriting the mailbox from the point where it has actually changed.
@@ -747,12 +750,15 @@
   { 
     /* this means ctx->changed or ctx->deleted was set, but no
      * messages were found to be changed or deleted.  This should
      * never happen, is we presume it is a bug in mutt.
      */
-    mutt_error _("sync: mbox modified, but no modified messages! (report this bug)");
-    sleep(5); /* the mutt_error /will/ get cleared! */
+    if (ErrorDelay)
+    {
+      mutt_error _("sync: mbox modified, but no modified messages! (report this bug)");
+      usleep (1000UL * ErrorDelay); /* the mutt_error /will/ get cleared! */
+    }
     dprint(1, (debugfile, "mbox_sync_mailbox(): no modified messages.\n"));
     unlink (tempfile);
     goto bail;
   }
 
@@ -796,22 +802,24 @@
       if (ctx->magic == M_MMDF)
       {
 	if (fputs (MMDF_SEP, fp) == EOF)
 	{
 	  mutt_perror (tempfile);
-	  sleep (5);
+	  if (ErrorDelay)
+	    usleep (1000UL * ErrorDelay);
 	  unlink (tempfile);
 	  goto bail;
 	}
 	  
       }
       else if (ctx->magic == M_KENDRA)
       {
 	if (fputs (KENDRA_SEP, fp) == EOF)
 	{
 	  mutt_perror (tempfile);
-	  sleep (5);
+	  if (ErrorDelay)
+	    usleep (1000UL * ErrorDelay);
 	  unlink (tempfile);
 	  goto bail;
 	}
       }
 
@@ -822,11 +830,12 @@
       newOffset[i - first].hdr = ftell (fp) + offset;
 
       if (mutt_copy_message (fp, ctx, ctx->hdrs[i], M_CM_UPDATE, CH_FROM | CH_UPDATE | CH_UPDATE_LEN) == -1)
       {
 	mutt_perror (tempfile);
-	sleep (5);
+	if (ErrorDelay)
+	  usleep (1000UL * ErrorDelay);
 	unlink (tempfile);
 	goto bail;
       }
 
       /* Since messages could have been deleted, the offsets stored in memory
@@ -842,29 +851,32 @@
       {
 	case M_MMDF: 
 	  if(fputs(MMDF_SEP, fp) == EOF) 
 	  {
 	    mutt_perror (tempfile);
-	    sleep (5);
+	    if (ErrorDelay)
+	      usleep (1000UL * ErrorDelay);
 	    unlink (tempfile);
 	    goto bail; 
 	  }
 	  break;
 	case M_KENDRA:
 	  if(fputs(KENDRA_SEP, fp) == EOF)
 	  {
 	    mutt_perror (tempfile);
-	    sleep (5);
+	    if (ErrorDelay)
+	      usleep (1000UL * ErrorDelay);
 	    unlink (tempfile);
 	    goto bail;
 	  }
 	  break;
 	default:
 	  if(fputs("\n", fp) == EOF) 
 	  {
 	    mutt_perror (tempfile);
-	    sleep (5);
+	    if (ErrorDelay)
+	      usleep (1000UL * ErrorDelay);
 	    unlink (tempfile);
 	    goto bail;
 	  }
       }
     }
@@ -874,31 +886,34 @@
   {
     fp = NULL;
     dprint(1, (debugfile, "mbox_sync_mailbox: fclose() returned non-zero.\n"));
     unlink (tempfile);
     mutt_perror (tempfile);
-    sleep (5);
+    if (ErrorDelay)
+      usleep (1000UL * ErrorDelay);
     goto bail;
   }
   fp = NULL;
 
   /* Save the state of this folder. */
   if (stat (ctx->path, &statbuf) == -1)
   {
     mutt_perror (ctx->path);
-    sleep (5);
+    if (ErrorDelay)
+      usleep (1000UL * ErrorDelay);
     unlink (tempfile);
     goto bail;
   }
 
   if ((fp = fopen (tempfile, "r")) == NULL)
   {
     mutt_unblock_signals ();
     mx_fastclose_mailbox (ctx);
     dprint (1, (debugfile, "mbox_sync_mailbox: unable to reopen temp copy of mailbox!\n"));
     mutt_perror (tempfile);
-    sleep (5);
+    if (ErrorDelay)
+      usleep (1000UL * ErrorDelay);
     return (-1);
   }
 
   if (fseek (ctx->fp, offset, SEEK_SET) != 0 ||  /* seek the append location */
       /* do a sanity check to make sure the mailbox looks ok */
@@ -951,12 +966,15 @@
 	      NONULL (Tempdir), NONULL(Username), NONULL(Hostname), getpid ());
     rename (tempfile, savefile);
     mutt_unblock_signals ();
     mx_fastclose_mailbox (ctx);
     mutt_pretty_mailbox (savefile);
-    mutt_error (_("Write failed!  Saved partial mailbox to %s"), savefile);
-    sleep (5);
+    if (ErrorDelay)
+    {
+      mutt_error (_("Write failed!  Saved partial mailbox to %s"), savefile);
+      usleep (1000UL * ErrorDelay);
+    }
     return (-1);
   }
 
   /* Restore the previous access/modification times */
   utimebuf.actime = statbuf.st_atime;
--- orig-menu.c	Fri Mar  3 02:10:10 2000
+++ menu.c	Tue Dec 19 12:40:42 2000
@@ -24,10 +24,11 @@
 #include "imap.h"
 #endif
 
 #include <string.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 static void print_enriched_string (int attr, unsigned char *s, int do_color)
 {
   while (*s)
   {
@@ -297,11 +298,12 @@
 {
   if (menu->dialog) 
   {
     if (option (OPTMSGERR)) 
     {
-      sleep (1);
+      if (ErrorDelay)
+	usleep (1000UL * ErrorDelay);
       unset_option (OPTMSGERR);
     }
 
     if (*Errorbuf)
       mutt_clear_error ();
--- orig-mx.c	Thu Jun 15 14:07:07 2000
+++ mx.c	Tue Dec 19 12:40:18 2000
@@ -185,12 +185,15 @@
       return (-1);
     }
 
     prev_sb = sb;
 
-    mutt_message (_("Waiting for fcntl lock... %d"), ++attempt);
-    sleep (1);
+    if (InfoDelay)
+    {
+      mutt_message (_("Waiting for fcntl lock... %d"), ++attempt);
+      usleep (1000UL * InfoDelay);
+    }
   }
 #endif /* USE_FCNTL */
 
 #ifdef USE_FLOCK
   count = 0;
@@ -220,12 +223,15 @@
       break;
     }
 
     prev_sb = sb;
 
-    mutt_message (_("Waiting for flock attempt... %d"), ++attempt);
-    sleep (1);
+    if (InfoDelay)
+    {
+      mutt_message (_("Waiting for flock attempt... %d"), ++attempt);
+      usleep (1000UL * InfoDelay);
+    }
   }
 #endif /* USE_FLOCK */
 
 #ifdef USE_DOTLOCK
   if (r == 0 && dot)
@@ -1074,19 +1080,21 @@
   else
 #endif
     rc = sync_mailbox (ctx, index_hint);
   if (rc == 0)
   {
+    if (InfoDelay)
+    {
 #ifdef USE_IMAP
-    if (ctx->magic == M_IMAP && !purge)
-      mutt_message (_("%d kept."), ctx->msgcount);
-    else
+      if (ctx->magic == M_IMAP && !purge)
+	mutt_message (_("%d kept."), ctx->msgcount);
+      else
 #endif
-    mutt_message (_("%d kept, %d deleted."), ctx->msgcount - ctx->deleted,
-      ctx->deleted);
-
-    sleep (1); /* allow the user time to read the message */
+      mutt_message (_("%d kept, %d deleted."), ctx->msgcount - ctx->deleted,
+	ctx->deleted);
+      usleep (1000UL * InfoDelay);
+    }
 
     if (ctx->msgcount == ctx->deleted &&
 	(ctx->magic == M_MBOX || ctx->magic == M_MMDF) &&
 	!mutt_is_spool(ctx->path) && !option (OPTSAVEEMPTY))
     {
--- orig-pager.c	Sat Apr 22 01:25:20 2000
+++ pager.c	Sun Nov 26 00:17:06 2000
@@ -729,11 +729,13 @@
       }
     }
   }
   else if (mutt_strncmp ("[-- ", buf, 4) == 0)
     lineInfo[n].type = MT_COLOR_ATTACHMENT;
-  else if (mutt_strcmp ("-- \n", buf) == 0 || mutt_strcmp ("-- \r\n", buf) == 0)
+  else if (mutt_strcmp ("-- \n", buf) == 0 || mutt_strcmp ("-- \r\n", buf) == 0
+    || mutt_strncmp("----------------------------------------", buf, 40) == 0
+    || mutt_strncmp("________________________________________", buf, 40) == 0)
   {
     i = n + 1;
 
     lineInfo[n].type = MT_COLOR_SIGNATURE;
     while (i < last && check_sig (buf, lineInfo, i - 1) == 0 &&
--- orig-pgpkey.c	Mon Jul 10 03:33:17 2000
+++ pgpkey.c	Thu Nov 30 16:47:45 2000
@@ -612,10 +612,12 @@
   FOREVER
   {
     resp[0] = 0;
     if (mutt_get_field (tag, resp, sizeof (resp), M_CLEAR) != 0)
       return NULL;
+    if (!*resp)
+      return NULL;
 
     if (whatfor)
     {
       if (l)
 	mutt_str_replace (&l->dflt, resp);
--- orig-send.c	Mon Mar 13 14:36:56 2000
+++ send.c	Sun Nov 26 00:17:06 2000
@@ -1129,11 +1129,12 @@
 
     if (option (OPTHDRS))
       process_user_recips (msg->env);
 
     if (! (flags & SENDMAILX) &&
-	! (option (OPTAUTOEDIT) && option (OPTEDITHDRS)) &&
+	! (option (OPTAUTOEDIT)) &&
+	! (option (OPTEDITHDRS)) &&
 	! ((flags & SENDREPLY) && option (OPTFASTREPLY)))
     {
       if (edit_envelope (msg->env) == -1)
 	goto cleanup;
     }
--- orig-sendlib.c	Fri May 19 23:38:59 2000
+++ sendlib.c	Sun Nov 26 00:17:06 2000
@@ -2012,11 +2012,12 @@
   /* (postponment) save the Fcc: using a special X-Mutt- header so that
    * it can be picked up when the message is recalled 
    */
   if (post && fcc)
     fprintf (msg->fp, "X-Mutt-Fcc: %s\n", fcc);
-  fprintf (msg->fp, "Status: RO\n");
+  if (f.magic != M_MAILDIR)
+    fprintf (msg->fp, "Status: RO\n");
 
 
 
 #ifdef HAVE_PGP
   /* (postponment) if the mail is to be signed or encrypted, save this info */
--- orig-sort.c	Wed Mar 22 00:24:45 2000
+++ sort.c	Tue Dec 19 12:36:59 2000
@@ -228,11 +228,12 @@
   }
   else if ((sortfunc = mutt_get_sort_func (Sort)) == NULL ||
 	   (AuxSort = mutt_get_sort_func (SortAux)) == NULL)
   {
     mutt_error _("Could not find sorting function! [report this bug]");
-    sleep (1);
+    if (ErrorDelay)
+      usleep (1000UL * ErrorDelay);
     return;
   }
   else 
     qsort ((void *) ctx->hdrs, ctx->msgcount, sizeof (HEADER *), sortfunc);
 
