Index: buffy.c
===================================================================
RCS file: /home/roessler/cvs/mutt/buffy.c,v
retrieving revision 2.15
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.15 buffy.c
--- buffy.c	2000/08/21 15:42:20	2.15
+++ buffy.c	2000/09/19 02:06:01
@@ -100,7 +100,7 @@ int test_last_status_new (FILE * f)
 
   hdr = mutt_new_header ();
   mutt_read_rfc822_header (f, hdr, 0, 0);
-  if (!(hdr->read || hdr->old))
+  if (!(hdr->read || (option(OPTSEEOLD) && hdr->old)))
     result = 1;
   mutt_free_header (&hdr);
 
Index: curs_main.c
===================================================================
RCS file: /home/roessler/cvs/mutt/curs_main.c,v
retrieving revision 2.50
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.50 curs_main.c
--- curs_main.c	2000/09/04 10:49:46	2.50
+++ curs_main.c	2000/09/19 02:06:01
@@ -191,7 +191,7 @@ static int ci_first_message (void)
       if (! Context->hdrs[Context->v2r[i]]->read &&
 	  ! Context->hdrs[Context->v2r[i]]->deleted)
       {
-	if (! Context->hdrs[Context->v2r[i]]->old)
+	if (! (option(OPTSEEOLD) && Context->hdrs[Context->v2r[i]]->old))
 	  return (i);
 	else if (old == -1)
 	  old = i;
@@ -1227,7 +1227,8 @@ int mutt_index_menu (void)
 	  }
 	  else if ((!CUR->deleted && !CUR->read))
 	  {
-	    if (op == OP_MAIN_NEXT_UNREAD || op == OP_MAIN_PREV_UNREAD || !CUR->old)
+	    if (op == OP_MAIN_NEXT_UNREAD || op == OP_MAIN_PREV_UNREAD ||
+                !(option(OPTSEEOLD) && CUR->old))
 	    {
 	      menu->current = i;
 	      break;
@@ -1296,7 +1297,7 @@ int mutt_index_menu (void)
 	    if (Context->hdrs[Context->v2r[j]]->tagged)
 	    {
 	      if (Context->hdrs[Context->v2r[j]]->read ||
-		  Context->hdrs[Context->v2r[j]]->old)
+		  (option(OPTSEEOLD) && Context->hdrs[Context->v2r[j]]->old))
 		mutt_set_flag (Context, Context->hdrs[Context->v2r[j]], M_NEW, 1);
 	      else
 		mutt_set_flag (Context, Context->hdrs[Context->v2r[j]], M_READ, 1);
@@ -1306,7 +1307,7 @@ int mutt_index_menu (void)
 	}
 	else
 	{
-	  if (CURHDR->read || CURHDR->old)
+	  if (CURHDR->read || (option(OPTSEEOLD) && CURHDR->old))
 	    mutt_set_flag (Context, CURHDR, M_NEW, 1);
 	  else
 	    mutt_set_flag (Context, CURHDR, M_READ, 1);
Index: flags.c
===================================================================
RCS file: /home/roessler/cvs/mutt/flags.c,v
retrieving revision 2.6
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.6 flags.c
--- flags.c	2000/03/03 10:10:08	2.6
+++ flags.c	2000/09/19 02:06:01
@@ -68,7 +68,7 @@ void _mutt_set_flag (CONTEXT *ctx, HEADE
     case M_NEW:
       if (bf)
       {
-	if (h->read || h->old)
+	if (h->read || (option(OPTSEEOLD) && h->old))
 	{
 	  h->old = 0;
 	  if (upd_ctx) ctx->new++;
@@ -290,6 +290,11 @@ int mutt_change_flag (HEADER *h, int bf)
 
     case 'o':
     case 'O':
+      if (!option(OPTSEEOLD)) {
+        mutt_error _("Set $see_old first");
+        return (-1);
+      }
+
       if (h)
 	mutt_set_flag (Context, h, M_READ, !bf);
       else
Index: hdrline.c
===================================================================
RCS file: /home/roessler/cvs/mutt/hdrline.c,v
retrieving revision 2.21
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.21 hdrline.c
--- hdrline.c	2000/08/28 09:38:42	2.21
+++ hdrline.c	2000/09/19 02:06:01
@@ -549,7 +549,7 @@ hdr_format_str (char *dest,
 	ch = 'r';
       else if (hdr->read && (ctx && ctx->msgnotreadyet != hdr->msgno))
 	ch = '-';
-      else if (hdr->old)
+      else if (option(OPTSEEOLD) && hdr->old)
 	ch = 'O';
       else
 	ch = 'N';
@@ -626,7 +626,8 @@ hdr_format_str (char *dest,
       snprintf (buf2, sizeof (buf2),
 		"%c%c%c", (THREAD_NEW ? 'n' : (THREAD_OLD ? 'o' : 
 		((hdr->read && (ctx && ctx->msgnotreadyet != hdr->msgno))
-		? (hdr->replied ? 'r' : ' ') : (hdr->old ? 'O' : 'N')))),
+		? (hdr->replied ? 'r' : ' ') :
+                ((option(OPTSEEOLD) && hdr->old) ? 'O' : 'N')))),
 		hdr->deleted ? 'D' : (hdr->attach_del ? 'd' : ch),
 		hdr->tagged ? '*' :
 		(hdr->flagged ? '!' :
Index: init.h
===================================================================
RCS file: /home/roessler/cvs/mutt/init.h,v
retrieving revision 2.101
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.101 init.h
--- init.h	2000/08/21 15:42:20	2.101
+++ init.h	2000/09/19 02:06:02
@@ -844,16 +844,17 @@ struct option_t MuttVars[] = {
   ** \fBDON'T CHANGE THIS SETTING UNLESS YOU ARE REALLY SURE WHAT YOU ARE
   ** DOING!\fP
   */
-  { "mark_old",		DT_BOOL, R_BOTH, OPTMARKOLD, 1 },
+  { "mark_old",		DT_QUAD, R_NONE, OPT_MARKOLD, M_YES },
   /*
   ** .pp
-  ** Controls whether or not Mutt makes the distinction between \fInew\fP
-  ** messages and \fIold\fP \fBunread\fP messages.  By default, Mutt will
-  ** mark new messages as old if you exit a mailbox without reading them.
-  ** The next time you start Mutt, the messages will show up with an "O"
-  ** next to them in the index menu, indicating that they are old.  In
-  ** order to make Mutt treat all unread messages as new only, you can
-  ** unset this variable.
+  ** When set, Mutt will mark new messages as old if you exit a mailbox
+  ** without reading them.  If not set messages will remain new until they
+  ** are read or the \fInew\fP flag is explicitly removed.  Set this variable
+  ** to ask-yes or ask-no to decide when leaving a folder.  Also see the
+  ** ``$$see_old'' variable.
+  ** .pp
+  ** \fBThis variable does not apply to IMAP folders, these always act as if
+  ** this variable is set to yes.
   */
   { "markers",		DT_BOOL, R_PAGER, OPTMARKERS, 1 },
   /*
@@ -1698,6 +1699,13 @@ struct option_t MuttVars[] = {
   ** ``$$record'' mailbox.
   ** .pp
   ** Also see the ``$$force_name'' variable.
+  */
+  { "see_old",		DT_BOOL, R_BOTH, OPTSEEOLD, 1 },
+  /*
+  ** .pp
+  ** Controls whether or not Mutt makes the distinction between \fInew\fP
+  ** messages and \fIold\fP \fBunread\fP messages.  In order to make Mutt
+  ** treat all unread messages as new only, you can unset this variable.
   */
   { "score", 		DT_BOOL, R_NONE, OPTSCORE, 1 },
   /*
Index: mh.c
===================================================================
RCS file: /home/roessler/cvs/mutt/mh.c,v
retrieving revision 2.23
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.23 mh.c
--- mh.c	2000/06/11 19:05:12	2.23
+++ mh.c	2000/09/19 02:06:02
@@ -234,7 +234,7 @@ static int maildir_parse_dir(CONTEXT *ct
   if(subdir)
   {
     snprintf(buf, sizeof(buf), "%s/%s", ctx->path, subdir);
-    is_old = (mutt_strcmp("cur", subdir) == 0) && option(OPTMARKOLD);
+    is_old = (mutt_strcmp("cur", subdir) == 0);
   }
   else
     strfcpy(buf, ctx->path, sizeof(buf));
Index: mutt.h
===================================================================
RCS file: /home/roessler/cvs/mutt/mutt.h,v
retrieving revision 2.76
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.76 mutt.h
--- mutt.h	2000/07/28 08:52:36	2.76
+++ mutt.h	2000/09/19 02:06:02
@@ -250,6 +250,7 @@ enum
   OPT_PRINT,
   OPT_INCLUDE,
   OPT_DELETE,
+  OPT_MARKOLD,
   OPT_MFUPTO,
   OPT_MIMEFWD,
   OPT_MOVE,
@@ -327,7 +328,6 @@ enum
   OPTIMPLICITAUTOVIEW,
   OPTMAILCAPSANITIZE,
   OPTMARKERS,
-  OPTMARKOLD,
   OPTMENUSCROLL,	/* scroll menu instead of implicit next-page */
   OPTMETAKEY,		/* interpret ALT-x as ESC-x */
   OPTMETOO,
@@ -350,6 +350,7 @@ enum
   OPTSAVEEMPTY,
   OPTSAVENAME,
   OPTSCORE,
+  OPTSEEOLD,
   OPTSIGDASHES,
   OPTSORTRE,
   OPTSTATUSONTOP,
Index: mx.c
===================================================================
RCS file: /home/roessler/cvs/mutt/mx.c,v
retrieving revision 2.48
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.48 mx.c
--- mx.c	2000/08/25 06:28:22	2.48
+++ mx.c	2000/09/19 02:06:03
@@ -763,7 +763,7 @@ static int sync_mailbox (CONTEXT *ctx, i
 /* save changes and close mailbox */
 int mx_close_mailbox (CONTEXT *ctx, int *index_hint)
 {
-  int i, move_messages = 0, purge = 1, read_msgs = 0;
+  int i, move_messages = 0, purge = 1, mark_old = 1, read_msgs = 0, new_msgs = 0;
   int check;
   int isSpool = 0;
   CONTEXT f;
@@ -795,6 +795,8 @@ int mx_close_mailbox (CONTEXT *ctx, int 
   {
     if (!ctx->hdrs[i]->deleted && ctx->hdrs[i]->read)
       read_msgs++;
+    if (!ctx->hdrs[i]->deleted && !ctx->hdrs[i]->read && !ctx->hdrs[i]->old)
+      new_msgs++;
   }
 
   if (read_msgs && quadoption (OPT_MOVE) != M_NO)
@@ -824,6 +826,14 @@ int mx_close_mailbox (CONTEXT *ctx, int 
     }
   }
 
+  if (new_msgs)
+  {
+    snprintf (buf, sizeof (buf), new_msgs == 1
+	     ? _("Mark new message as old?") : _("Mark new messages as old?"));
+    if ((mark_old = query_quadoption (OPT_MARKOLD, buf)) < 0)
+      return (-1);
+  }
+
   if (ctx->deleted)
   {
     snprintf (buf, sizeof (buf), ctx->deleted == 1
@@ -840,7 +850,8 @@ int mx_close_mailbox (CONTEXT *ctx, int 
   /* IMAP servers manage the OLD flag themselves */
   if (ctx->magic != M_IMAP)
 #endif
-  if (option (OPTMARKOLD))
+  
+  if (mark_old)
   {
     for (i = 0; i < ctx->msgcount; i++)
     {
Index: pager.c
===================================================================
RCS file: /home/roessler/cvs/mutt/pager.c,v
retrieving revision 2.26
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.26 pager.c
--- pager.c	2000/08/30 21:34:42	2.26
+++ pager.c	2000/09/19 02:06:03
@@ -2362,7 +2362,7 @@ mutt_pager (const char *banner, const ch
       case OP_TOGGLE_NEW:
 	CHECK_MODE(IsHeader (extra));
 	CHECK_READONLY;
-	if (extra->hdr->read || extra->hdr->old)
+	if (extra->hdr->read || (option(OPTSEEOLD) && extra->hdr->old))
 	  mutt_set_flag (Context, extra->hdr, M_NEW, 1);
 	else if (!first)
 	  mutt_set_flag (Context, extra->hdr, M_READ, 1);
Index: parse.c
===================================================================
RCS file: /home/roessler/cvs/mutt/parse.c,v
retrieving revision 2.34
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.34 parse.c
--- parse.c	2000/08/22 21:55:33	2.34
+++ parse.c	2000/09/19 02:06:04
@@ -1116,8 +1116,7 @@ int mutt_parse_rfc822_line (ENVELOPE *e,
 	    hdr->replied = 1;
 	    break;
 	    case 'O':
-	    if (option (OPTMARKOLD))
-	      hdr->old = 1;
+	    hdr->old = 1;
 	    break;
 	    case 'R':
 	    hdr->read = 1;
Index: pattern.c
===================================================================
RCS file: /home/roessler/cvs/mutt/pattern.c,v
retrieving revision 2.18
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.18 pattern.c
--- pattern.c	2000/06/09 17:42:14	2.18
+++ pattern.c	2000/09/19 02:06:04
@@ -823,13 +823,14 @@ mutt_pattern_exec (struct pattern_t *pat
     case M_TAG:
       return (pat->not ^ h->tagged);
     case M_NEW:
-      return (pat->not ? h->old || h->read : !(h->old || h->read));
+      return (pat->not ^ !((option(OPTSEEOLD) && h->old) || h->read));
     case M_UNREAD:
       return (pat->not ? h->read : !h->read);
     case M_REPLIED:
       return (pat->not ^ h->replied);
     case M_OLD:
-      return (pat->not ? (!h->old || h->read) : (h->old && !h->read));
+      return (pat->not ? (!(option(OPTSEEOLD) && h->old) || h->read) :
+              ((option(OPTSEEOLD) && h->old) && !h->read));
     case M_READ:
       return (pat->not ^ h->read);
     case M_DELETED:
Index: status.c
===================================================================
RCS file: /home/roessler/cvs/mutt/status.c,v
retrieving revision 2.6
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.6 status.c
--- status.c	2000/03/03 10:10:14	2.6
+++ status.c	2000/09/19 02:06:04
@@ -159,9 +159,11 @@ status_format_str (char *buf, size_t buf
       if (!optional)
       {
 	snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
-	snprintf (buf, buflen, fmt, Context ? Context->new : 0);
+	snprintf (buf, buflen, fmt, Context ?
+                  (option(OPTSEEOLD) ? Context->new : Context->unread) : 0);
       }
-      else if (!Context || !Context->new)
+      else if (!Context ||
+               !(option(OPTSEEOLD) ? Context->new : Context->unread))
 	optional = 0;
       break;
 
@@ -169,9 +171,11 @@ status_format_str (char *buf, size_t buf
       if (!optional)
       {
 	snprintf (fmt, sizeof (fmt), "%%%sd", prefix);
-	snprintf (buf, buflen, fmt, Context ? Context->unread - Context->new : 0);
+	snprintf (buf, buflen, fmt, (Context && option(OPTSEEOLD)) ?
+                  Context->unread - Context->new : 0);
       }
-      else if (!Context || !(Context->unread - Context->new))
+      else if (!Context || !option(OPTSEEOLD) ||
+               !(Context->unread - Context->new))
 	optional = 0;
       break;
 
Index: thread.c
===================================================================
RCS file: /home/roessler/cvs/mutt/thread.c,v
retrieving revision 2.13
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r2.13 thread.c
--- thread.c	2000/05/10 17:16:43	2.13
+++ thread.c	2000/09/19 02:06:04
@@ -765,7 +765,7 @@ int _mutt_traverse_thread (CONTEXT *ctx,
 
   if (!cur->read && CHECK_LIMIT)
   {
-    if (cur->old)
+    if (option(OPTSEEOLD) && cur->old)
       old = 2;
     else
       new = 1;
@@ -838,7 +838,7 @@ int _mutt_traverse_thread (CONTEXT *ctx,
 
     if (!cur->read && CHECK_LIMIT)
     {
-      if (cur->old)
+      if (option(OPTSEEOLD) && cur->old)
 	old = 2;
       else
 	new = 1;
Index: imap/message.c
===================================================================
RCS file: /home/roessler/cvs/mutt/imap/message.c,v
retrieving revision 1.42
diff -p -u -I$\(Author\|Date\|Header\|Id\|Locker\|Log\|Name\|RCSfile\|Revision\|Source\|State\)[:$] -r1.42 message.c
--- imap/message.c	2000/08/30 08:43:12	1.42
+++ imap/message.c	2000/09/19 02:06:05
@@ -874,7 +874,7 @@ static char* msg_parse_flags (IMAP_HEADE
   if (*s == ')')
   {
     /* if a message is neither seen nor recent, it is OLD. */
-    if (option (OPTMARKOLD) && !recent && !(h->read))
+    if (!recent && !(h->read))
       h->old = 1;
     s++;
   }
