From 801dd35ea71639c25bbc9c9ff03e0b753f772137 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Wed, 27 Jun 2001 10:09:40 +0000 Subject: [PATCH] patch-1.3.19i.rs.keep_flagged --- init.h | 7 +++++++ mutt.h | 1 + mx.c | 9 ++++++--- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/init.h b/init.h index b34a9429f..d2bf0ee96 100644 --- a/init.h +++ b/init.h @@ -852,6 +852,13 @@ struct option_t MuttVars[] = { ** .pp ** How to invoke ispell (GNU's spell-checking software). */ + { "keep_flagged", DT_BOOL, R_NONE, OPTKEEPFLAGGED, 0 }, + /* + ** .pp + ** If set, read messages marked as flagged will not be moved + ** from your spool mailbox to your ``$$mbox'' mailbox, or as a result of + ** a ``$mbox-hook'' command. + */ { "locale", DT_STR, R_BOTH, UL &Locale, UL "C" }, /* ** .pp diff --git a/mutt.h b/mutt.h index 2406546f6..6329ec9f6 100644 --- a/mutt.h +++ b/mutt.h @@ -345,6 +345,7 @@ enum OPTSSLSYSTEMCERTS, #endif OPTIMPLICITAUTOVIEW, + OPTKEEPFLAGGED, OPTMAILCAPSANITIZE, OPTMAILDIRTRASH, OPTMARKERS, diff --git a/mx.c b/mx.c index 9dec7b340..2eb64854c 100644 --- a/mx.c +++ b/mx.c @@ -847,7 +847,8 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) for (i = 0; i < ctx->msgcount; i++) { - if (!ctx->hdrs[i]->deleted && ctx->hdrs[i]->read) + if (!ctx->hdrs[i]->deleted && ctx->hdrs[i]->read + && !(ctx->hdrs[i]->flagged && option (OPTKEEPFLAGGED))) read_msgs++; } @@ -915,7 +916,8 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) { /* tag messages for moving, and clear old tags, if any */ for (i = 0; i < ctx->msgcount; i++) - if (ctx->hdrs[i]->read && !ctx->hdrs[i]->deleted) + if (ctx->hdrs[i]->read && !ctx->hdrs[i]->deleted + && !(ctx->hdrs[i]->flagged && option (OPTKEEPFLAGGED))) ctx->hdrs[i]->tagged = 1; else ctx->hdrs[i]->tagged = 0; @@ -941,7 +943,8 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) for (i = 0; i < ctx->msgcount; i++) { - if (ctx->hdrs[i]->read && !ctx->hdrs[i]->deleted) + if (ctx->hdrs[i]->read && !ctx->hdrs[i]->deleted + && !(ctx->hdrs[i]->flagged && option (OPTKEEPFLAGGED))) { if (mutt_append_message (&f, ctx, ctx->hdrs[i], 0, CH_UPDATE_LEN) == 0) { -- 2.40.0