From: Ken Hornstein Date: Fri, 16 Mar 2012 15:32:35 +0000 (-0400) Subject: Create new switches -atfile and -noatfile to control the creation of the @ X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=46d843745041d6e852be2ae57de9261ae4e5f399;p=mmh Create new switches -atfile and -noatfile to control the creation of the @ file when repl'ing or dist'ing a message. --- diff --git a/man/dist.man b/man/dist.man index 63292c0..4955d63 100644 --- a/man/dist.man +++ b/man/dist.man @@ -35,6 +35,8 @@ dist \- redistribute a message to additional addresses .RB [ \-whatnowproc .IR program ] .RB [ \-nowhatnowproc ] +.RB [ \-atfile ] +.RB [ \-noatfile ] .RB [ \-version ] .RB [ \-help ] .ad @@ -164,6 +166,12 @@ stored in the environment variable and the pathname of the folder containing the message is stored in the environment variable .BR $mhfolder . +The creation of the \*(lq@\*(rq file and associated environment variables +can be controlled via the +.B \-atfile +and +.B \-noatfile +options. .PP The .B \-draftfolder @@ -226,6 +234,7 @@ comp(1), forw(1), repl(1), send(1), whatnow(1) .RB ` \-noannotate ' .RB ` \-nodraftfolder ' .RB ` \-inplace ' +.RB ` \-atfile ' .fi .SH CONTEXT diff --git a/man/repl.man b/man/repl.man index 4c04887..261ee60 100644 --- a/man/repl.man +++ b/man/repl.man @@ -39,6 +39,8 @@ all/to/cc/me] .RB [ \-whatnowproc .IR program ] .RB [ \-nowhatnowproc ] +.RB [ \-atfile ] +.RB [ \-noatfile ] .RB [ \-build ] .RB [ \-file .IR msgfile ] @@ -220,6 +222,12 @@ stored in the environment variable and the pathname of the folder containing the message is stored in the environment variable .BR $mhfolder . +The creation of the \*(lq@\*(rq file and associated environment variables +can be controlled via the +.B \-atfile +and +.B \-noatfile +options. .PP Although .B repl @@ -510,6 +518,7 @@ mhbuild(1), comp(1), forw(1), send(1), whatnow(1), mh\-format(5) .RB ` \-inplace ' .RB ` \-nomime ' .RB ` \-noquery ' +.RB ` \-atfile ' .RB ` "\-width\ 72" ' .fi diff --git a/uip/dist.c b/uip/dist.c index 20ae318..169eacd 100644 --- a/uip/dist.c +++ b/uip/dist.c @@ -52,6 +52,10 @@ static struct swit switches[] = { { "fcc mailbox", 0 }, #define WIDTHSW 19 { "width columns", 0 }, +#define ATFILESW 20 + { "atfile", 0 }, +#define NOATFILESW 21 + { "noatfile", 0 }, { NULL, 0 } }; @@ -85,7 +89,7 @@ main (int argc, char **argv) int anot = 0, inplace = 1, nedit = 0; int nwhat = 0, i, in, isdf = 0, out; int outputlinelen = OUTPUTLINELEN; - int dat[5]; + int dat[5], atfile = 1; char *cp, *cwd, *maildir, *msgnam, *dfolder = NULL; char *dmsg = NULL, *ed = NULL, *file = NULL, *folder = NULL; char *form = NULL, *msg = NULL, buf[BUFSIZ], drft[BUFSIZ]; @@ -213,6 +217,13 @@ main (int argc, char **argv) if ((outputlinelen = atoi(cp)) < 10) adios (NULL, "impossible width %d", outputlinelen); continue; + + case ATFILESW: + atfile++; + continue; + case NOATFILESW: + atfile = 0; + continue; } } if (*cp == '+' || *cp == '@') { @@ -333,7 +344,7 @@ try_it_again: if (nwhat) done (0); - what_now (ed, nedit, NOUSE, drft, msgnam, 1, mp, + what_now (ed, nedit, NOUSE, drft, atfile ? msgnam : NULL, 1, mp, anot ? "Resent" : NULL, inplace, cwd); done (1); return 1; diff --git a/uip/repl.c b/uip/repl.c index ab8042f..97178b1 100644 --- a/uip/repl.c +++ b/uip/repl.c @@ -70,6 +70,10 @@ static struct swit switches[] = { { "file file", 4 }, /* interface from msh */ #define BILDSW 28 { "build", 5 }, /* interface from mhe */ +#define ATFILESW 29 + { "atfile", 0 }, +#define NOATFILESW 30 + { "noatfile", 0 }, { NULL, 0 } }; @@ -134,6 +138,7 @@ main (int argc, char **argv) int i, isdf = 0; int anot = 0, inplace = 1; int nedit = 0, nwhat = 0; + int atfile = 1; char *cp, *cwd, *dp, *maildir, *file = NULL; char *folder = NULL, *msg = NULL, *dfolder = NULL; char *dmsg = NULL, *ed = NULL, drft[BUFSIZ], buf[BUFSIZ]; @@ -304,6 +309,13 @@ main (int argc, char **argv) dfolder = NULL; isdf = NOTOK; continue; + + case ATFILESW: + atfile++; + continue; + case NOATFILESW: + atfile = 0; + continue; } } if (*cp == '+' || *cp == '@') { @@ -424,7 +436,7 @@ try_it_again: if (nwhat) done (0); - what_now (ed, nedit, NOUSE, drft, msg, 0, mp, + what_now (ed, nedit, NOUSE, drft, atfile ? msg : NULL, 0, mp, anot ? "Replied" : NULL, inplace, cwd); done (1); return 1;