<<< Date Index >>>     <<< Thread Index >>>

[PATCH] save indication patch



Here is a patch that I've been using for some time that marks a message
in the index with a '$' when that message has been successfully saved or
copied to another folder.  I find it useful when I'm looking at messages
that are marked for deletion and I want to be sure the message has been
copied/saved before I sync the mbox.

# HG changeset patch
# User Will Fiveash <Will.Fiveash@xxxxxxx>
# Date 1268091144 21600
# Branch HEAD
# Node ID 64df3b347774574eb0ce294925bff213bd81c1f9
# Parent  ad6d799951cbd5dc835f44dc809dd220df53af21
save indication patch

diff -r ad6d799951cb -r 64df3b347774 commands.c
--- a/commands.c        Mon Mar 08 15:13:33 2010 -0800
+++ b/commands.c        Mon Mar 08 17:32:24 2010 -0600
@@ -710,6 +710,8 @@
 
   if ((rc = mutt_append_message (ctx, Context, h, cmflags, chflags)) != 0)
     return rc;
+  else
+    mutt_set_flag (Context, h, M_APPENDED, 1);
 
   if (delete)
   {
diff -r ad6d799951cb -r 64df3b347774 curs_main.c
--- a/curs_main.c       Mon Mar 08 15:13:33 2010 -0800
+++ b/curs_main.c       Mon Mar 08 17:32:24 2010 -0600
@@ -1429,7 +1429,7 @@
                               (op == OP_DECRYPT_SAVE) || (op == 
OP_DECRYPT_COPY) ||
                               0,
                               &menu->redraw) == 0 &&
-            (op == OP_SAVE || op == OP_DECODE_SAVE || op == OP_DECRYPT_SAVE)
+            (op == OP_SAVE || op == OP_DECODE_SAVE || op == OP_COPY_MESSAGE || 
op == OP_DECRYPT_SAVE)
            )
        {
          if (tag)
diff -r ad6d799951cb -r 64df3b347774 doc/manual.xml.head
--- a/doc/manual.xml.head       Mon Mar 08 15:13:33 2010 -0800
+++ b/doc/manual.xml.head       Mon Mar 08 17:32:24 2010 -0600
@@ -710,6 +710,7 @@
 <row><entry>s</entry><entry>message is signed</entry></row>
 <row><entry>!</entry><entry>message is flagged</entry></row>
 <row><entry>*</entry><entry>message is tagged</entry></row>
+<row><entry>$</entry><entry>message was successfully appended to another 
folder</entry></row>
 <row><entry>n</entry><entry>thread contains new messages (only if 
collapsed)</entry></row>
 <row><entry>o</entry><entry>thread contains old messages (only if 
collapsed)</entry></row>
 </tbody>
diff -r ad6d799951cb -r 64df3b347774 flags.c
--- a/flags.c   Mon Mar 08 15:13:33 2010 -0800
+++ b/flags.c   Mon Mar 08 17:32:24 2010 -0600
@@ -209,6 +209,12 @@
       }
       break;
 
+    case M_APPENDED:
+      if (bf) {
+         h->appended = 1;
+      }
+      break;
+
     case M_FLAG:
 
       if (!mutt_bit_isset(ctx->rights,M_ACL_WRITE))
diff -r ad6d799951cb -r 64df3b347774 hdrline.c
--- a/hdrline.c Mon Mar 08 15:13:33 2010 -0800
+++ b/hdrline.c Mon Mar 08 17:32:24 2010 -0600
@@ -651,13 +651,14 @@
         ch = 'K';
 
       snprintf (buf2, sizeof (buf2),
-               "%c%c%c", (THREAD_NEW ? 'n' : (THREAD_OLD ? 'o' : 
+               "%c%c%c%c", (THREAD_NEW ? 'n' : (THREAD_OLD ? 'o' : 
                ((hdr->read && (ctx && ctx->msgnotreadyet != hdr->msgno))
                ? (hdr->replied ? 'r' : ' ') : (hdr->old ? 'O' : 'N')))),
                hdr->deleted ? 'D' : (hdr->attach_del ? 'd' : ch),
                hdr->tagged ? '*' :
                (hdr->flagged ? '!' :
-                (Tochars && ((i = mutt_user_is_recipient (hdr)) < mutt_strlen 
(Tochars)) ? Tochars[i] : ' ')));
+                (Tochars && ((i = mutt_user_is_recipient (hdr)) < mutt_strlen 
(Tochars)) ? Tochars[i] : ' ')),
+               hdr->appended ? '$' : ' ');
       mutt_format_s (dest, destlen, prefix, buf2);
       break;
 
diff -r ad6d799951cb -r 64df3b347774 mutt.h
--- a/mutt.h    Mon Mar 08 15:13:33 2010 -0800
+++ b/mutt.h    Mon Mar 08 17:32:24 2010 -0600
@@ -193,6 +193,7 @@
   M_LIMIT,
   M_EXPIRED,
   M_SUPERSEDED,
+  M_APPENDED,
 
   /* actions for mutt_pattern_comp/mutt_pattern_exec */
   M_AND,
@@ -713,6 +714,7 @@
   unsigned int expired : 1;            /* already expired? */
   unsigned int superseded : 1;                 /* got superseded? */
   unsigned int replied : 1;
+  unsigned int appended : 1;
   unsigned int subject_changed : 1;    /* used for threading */
   unsigned int threaded : 1;           /* used for threading */
   unsigned int display_subject : 1;    /* used for threading */
diff -r ad6d799951cb -r 64df3b347774 pager.c
--- a/pager.c   Mon Mar 08 15:13:33 2010 -0800
+++ b/pager.c   Mon Mar 08 17:32:24 2010 -0600
@@ -2584,6 +2584,7 @@
                               (ch == OP_DECRYPT_SAVE) || (ch == 
OP_DECRYPT_COPY) ||
                               0,
                               &redraw) == 0 && (ch == OP_SAVE || ch == 
OP_DECODE_SAVE
+                                                || ch == OP_COPY_MESSAGE
                                                 || ch == OP_DECRYPT_SAVE
                                                 ))
        {