From: David Levine Date: Thu, 20 Nov 2014 02:13:01 +0000 (-0600) Subject: Added -[no]changecur switches to mhfixmsg(1). X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/587a468f26237df52d7f9f4ee2774afe105d0a51?ds=inline;hp=--cc Added -[no]changecur switches to mhfixmsg(1). --- 587a468f26237df52d7f9f4ee2774afe105d0a51 diff --git a/docs/pending-release-notes b/docs/pending-release-notes index 58895578..cf247dee 100644 --- a/docs/pending-release-notes +++ b/docs/pending-release-notes @@ -25,6 +25,7 @@ NEW FEATURES - When building from source, configure will derive ${prefix} from an existing nmh installation if it finds one in your $PATH. - Added getmymbox and getmyaddr mh-format(5) function escapes. +- The -changecur and -nochangecur switches have been added to mhfixmsg(1). ----------------- OBSOLETE FEATURES diff --git a/man/mhfixmsg.man b/man/mhfixmsg.man index 81d069ba..de5cc611 100644 --- a/man/mhfixmsg.man +++ b/man/mhfixmsg.man @@ -1,4 +1,4 @@ -.TH MHFIXMSG %manext1% "August 20, 2014" "%nmhversion%" +.TH MHFIXMSG %manext1% "November 19, 2014" "%nmhversion%" .\" .\" %nmhwarning% .\" @@ -28,6 +28,7 @@ mhfixmsg \- rewrite MIME messages with various transformations .RB [ \-rmmproc .IR program ] .RB [ \-normmproc ] +.RB [ \-changecur " | " \-nochangecur ] .RB [ \-verbose " | " \-noverbose ] .RB [ \-version ] .RB [ \-help ] @@ -346,12 +347,15 @@ is checked. .RB ` \-noreplacetextplain ' .RB ` \-fixboundary ' .RB ` \-fixcte ' +.RB ` \-changecur ' .RB ` \-noverbose ' .fi .SH CONTEXT If a folder is given, it will become the current folder. The last -message selected from a folder will become the current message. If +message selected from a folder will become the current message, unless the +.B \-nochangecur +switch is enabled. If the .B \-file switch or an absolute pathname is used, the context will not be modified. diff --git a/uip/mhfixmsg.c b/uip/mhfixmsg.c index 66b2eaca..ffe97acd 100644 --- a/uip/mhfixmsg.c +++ b/uip/mhfixmsg.c @@ -30,6 +30,8 @@ X("outfile file", 0, OUTFILESW) \ X("rmmproc program", 0, RPROCSW) \ X("normmproc", 0, NRPRCSW) \ + X("changecur", 0, CHGSW) \ + X("nochangecur", 0, NCHGSW) \ X("verbose", 0, VERBSW) \ X("noverbose", 0, NVERBSW) \ X("version", 0, VERSIONSW) \ @@ -114,6 +116,7 @@ main (int argc, char **argv) { CT *ctp; FILE *fp; int using_stdin = 0; + int chgflag = 1; int status = OK; fix_transformations fx; fx.reformat = fx.fixcte = fx.fixboundary = 1; @@ -212,6 +215,12 @@ main (int argc, char **argv) { case NRPRCSW: rmmproc = NULL; continue; + case CHGSW: + chgflag = 1; + continue; + case NCHGSW: + chgflag = 0; + continue; case VERBSW: verbosw = 1; continue; @@ -335,7 +344,9 @@ main (int argc, char **argv) { } } - seq_setcur (mp, mp->hghsel); /* update current message */ + if (chgflag) { + seq_setcur (mp, mp->hghsel); /* update current message */ + } seq_save (mp); /* synchronize sequences */ context_replace (pfolder, folder);/* update current folder */ context_save (); /* save the context file */