--- mutt-1.5.8/PATCHES~ never +++ mutt-1.5.8/PATCHES Thu Mar 10 17:47:31 CST 2005 @@ -1,0 +1 @@ +patch-1.5.8.ats.mark_old.1.5 diff -Pur mutt-1.5.8-base/buffy.c mutt-1.5.8/buffy.c --- mutt-1.5.8-base/buffy.c Thu Feb 3 12:47:52 2005 +++ mutt-1.5.8/buffy.c Thu Mar 10 17:46:04 2005 @@ -107,7 +107,7 @@ hdr = mutt_new_header (); tmp_envelope = mutt_read_rfc822_header (f, hdr, 0, 0); - if (!(hdr->read || hdr->old)) + if (!(hdr->read || (option(OPTSEEOLD) && hdr->old))) result = 1; mutt_free_envelope(&tmp_envelope); diff -Pur mutt-1.5.8-base/curs_main.c mutt-1.5.8/curs_main.c --- mutt-1.5.8-base/curs_main.c Sat Feb 12 13:22:15 2005 +++ mutt-1.5.8/curs_main.c Thu Mar 10 17:46:04 2005 @@ -214,7 +214,7 @@ 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; @@ -1364,7 +1364,7 @@ { if (first_unread == -1) first_unread = i; - if ((!CURHDRi->old) && first_new == -1) + if ((!(option(OPTSEEOLD) && CURHDRi->old)) && first_new == -1) first_new = i; } @@ -1467,7 +1467,7 @@ 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); @@ -1477,7 +1477,7 @@ } 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); diff -Pur mutt-1.5.8-base/flags.c mutt-1.5.8/flags.c --- mutt-1.5.8-base/flags.c Thu Feb 3 12:47:52 2005 +++ mutt-1.5.8/flags.c Thu Mar 10 17:46:04 2005 @@ -102,7 +102,7 @@ if (bf) { - if (h->read || h->old) + if (h->read || (option(OPTSEEOLD) && h->old)) { h->old = 0; if (upd_ctx) ctx->new++; @@ -360,6 +360,11 @@ 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 diff -Pur mutt-1.5.8-base/hdrline.c mutt-1.5.8/hdrline.c --- mutt-1.5.8-base/hdrline.c Sat Feb 12 12:53:35 2005 +++ mutt-1.5.8/hdrline.c Thu Mar 10 17:46:05 2005 @@ -571,7 +571,7 @@ 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'; @@ -646,7 +646,8 @@ 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 ? '!' : diff -Pur mutt-1.5.8-base/imap/message.c mutt-1.5.8/imap/message.c --- mutt-1.5.8-base/imap/message.c Sat Feb 12 13:59:59 2005 +++ mutt-1.5.8/imap/message.c Thu Mar 10 17:46:05 2005 @@ -1121,7 +1121,7 @@ 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++; } diff -Pur mutt-1.5.8-base/init.h mutt-1.5.8/init.h --- mutt-1.5.8-base/init.h Sat Feb 12 14:01:10 2005 +++ mutt-1.5.8/init.h Thu Mar 10 17:46:20 2005 @@ -1049,7 +1049,7 @@ ** to maildir-style mailboxes. Setting it will have no effect on other ** mailbox types. */ - { "mark_old", DT_BOOL, R_BOTH, OPTMARKOLD, 1 }, + { "mark_old", DT_BOOL, R_BOTH, OPT_MARKOLD, 1 }, /* ** .pp ** Controls whether or not mutt marks \fInew\fP \fBunread\fP @@ -1057,6 +1057,12 @@ ** With this option set, 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. + ** .pp + ** If unset, messages remain \fInew\fP until they are read or the + ** \fInew\fP flag is explicitly removed. See also the ``$$see_old'' + ** variable. + ** .pp + ** N.B. This variable does not affect IMAP folders. */ { "markers", DT_BOOL, R_PAGER, OPTMARKERS, 1 }, /* @@ -2297,6 +2303,13 @@ ** ``$$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 }, /* diff -Pur mutt-1.5.8-base/mutt.h mutt-1.5.8/mutt.h --- mutt-1.5.8-base/mutt.h Sat Feb 12 14:01:20 2005 +++ mutt-1.5.8/mutt.h Thu Mar 10 17:46:05 2005 @@ -275,6 +275,7 @@ OPT_DELETE, OPT_FORWEDIT, OPT_INCLUDE, + OPT_MARKOLD, OPT_MFUPTO, OPT_MIMEFWD, OPT_MIMEFWDREST, @@ -386,7 +387,6 @@ OPTMAILCAPSANITIZE, OPTMAILDIRTRASH, OPTMARKERS, - OPTMARKOLD, OPTMENUSCROLL, /* scroll menu instead of implicit next-page */ OPTMETAKEY, /* interpret ALT-x as ESC-x */ OPTMETOO, @@ -414,6 +414,7 @@ OPTSAVEEMPTY, OPTSAVENAME, OPTSCORE, + OPTSEEOLD, OPTSIGDASHES, OPTSIGONTOP, OPTSORTRE, diff -Pur mutt-1.5.8-base/mx.c mutt-1.5.8/mx.c --- mutt-1.5.8-base/mx.c Thu Feb 3 12:47:53 2005 +++ mutt-1.5.8/mx.c Thu Mar 10 17:46:05 2005 @@ -822,7 +822,7 @@ /* 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; @@ -855,6 +855,8 @@ if (!ctx->hdrs[i]->deleted && ctx->hdrs[i]->read && !(ctx->hdrs[i]->flagged && option (OPTKEEPFLAGGED))) 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) @@ -884,6 +886,14 @@ } } + 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); + } + /* * There is no point in asking whether or not to purge if we are * just marking messages as "trash". @@ -904,7 +914,7 @@ /* 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++) { diff -Pur mutt-1.5.8-base/pager.c mutt-1.5.8/pager.c --- mutt-1.5.8-base/pager.c Sat Feb 12 13:30:16 2005 +++ mutt-1.5.8/pager.c Thu Mar 10 17:46:05 2005 @@ -2514,7 +2514,7 @@ CHECK_IMAP_ACL(IMAP_ACL_SEEN); #endif - 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); diff -Pur mutt-1.5.8-base/pattern.c mutt-1.5.8/pattern.c --- mutt-1.5.8-base/pattern.c Wed Feb 9 03:07:45 2005 +++ mutt-1.5.8/pattern.c Thu Mar 10 17:46:05 2005 @@ -973,13 +973,14 @@ 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: diff -Pur mutt-1.5.8-base/status.c mutt-1.5.8/status.c --- mutt-1.5.8-base/status.c Thu Feb 3 12:47:53 2005 +++ mutt-1.5.8/status.c Thu Mar 10 17:46:05 2005 @@ -163,9 +163,11 @@ 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; @@ -173,9 +175,11 @@ 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; diff -Pur mutt-1.5.8-base/thread.c mutt-1.5.8/thread.c --- mutt-1.5.8-base/thread.c Thu Feb 3 12:47:53 2005 +++ mutt-1.5.8/thread.c Thu Mar 10 17:46:05 2005 @@ -1145,7 +1145,7 @@ if (!cur->read && CHECK_LIMIT) { - if (cur->old) + if (option(OPTSEEOLD) && cur->old) old = 2; else new = 1; @@ -1222,7 +1222,7 @@ if (!cur->read && CHECK_LIMIT) { - if (cur->old) + if (option(OPTSEEOLD) && cur->old) old = 2; else new = 1;