groff-commit
[Top][All Lists]
Advanced

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

[groff] 15/17: [docs]: Update conditional expression material.


From: G. Branden Robinson
Subject: [groff] 15/17: [docs]: Update conditional expression material.
Date: Tue, 25 May 2021 09:35:52 -0400 (EDT)

gbranden pushed a commit to branch master
in repository groff.

commit 2cbf2241b5dc6b4b01b7451b8569009060747a25
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Tue May 25 22:16:48 2021 +1000

    [docs]: Update conditional expression material.
    
    * doc/groff.texi (Operators in Conditionals):
    * man/groff.7.man (Control structures/Conditional expressions): Fix
      omission; the conditional operators "F", "m", and "S" also accept
      optional spaces and/or tabs between themselves and their arguments.
    
    Also, in groff(7):
    * Demote "Conditional expressions" heading from section to subsection.
    * Migrate table of conditional expression operators from ".PD 0/.TPx"
      hack to a tbl(1) table.
    * Recast table entries for parallelism and precision.
    * Refer to ! operator as performing complementation, not negation.
---
 ChangeLog       |   8 +++
 doc/groff.texi  |   8 +--
 man/groff.7.man | 162 ++++++++++++++++++++++++++++++--------------------------
 3 files changed, 98 insertions(+), 80 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f327767..9010b5c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2021-05-25  G. Branden Robinson <g.branden.robinson@gmail.com>
 
+       * doc/groff.texi (Operators in Conditionals):
+       * man/groff.7.man (Control structures/Conditional expressions):
+       Fix omission; the conditional operators "F", "m", and "S" also
+       accept optional spaces and/or tabs between themselves and their
+       arguments.
+
+2021-05-25  G. Branden Robinson <g.branden.robinson@gmail.com>
+
        * man/groff.7.man (Requests/Request short reference) <.ta>:
        Describe the request as tersely as possible without omitting its
        essential syntax and semantics.  (The AT&T troff "+" relative
diff --git a/doc/groff.texi b/doc/groff.texi
index 0e62fcd..98c8e99 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -11654,10 +11654,10 @@ mark and the operator) can be used to negate the 
result.
     @result{} register x is defined
 @endExample
 
-Spaces and tabs are optional immediately after the @samp{r}, @samp{d},
-and @samp{c} operators, but immediately after @samp{!}, they cause the
-condition to evaluate false (this bizarre behavior maintains
-compatibility with @acronym{AT&T} @code{troff}).
+Spaces and tabs are optional immediately after the @samp{c}, @samp{d},
+@samp{F}, @samp{m}, @samp{r}, and @samp{S} operators, but immediately
+after @samp{!}, they cause the condition to evaluate false (this bizarre
+behavior maintains compatibility with @acronym{AT&T} @code{troff}).
 
 @Example
 .nr x 1
diff --git a/man/groff.7.man b/man/groff.7.man
index ac38dab..6d16e22 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -1038,7 +1038,7 @@ request must be the last such escape on an input line.
 .
 .
 .\" ====================================================================
-.SH "Conditional expressions"
+.SS "Conditional expressions"
 .\" ====================================================================
 .
 In
@@ -1055,92 +1055,99 @@ the members of this expanded class are termed
 .
 .P
 A numerical expression
-.I N
-yields true if its value is positive.
+.I expr
+is true if its value is positive.
 .
 In
 .I roff
 languages,
-negative values are false,
-not true.
+negative values are false.
 .
+The truth values of other conditional expression operators are as shown
+below.
 .
-.P
 .
-.PD 0
-.RS
-.
-.TPx
+.P
+.ne 14v
+.TS
+rf(BI) lB
+rB lx.
+cond-expr\f[R].\|.\|.  .\|.\|.is true if.\|.\|.
+_
+T{
 .BI \[aq] s1 \[aq] s2 \[aq]
-True
-.RI if\~ s1
-produces the same formatted output
-.RI as\~ s2 .
-.
-.
-.TPx
+T}     T{
+.I s1
+produces the same formatted output as
+.IR s2 .
+T}
+T{
 .BI c\~ g
-True if a glyph
+T}     T{
+a glyph
 .I g
 is available.
-.
-.TPx
-.BI d\~ name
-True if there is a string,
+T}
+T{
+.BI d\~ m
+T}     T{
+a string,
 macro,
 diversion,
-or request called
-.IR name .
-.
-.TPx
-.B e
-Current page number is even.
-.
-.TPx
-.BI F\~ font
-True if a font called
-.I font
-exists.
-.
-.TPx
-.BI m\~ color
-True if there is a color called
-.IR color .
-.
-.TPx
-.B n
-Formatter is
-.IR nroff .
-.
-.TPx
-.B o
-Current page number is odd.
-.
-.TPx
-.BI r\~ reg
-True if there is a number register called
-.IR reg .
-.
-.TPx
-.BI S\~ style
-True if a style called
-.I style
-has been registered.
-.
-.TPx
-.B t
-Formatter is
-.IR troff .
-.
-.TPx
-.B v
-Always false
-(for compatibilty with other
+or request
+.I m
+is defined.
+T}
+e      T{
+the current page number is even.
+T}
+T{
+.BI F\~ f
+T}     T{
+a font named
+.I f
+is available.
+T}
+T{
+.BI m\~ c
+T}     T{
+a color named
+.I c
+is defined.
+T}
+n      T{
+the formatter is in
+.I nroff
+mode.
+T}
+o      T{
+the current page number is odd.
+T}
+T{
+.BI r\~ n
+T}     T{
+a register named
+.I n
+is defined.
+T}
+T{
+.BI S\~ s
+T}     T{
+a font style named
+.I s
+is available.
+T}
+t      T{
+the formatter is in
 .I troff
-implementations).
-.
-.RE
-.PD
+mode.
+T}
+v      T{
+n/a
+(historical artifact;
+always false).
+T}
+.TE
 .
 .
 .P
@@ -1151,15 +1158,18 @@ or
 only a leading
 .RB \[lq] ! \[rq]
 (without spaces or tabs between the exclamation mark and the operator)
-can be used to negate the result.
+can be used to complement the result.
 .
 .
 .P
 Spaces and tabs are optional immediately after the
-.RB \[lq] r \[rq],
+.RB \[lq] c \[rq],
 .RB \[lq] d \[rq],
+.RB \[lq] F \[rq],
+.RB \[lq] m \[rq],
+.RB \[lq] r \[rq],
 and
-.RB \[lq] c \[rq]
+.RB \[lq] S \[rq]
 operators,
 but immediately after
 .RB \[lq] ! \[rq],



reply via email to

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