]> granicus.if.org Git - neomutt/commitdiff
Add purge-message patch.
authorKevin McCarthy <kevin@8t8.us>
Mon, 18 Jul 2016 02:31:13 +0000 (19:31 -0700)
committerKevin McCarthy <kevin@8t8.us>
Mon, 18 Jul 2016 02:31:13 +0000 (19:31 -0700)
This is based on the patch by Cedric Duval.
Modifications are:

* Use the exising M_PURGE flag from the trash folder patch, rather
  than adding a separate flag.

* Undelete operations are already handled by the trash folder patch.

OPS
curs_main.c
functions.h
pager.c

diff --git a/OPS b/OPS
index 8414a8b337671ddee819f83f06b26da76559ee92..02cea8e1e86293ead331873f2fe9b60783dc5acc 100644 (file)
--- a/OPS
+++ b/OPS
@@ -142,6 +142,7 @@ OP_PREV_ENTRY "move to the previous entry"
 OP_PREV_LINE "scroll up one line"
 OP_PREV_PAGE "move to the previous page"
 OP_PRINT "print the current entry"
+OP_PURGE_MESSAGE "really delete the current entry, bypassing the trash folder"
 OP_QUERY "query external program for addresses"
 OP_QUERY_APPEND "append new query results to current results"
 OP_QUIT "save changes to mailbox and quit"
index 8c291bdfd98dd17b27b154ddf81f26026442e890..ca79388866d9b343adedd658342f8b14b3de7b84 100644 (file)
@@ -1950,6 +1950,7 @@ int mutt_index_menu (void)
        MAYBE_REDRAW (menu->redraw);
        break;
 
+      case OP_PURGE_MESSAGE:
       case OP_DELETE:
 
        CHECK_MSGCOUNT;
@@ -1961,6 +1962,7 @@ int mutt_index_menu (void)
        if (tag)
        {
          mutt_tag_set_flag (MUTT_DELETE, 1);
+          mutt_tag_set_flag (MUTT_PURGE, (op == OP_PURGE_MESSAGE));
          if (option (OPTDELETEUNTAG))
            mutt_tag_set_flag (MUTT_TAG, 0);
          menu->redraw = REDRAW_INDEX;
@@ -1968,6 +1970,7 @@ int mutt_index_menu (void)
        else
        {
          mutt_set_flag (Context, CURHDR, MUTT_DELETE, 1);
+         mutt_set_flag (Context, CURHDR, MUTT_PURGE, (op == OP_PURGE_MESSAGE));
          if (option (OPTDELETEUNTAG))
            mutt_set_flag (Context, CURHDR, MUTT_TAG, 0);
          if (option (OPTRESOLVE))
index 2af8827d7e6d2b4ef2d3dc57a0148fa7b711d307..abc06ca0da943c40a69545a52a46dc4770b1f6d7 100644 (file)
@@ -121,6 +121,7 @@ const struct binding_t OpMain[] = { /* map: index */
   { "toggle-write",            OP_TOGGLE_WRITE,                "%" },
   { "next-thread",             OP_MAIN_NEXT_THREAD,            "\016" },
   { "next-subthread",          OP_MAIN_NEXT_SUBTHREAD,         "\033n" },
+  { "purge-message",           OP_PURGE_MESSAGE,               NULL },
   { "query",                   OP_QUERY,                       "Q" },
   { "quit",                    OP_QUIT,                        "q" },
   { "reply",                   OP_REPLY,                       "r" },
@@ -223,6 +224,7 @@ const struct binding_t OpPager[] = { /* map: pager */
   { "print-message",   OP_PRINT,                       "p" },
   { "previous-thread", OP_MAIN_PREV_THREAD,            "\020" },
   { "previous-subthread",OP_MAIN_PREV_SUBTHREAD,       "\033p" },
+  { "purge-message",   OP_PURGE_MESSAGE,               NULL },
   { "quit",            OP_QUIT,                        "Q" },
   { "exit",            OP_EXIT,                        "q" },
   { "reply",           OP_REPLY,                       "r" },
diff --git a/pager.c b/pager.c
index f8113aea5b7e27bdcee65f3291cd1480c6b566d0..c1bd8caf18455ce5b57b5399a09e6cbb48d12e22 100644 (file)
--- a/pager.c
+++ b/pager.c
@@ -2406,6 +2406,7 @@ search_next:
        MAYBE_REDRAW (redraw);
        break;
 
+      case OP_PURGE_MESSAGE:
       case OP_DELETE:
        CHECK_MODE(IsHeader (extra));
        CHECK_READONLY;
@@ -2413,6 +2414,7 @@ search_next:
        CHECK_ACL(MUTT_ACL_DELETE, _("Cannot delete message"));
 
        mutt_set_flag (Context, extra->hdr, MUTT_DELETE, 1);
+       mutt_set_flag (Context, extra->hdr, MUTT_PURGE, (ch == OP_PURGE_MESSAGE));
         if (option (OPTDELETEUNTAG))
          mutt_set_flag (Context, extra->hdr, MUTT_TAG, 0);
        redraw = REDRAW_STATUS | REDRAW_INDEX;