=================================================================== RCS file: /cvs/mandoc/roff.7,v retrieving revision 1.1 retrieving revision 1.4 diff -u -p -r1.1 -r1.4 --- mandoc/roff.7 2010/05/16 19:08:11 1.1 +++ mandoc/roff.7 2010/05/17 02:01:05 1.4 @@ -1,4 +1,4 @@ -.\" $Id: roff.7,v 1.1 2010/05/16 19:08:11 kristaps Exp $ +.\" $Id: roff.7,v 1.4 2010/05/17 02:01:05 kristaps Exp $ .\" .\" Copyright (c) 2010 Kristaps Dzonsons .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: May 16 2010 $ +.Dd $Mdocdate: May 17 2010 $ .Dt ROFF 7 .Os .Sh NAME @@ -65,10 +65,57 @@ Thus, the following are equivalent: .Sh REFERENCE This section is a canonical reference of all macros, arranged alphabetically. +.Ss \&am +The syntax of this macro is the same as that of +.Sx \&ig , +except that a leading argument must be specified. +It is ignored, as are its children. +.Ss \&ami +The syntax of this macro is the same as that of +.Sx \&ig , +except that a leading argument must be specified. +It is ignored, as are its children. +.Ss \&am1 +The syntax of this macro is the same as that of +.Sx \&ig , +except that a leading argument must be specified. +It is ignored, as are its children. +.Ss \&de +The syntax of this macro is the same as that of +.Sx \&ig , +except that a leading argument must be specified. +It is ignored, as are its children. +.Ss \&dei +The syntax of this macro is the same as that of +.Sx \&ig , +except that a leading argument must be specified. +It is ignored, as are its children. +.Ss \&de1 +The syntax of this macro is the same as that of +.Sx \&ig , +except that a leading argument must be specified. +It is ignored, as are its children. .Ss \&if -Begins a conditional. -Has the following syntax: +Begins a conditional that always evaluates to false. +If a conditional is false, its children are not processed, but are +syntactically interpreted to preserve the integrity of the input +document. +Thus, .Pp +.D1 \&.if t \e .ig +.Pp +will discard the +.Sq \&.ig , +which may lead to interesting results, but +.Pp +.D1 \&.if t \e .if t \e{\e +.Pp +will continue to syntactically interpret to the block close of the final +conditional. +Sub-conditionals, in this case, obviously inherit the truth value of +the parent. +This macro has the following syntax: +.Pp .Bd -literal -offset indent -compact \&.if COND \e{\e BODY... @@ -76,6 +123,10 @@ BODY... .Ed .Bd -literal -offset indent -compact \&.if COND \e{ BODY +BODY... \e} +.Ed +.Bd -literal -offset indent -compact +\&.if COND \e{ BODY BODY... \&.\e} .Ed @@ -84,7 +135,8 @@ BODY... BODY .Ed .Pp -COND is a conditional (TODO: document). +COND is a conditional (for the time being, this always evaluates to +false). .Pp If the BODY section is begun by an escaped brace .Sq \e{ , @@ -112,15 +164,76 @@ The scope of a conditional is always parsed, but only conditional evaluates to true. .Pp Note that text subsequent a +.Sq \&.\e} +macro is discarded. +Furthermore, if an explicit closing sequence .Sq \e} -is discarded. +is specified in a free-form line, the entire line is accepted within the +scope of the prior macro, not only the text preceding the close. .Ss \&ig -Ignore input until a -.Sq \.\. +Ignore input. +Accepts the following syntax: +.Pp +.Bd -literal -offset indent -compact +\&.ig +BODY... +\&.. +.Ed +.Bd -literal -offset indent -compact +\&.ig END +BODY... +\&.END +.Ed +.Pp +In the first case, input is ignored until a +.Sq \&.. macro is encountered on its own line. -Note that text subsequent the -.Sq \.\. +In the second case, input is ignored until a +.Sq \&.END +is encountered. +Text subsequent the +.Sq \&.END +or +.Sq \&.. is discarded. +.Pp +Do not use the escape +.Sq \e +anywhere in the definition of END. +It causes very strange behaviour. +Furthermore, if you redefine a +.Nm +macro, such as +.Pp +.D1 \&.ig if +.Pp +the subsequent invocation of +.Sx \&if +will first signify the end of comment, then be invoked as a macro. +This behaviour really shouldn't be counted upon. +.Sh COMPATIBILITY +This section documents compatibility between mandoc and other other +troff implementations, at this time limited to GNU troff +.Pq Qq groff . +The term +.Qq historic groff +refers to groff versions before the +.Pa doc.tmac +file re-write +.Pq somewhere between 1.15 and 1.19 . +.Pp +.Bl -dash -compact +.It +Historic groff did not accept white-space buffering the custom END tag +for the +.Sx \&ig +macro. +.It +The +.Sx \&if +and family would print funny white-spaces with historic groff when +depending on next-line syntax. +.El .Sh AUTHORS The .Nm