On Mon, Aug 29, 2016 at 02:06:34PM -0500, Will Fiveash wrote:
> On Mon, Aug 29, 2016 at 02:33:01PM -0400, Jon LaBadie wrote:
> > The message index shows a "D" when a message has been
> > deleted or when it has been saved.  Is there a way
> > to distinguish which of the two operations (delete
> > or save) has been performed?
> 
> I wrote a small patch (attached) to provide a '$' indication in the
> index for messages that have been successfully saved or copied.  It
> exists in a separate column from the deletion indicator.

So, I'm wondering... with your patch is the message actually deleted
from the folder it was copied from, or does it stay there with a $
flag, forever?

> 
> -- 
> Will Fiveash

> # HG changeset patch
> # User Will Fiveash <[email protected]>
> # Date 1355163234 21600
> #      Mon Dec 10 12:13:54 2012 -0600
> # Node ID 5edf55351321d7dc1e132ae0352f305f835c205a
> # Parent  3834da0c024e61f9855e36c9fbbdd9fa578f4b14
> my save indication patch
> 
> diff --git a/commands.c b/commands.c
> --- a/commands.c
> +++ b/commands.c
> @@ -713,6 +713,8 @@
>  
>    if ((rc = mutt_append_message (ctx, Context, h, cmflags, chflags)) != 0)
>      return rc;
> +  else
> +    mutt_set_flag (Context, h, MUTT_APPENDED, 1);
>  
>    if (delete)
>    {
> diff --git a/curs_main.c b/curs_main.c
> --- a/curs_main.c
> +++ b/curs_main.c
> @@ -1539,7 +1539,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 --git a/doc/manual.xml.head b/doc/manual.xml.head
> --- a/doc/manual.xml.head
> +++ b/doc/manual.xml.head
> @@ -719,6 +719,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 --git a/flags.c b/flags.c
> --- a/flags.c
> +++ b/flags.c
> @@ -223,6 +223,13 @@
>        }
>        break;
>  
> +    case MUTT_APPENDED:
> +
> +      if (bf) {
> +           h->appended = 1;
> +      }
> +      break;
> +
>      case MUTT_FLAG:
>  
>        if (!mutt_bit_isset(ctx->rights,MUTT_ACL_WRITE))
> diff --git a/hdrline.c b/hdrline.c
> --- a/hdrline.c
> +++ b/hdrline.c
> @@ -670,13 +670,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 --git a/mutt.h b/mutt.h
> --- a/mutt.h
> +++ b/mutt.h
> @@ -190,6 +190,7 @@
>    MUTT_EXPIRED,
>    MUTT_SUPERSEDED,
>    MUTT_TRASH,
> +  MUTT_APPENDED,
>  
>    /* actions for mutt_pattern_comp/mutt_pattern_exec */
>    MUTT_AND,
> @@ -738,6 +739,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 --git a/pager.c b/pager.c
> --- a/pager.c
> +++ b/pager.c
> @@ -2681,6 +2681,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
>                                                ))
>       {




-- 
---- Fred Smith -- [email protected] -----------------------------
               Show me your ways, O LORD, teach me your paths;
                     Guide me in your truth and teach me,
                         for you are God my Savior,
                    And my hope is in you all day long.
-------------------------- Psalm 25:4-5 (NIV) --------------------------------

Reply via email to