[comp.mail.mh] Full list of MH6.6 mh-format escapes needed

jamesp@metolius.wr.tek.COM (James T Perkins) (03/01/91)

I am trying to understand some lesser-known mh-format escapes, such as:
width, lit, putaddr, and void.  They do not seem to be documented in the
standard MH6.6 documentation (as reprinted in the Berkeley URM).  If
someone would share the meaning of these non-standard escapes with me, I
will gladly summarize the responses to the list.

My end desire is to be able to have my replcomps generate an "In-Reply-To"
header that auto-linewraps when it exceeds 79 characters in length.  Any
specific examples on how to do this, specifically, would be appreciated.
I suspect I'll have to add each token to the output string until the
next one would push me beyond 79 characters, then emit a newline-tab,
but perhaps there's a less painful way to do this, using only vanilla MH
and with no funky message post-processing.

 ___    ___   ___
|   \  / _ \ / __|  James Perkins, jamesp@metolius.wr.tek.com, (503)629-1149
| |> || |_| |\__ \  Logic Analyzers Division, DAS 9200 Engineering
|___/ |_| |_||___/  Tektronix, MS 92-725, PO Box 4600, Beaverton, OR 97076

This package is sold by weight, not by volume.  Some settling of contents may
have occurred during shipping and handling.

jamesp@metolius.wr.tek.COM (James T Perkins) (03/07/91)

This is a status report on my inquiry of a week ago.  Jerry Peek kindly
sent me the MH 6.7 mh-format(5) man page, and that gave me enough
information to start experimenting with and finding the pitfalls in my
MH 6.6 mh-format scanner.

I promised I would share whatever result I came up with.  Well, it's
ugly.  I prepare my In-Reply-To line programatically with MH now, with
the assumption that the field width is 80 characters.  The basic idea is
to prepare a string for output, and if it's too long, split it onto the
next line.

It also uses (note{from}) in preference to (friendly{from}) in
preference to {from} for the sender's name, and formats the date in a
different format which I found more readable for myself.

There's some wierd pussyfooting about with (void(tws{date})) and (eq 0)
that seemed to be a hack necessary to get things to function.  I didn't
find that the escapes, in combination with conditionals, did what seemed
natural.  Looks like I ought to break down and buy Jerry's book - maybe
I just misunderstand things a little.

Anyway, without further ado, here's what works for me:

%<{date}In-Reply-To: Message from \
%(void(note{from}))%<(nonnull)%(putstr) \
%|%(void(friendly{from}))%<(nonnull)"%(putstr)" \
%|%(void{from})%(putstr)%>%>\
%(void(strlen))%(void(gt 26))%(void(tws{date}))%<(eq 0)
\tof %(day{date}), %02(putnumf(mday{date}))-%(month{date})-%02(putnumf(year{date})) %02(putnumf(hour{date})):%02(putnumf(min{date}))%(tzone{date}) \
%|of %(day{date}), %02(putnumf(mday{date}))-%(month{date})-%02(putnumf(year{date})) %02(putnumf(hour{date})):%02(putnumf(min{date}))%(tzone{date})
\t%>\
%<{message-id}%{message-id}%>
%>\

James

 ___    ___   ___
|   \  / _ \ / __|  James Perkins, jamesp@metolius.wr.tek.com, (503)629-1149
| |> || |_| |\__ \  Logic Analyzers Division, DAS 9200 Engineering
|___/ |_| |_||___/  Tektronix, MS 92-725, PO Box 4600, Beaverton, OR 97076

This package is sold by weight, not by volume.  Some settling of contents may
have occurred during shipping and handling.