groff-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[groff] 03/03: Update documentation of condition expressions.


From: G. Branden Robinson
Subject: [groff] 03/03: Update documentation of condition expressions.
Date: Tue, 19 May 2020 08:57:36 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 097b3c6c4e555d95c2f99dee506b9c481d9d466e
Author: G. Branden Robinson <address@hidden>
AuthorDate: Tue May 19 21:31:00 2020 +1000

    Update documentation of condition expressions.
    
    * doc/groff.texi: Explain the "v" condition a bit more since it was
      mysterious.  (Once upon a time, there was an electrostatic plotter
      called the Versatec V-80, and some troff somewhere supported it.)
      Tighten and parallelize descriptions of conditions slightly.  Refer to
      ASCII characters as "basic Latin" from Unicode.  Use correct irrealis
      mood (subjunctive).
    
    * man/groff.7.man: Fix error: negative numeric expressions evaluate
      false, not true as was implied.  Parallelize descriptions with Texinfo
      and groff_diff(7) (in abbreviated form).  Document "v" condition.  Add
      leading dots to request names.  Add space between test sigil (c, d, F,
      etc.) and expression.  Sort alphabetical conditions.  Prevent sentence
      spacing after "!" mentioned as operator in running prose.
    
    * man/groff_diff.7.man: Give conditions their own subsection and
      relocate them out of the "Miscellaneous" subsection.  Parallelize
      descriptions with Texinfo.  Document "v" condition.
---
 doc/groff.texi       |  36 ++++++------
 man/groff.7.man      |  70 ++++++++++++++----------
 man/groff_diff.7.man | 152 +++++++++++++++++++++++++++++++++------------------
 3 files changed, 157 insertions(+), 101 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 6be012d..91291c9 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -10737,8 +10737,9 @@ True if the document is being processed in troff mode 
(i.e., the
 @code{troff} request has been issued).  @xref{Troff and Nroff Mode}.
 
 @item v
-Always false.  This condition is for compatibility with other
-@code{troff} versions only (identifying a @code{-Tversatec} device).
+Always false.  This condition is for compatibility with certain other
+@code{troff} implementations only (identifying a processing mode
+destined for a Versatec electrostatic plotter as the output device).
 
 @item '@var{xxx}'@var{yyy}'
 True if the output produced by @var{xxx} is equal to the output produced
@@ -10796,34 +10797,33 @@ false
     @result{} true
 @endExample
 
-@item r @var{xxx}
-True if there is a number register named @var{xxx}.
+@item r @var{reg}
+True if there is a number register called @var{reg}.
 
-@item d @var{xxx}
-True if there is a string, macro, diversion, or request named @var{xxx}.
+@item d @var{name}
+True if there is a string, macro, diversion, or request called
+@var{name}.
 
-@item m @var{xxx}
-True if there is a color named @var{xxx}.
+@item m @var{color}
+True if there is a color called @var{color}.
 
 @item c @var{g}
-True if there is a glyph @var{g} available@footnote{The name of this
-conditional operator is a misnomer since it tests names of output
-glyphs.}; @var{g} is either an @acronym{ASCII} character or a special
-character (@code{\N'@var{xxx}'}, @code{\(@var{gg}} or
-@code{\[@var{ggg}]}); the condition is also true if @var{g} has been
-defined by the @code{char} request.
+True if a glyph @var{g} is available, where @var{g} is a Unicode basic
+Latin character; a GNU @code{troff} special character @samp{\(@var{xx}}
+or @samp{\[@var{xxx}]}; @samp{\N'@var{xxx}'}; or has been defined by the
+@code{char} request.
 
 @item F @var{font}
-True if a font named @var{font} exists.  @var{font} is handled as if it
-was opened with the @code{ft} request (that is, font translation and
+True if a font called @var{font} exists.  @var{font} is handled as if it
+were opened with the @code{ft} request (that is, font translation and
 styles are applied), without actually mounting it.
 
 This test doesn't load the complete font but only its header to verify
 its validity.
 
 @item S @var{style}
-True if style @var{style} has been registered.  Font translation is
-applied.
+True if a style called @var{style} has been registered.  Font
+translation is applied.
 @end table
 
 Note that these operators can't be combined with other operators like
diff --git a/man/groff.7.man b/man/groff.7.man
index ede3a76..6c0c652 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -931,13 +931,13 @@ Texinfo manual.
 .\" ====================================================================
 .
 .B Conditions
-occur in tests raised by the
-.request if\c
+are expressions tested by the
+.request .if\c
 ,
-.request ie\c
+.request .ie\c
 ,
 and the
-.request while
+.request .while
 requests.
 .
 The following table characterizes the different types of conditions.
@@ -957,7 +957,8 @@ yields true if its value is greater than\~0.
 .BI ! N
 True if the value of
 .I N
-is\~0 (see below).
+is \[<=]\~0
+(see below).
 .
 .TPx
 .BI \[aq] s1 \[aq] s2 \[aq]
@@ -975,14 +976,17 @@ is not identical to string\~\c
 (see below).
 .
 .TPx
-.BI c ch
-True if there is a glyph\~\c
-.I ch
-available.
+.BI c\~ g
+True if a glyph
+.I g
+is available.
 .
 .TPx
-.BI d name
-True if there is a string, macro, diversion, or request called
+.BI d\~ name
+True if there is a string,
+macro,
+diversion,
+or request called
 .IR name .
 .
 .TPx
@@ -990,39 +994,47 @@ True if there is a string, macro, diversion, or request 
called
 Current page number is even.
 .
 .TPx
-.B o
-Current page number is odd.
+.BI F\~ font
+True if a font called
+.I font
+exists.
 .
 .TPx
-.BI m name
+.BI m\~ color
 True if there is a color called
-.IR name .
+.IR color .
 .
 .TPx
 .B n
 Formatter is
-.BR nroff .
+.IR nroff .
+.
+.TPx
+.B o
+Current page number is odd.
 .
 .TPx
-.BI r reg
-True if there is a register named
+.BI r\~ reg
+True if there is a number register called
 .IR reg .
 .
 .TPx
-.B t
-Formatter is
-.BR troff .
+.BI S\~ style
+True if a style called
+.I style
+has been registered.
 .
 .TPx
-.BI F font
-True if there exists a font named
-.IR font .
+.B t
+Formatter is
+.IR troff .
 .
 .TPx
-.BI S style
-True if a style named
-.I style
-has been registered.
+.B v
+Always false
+(for compatibilty with other
+.I troff
+implementations).
 .
 .RE
 .PD
@@ -1030,7 +1042,7 @@ has been registered.
 .
 .P
 Note that the
-.B !
+.B !\&
 operator may only appear at the beginning of an expression,
 and negates the entire expression.
 This maintains bug-compatibility with AT&T
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index d5b2e5b..57e05a3 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -242,6 +242,104 @@ is missing, ignore scaling indicators in the evaluation 
of\~\c
 .
 .
 .\" ====================================================================
+.SS Conditions
+.\" ====================================================================
+.
+More conditions can be tested with the
+.B .if
+and
+.B .ie
+requests,
+as well as the new
+.B .while
+request.
+.
+.
+.TP
+.BI c\~ g
+True if a glyph
+.I g
+is available,
+where
+.I g
+is a Unicode basic Latin character;
+a
+.I groff
+special character
+.BI \[rs]( xx
+or
+.BI \[rs][ xxx\c
+.BR ] ;
+.BI \[rs]N' xxx\c
+.BR ' ;
+or has been defined by the
+.B .char
+request.
+.
+.
+.TP
+.BI d\~ name
+True if there is a string,
+macro,
+diversion,
+or request called
+.IR name .
+.
+.
+.TP
+.BI F\~ font
+True if a font called
+.I font
+exists.
+.
+.I font
+is handled as if it
+were opened with the
+.B .ft
+request
+(that is,
+font translation and
+styles are applied),
+without actually mounting it.
+.
+This test doesn't load the complete font,
+but only its header,
+to verify its validity.
+.
+.
+.TP
+.BI m\~ color
+True if there is a color called
+.IR color .
+.
+.
+.TP
+.BI r\~ reg
+True if there is a number register called
+.IR reg .
+.
+.
+.TP
+.BI S\~ style
+True if a style called
+.I style
+has been registered.
+.
+Font translation is applied.
+.
+.
+.TP
+.B v
+Always false.
+.
+This condition is for compatibility with certain other
+.I troff
+implementations only
+(identifying a processing mode destined for a Versatec electrostatic
+plotter as the output device).
+.
+.
+.\" ====================================================================
 .SS "Escape sequences"
 .\" ====================================================================
 .
@@ -3366,60 +3464,6 @@ the same input level as the opening\~\c
 .
 In compatibility mode, no attention is paid to the input-level.
 .
-.P
-There are some new types of condition:
-.
-.TP
-.BI .if\~r xxx
-True if there is a number register named
-.IR xxx .
-.
-.TP
-.BI .if\~d xxx
-True if there is a string, macro, diversion, or request named
-.IR xxx .
-.
-.TP
-.BI .if\~m xxx
-True if there is a color named
-.IR xxx .
-.
-.TP
-.BI .if\~c ch
-True if there is a character (or glyph)
-.I ch
-available;
-.I ch
-is either an ASCII character or a glyph (special character)
-.BI \[rs]N' xxx '\f[R],
-.BI \[rs]( xx
-or
-.BI \[rs][ xxx ]\f[R];
-the condition is also true if
-.I ch
-has been defined by the
-.B char
-request.
-.
-.TP
-.BI .if\~F f
-True if font\~\c
-.I f
-exists.
-.
-.BR f \~\c
-is handled as if it was opened with the
-.B ft
-request (this is, font translation and styles are applied), without
-actually mounting it.
-.
-.TP
-.BI .if\~S s
-True if style\~\c
-.I s
-has been registered.
-.
-Font translation is applied.
 .
 .P
 The



reply via email to

[Prev in Thread] Current Thread [Next in Thread]