{ "metoo", DT_BOOL, R_NONE, OPTMETOO, 0 },
{ "menu_scroll", DT_BOOL, R_NONE, OPTMENUSCROLL, 0 },
{ "meta_key", DT_BOOL, R_NONE, OPTMETAKEY, 0 },
+ { "mh_purge", DT_BOOL, R_NONE, OPTMHPURGE, 0 },
{ "mime_forward", DT_QUAD, R_NONE, OPT_MIMEFWD, 0 },
{ "mime_forward_decode", DT_BOOL, R_NONE, OPTMIMEFORWDECODE, 0 },
{ "mime_fwd", DT_SYN, R_NONE, UL "mime_forward", 0 },
/*
* Mark all the mails in ctx read.
*/
-void tag_all_read (CONTEXT * ctx)
+static void tag_all_read (CONTEXT * ctx)
{
int i;
/*
* Mark one mail as unread
*/
-int tag_unread (CONTEXT * ctx, char *name)
+static int tag_unread (CONTEXT * ctx, char *name)
{
int i;
if (ctx->hdrs[i]->deleted)
{
snprintf (path, sizeof (path), "%s/%s", ctx->path, ctx->hdrs[i]->path);
- if (ctx->magic == M_MAILDIR)
+ if (ctx->magic == M_MAILDIR || (option (OPTMHPURGE) && ctx->magic == M_MH))
unlink (path);
- else
+ else if (ctx->magic == M_MH)
{
/* MH just moves files out of the way when you delete them */
- snprintf (tmp, sizeof (tmp), "%s/,%s", ctx->path, ctx->hdrs[i]->path);
- unlink (tmp);
- rename (path, tmp);
+ if(*ctx->hdrs[i]->path != ',')
+ {
+ snprintf (tmp, sizeof (tmp), "%s/,%s", ctx->path, ctx->hdrs[i]->path);
+ unlink (tmp);
+ rename (path, tmp);
+ }
+
}
}
else if (ctx->hdrs[i]->changed || ctx->hdrs[i]->attach_del)
OPTMENUSCROLL, /* scroll menu instead of implicit next-page */
OPTMETAKEY, /* interpret ALT-x as ESC-x */
OPTMETOO,
+ OPTMHPURGE,
OPTMIMEFORWDECODE,
OPTPAGERSTOP,
OPTPIPEDECODE,