]> diplodocus.org Git - nmh/blobdiff - man/mh-format.man
Added note that suffixes were removed from filenames of temporary files.
[nmh] / man / mh-format.man
index de276fd16377169cf128e7a5ea098d1de4af4f87..38d313897e1836cf1ef34649eb9894f185fb6e7e 100644 (file)
@@ -253,7 +253,7 @@ cur         integer message is current (0 or 1)
 unseen         integer message is unseen (0 or 1)
 size           integer size of message
 strlen         integer length of \fIstr\fR
 unseen         integer message is unseen (0 or 1)
 size           integer size of message
 strlen         integer length of \fIstr\fR
-width          integer output buffer size in bytes
+width          integer column width of terminal
 charleft               integer bytes left in output buffer
 timenow                integer seconds since the UNIX epoch
 me             string  the user's mailbox (username)
 charleft               integer bytes left in output buffer
 timenow                integer seconds since the UNIX epoch
 me             string  the user's mailbox (username)
@@ -285,11 +285,11 @@ void      expr            Set \fIstr\fR or \fInum\fR
 comp   comp    string  Set \fIstr\fR to component text
 compval        comp    integer Set \fInum\fR to \*(lq\fBatoi\fR(\fIcomp\fR\^)\*(rq
 .\" compflag   comp    integer Set \fInum\fR to component flags bits (internal)
 comp   comp    string  Set \fIstr\fR to component text
 compval        comp    integer Set \fInum\fR to \*(lq\fBatoi\fR(\fIcomp\fR\^)\*(rq
 .\" compflag   comp    integer Set \fInum\fR to component flags bits (internal)
-.\" decodecomp comp    string  Set \fIstr\fR to RFC-2047 decoded component text
-decode expr    string  decode \fIstr\fR as RFC-2047 (MIME-encoded) 
+.\" decodecomp comp    string  Set \fIstr\fR to RFC 2047 decoded component text
+decode expr    string  decode \fIstr\fR as RFC 2047 (MIME-encoded) 
                        component
                        component
-unquote        expr    string  remove RFC-2822 quotes from \fIstr\fR
-trim   expr            trim trailing white-space from \fIstr\fR
+unquote        expr    string  remove RFC 2822 quotes from \fIstr\fR
+trim   expr            trim trailing whitespace from \fIstr\fR
 putstr expr            print \fIstr\fR
 putstrf        expr            print \fIstr\fR in a fixed width
 putnum expr            print \fInum\fR
 putstr expr            print \fIstr\fR
 putstrf        expr            print \fIstr\fR in a fixed width
 putnum expr            print \fInum\fR
@@ -298,6 +298,13 @@ putnumf    expr            print \fInum\fR in a fixed width
 putlit expr            print \fIstr\fR without space compression
 zputlit        expr            print \fIstr\fR without space compression;
                        \fIstr\fR must occupy no width on display
 putlit expr            print \fIstr\fR without space compression
 zputlit        expr            print \fIstr\fR without space compression;
                        \fIstr\fR must occupy no width on display
+bold           string  set terminal bold mode
+underline              string  set terminal underlined mode
+standout               string  set terminal standout mode
+resetterm              string  reset all terminal attributes
+hascolor               boolean terminal supports color
+fgcolor        literal string  set terminal foreground color
+bgcolor        literal string  set terminal background color
 formataddr     expr            append \fIarg\fR to \fIstr\fR as a
                        (comma separated) address list
 concataddr     expr            append \fIarg\fR to \fIstr\fR as a
 formataddr     expr            append \fIarg\fR to \fIstr\fR as a
                        (comma separated) address list
 concataddr     expr            append \fIarg\fR to \fIstr\fR as a
@@ -363,8 +370,9 @@ date2gmt    date            coerce date to GMT
 dst    date    integer daylight savings in effect? (0 or 1)
 clock  date    integer seconds since the UNIX epoch
 rclock date    integer seconds prior to current time
 dst    date    integer daylight savings in effect? (0 or 1)
 clock  date    integer seconds since the UNIX epoch
 rclock date    integer seconds prior to current time
-tws    date    string  official 822 rendering
+tws    date    string  official RFC 822 rendering
 pretty date    string  user-friendly rendering
 pretty date    string  user-friendly rendering
+nodate date    integer returns 1 if date is invalid
 .fi
 .RE
 .PP
 .fi
 .RE
 .PP
@@ -376,7 +384,7 @@ the first address present in the header component.
 .nf
 .ta \w'Fformataddr 'u +\w'Aboolean 'u +\w'Rboolean 'u
 .I "Function   Argument        Return  Description"
 .nf
 .ta \w'Fformataddr 'u +\w'Aboolean 'u +\w'Rboolean 'u
 .I "Function   Argument        Return  Description"
-proper addr    string  official 822 rendering
+proper addr    string  official RFC 822 rendering
 friendly       addr    string  user-friendly rendering
 addr   addr    string  mbox@host or host!mbox rendering*
 pers   addr    string  the personal name*
 friendly       addr    string  user-friendly rendering
 addr   addr    string  mbox@host or host!mbox rendering*
 pers   addr    string  the personal name*
@@ -432,8 +440,29 @@ the str register, but requires that those contents not occupy any
 output width.  It can therefore be used for outputting terminal escape
 sequences.
 .PP
 output width.  It can therefore be used for outputting terminal escape
 sequences.
 .PP
+There are a limited number of function escapes to output terminal escape
+sequences. These sequences are retrieved from the
+.IR terminfo (5)
+database according to the current terminal setting.  The (\fIbold\fR\^),
+(\fIunderline\fR\^), and (\fIstandout\fR\^) escapes set bold mode,
+underline mode, and standout mode respectively.
+.PP
+(\fIhascolor\fR\^)
+can be used to determine if the current terminal supports color.
+(\fIfgcolor\fR\^) and (\fIbgcolor\fR\^) set the foreground and
+background colors respectively.  Both of these escapes take one literal
+argument, the color name, which can be one of: black, red, green, yellow,
+blue, magenta, cyan, white.  (\fIresetterm\fR\^) resets all terminal
+attributes back to their default setting.
+.PP
+All of these terminal escape should be used in conjunction with
+(\fIzputlit\fR\^) (preferred) or (\fIputlit\fR\^), as the normal
+(\fputstr\fR\^) function will strip out control characters.
+.PP
 The available output width is kept in an internal register; any output
 The available output width is kept in an internal register; any output
-past this width will be truncated.
+past this width will be truncated.  The one exception to this is
+(\fIzputlit\fR\^) functions will still be executed in case a terminal reset
+code is being placed at the end of the line.
 .SS Special Handling
 A few functions have different behavior depending on what command they are
 being invoked from.
 .SS Special Handling
 A few functions have different behavior depending on what command they are
 being invoked from.
@@ -510,16 +539,14 @@ clause sets the
 register.
 .PP
 As an additional note, the (\fIformataddr\fR\^) and (\fIconcataddr\fR\^)
 register.
 .PP
 As an additional note, the (\fIformataddr\fR\^) and (\fIconcataddr\fR\^)
-functions have some behavior when it comes to the
+functions have special behavior when it comes to the
 .I str
 register.  The starting point of the register is saved and is used to
 build up entries in the address list.
 .PP
 You will find the
 .I str
 register.  The starting point of the register is saved and is used to
 build up entries in the address list.
 .PP
 You will find the
-.B ap
-and
-.B fmtdump
-utilities invaluable in debugging problems with format strings.
+.B fmttest
+utility invaluable when debugging problems with format strings.
 .SS Examples
 With all this in mind,
 here's the default format string for
 .SS Examples
 With all this in mind,
 here's the default format string for
@@ -749,7 +776,6 @@ at 4 digits.
 .SH "SEE ALSO"
 .IR scan (1),
 .IR repl (1),
 .SH "SEE ALSO"
 .IR scan (1),
 .IR repl (1),
-.IR ap (8),
-.IR dp (8)
+.IR fmttest (1),
 .SH CONTEXT
 None
 .SH CONTEXT
 None