File patch-1.5.5.1.cd.purge_message.3.4 of Package mutt
Index: mutt-1.5.21/OPS
===================================================================
--- mutt-1.5.21.orig/OPS
+++ mutt-1.5.21/OPS
@@ -141,8 +141,9 @@ OP_PIPE "pipe message/attachment to a sh
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"
OP_RECALL_MESSAGE "recall a postponed message"
Index: mutt-1.5.21/curs_main.c
===================================================================
--- mutt-1.5.21.orig/curs_main.c
+++ mutt-1.5.21/curs_main.c
@@ -1869,8 +1869,9 @@ int mutt_index_menu (void)
mutt_query_menu (NULL, 0);
MAYBE_REDRAW (menu->redraw);
break;
+ case OP_PURGE_MESSAGE:
case OP_DELETE:
CHECK_MSGCOUNT;
CHECK_VISIBLE;
@@ -1879,15 +1880,18 @@ int mutt_index_menu (void)
if (tag)
{
mutt_tag_set_flag (M_DELETE, 1);
+ mutt_tag_set_flag (M_PURGED, (op != OP_PURGE_MESSAGE) ? 0 : 1);
if (option (OPTDELETEUNTAG))
mutt_tag_set_flag (M_TAG, 0);
menu->redraw = REDRAW_INDEX;
}
else
{
mutt_set_flag (Context, CURHDR, M_DELETE, 1);
+ mutt_set_flag (Context, CURHDR, M_PURGED,
+ (op != OP_PURGE_MESSAGE) ? 0 : 1);
if (option (OPTDELETEUNTAG))
mutt_set_flag (Context, CURHDR, M_TAG, 0);
if (option (OPTRESOLVE))
{
@@ -2187,13 +2191,15 @@ int mutt_index_menu (void)
if (tag)
{
mutt_tag_set_flag (M_DELETE, 0);
+ mutt_tag_set_flag (M_PURGED, 0);
menu->redraw = REDRAW_INDEX;
}
else
{
mutt_set_flag (Context, CURHDR, M_DELETE, 0);
+ mutt_set_flag (Context, CURHDR, M_PURGED, 0);
if (option (OPTRESOLVE) && menu->current < Context->vcount - 1)
{
menu->current++;
menu->redraw = REDRAW_MOTION_RESYNCH;
@@ -2212,11 +2218,13 @@ int mutt_index_menu (void)
CHECK_READONLY;
CHECK_ACL(M_ACL_DELETE, _("undelete message(s)"));
rc = mutt_thread_set_flag (CURHDR, M_DELETE, 0,
- op == OP_UNDELETE_THREAD ? 0 : 1);
+ op == OP_UNDELETE_THREAD ? 0 : 1)
+ + mutt_thread_set_flag (CURHDR, M_PURGED, 0,
+ op == OP_UNDELETE_THREAD ? 0 : 1);
- if (rc != -1)
+ if (rc > -1)
{
if (option (OPTRESOLVE))
{
if (op == OP_UNDELETE_THREAD)
Index: mutt-1.5.21/flags.c
===================================================================
--- mutt-1.5.21.orig/flags.c
+++ mutt-1.5.21/flags.c
@@ -105,8 +105,18 @@ void _mutt_set_flag (CONTEXT *ctx, HEADE
}
}
break;
+ case M_PURGED:
+ if (bf)
+ {
+ if (!h->purged)
+ h->purged = 1;
+ }
+ else if (h->purged)
+ h->purged = 0;
+ break;
+
case M_NEW:
if (!mutt_bit_isset(ctx->rights,M_ACL_SEEN))
return;
Index: mutt-1.5.21/functions.h
===================================================================
--- mutt-1.5.21.orig/functions.h
+++ mutt-1.5.21/functions.h
@@ -120,8 +120,9 @@ struct binding_t OpMain[] = { /* map: in
{ "toggle-new", OP_TOGGLE_NEW, "N" },
{ "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" },
{ "show-limit", OP_MAIN_SHOW_LIMIT, "\033l" },
@@ -217,8 +218,9 @@ struct binding_t OpPager[] = { /* map: p
{ "sort-reverse", OP_SORT_REVERSE, "O" },
{ "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" },
{ "recall-message", OP_RECALL_MESSAGE, "R" },
Index: mutt-1.5.21/mutt.h
===================================================================
--- mutt-1.5.21.orig/mutt.h
+++ mutt-1.5.21/mutt.h
@@ -192,8 +192,9 @@ enum
M_DELETE,
M_UNDELETE,
M_DELETED,
M_APPENDED,
+ M_PURGED,
M_FLAG,
M_TAG,
M_UNTAG,
M_LIMIT,
@@ -723,8 +724,9 @@ typedef struct header
unsigned int mime : 1; /* has a MIME-Version header? */
unsigned int flagged : 1; /* marked important? */
unsigned int tagged : 1;
unsigned int appended : 1; /* has been saved */
+ unsigned int purged : 1; /* bypassing the trash folder */
unsigned int deleted : 1;
unsigned int changed : 1;
unsigned int attach_del : 1; /* has an attachment marked for deletion */
unsigned int old : 1;
Index: mutt-1.5.21/mx.c
===================================================================
--- mutt-1.5.21.orig/mx.c
+++ mutt-1.5.21/mx.c
@@ -853,8 +853,9 @@ static int trash_append (CONTEXT *ctx)
if ((ctx_trash = mx_open_mailbox (TrashPath, M_APPEND, NULL)) != NULL)
{
for (i = 0 ; i < ctx->msgcount ; i++)
if (ctx->hdrs[i]->deleted && !ctx->hdrs[i]->appended
+ && !ctx->hdrs[i]->purged
&& mutt_append_message (ctx_trash, ctx, ctx->hdrs[i], 0, 0) == -1)
{
mx_close_mailbox (ctx_trash, NULL);
return -1;
Index: mutt-1.5.21/pager.c
===================================================================
--- mutt-1.5.21.orig/pager.c
+++ mutt-1.5.21/pager.c
@@ -2362,14 +2362,17 @@ search_next:
mutt_create_alias (extra->hdr->env, NULL);
MAYBE_REDRAW (redraw);
break;
+ case OP_PURGE_MESSAGE:
case OP_DELETE:
CHECK_MODE(IsHeader (extra));
CHECK_READONLY;
CHECK_ACL(M_ACL_DELETE, _("delete message"));
mutt_set_flag (Context, extra->hdr, M_DELETE, 1);
+ mutt_set_flag (Context, extra->hdr, M_PURGED,
+ ch != OP_PURGE_MESSAGE ? 0 : 1);
if (option (OPTDELETEUNTAG))
mutt_set_flag (Context, extra->hdr, M_TAG, 0);
redraw = REDRAW_STATUS | REDRAW_INDEX;
if (option (OPTRESOLVE))
@@ -2694,8 +2697,9 @@ search_next:
CHECK_READONLY;
CHECK_ACL(M_ACL_DELETE, _("undelete message"));
mutt_set_flag (Context, extra->hdr, M_DELETE, 0);
+ mutt_set_flag (Context, extra->hdr, M_PURGED, 0);
redraw = REDRAW_STATUS | REDRAW_INDEX;
if (option (OPTRESOLVE))
{
ch = -1;
@@ -2709,11 +2713,13 @@ search_next:
CHECK_READONLY;
CHECK_ACL(M_ACL_DELETE, _("undelete message(s)"));
r = mutt_thread_set_flag (extra->hdr, M_DELETE, 0,
+ ch == OP_UNDELETE_THREAD ? 0 : 1)
+ + mutt_thread_set_flag (extra->hdr, M_PURGED, 0,
ch == OP_UNDELETE_THREAD ? 0 : 1);
- if (r != -1)
+ if (r > -1)
{
if (option (OPTRESOLVE))
{
rc = (ch == OP_DELETE_THREAD) ?
Index: mutt-1.5.21/pattern.c
===================================================================
--- mutt-1.5.21.orig/pattern.c
+++ mutt-1.5.21/pattern.c
@@ -1394,10 +1394,12 @@ int mutt_pattern_func (int op, char *pro
if (mutt_pattern_exec (pat, M_MATCH_FULL_ADDRESS, Context, Context->hdrs[Context->v2r[i]]))
{
switch (op)
{
- case M_DELETE:
case M_UNDELETE:
+ mutt_set_flag (Context, Context->hdrs[Context->v2r[i]], M_PURGED,
+ 0);
+ case M_DELETE:
mutt_set_flag (Context, Context->hdrs[Context->v2r[i]], M_DELETE,
(op == M_DELETE));
break;
case M_TAG:
Index: mutt-1.5.21/PATCHES
===================================================================
--- mutt-1.5.21.orig/PATCHES
+++ mutt-1.5.21/PATCHES
@@ -1,5 +1,6 @@
patch-1.5.3.vk.pgp_verbose_mime
+patch-1.5.5.1.cd.purge_message.3.4
patch-1.5.5.1.cd.trash_folder.3.4
patch-1.5.9.aw.listreply.1
patch-1.5.21.sidebar.20120829.txt
patch-1.5.19.rr.compressed.1