Add two new format functions: %(myhost) and %(myname).
[mmh] / man / mh-format.man
index b2b5818..aa1c630 100644 (file)
@@ -1,8 +1,7 @@
 .\"
-.\" THIS FILE HAS BEEN AUTOMATICALLY GENERATED.  DO NOT EDIT.
-.\" $Id$
+.\" %nmhwarning%
 .\"
-.TH MH-FORMAT 5 "%nmhdate%" MH.6.8 [%nmhversion%]
+.TH MH-FORMAT %manext5% "%nmhdate%" MH.6.8 [%nmhversion%]
 .SH NAME
 mh-format \- format file for nmh message system
 .SH DESCRIPTION
@@ -253,7 +252,9 @@ strlen              integer length of \fIstr\fR
 width          integer output buffer size in bytes
 charleft               integer bytes left in output buffer
 timenow                integer seconds since the UNIX epoch
-me             string  the user's mailbox
+me             string  the user's mailbox (username)
+myhost         string  the user's local hostname
+myname         string  the user's name
 eq     literal boolean \fInum\fR == \fIarg\fR
 ne     literal boolean \fInum\fR != \fIarg\fR
 gt     literal boolean \fInum\fR > \fIarg\fR
@@ -282,21 +283,40 @@ compval   comp    integer Set \fInum\fR to \*(lq\fBatoi\fR(\fIcomp\fR\^)\*(rq
 .\" decodecomp comp    string  Set \fIstr\fR to RFC-2047 decoded component text
 decode expr    string  decode \fIstr\fR as RFC-2047 (MIME-encoded) 
                        component
+unquote        expr    string  remove RFC-2822 quotes from \fIstr\fR
 trim   expr            trim trailing white-space from \fIstr\fR
 putstr expr            print \fIstr\fR
 putstrf        expr            print \fIstr\fR in a fixed width
 putnum expr            print \fInum\fR
 putnumf        expr            print \fInum\fR in a fixed width
 .\" addtoseq literal    add msg to sequence (LBL option)
+putlit expr            print \fIstr\fR without space compression
 nodate string  integer Argument not a date string (0 or 1)
 formataddr     expr            append \fIarg\fR to \fIstr\fR as a
                        (comma separated) address list
+concataddr     expr            append \fIarg\fR to \fIstr\fR as a
+                       (comma separated) address list,
+                       including duplicates,
+                       see Special Handling
 putaddr        literal         print \fIstr\fR address list with
                        \fIarg\fR as optional label;
                        get line width from \fInum\fR
 .fi
 .RE
 .PP
+The (\fIme\fR\^) function returns the username of the current user.  The
+(\fImyhost\fR\^) function returns the
+.B localname
+entry in
+.IR mts.conf ,
+or the local hostname if
+.B localname
+is not configured.  The (\fImyname\fR\^) function will return the value of
+the
+.B SIGNATURE
+environment variable if set, otherwise will return the passwd GECOS field for
+the current user.
+.PP
 The following functions require a date component as an argument:
 .PP
 .RS 5
@@ -387,10 +407,24 @@ right-justification of the string within the field, with padding on
 the left up to the field width.
 The functions (\fIputnum\fR\^) and
 (\fIputstr\fR\^) are somewhat special: they print their result in the minimum number of characters
-required, and ignore any leading field width argument.
+required, and ignore any leading field width argument.  The (\fIputlit\fR\^)
+function outputs the exact contents of str register without any changes
+such as duplicate space removal or control character conversion.
 .PP
 The available output width is kept in an internal register; any output
 past this width will be truncated.
+.SS Special Handling
+A few functions have different behavior depending on what command they are
+being invoked from.
+.PP
+In
+.BR repl
+the (\fIformataddr\fR\^) function stores all email addresses encountered into
+an internal cache and will use this cache to suppress duplicate addresses.
+If you need to create an address list that includes previously-seen
+addresses you may use the (\fIconcataddr\fR\^) function, which is identical
+to (\fIformataddr\fR\^) in all other respects.  Note that (\fIconcataddr\fR\^)
+will NOT add addresses to the duplicate-suppression cache.
 .SS Examples
 With all this in mind,
 here's the default format string for
@@ -421,7 +455,7 @@ a slash. Next,
 .PP
 .RS 5
 .nf
-%<{date} %|*>
+%<{date} %|*%>
 .fi
 .RE
 .PP