Dear all, I've prepared a patch for mutt 1.5.24 which allows users to mute threads like Google Mail does. The patch is attached, a slightly longer rationale is available here[1]. Would you be interested in merging this with trunk?
Thanks! -Andreas [1] http://gentryx.de/news_mute_a_la_google_mail.html -- ========================================================== Andreas Schäfer HPC and Grid Computing Department of Computer Science 3 Friedrich-Alexander-Universität Erlangen-Nürnberg, Germany +49 9131 85-27910 PGP/GPG key via keyserver http://www.libgeodecomp.org ========================================================== (\___/) (+'.'+) (")_(") This is Bunny. Copy and paste Bunny into your signature to help him gain world domination!
diff --ignore-space-change -ru '--exclude=doc' mutt-1.5.24/commands.c mutt-1.5.24-new/commands.c --- mutt-1.5.24/commands.c 2015-08-30 19:18:28.000000000 +0200 +++ mutt-1.5.24-new/commands.c 2015-09-08 22:05:19.681904163 +0200 @@ -659,6 +659,43 @@ mutt_message ("%s: %s", pfx, buf); } +void mutt_tag_muted_threads (CONTEXT *ctx, int *redraw) +{ + THREAD *thread; + CONTEXT *reference_ctx; + LIST *message_ref; + LIST *reference_ref; + HEADER *message_header; + HEADER *reference_header; + int i; + int j; + + reference_ctx = mx_open_mailbox (Muted, NULL, NULL); + if (reference_ctx == NULL) { + return; + } + + for (j = 0; j < ctx->msgcount; ++j) { + message_header = ctx->hdrs[j]; + + for (message_ref = message_header->env->references; + message_ref != NULL; + message_ref = message_ref->next) { + + for (i = 0; i < reference_ctx->msgcount; ++i) { + reference_header = reference_ctx->hdrs[i]; + + if (mutt_strcmp (message_ref->data, reference_header->env->message_id) == 0) { + mutt_set_flag (ctx, message_header, M_TAG, 1); + *redraw |= REDRAW_FULL; + } + } + } + } + + FREE (reference_ctx); +} + static void set_copy_flags (HEADER *hdr, int decode, int decrypt, int *cmflags, int *chflags) { *cmflags = 0; diff --ignore-space-change -ru '--exclude=doc' mutt-1.5.24/curs_main.c mutt-1.5.24-new/curs_main.c --- mutt-1.5.24/curs_main.c 2015-08-30 19:06:38.000000000 +0200 +++ mutt-1.5.24-new/curs_main.c 2015-09-08 22:06:45.341903362 +0200 @@ -1978,6 +1978,11 @@ mutt_display_address (CURHDR->env); break; + case OP_TAG_MUTED_THREADS: + + mutt_tag_muted_threads (Context, &menu->redraw); + break; + case OP_ENTER_COMMAND: CurrentMenu = MENU_MAIN; diff --ignore-space-change -ru '--exclude=doc' mutt-1.5.24/functions.h mutt-1.5.24-new/functions.h --- mutt-1.5.24/functions.h 2015-08-30 19:06:38.000000000 +0200 +++ mutt-1.5.24-new/functions.h 2015-09-08 22:06:44.591903369 +0200 @@ -151,6 +151,7 @@ { "buffy-list", OP_BUFFY_LIST, "." }, { "sync-mailbox", OP_MAIN_SYNC_FOLDER, "$" }, { "display-address", OP_DISPLAY_ADDRESS, "@" }, + { "tag-muted-threads", OP_TAG_MUTED_THREADS, "A" }, { "pipe-message", OP_PIPE, "|" }, { "next-new", OP_MAIN_NEXT_NEW, NULL }, { "next-new-then-unread", OP_MAIN_NEXT_NEW_THEN_UNREAD, "\t" }, diff --ignore-space-change -ru '--exclude=doc' mutt-1.5.24/globals.h mutt-1.5.24-new/globals.h --- mutt-1.5.24/globals.h 2015-08-30 19:06:38.000000000 +0200 +++ mutt-1.5.24-new/globals.h 2015-09-08 21:41:06.801917735 +0200 @@ -94,6 +94,7 @@ WHERE char *MixEntryFormat; #endif +WHERE char *Muted; WHERE char *Muttrc INITVAL (NULL); WHERE char *Outbox; WHERE char *Pager; diff --ignore-space-change -ru '--exclude=doc' mutt-1.5.24/init.h mutt-1.5.24-new/init.h --- mutt-1.5.24/init.h 2015-08-30 19:06:38.000000000 +0200 +++ mutt-1.5.24-new/init.h 2015-09-08 21:45:57.101915023 +0200 @@ -1625,6 +1625,14 @@ ** from your spool mailbox to your $$mbox mailbox, or as a result of ** a ``$mbox-hook'' command. */ + { "muted", DT_PATH, R_NONE, UL &Muted, UL "~/muted" }, + /* + ** .pp + ** This variable lets users define a mailbox which contains threads + ** that are irrelevant to the user. Mails in the current mailbox, + ** which reference these threads, can be automatically tagged for + ** easy archiving. + */ { "narrow_tree", DT_BOOL, R_TREE|R_INDEX, OPTNARROWTREE, 0 }, /* ** .pp diff --ignore-space-change -ru '--exclude=doc' mutt-1.5.24/OPS mutt-1.5.24-new/OPS --- mutt-1.5.24/OPS 2015-08-30 19:06:38.000000000 +0200 +++ mutt-1.5.24-new/OPS 2015-09-08 22:06:43.551903379 +0200 @@ -161,6 +161,7 @@ OP_SORT "sort messages" OP_SORT_REVERSE "sort messages in reverse order" OP_TAG "tag the current entry" +OP_TAG_MUTED_THREADS "tag all mails which belong to muted threads" OP_TAG_PREFIX "apply next function to tagged messages" OP_TAG_PREFIX_COND "apply next function ONLY to tagged messages" OP_TAG_SUBTHREAD "tag the current subthread" diff --ignore-space-change -ru '--exclude=doc' mutt-1.5.24/protos.h mutt-1.5.24-new/protos.h --- mutt-1.5.24/protos.h 2015-08-30 19:06:38.000000000 +0200 +++ mutt-1.5.24-new/protos.h 2015-09-08 22:07:14.851903087 +0200 @@ -250,6 +250,7 @@ void mutt_signal_init (void); void mutt_stamp_attachment (BODY *a); void mutt_tabs_to_spaces (char *); +void mutt_tag_muted_threads (CONTEXT *, int *); void mutt_tag_set_flag (int, int); short mutt_ts_capability (void); void mutt_unblock_signals (void);
signature.asc
Description: Digital signature