X-Git-Url: https://git.pld-linux.org/?p=packages%2Fmutt.git;a=blobdiff_plain;f=mutt-cd.purge_message.patch;h=9d20e359880dcdbbe75fe4041c1af67888816aa2;hp=d6285049740191f303cd04e028e8eb25130639fd;hb=9b7ff4e7ae64b6a8036923fcb4c9f77e15cd8432;hpb=d66e5ee829219ba78ed0b1bec1eaa4365403e66b diff --git a/mutt-cd.purge_message.patch b/mutt-cd.purge_message.patch index d628504..9d20e35 100644 --- a/mutt-cd.purge_message.patch +++ b/mutt-cd.purge_message.patch @@ -1,36 +1,85 @@ -diff -pruN1 mutt-1.3.25.trash_folder/OPS mutt-1.3.25.purge_command/OPS ---- mutt-1.3.25.trash_folder/OPS Tue Sep 11 12:50:50 2001 -+++ mutt-1.3.25.purge_command/OPS Wed Jan 9 20:40:27 2002 -@@ -136,2 +136,3 @@ OP_PREV_PAGE "move to the previous page" +# vim:ft=diff: +This is the purge message patch by Cedric Duval . + +(requires trash folder patch) + +This patch adds the purge-message function, which, unlike delete-message, will +bypass the trash folder and really delete the mail. + +You can bind this function to D, for instance, by adding the following +lines to your muttrc: + +bind index \eD purge-message +bind pager \eD purge-message + +Please be very careful with this function, and try to use it as less as +possible. The risk resides in getting into the habit of always using +purge-message instead of delete-message, which would really defeat the purpose +of having a trash folder feature. + +* Patch last synced with upstream: + - Date: 2007-02-15 + - File: http://cedricduval.free.fr/mutt/patches/download/patch-1.5.5.1.cd.purge_message.3.4 + +* Changes made: + - Updated to 1.5.13 + - Fixed indentation of "purged" in mutt.h. + +== END PATCH +--- a/OPS ++++ b/OPS +@@ -142,6 +142,7 @@ + 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" -diff -pruN1 mutt-1.3.25.trash_folder/curs_main.c mutt-1.3.25.purge_command/curs_main.c ---- mutt-1.3.25.trash_folder/curs_main.c Thu Nov 8 09:56:02 2001 -+++ mutt-1.3.25.purge_command/curs_main.c Wed Jan 9 20:40:27 2002 -@@ -1615,2 +1615,3 @@ int mutt_index_menu (void) + OP_QUERY_APPEND "append new query results to current results" + OP_QUIT "save changes to mailbox and quit" +--- a/curs_main.c ++++ b/curs_main.c +@@ -1843,6 +1843,7 @@ + MAYBE_REDRAW (menu->redraw); + break; + case OP_PURGE_MESSAGE: case OP_DELETE: -@@ -1623,2 +1624,4 @@ int mutt_index_menu (void) + + CHECK_MSGCOUNT; +@@ -1853,6 +1854,7 @@ + if (tag) + { mutt_tag_set_flag (M_DELETE, 1); -+ if (op == OP_PURGE_MESSAGE) -+ mutt_tag_set_flag (M_PURGED, 1); ++ mutt_tag_set_flag (M_PURGED, (op != OP_PURGE_MESSAGE) ? 0 : 1); if (option (OPTDELETEUNTAG)) -@@ -1630,2 +1633,4 @@ int mutt_index_menu (void) + mutt_tag_set_flag (M_TAG, 0); + menu->redraw = REDRAW_INDEX; +@@ -1860,6 +1862,8 @@ + else + { mutt_set_flag (Context, CURHDR, M_DELETE, 1); -+ if (op == OP_PURGE_MESSAGE) -+ mutt_set_flag (Context, CURHDR, M_PURGED, 1); ++ mutt_set_flag (Context, CURHDR, M_PURGED, ++ (op != OP_PURGE_MESSAGE) ? 0 : 1); if (option (OPTDELETEUNTAG)) -@@ -1908,2 +1913,3 @@ int mutt_index_menu (void) + mutt_set_flag (Context, CURHDR, M_TAG, 0); + if (option (OPTRESOLVE)) +@@ -2161,11 +2165,13 @@ + if (tag) + { mutt_tag_set_flag (M_DELETE, 0); + mutt_tag_set_flag (M_PURGED, 0); menu->redraw = REDRAW_INDEX; -@@ -1913,2 +1919,3 @@ int mutt_index_menu (void) + } + 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) -@@ -1932,5 +1939,7 @@ int mutt_index_menu (void) + { + menu->current++; +@@ -2186,9 +2192,11 @@ + 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) @@ -40,10 +89,13 @@ diff -pruN1 mutt-1.3.25.trash_folder/curs_main.c mutt-1.3.25.purge_command/curs_ - if (rc != -1) + if (rc > -1) { -diff -pruN1 mutt-1.3.25.trash_folder/flags.c mutt-1.3.25.purge_command/flags.c ---- mutt-1.3.25.trash_folder/flags.c Wed Jan 9 20:39:31 2002 -+++ mutt-1.3.25.purge_command/flags.c Wed Jan 9 20:40:27 2002 -@@ -100,2 +100,12 @@ void _mutt_set_flag (CONTEXT *ctx, HEADE + if (option (OPTRESOLVE)) + { +--- a/flags.c ++++ b/flags.c +@@ -104,6 +104,16 @@ + } + break; + case M_PURGED: + if (bf) @@ -56,51 +108,84 @@ diff -pruN1 mutt-1.3.25.trash_folder/flags.c mutt-1.3.25.purge_command/flags.c + break; + case M_NEW: -diff -pruN1 mutt-1.3.25.trash_folder/functions.h mutt-1.3.25.purge_command/functions.h ---- mutt-1.3.25.trash_folder/functions.h Tue Sep 11 12:51:39 2001 -+++ mutt-1.3.25.purge_command/functions.h Wed Jan 9 20:40:27 2002 -@@ -100,2 +100,3 @@ struct binding_t OpMain[] = { + + if (!mutt_bit_isset(ctx->rights,M_ACL_SEEN)) +--- a/functions.h ++++ b/functions.h +@@ -121,6 +121,7 @@ + { "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" }, -@@ -184,2 +185,3 @@ struct binding_t OpPager[] = { + { "quit", OP_QUIT, "q" }, + { "reply", OP_REPLY, "r" }, +@@ -213,6 +214,7 @@ + { "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" }, -diff -pruN1 mutt-1.3.25.trash_folder/mutt.h mutt-1.3.25.purge_command/mutt.h ---- mutt-1.3.25.trash_folder/mutt.h Wed Jan 9 20:39:31 2002 -+++ mutt-1.3.25.purge_command/mutt.h Wed Jan 9 20:40:27 2002 -@@ -187,2 +187,3 @@ enum + { "exit", OP_EXIT, "q" }, + { "reply", OP_REPLY, "r" }, +--- a/mutt.h ++++ b/mutt.h +@@ -188,6 +188,7 @@ + M_UNDELETE, + M_DELETED, M_APPENDED, + M_PURGED, M_FLAG, -@@ -620,2 +621,3 @@ typedef struct header - unsigned int appended : 1; /* has been saved */ -+ unsigned int purged : 1; /* bypassing the trash folder */ + M_TAG, + M_UNTAG, +@@ -709,6 +710,7 @@ + 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; -diff -pruN1 mutt-1.3.25.trash_folder/mx.c mutt-1.3.25.purge_command/mx.c ---- mutt-1.3.25.trash_folder/mx.c Wed Jan 9 20:39:31 2002 -+++ mutt-1.3.25.purge_command/mx.c Wed Jan 9 20:40:27 2002 -@@ -841,2 +841,3 @@ static int trash_append (CONTEXT *ctx) + unsigned int changed : 1; + unsigned int attach_del : 1; /* has an attachment marked for deletion */ +--- a/mx.c ++++ b/mx.c +@@ -806,6 +806,7 @@ + { + 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) -diff -pruN1 mutt-1.3.25.trash_folder/pager.c mutt-1.3.25.purge_command/pager.c ---- mutt-1.3.25.trash_folder/pager.c Fri Dec 21 01:21:03 2001 -+++ mutt-1.3.25.purge_command/pager.c Wed Jan 9 20:40:27 2002 -@@ -2148,2 +2148,3 @@ mutt_pager (const char *banner, const ch + { + mx_close_mailbox (ctx_trash, NULL); +--- a/pager.c ++++ b/pager.c +@@ -2351,6 +2351,7 @@ + MAYBE_REDRAW (redraw); + break; + case OP_PURGE_MESSAGE: case OP_DELETE: -@@ -2152,2 +2153,3 @@ mutt_pager (const char *banner, const ch + CHECK_MODE(IsHeader (extra)); + CHECK_READONLY; +@@ -2358,6 +2359,8 @@ + CHECK_ACL(M_ACL_DELETE, _("Cannot delete message")); + mutt_set_flag (Context, extra->hdr, M_DELETE, 1); -+ mutt_set_flag (Context, extra->hdr, M_PURGED, 1); ++ mutt_set_flag (Context, extra->hdr, M_PURGED, ++ ch != OP_PURGE_MESSAGE ? 0 : 1); if (option (OPTDELETEUNTAG)) -@@ -2461,2 +2463,3 @@ mutt_pager (const char *banner, const ch + mutt_set_flag (Context, extra->hdr, M_TAG, 0); + redraw = REDRAW_STATUS | REDRAW_INDEX; +@@ -2675,6 +2678,7 @@ + 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; -@@ -2475,5 +2478,7 @@ mutt_pager (const char *banner, const ch + if (option (OPTRESOLVE)) + { +@@ -2690,9 +2694,11 @@ + 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, @@ -109,10 +194,13 @@ diff -pruN1 mutt-1.3.25.trash_folder/pager.c mutt-1.3.25.purge_command/pager.c - if (r != -1) + if (r > -1) { -diff -pruN1 mutt-1.3.25.trash_folder/pattern.c mutt-1.3.25.purge_command/pattern.c ---- mutt-1.3.25.trash_folder/pattern.c Mon Dec 3 11:17:57 2001 -+++ mutt-1.3.25.purge_command/pattern.c Wed Jan 9 20:40:27 2002 -@@ -1172,4 +1172,6 @@ int mutt_pattern_func (int op, char *pro + if (option (OPTRESOLVE)) + { +--- a/pattern.c ++++ b/pattern.c +@@ -1357,8 +1357,10 @@ + { + switch (op) { - case M_DELETE: case M_UNDELETE: @@ -120,8 +208,5 @@ diff -pruN1 mutt-1.3.25.trash_folder/pattern.c mutt-1.3.25.purge_command/pattern + 0); + case M_DELETE: mutt_set_flag (Context, Context->hdrs[Context->v2r[i]], M_DELETE, -diff -pruN mutt-1.3.25.orig/PATCHES mutt-1.3.25/PATCHES ---- mutt-1.3.25.orig/PATCHES Mon Nov 26 20:16:52 2001 -+++ mutt-1.3.25/PATCHES Thu Dec 6 16:27:55 2001 -@@ -1,0 +1 @@ -+patch-1.3.25.cd.purge_command.2 + (op == M_DELETE)); + break;