]> granicus.if.org Git - mutt/commitdiff
patch-1.3.19i.rs.keep_flagged
authorThomas Roessler <roessler@does-not-exist.org>
Wed, 27 Jun 2001 10:09:40 +0000 (10:09 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Wed, 27 Jun 2001 10:09:40 +0000 (10:09 +0000)
init.h
mutt.h
mx.c

diff --git a/init.h b/init.h
index b34a9429fe2108dbe41ec1b53200004071740fc1..d2bf0ee966776d2ffd56a502cfa52a603172affc 100644 (file)
--- 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 2406546f6d31a2b0df5f99734cba24aeb5d8125d..6329ec9f6ec02e72840ad9fd1361ee637f5b89f5 100644 (file)
--- 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 9dec7b340a2bf321d39da4b3d35d81cea5f82942..2eb64854ce5d400a040f0a89a9fd1ebb2b789e92 100644 (file)
--- 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)
          {