[bug #61477] [tbl] "nowarn" should suppress "table row will not fit warning" as well

2021-11-14 Thread G. Branden Robinson
Update of bug #61477 (project groff):

  Status:   Need Info => In Progress
 Assigned to:None => gbranden   

___

Follow-up Comment #1:

The lack of a NOWARN conditional bracket around this diagnostic appears to be
an oversight.

The diagnostic in question goes back to James Clark in 1993 (commit
71e9155c33) and it was not touched all the way through groff 1.22.4.

Werner added the "nowarn" region option to tbl(1) and the underlying C++
NOWARN flag in commit 065f04d6371bdf108a9cb34630e06b817b0a8e80, 16 February
2010.

I can't imagine why Joe Q. Tbl-User would want to be bothered about truncation
of a text block in the vertical dimension but not the truncation of table
entries of any sort in the horizontal one, so I'll proceed.

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[groff] 26/26: tbl(1): Heavily revise.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 03a27783205426444d51425a2897861dc2125f9a
Author: G. Branden Robinson 
AuthorDate: Sun Nov 14 02:13:58 2021 +1100

tbl(1): Heavily revise.

* Update summary description; tbl(1) _prepares_ tables rather than
  "formatting" them.  In the *roff sense, tbl cannot do the formatting
  because it doesn't know what the output line length is.  (This is also
  why tbl produces groff code to throw warnings at formatting time.)
* Drop comment credit to Bernd Warken for simple examples.  I've
  replaced them.
* Push in-document tables to the "Limitations" and "Examples" sections,
  so that they stop cluttering the presentation of the language.  Drop
  or replace most of examples in favor of more illustrative ones.
* Describe rofflike symbols (e.g., `.T&`, `\&`) as "tokens" when they
  are interpreted by tbl(1), not a *roff formatter.
* Rename "Bugs" section to "Limitations".
* Too many tightenings and recasts to enumerate.
* Sprinkle `ne` requests to prevent widows/orphans in typeset output.

Description:
* Introduce a domain lexicon, which I attempted to formally introduce
  and adhere strictly to for the balance of this rewrite.
  - table region
  - region option
  - table definition
  - format specification
  - (table) entry
  - table data
  In particular, the terms "global option" and "key", which seem to come
  from CSTR #49, are retired.  Use "cell" in a drastically more limited
  context.  Consistently refer to table entries as such rather than
  "items".  Use "keyword" in a more controlled way.

Region options:
* Explain why they have the name they do.
* Describe the syntax more carefully.
* Introduce a term "box options" to collect the *box/*frame keywords.
* Clarify that "box" and "doublebox" enclose the entire table region.
* Coalesce synonymous option names into those for their synonyms,
  following "centre" and "center".
* Add forward references.
* Rewrite description of "expand" option for much greater precision.
  Increase contrast with non-expanded table regions.  Elaborate on how
  "expanded" table regions can contract as well.  (This option probably
  should have been named "flex" or similar.)

Table format specification:
* Start by explaining what it does and what its syntax is.
* Introduce more terminology:
  - column descriptor
  - row definition
  - (column) classifier
  - (column) modifier
* Adopt a pedagogical convention: render column classifiers in capitals,
  and column modifiers in lowercase.
* Add inline example of a simple table format.
* Explicitly document table rectangularization.  (It was there, but
  covered breezily.)
* Heighten the bifurcation of column classifiers and column modifiers by
  giving them each a subsection.

Column classifiers:
* Add new subsection.
* Give the novice a hint to start with C, L, and R.
* Recast descriptions of A and N classifiers to try to make them less
  recondite.
* Document error condition when a non-empty table entry corresponds to a
  '_' or '=' column classifier.
* Document that the '|' classifier does not contribute to the column
  count and no table data corresponds to it.
* Tell the novice how to get around the ".T& won't let me add columns"
  problem for simple cases.
* Add guidance for how to cope with table whose number of columns must
  increase.

Column modifiers:
* Introduce modifiers with a summary of how they interact.
* Parallelize much of the language within the modifier descriptions.
* Recast 'b' and 'i' discussions to be complete sentences.
* Explicitly associate 'f', 'p', and 'v' modifiers with their *roff
  requests.
* Note that the macro called with the 'm' modifier must be defined prior
  to the table region.
* Tighten description of 'm' and 'u' modifiers.
* Use term "staggering" (of rows) in 'u' description, since this
  feature/effect needs a name, and this is the one found in the source.
* Document error cases in use of column separators; they can't be
  negative and one after the last column is meaningless.

Table data:
* Revise subsection introduction.  Cover input line/row correspondence,
  line continuation, entry separation, error condition arising from
  excess entries, prohibition of *roff comments in entries, and data
  termination condition.
* Describe how table entries are typeset and column widths computed.
* Explain how to get "literal" versions of the various
  specially interpreted table entries.

Text blocks:
* Recast introduction.  Motivate why they exist and when they are, and
  are not, necessary.

GNU tbl enhancements:
* Add introductory 

[groff] 25/26: doc/groff.texi: Fix content and style nits.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit aee0c8e62e62020fdd1bd85452482eaba2c3544a
Author: G. Branden Robinson 
AuthorDate: Mon Nov 15 07:38:54 2021 +1100

doc/groff.texi: Fix content and style nits.

Content:
* (Writing Macros): Before mentioning the "alternate syntax" for calling
  macros, remind the reader of the primary one.

Style:
* (Writing Macros): Recast discussion of how end macros work, for
  precision.
* (Writing Macros): Fix poorly placed "only" modifier.
* (Parameters): Say "expects" instead of "accepts" when presenting the
  `\$` syntax forms, for precision and to diversify the wording.
---
 doc/groff.texi | 31 ---
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 1c315d7..b5f2b70 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -12175,11 +12175,12 @@ restarting the next iteration.
 @cindex macros, writing
 
 A @dfn{macro} is a stored collection of text and control lines that can
-be used multiple times.  Use macros to define common operations.
-@xref{Strings}, for a (limited) alternative syntax to call macros.
-While requests exist for the purpose of creating macros, simply calling
-an undefined macro, or interpolating it as a string, will cause it to be
-defined as empty.  @xref{Identifiers}.
+be used multiple times.  Use macros to define common operations.  Macros
+are called in the same way that requests are invoked.  @xref{Strings},
+for a (limited) alternative syntax to call macros.  While requests exist
+for the purpose of creating macros, simply calling an undefined macro,
+or interpolating it as a string, will cause it to be defined as empty.
+@xref{Identifiers}.
 
 @Defreq {de, name [@Var{end}]}
 Define a macro @var{name}, replacing the definition of any existing
@@ -12187,14 +12188,14 @@ request, macro, string, or diversion called 
@var{name}.  GNU
 @code{troff} enters ``copy mode'', storing subsequent input lines as the
 macro definition.  If the optional second argument is not specified, the
 definition ends with the control line @samp{..} (two dots).
-Alternatively, @var{end} identifies a macro that, if called at the start
-of a control line, ends the definition of @var{name}; @var{end} is then
-called normally.  A macro definition must end in the same conditional
-block (if any) in which it began.@footnote{@xref{Conditional Blocks}}
-Spaces or tabs are permitted after the control character in the line
-containing this ending token (either @samp{.} or @samp{@var{end}}), but
-a tab immediately after the token prevents its recognition as the end of
-a macro definition.  The macro @var{end} can be called with
+Alternatively, @var{end} identifies a macro whose call syntax at the
+start of a control line ends the definition of @var{name}; @var{end} is
+then called normally.  A macro definition must end in the same
+conditional block (if any) in which it began.@footnote{@xref{Conditional
+Blocks}} Spaces or tabs are permitted after the control character in the
+line containing this ending token (either @samp{.} or @samp{@var{end}}),
+but a tab immediately after the token prevents its recognition as the
+end of a macro definition.  The macro @var{end} can be called with
 arguments.@footnote{While it is possible to define and call a macro
 @samp{.}, you can't use it as an end macro: during a macro definition,
 @samp{..} is never handled as calling @samp{.}, even if @samp{.de
@@ -12363,7 +12364,7 @@ create an alias of, remove, and rename a macro, 
respectively.
 Macro identifiers share their name space with requests, strings, and
 diversions; @ref{Identifiers}.  The @code{am}, @code{as}, @code{da},
 @code{de}, @code{di}, and @code{ds} requests (together with their
-variants) only create a new object if the name of the macro, diversion,
+variants) create a new object only if the name of the macro, diversion,
 or string is currently undefined or if it is defined as a request;
 normally, they modify the value of an existing object.  @xref{als,,the
 description of the @code{als} request}, for pitfalls when redefining a
@@ -12408,7 +12409,7 @@ with one of the following escape sequences.
 @DefescItem {\\$, (, nn, }
 @DefescListEnd {\\$, [, nnn, ]}
 Interpolate the @var{n}th, @var{nn}th, or @var{nnn}th parameter.  The
-first form only accepts a single digit (1@leq{}@var{n}@leq{}9)), the
+first form expects only a single digit (1@leq{}@var{n}@leq{}9)), the
 second two digits (01@leq{}@var{nn}@leq{}99)), and the third any
 positive integer @var{nnn}.  Macros and strings accept an unlimited
 number of parameters.

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 19/26: doc/groff.texi: Rename a set of macros.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 44c91f0f3c80d8106a6d679931f3400a1b64e522
Author: G. Branden Robinson 
AuthorDate: Sat Nov 13 07:26:51 2021 +1100

doc/groff.texi: Rename a set of macros.

All but one string we document is defined by a macro package rather than
the language, but that exception makes an ugly outlier in our index.

Prepare the way for fixing it.  Rename existing "Defstr" macros to
"Defmpstr", in parallel with "Defmpreg".
---
 doc/groff.texi | 214 -
 1 file changed, 107 insertions(+), 107 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 8ac1702..c49b39f 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -249,7 +249,7 @@ developing GNU and promoting software freedom.''
 @end macro
 
 
-@c definition of registers specific to macro packages, preprocessors, etc.
+@c register definitions specific to macro packages, preprocessors, ...
 
 @macro Defmpreg{name, package}
 @deffn Register @t{\\n[\name\]}
@@ -337,46 +337,46 @@ developing GNU and promoting software freedom.''
 @end macro
 
 
-@c definition of strings
+@c string definitions specific to macro packages, preprocessors, ...
 
-@macro Defstr{name, package}
+@macro Defmpstr{name, package}
 @deffn String @t{\\*[\name\]}
 @stindex \name\ @r{[}\package\@r{]}
 @c
 @end macro
 
-@macro DefstrList{name, package}
+@macro DefmpstrList{name, package}
 @deffn String @t{\\*[\name\]}
 @defdummy
 @stindex \name\ @r{[}\package\@r{]}
 @c
 @end macro
 
-@macro DefstrItem{name, package}
+@macro DefmpstrItem{name, package}
 @deffnx String @t{\\*[\name\]}
 @defdummy
 @c
 @end macro
 
-@macro DefstrItemx{name, package}
+@macro DefmpstrItemx{name, package}
 @deffnx String @t{\\*[\name\]}
 @defdummy
 @stindex \name\ @r{[}\package\@r{]}
 @c
 @end macro
 
-@macro DefstrListEnd{name, package}
+@macro DefmpstrListEnd{name, package}
 @deffnx String @t{\\*[\name\]}
 @c
 @end macro
 
-@macro DefstrListEndx{name, package}
+@macro DefmpstrListEndx{name, package}
 @deffnx String @t{\\*[\name\]}
 @stindex \name\ @r{[}\package\@r{]}
 @c
 @end macro
 
-@macro endDefstr
+@macro endDefmpstr
 @end deffn
 @end macro
 
@@ -2644,53 +2644,53 @@ Default: 1@dmn{i}.
 
 @unnumberedsubsubsec Titles (headers, footers)
 
-@Defstr {LH, ms}
+@Defmpstr {LH, ms}
 Defines the text displayed in the left header position.
 
 Effective: next header.
 
 Default: empty.
-@endDefstr
+@endDefmpstr
 
-@Defstr {CH, ms}
+@Defmpstr {CH, ms}
 Defines the text displayed in the center header position.
 
 Effective: next header.
 
 Default: @samp{-\n[%]-}.
-@endDefstr
+@endDefmpstr
 
-@Defstr {RH, ms}
+@Defmpstr {RH, ms}
 Defines the text displayed in the right header position.
 
 Effective: next header.
 
 Default: empty.
-@endDefstr
+@endDefmpstr
 
-@Defstr {LF, ms}
+@Defmpstr {LF, ms}
 Defines the text displayed in the left footer position.
 
 Effective: next footer.
 
 Default: empty.
-@endDefstr
+@endDefmpstr
 
-@Defstr {CF, ms}
+@Defmpstr {CF, ms}
 Defines the text displayed in the center footer position.
 
 Effective: next footer.
 
 Default: empty.
-@endDefstr
+@endDefmpstr
 
-@Defstr {RF, ms}
+@Defmpstr {RF, ms}
 Defines the text displayed in the right footer position.
 
 Effective: next footer.
 
 Default: empty.
-@endDefstr
+@endDefmpstr
 
 @unnumberedsubsubsec Text Settings
 
@@ -2731,14 +2731,14 @@ Effective: next paragraph.
 Default: 6.
 @endDefmpreg
 
-@Defstr {FAM, ms}
+@Defmpstr {FAM, ms}
 Defines the font family used to typeset the document.  This is a GNU
 extension.
 
 Effective: next paragraph.
 
 Default: as defined in the output device.
-@endDefstr
+@endDefmpstr
 
 @unnumberedsubsubsec Paragraph Settings
 
@@ -2824,14 +2824,14 @@ Effective: next paragraph.
 Default: 1.
 @endDefmpreg
 
-@Defstr {SN-STYLE, ms}
+@Defmpstr {SN-STYLE, ms}
 Defines the style used to print numbered headings.  @xref{Headings in
 ms}.  This is a GNU extension.
 
 Effective: next heading.
 
 Default: alias of @code{SN-DOT}
-@endDefstr
+@endDefmpstr
 
 @unnumberedsubsubsec Footnote Settings
 
@@ -2900,7 +2900,7 @@ Effective: next footnote.
 Default: @math{@code{@\n[PD]} / 2}.
 @endDefmpreg
 
-@Defstr {FR, ms}
+@Defmpstr {FR, ms}
 Defines the ratio of the footnote line length to the current line
 length.  This is a GNU extension.
 
@@ -2908,7 +2908,7 @@ Effective: next footnote in single-column arrangements, 
next page
 otherwise.
 
 Default: @math{11/12}.
-@endDefstr
+@endDefmpstr
 
 @unnumberedsubsubsec Display Settings
 
@@ -3263,10 +3263,10 @@ normally precedes each heading is omitted.
 7.  Plantae
 @endExample
 
-@DefstrList {SN-STYLE, ms}
-@DefstrItemx {SN-DOT, ms}
-@DefstrItemx {SN-NO-DOT, ms}
-@DefstrListEndx {SN, ms}
+@DefmpstrList {SN-STYLE, ms}
+@DefmpstrItemx {SN-DOT, ms}
+@DefmpstrItemx {SN-NO-DOT, ms}
+@DefmpstrListEndx {SN, ms}
 After invocation of @code{NH}, the assigned number is made available in
 the strings @code{SN-DOT} (as it appears in a printed heading with
 

[groff] 12/26: [docs]: Fix terminology in `.T` string definition.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit aad8b073bffb544d4b24ad311a56bf4a409867ca
Author: G. Branden Robinson 
AuthorDate: Sat Nov 13 07:32:59 2021 +1100

[docs]: Fix terminology in `.T` string definition.

* "output driver" -> "output device"
---
 doc/groff.texi  | 2 +-
 man/groff.7.man | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 07223fe..5a48020 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -11222,7 +11222,7 @@ Only one string is predefined by the language.
 @Defstr {.T,}
 @stindex .T
 @cindex output device name string (@code{.T})
-Contains the name of the output driver (for example, @samp{utf8} or
+Contains the name of the output device (for example, @samp{utf8} or
 @samp{pdf}).
 @endDefstr
 
diff --git a/man/groff.7.man b/man/groff.7.man
index 3e4bc16..182b568 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -4420,7 +4420,7 @@ Only one string is predefined by the language.
 .
 .TPx
 .STRING .T
-Contains the name of the output driver
+Contains the name of the output device
 (for example,
 .RB \[lq] utf8 \[rq]
 or

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 10/26: groff(7): Fix style nits.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit f5fbde786d275e84a231a6ae08e828877ce8df11
Author: G. Branden Robinson 
AuthorDate: Mon Nov 15 07:46:33 2021 +1100

groff(7): Fix style nits.

* Consistently say "'numerical' expression".  I prefer adjective forms
  ending in "-ic" where this does not create ambiguity with a noun
  (contrast "numeric" with "cynic"), but this is the shorter path to
  consistent usage in the page for now.
* Tighten wording.

"An American complaining about the English usage patterns of the
U.K.--that's ironical," said Tom, as he incited an historic furore.
---
 man/groff.7.man | 16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/man/groff.7.man b/man/groff.7.man
index ff4e521..030880a 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -1058,9 +1058,7 @@ End expression group of higher precedence
 .
 .
 .P
-In many contexts,
-unary prefix operators are also available in contexts where they make
-sense.
+Unary prefix operators are available in contexts where they make sense.
 .
 .
 .RS
@@ -1218,14 +1216,14 @@ request must be the last such escape sequence on an 
input line.
 .SS "Conditional expressions"
 .\" 
 .
-In
+The
 .request .if ,
 .request .ie ,
 and
 .request .while
-requests,
-in addition to the numeric expressions described above,
-several Boolean operators are available;
+requests can test the truth values of numerical expressions.
+.
+They also support several additional Boolean operators;
 the members of this expanded class are termed
 .IR "conditional expressions" .
 .
@@ -1405,7 +1403,7 @@ depending on its sign.
 .
 .
 .P
-If a numeric expression presented as
+If a numerical expression presented as
 .I \[+-]N
 starts with a
 .squoted_char +
@@ -3828,7 +3826,7 @@ vertically.
 .ESCq B anything
 Interpolate 1 if
 .I anything
-is a valid numeric expression,
+is a valid numerical expression,
 and\~0 otherwise.
 .
 .

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 02/26: m4/groff.m4: Clarify message.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit af7a753dcb99c73ac1056058ddaeea6f0400ecaf
Author: G. Branden Robinson 
AuthorDate: Fri Nov 12 12:13:45 2021 +1100

m4/groff.m4: Clarify message.

* m4/groff.m4 (GROFF_HTML_PROGRAMS): Clarify message; it is only
  groff-generated HTML that is disabled by the absence of the programs
  checked for.  (`makeinfo` can still generate our Texinfo manual in
  HTML format.)
---
 ChangeLog   | 7 +++
 m4/groff.m4 | 4 ++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8fd0a86..15bb0c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-11-12  G. Branden Robinson 
+
+   * m4/groff.m4 (GROFF_HTML_PROGRAMS): Clarify message; it is only
+   groff-generated HTML that is disabled by the absence of the
+   programs checked for.  (`makeinfo` can still generate our
+   Texinfo manual in HTML format.)
+
 2021-11-11  G. Branden Robinson 
 
[build]: Drop `BUILD_INFODOC` symbol.  Ship manual in GNU Info,
diff --git a/m4/groff.m4 b/m4/groff.m4
index e73a217..353c56a 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -268,8 +268,8 @@ AC_DEFUN([GROFF_HTML_PROGRAMS],
 
  docnote=.
  test $docadd_html = yes && docnote=';
-  therefore, it will neither be possible to prepare, nor to install,
-  documentation in HTML format.'
+  therefore, it will be possible neither to prepare, nor to install,
+  groff-generated documentation in HTML format.'
 
  AC_MSG_WARN([missing program$plural:
 

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 05/26: [m4]: Clean up test(1) usage.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit f3619aa295ef686ea5e852302d3bc5f5907338d1
Author: G. Branden Robinson 
AuthorDate: Fri Nov 12 22:18:09 2021 +1100

[m4]: Clean up test(1) usage.

Get rid of string (non-)nullity tests and comparisons involving
concatenation with garbage (usually "x").  Even the GNU Autoconf
manual's shell portability material doesn't recommend this.  It must be
either a bodge cooked up by shell programmers who couldn't remember to
quote variable expansions, or a workaround for shells of such poor
quality that they defied the odds and decayed out of usage or got fixed.

Instead, use double quotes (only where necessary).  Test for non-empty
strings with "test -n" and empty strings with "test -z".  Stop quoting
literal comparands that obviously have no shell metacharacters in them.

* m4/groff.m4 (GROFF_PRINT, GROFF_PROG_YACC, GROFF_PERL,
  GROFF_DOC_CHECK, GROFF_MAKEINFO, GROFF_TEXI2DVI, GROFF_HTML_PROGRAMS,
  GROFF_PDFDOC_PROGRAMS, GROFF_PAGE, GROFF_TMAC,
  GROFF_WITH_COMPATIBILITY_WRAPPERS, GROFF_X11, GROFF_APPRESDIR_DEFAULT,
  GROFF_APPRESDIR_CHECK, GROFF_HAVE_TEST_EF_OPTION, GROFF_BASH,
  GROFF_UCHARDET, GROFF_UCHARDET_CHECK, GROFF_PDFTOOLS,
  GROFF_USE_GROFF_ALLOCATOR): Do it.
---
 ChangeLog   | 26 +++
 m4/groff.m4 | 86 ++---
 2 files changed, 69 insertions(+), 43 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c9948a1..88a0c86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2021-11-13  G. Branden Robinson 
+
+   [m4]: Clean up test(1) usage.
+
+   Get rid of string (non-)nullity tests and comparisons involving
+   concatenation with garbage (usually "x").  Even the GNU Autoconf
+   manual's shell portability material doesn't recommend this.  It
+   must be either a bodge cooked up by shell programmers who
+   couldn't remember to quote variable expansions, or a workaround
+   for shells of such poor quality that they defied the odds and
+   decayed out of usage or got fixed.
+
+   Instead, use double quotes (only where necessary).  Test for
+   non-empty strings with "test -n" and empty strings with "test
+   -z".  Stop quoting literal comparands that obviously have no
+   shell metacharacters in them.
+
+   * m4/groff.m4 (GROFF_PRINT, GROFF_PROG_YACC, GROFF_PERL,
+   GROFF_DOC_CHECK, GROFF_MAKEINFO, GROFF_TEXI2DVI,
+   GROFF_HTML_PROGRAMS, GROFF_PDFDOC_PROGRAMS, GROFF_PAGE,
+   GROFF_TMAC, GROFF_WITH_COMPATIBILITY_WRAPPERS, GROFF_X11,
+   GROFF_APPRESDIR_DEFAULT, GROFF_APPRESDIR_CHECK,
+   GROFF_HAVE_TEST_EF_OPTION, GROFF_BASH, GROFF_UCHARDET,
+   GROFF_UCHARDET_CHECK, GROFF_PDFTOOLS,
+   GROFF_USE_GROFF_ALLOCATOR): Do it.
+
 2021-11-12  G. Branden Robinson 
 
* m4/groff.m4 (GROFF_TEXI2DVI): Add dependency on
diff --git a/m4/groff.m4 b/m4/groff.m4
index 35e42ce..dd7324e 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -40,7 +40,7 @@ AC_DEFUN([GROFF_PRINT],
# Figure out DVIPRINT from PSPRINT.
AC_MSG_CHECKING([for command to use for printing dvi files])
if test -n "$PSPRINT" && test -z "$DVIPRINT"; then
- if test "x$PSPRINT" = "xlpr"; then
+ if test "$PSPRINT" = lpr; then
DVIPRINT="lpr -d"
  else
DVIPRINT="$PSPRINT"
@@ -57,7 +57,7 @@ AC_DEFUN([GROFF_PRINT],
 
 AC_DEFUN([GROFF_PROG_YACC],
   [AC_CHECK_PROGS([YACC], [byacc 'bison -y' yacc], [missing])
-  if test "x$YACC" = "xmissing" -a -d ${srcdir}/.git; then
+  if test "$YACC" = missing -a -d ${srcdir}/.git; then
 AC_MSG_ERROR([Could not find 'yacc' or 'bison'], 1)
   fi
   ])
@@ -68,7 +68,7 @@ AC_DEFUN([GROFF_PROG_YACC],
 AC_DEFUN([GROFF_PERL],
   [PERLVERSION=v5.6.1
AC_PATH_PROG([PERL], [perl], [no])
-   if test "x$PERL" = "xno"; then
+   if test "$PERL" = no; then
  AC_MSG_ERROR([perl binary not found], 1)
fi
AX_PROG_PERL_VERSION([$PERLVERSION], true, \
@@ -86,8 +86,8 @@ AC_DEFUN([GROFF_DOC_CHECK],
'examples', to restrict what is produced])],
 [doc="$withval"],
 [doc=yes])
-  test "x$doc" = xno && doc=''
-  if test "x$doc" = xyes; then
+  test "$doc" = no && doc=''
+  if test "$doc" = yes; then
 doc_dist_target_ok=yes
 docadd_html=yes
 docadd_info=yes
@@ -108,11 +108,11 @@ AC_DEFUN([GROFF_DOC_CHECK],
 IFS=$OFS
 for i
 do
-  test "x$i" = xhtml && { docadd_html=yes; continue; }
-  test "x$i" = xinfo && { docadd_info=yes; continue; }
-  test "x$i" = xother&& { docadd_other=yes; continue; }
-  test "x$i" = xpdf  && { docadd_pdf=yes; continue; }
-  test "x$i" = xexamples && { docadd_examples=yes; continue; }
+  test "$i" = html && { docadd_html=yes; continue; }
+  test "$i" = info && { docadd_info=yes; continue; }
+  test "$i" = other&& { docadd_other=yes; continue; }
+  test "$i" = pdf  

[groff] 22/26: doc/groff.texi: Fix error in example description.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 72780e21973d9aaad0d2d62de1fd8b1da6004d73
Author: G. Branden Robinson 
AuthorDate: Sat Nov 13 18:47:45 2021 +1100

doc/groff.texi: Fix error in example description.

Problem introduced by me in commit 88cbc3f2, 9 November.
---
 doc/groff.texi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 5b67410..742006b 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -5823,9 +5823,9 @@ the beginning of an input line;@footnote{Control 
structure syntax
 creates an exception to this rule, but is designed to remain useful:
 recalling our example, @samp{.if 1 .Underline this} would underline only
 ``this'', precisely.  @xref{Conditionals and Loops}.} if the @code{|}
-operator were omitted, then the underline would be drawn to the
-beginning of the @emph{output} line, where many words might precede the
-macro argument.
+operator were omitted, then the underline would be drawn a zero distance
+from the current position, producing device-dependent, and likely
+undesirable, results.
 
 @codequotebacktick off
 @codequoteundirected off

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 24/26: doc/groff.texi: Fix content nits.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 9a181e87cb65bdb3665870bacd7ee2394a31a979
Author: G. Branden Robinson 
AuthorDate: Sun Nov 14 03:49:40 2021 +1100

doc/groff.texi: Fix content nits.

* Say "request invocation" instead of "request line".
* Improve terminological discipline: requests are invoked while macros
  are called.
* Note additional cases that produce "mac" warnings.
* Use consistent phrasing when cross-referencing "Debugging" node.
* Recast description of `di` and `da` requests.  Add cross reference to
  "Environment" node since diversions and environments are often used
  together.
* Note circumstance that produces "di" warnings.
---
 doc/groff.texi | 68 --
 1 file changed, 42 insertions(+), 26 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index c1fe766..1c315d7 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -6041,13 +6041,13 @@ superscripting or interpolating a symbol.
 @cindex no-break control character (@code{'})
 @cindex character, no-break control (@code{'})
 @cindex control character, no-break (@code{'})
-A request line begins with a control character, which is either a single
-quote (@samp{'}, the @dfn{no-break control character}) or a period
-(@samp{.}, the normal @dfn{control character}).  These can be changed;
-see @ref{Character Translations}, for details.  After this there may be
-optional tabs or spaces followed by an identifier, which is the name of
-the request.  This may be followed by any number of space-separated
-arguments (@emph{no} tabs here).
+A request invocation begins with a control character, which is either a
+single quote (@samp{'}, the @dfn{no-break control character}) or a
+period (@samp{.}, the normal @dfn{control character}).  These can be
+changed; see @ref{Character Translations}, for details.  After this
+there may be optional tabs or spaces followed by an identifier, which is
+the name of the request.  This may be followed by any number of
+space-separated arguments (@emph{no} tabs here).
 
 @cindex structuring source code of documents or macro packages
 @cindex documents, structuring the source of
@@ -6133,6 +6133,14 @@ If a macro is interpolated as a string (that is, using 
@code{\*}), the
 value of the @code{.br} register is inherited from the caller.
 @endDefreg
 
+There is no way to invoke an undefined request; such syntax is
+interpreted as a macro call instead.  If a macro of the desired name
+does not exist, it is created, assigned an empty definition, and a
+warning of type @samp{mac} is produced.  @xref{Debugging}, for
+information about the enablement and suppression of warnings.  A call of
+an undefined macro @emph{does} end a macro definition naming it as its
+end macro (@pxref{Writing Macros}).
+
 @menu
 * Request and Macro Arguments::
 @end menu
@@ -6706,8 +6714,9 @@ exist, the request is ignored.
 @cindex register, creating alias for (@code{aln})
 Create an alias @var{new} for an existing register @var{old}, causing
 the names to refer to the same stored object.  If @var{old} is
-undefined, a warning of type @samp{reg} is generated and the request is
-ignored.  @xref{Debugging}, for information about warnings.
+undefined, a warning of type @samp{reg} is produced and the request is
+ignored.  @xref{Debugging}, for information about the enablement and
+suppression of warnings.
 
 @cindex alias, register, removing (@code{aln})
 @cindex removing alias for register (@code{aln})
@@ -10055,9 +10064,9 @@ input character with character code @var{XXX}.  For 
example,
 @code{\[char97]} is identical to the letter @code{a} if @acronym{ASCII}
 encoding is active.}
 
-If @var{name} is undefined, a warning of type @samp{char} is generated,
-and the escape is ignored.  @xref{Debugging}, for information about
-warnings.
+If @var{name} is undefined, a warning of type @samp{char} is produced
+and the escape is ignored.  @xref{Debugging}, for information about the
+enablement and suppression of warnings.
 
 groff resolves @code{\[...]} with more than a single component as
 follows:
@@ -11299,8 +11308,9 @@ I see a \*[b].
 @endExample
 
 If the string named by the @code{\*} escape does not exist, it is
-defined as empty, and a warning of type @samp{mac} is emitted
-(@pxref{Debugging}).
+defined as empty, and a warning of type @samp{mac} is produced.
+@xref{Debugging}, for information about the enablement and suppression
+of warnings.
 
 If @code{ds} is called with only one argument, @var{name} is defined as
 an empty string.
@@ -11376,7 +11386,7 @@ effect, use the @code{\*} escape to interpolate a macro 
instead.
 
 Strings, macros, and diversions share a name space; @ref{Identifiers}.
 Internally, the same mechanism is used to store them.  It is thus
-possible to invoke a macro with string interpolation syntax and vice
+possible to call a macro with string interpolation syntax and vice
 versa.
 
 @Example
@@ -11668,7 

[groff] 23/26: doc/groff.texi: Fix content and style nits.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit e657545e148a12f575ea656834f8e64bc8082189
Author: G. Branden Robinson 
AuthorDate: Sun Nov 14 03:19:00 2021 +1100

doc/groff.texi: Fix content and style nits.

* Recast introduction to "Registers" node.
* Reorder to coalesce discussion of `\R' escape sequence.
* Relocate caveat about "use" of undefined registers to a more formal
  statement in the description of `\n`.
* Emphasize that "auto-incrementation" is not fully automatic; merely
  observing the register does not alter its value.
* Tighten wording.

Also remove spurious quotes in man/groff.7.man.
---
 doc/groff.texi  | 50 --
 man/groff.7.man |  4 +++-
 2 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 742006b..c1fe766 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -6526,7 +6526,7 @@ Test
 
 @Defreq {ig, [@Var{end}]}
 Ignore input until, in the current conditional block (if
-any),@footnote{@xref{Conditional Blocks}} the macro @var{end} is called
+any),@footnote{@xref{Conditional Blocks}.} the macro @var{end} is called
 at the start of a control line, or the control line @samp{..} is
 encountered if @var{end} is not specified.  @code{ig} is parsed as if it
 were a macro definition, but its contents are discarded, not
@@ -6559,11 +6559,11 @@ the call of its end macro.
 @section Registers
 @cindex registers
 
-Numeric variables in GNU @code{troff} are called @dfn{registers}.  There
-are a number of built-in registers, supplying anything from the date to
-details of formatting parameters.
-
-@xref{Identifiers}, for details on register identifiers.
+Numeric variables in GNU @code{troff} are called @dfn{registers}.  Many
+built-in registers exist, supplying anything from the date to details of
+formatting parameters.  You can also define your own.
+@xref{Identifiers}, for information on constructing a valid name for a
+register.
 
 @menu
 * Setting Registers::
@@ -6580,28 +6580,18 @@ details of formatting parameters.
 @cindex setting registers (@code{nr}, @code{\R})
 @cindex registers, setting (@code{nr}, @code{\R})
 
-Define or set registers using the @code{nr} request or the @code{\R}
-escape.
-
-Although the following requests and escapes can be used to create
-registers, simply using an undefined register will cause it to be set to
-zero.
+Define registers and update their values with the @code{nr} request or
+the @code{\R} escape sequence.
 
 @DefreqList {nr, ident value}
 @DefescListEndx {\\R, @code{'}, ident value, @code{'}}
 Set register @var{ident} to @var{value}.  If @var{ident} doesn't exist,
 GNU @code{troff} creates it.
 
-The argument to @code{\R} usually has to be enclosed in quotes.
-@xref{Escapes}, for details on parameter delimiting characters.
-
-(Later, we will discuss additional forms of @code{nr} and @code{\R} that
-can change a register's value after it is dereferenced.
-@ref{Auto-increment}.)
-
-The @code{\R} escape doesn't produce an input token in GNU @code{troff};
-in other words, it vanishes completely after GNU @code{troff} has
-processed it.
+The argument to @code{\R} must be enclosed within delimiters; see
+@ref{Escapes}, for a list of valid delimiter characters.  The @code{\R}
+escape doesn't produce an input token in GNU @code{troff}; in other
+words, it vanishes completely after GNU @code{troff} has processed it.
 
 For example, the following two lines are equivalent:
 
@@ -6611,6 +6601,10 @@ For example, the following two lines are equivalent:
 @result{} 1
 @endExample
 
+(Later, we will discuss additional forms of @code{nr} and @code{\R} that
+can change a register's value after it is dereferenced but before it is
+interpolated.  @xref{Auto-increment}.)
+
 The complete transparency of @code{\R} can cause surprising effects if
 you use registers like @code{.k}, which get evaluated at the time they
 are accessed.
@@ -6648,7 +6642,7 @@ length, which in turn causes the start of a new output 
line.  Now
 @code{.k} returns the expected value.
 @endDefreq
 
-Both @code{nr} and @code{\R} have two additional special forms to
+@code{nr} and @code{\R} each have two additional special forms to
 increment or decrement a register.
 
 @DefreqList {nr, ident @t{+}@Var{value}}
@@ -6740,7 +6734,10 @@ Register contents are interpolated with the @code{\n} 
escape sequence.
 @cindex assignments, indirect
 Interpolate register with name @var{ident} (one-character
 name@tie{}@var{i}, two-character name @var{id}).  @code{\n} is
-interpreted even in copy mode (@pxref{Copy Mode}).
+interpreted even in copy mode (@pxref{Copy Mode}).  If the register is
+undefined, it is created, assigned a value of@tie{}@samp{0}, and a
+warning of type @samp{reg} is produced.  @xref{Debugging}, for
+information about the enablement and suppression of warnings.
 
 @Example
 .nr a 5
@@ -6785,8 +6782,9 @@ notation.
 @endDefreq
 
 

[groff] 18/26: doc/groff.texi: Fix content, style, markup nits.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 8367785a19d19f9608b4bae57b240448bdc1a039
Author: G. Branden Robinson 
AuthorDate: Sat Nov 13 07:05:12 2021 +1100

doc/groff.texi: Fix content, style, markup nits.

Content:
* Rename node "Escape Index" to "Escape Sequence Index".
* Revise introduction to that index: an "escape sequence...not in the
  list below" is not an escape sequence, but merely an input token.
  Further, the two items \\ and \. are not escape sequences either, but
  _do_ receive special handling, so they warrant placement here.

Style:
* Use Texinfo @xref command instead of "See @ref"; that's what it's for.

Markup:
* Set "(unary)" in roman in the index when applied to operators.
---
 doc/groff.texi | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index f20a892..8ac1702 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -452,7 +452,7 @@ developing GNU and promoting software freedom.''
 * Installation::
 * Copying This Manual::
 * Request Index::
-* Escape Index::
+* Escape Sequence Index::
 * Operator Index::
 * Register Index::
 * Macro Index::
@@ -5695,8 +5695,8 @@ be expected.
 @cindex @code{-}, and page motion
 @cindex motion operators
 @cindex operators, motion
-@opindex + (unary)
-@opindex - (unary)
+@opindex + @r{(unary)}
+@opindex - @r{(unary)}
 For many requests that cause a motion on the page, the unary operators
 @samp{+} and @samp{-} work differently if leading an expression.  They
 then indicate a motion relative to the current position (down or up,
@@ -7207,7 +7207,7 @@ the @code{fi} request.
 Enable filling of output lines; a pending output line is broken.  The
 read-only register @code{.u} is set to@tie{}1.  The filling enablement
 status, sometimes called @dfn{fill mode}, is associated with the
-environment (@pxref{Environments}).  See @ref{Line Continuation}, for
+environment (@pxref{Environments}).  @xref{Line Continuation}, for
 interaction with the @code{\c} escape.
 @endDefreq
 
@@ -18430,7 +18430,7 @@ for@tie{}@var{n}.
 @codequotebacktick on
 @codequoteundirected on
 
-@node Request Index, Escape Index, Copying This Manual, Top
+@node Request Index, Escape Sequence Index, Copying This Manual, Top
 @appendix Request Index
 
 Requests appear without the leading control character (normally either
@@ -18443,11 +18443,11 @@ Requests appear without the leading control character 
(normally either
 @c =
 @c =
 
-@node Escape Index, Operator Index, Request Index, Top
-@appendix Escape Index
+@node Escape Sequence Index, Operator Index, Request Index, Top
+@appendix Escape Sequence Index
 
-Any escape sequence @code{\@var{X}} with @var{X} not in the list below
-emits a warning, printing glyph @var{X}.
+Any token @code{\@var{X}} with @var{X} not in the list below emits a
+warning and interpolates glyph @var{X}.
 
 @printindex es
 
@@ -18456,7 +18456,7 @@ emits a warning, printing glyph @var{X}.
 @c =
 @c =
 
-@node Operator Index, Register Index, Escape Index, Top
+@node Operator Index, Register Index, Escape Sequence Index, Top
 @appendix Operator Index
 
 @printindex op

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 16/26: [docs]: Fix style nit in DESC file documentation.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 9b2bbcb86deee23578c4bc3e865969a143f0ccd9
Author: G. Branden Robinson 
AuthorDate: Mon Nov 15 06:11:12 2021 +1100

[docs]: Fix style nit in DESC file documentation.
---
 doc/groff.texi   | 4 ++--
 man/groff_font.5.man | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 384287b..9da05b9 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -18040,8 +18040,8 @@ if the file can be opened, GNU @code{troff} reads the 
first line and
 attempts to match either of the other forms.  No comment syntax is
 supported.
 
-More than one argument can be specified; GNU @code{troff} scans from
-left to right and uses the first valid paper specification.
+More than one argument can be specified; GNU @code{troff} scans each in
+turn and uses the first valid paper specification.
 
 @item paperwidth @var{n}
 @kindex paperwidth
diff --git a/man/groff_font.5.man b/man/groff_font.5.man
index d134b01..97486ea 100644
--- a/man/groff_font.5.man
+++ b/man/groff_font.5.man
@@ -274,7 +274,7 @@ No comment syntax is supported.
 .IP
 More than one argument can be specified;
 .I \%@g@troff
-scans from left to right and uses the first valid paper specification.
+scans each in turn and uses the first valid paper specification.
 .
 .
 .TP

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 20/26: doc/groff.texi: Migrate `.T` string to new macros.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit b763c059bcebb87a99cf021624814ab0d49f9db3
Author: G. Branden Robinson 
AuthorDate: Sat Nov 13 07:34:14 2021 +1100

doc/groff.texi: Migrate `.T` string to new macros.
---
 doc/groff.texi | 50 +++---
 1 file changed, 47 insertions(+), 3 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index c49b39f..a54c91a 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -161,7 +161,7 @@ developing GNU and promoting software freedom.''
 @end macro
 
 
-@c definition of escapes
+@c definition of escape sequences
 
 @macro Defesc{name, delimI, arg, delimII}
 @deffn Escape @t{\name\\delimI\}@Var{\arg\}@t{\delimII\}
@@ -205,7 +205,7 @@ developing GNU and promoting software freedom.''
 @end macro
 
 
-@c definition of registers
+@c definition of registers (built in to GNU troff)
 
 @macro Defreg{name}
 @deffn Register @t{\\n[\name\]}
@@ -249,6 +249,50 @@ developing GNU and promoting software freedom.''
 @end macro
 
 
+@c string definitions (built in to GNU troff)
+
+@macro Defstr{name}
+@deffn String @t{\\*[\name\]}
+@stindex \name\
+@c
+@end macro
+
+@macro DefstrList{name}
+@deffn String @t{\\*[\name\]}
+@defdummy
+@stindex \name\
+@c
+@end macro
+
+@macro DefstrItem{name}
+@deffnx String @t{\\*[\name\]}
+@defdummy
+@c
+@end macro
+
+@macro DefstrItemx{name}
+@deffnx String @t{\\*[\name\]}
+@defdummy
+@stindex \name\
+@c
+@end macro
+
+@macro DefstrListEnd{name}
+@deffnx String @t{\\*[\name\]}
+@c
+@end macro
+
+@macro DefstrListEndx{name}
+@deffnx String @t{\\*[\name\]}
+@stindex \name\
+@c
+@end macro
+
+@macro endDefstr
+@end deffn
+@end macro
+
+
 @c register definitions specific to macro packages, preprocessors, ...
 
 @macro Defmpreg{name, package}
@@ -11206,7 +11250,7 @@ with a default scaling indicator of @samp{z}.
 GNU @code{troff} has string variables primarily for user convenience.
 Only one string is predefined by the language.
 
-@Defmpstr {.T,}
+@Defstr {.T}
 @stindex .T
 @cindex output device name string (@code{.T})
 Contains the name of the output device (for example, @samp{utf8} or

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 21/26: doc/groff.texi: Slightly recast.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit bfe003d6531ce056deeb4a134b8126d773bbe665
Author: G. Branden Robinson 
AuthorDate: Sat Nov 13 09:07:50 2021 +1100

doc/groff.texi: Slightly recast.
---
 doc/groff.texi | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index a54c91a..5b67410 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -4780,11 +4780,11 @@ Welcome to groff.
 @cindex space between sentences
 @cindex French spacing
 GNU @code{troff} does this by flagging certain characters (normally
-@samp{!}, @samp{?}, and @samp{.}) as @dfn{end-of-sentence} characters;
-when GNU @code{troff} encounters one of these characters at the end of a
-line, or one of them is followed by two spaces on the same input line,
-it appends an inter-word space followed by an inter-sentence space in
-the formatted output.
+@samp{!}, @samp{?}, and @samp{.}) as potentially ending a sentence.
+When GNU @code{troff} encounters one of these @dfn{end-of-sentence
+characters} at the end of a line, or one of them is followed by two
+spaces on the same input line, it appends an inter-word space followed
+by an inter-sentence space in the formatted output.
 
 @Example
 R. Harper subscribes to a maxim of P. T. Barnum.

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 11/26: [docs]: Rein in bloat of the lexicon.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 3f3d085e97c6d0b90fdff4a00b3585a9742b757f
Author: G. Branden Robinson 
AuthorDate: Sat Nov 13 06:48:36 2021 +1100

[docs]: Rein in bloat of the lexicon.

We already have a term "conditional block".  Formally introduce it in
the relevant section of our Texinfo manual.  Eliminate use of "brace
scope" as a synonym for it.  Indiscipline introduced by me in commit
3bfd4798, 9 November.
---
 doc/groff.texi  | 30 --
 man/groff.7.man | 10 ++
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 2b3981a..07223fe 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -6481,8 +6481,9 @@ Test
 @endDefesc
 
 @Defreq {ig, [@Var{end}]}
-Ignore input until, at the current brace scope, the macro @var{end} is
-called at the start of a control line, or the control line @samp{..} is
+Ignore input until, in the current conditional block (if
+any),@footnote{@xref{Conditional Blocks}} the macro @var{end} is called
+at the start of a control line, or the control line @samp{..} is
 encountered if @var{end} is not specified.  @code{ig} is parsed as if it
 were a macro definition, but its contents are discarded, not
 stored.@footnote{Exception: auto-incrementing registers defined outside
@@ -11960,9 +11961,9 @@ requests may be interposed between the @code{ie} branch 
and the
 It is frequently desirable for a control structure to govern more than
 one request, call more than one macro, span more than one input line of
 text, or mix the foregoing.  The opening and closing brace escape
-sequences @code{\@{} and @code{\@}} perform such grouping.  Brace escape
-sequences outside of control structures have no meaning and produce no
-output.
+sequences @code{\@{} and @code{\@}} perform such grouping; such
+@dfn{conditional blocks} can be nested.  Brace escape sequences outside
+of control structures have no meaning and produce no output.
 
 @code{\@{} should appear (after optional spaces and tabs) immediately
 subsequent to the request's conditional expression.  @code{\@}} should
@@ -12148,15 +12149,16 @@ macro definition.  If the optional second argument is 
not specified, the
 definition ends with the control line @samp{..} (two dots).
 Alternatively, @var{end} identifies a macro that, if called at the start
 of a control line, ends the definition of @var{name}; @var{end} is then
-called normally.  A macro definition must end at the same brace scope at
-which it began.  Spaces or tabs are permitted after the control
-character in the line containing this ending token (either @samp{.} or
-@samp{@var{end}}), but a tab immediately after the token prevents its
-recognition as the end of a macro definition.  The macro @var{end} can
-be called with arguments.@footnote{While it is possible to define and
-call a macro @samp{.}, you can't use it as an end macro: during a macro
-definition, @samp{..} is never handled as calling @samp{.}, even if
-@samp{.de @var{name} .} explicitly precedes it.}
+called normally.  A macro definition must end in the same conditional
+block (if any) in which it began.@footnote{@xref{Conditional Blocks}}
+Spaces or tabs are permitted after the control character in the line
+containing this ending token (either @samp{.} or @samp{@var{end}}), but
+a tab immediately after the token prevents its recognition as the end of
+a macro definition.  The macro @var{end} can be called with
+arguments.@footnote{While it is possible to define and call a macro
+@samp{.}, you can't use it as an end macro: during a macro definition,
+@samp{..} is never handled as calling @samp{.}, even if @samp{.de
+@var{name} .} explicitly precedes it.}
 @c
 @c @Example
 @c .de .
diff --git a/man/groff.7.man b/man/groff.7.man
index 030880a..3e4bc16 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -1863,7 +1863,7 @@ Define or redefine
 .I macro
 until
 .RB \[lq] ..\& \[rq]
-occurs at the start of a control line at the current brace scope.
+occurs at the start of a control line in the current conditional block.
 .
 .
 .TPx
@@ -1872,7 +1872,8 @@ Define or redefine
 .I macro
 until
 .BI . end
-is called at the start of a control line at the current brace scope.
+is called at the start of a control line in the current conditional
+block.
 .
 .
 .TPx
@@ -2409,7 +2410,7 @@ Ignore input
 on auto-incrementing registers)
 until
 .RB \[lq] ..\& \[rq]
-occurs at the start of a control line at the current brace scope.
+occurs at the start of a control line in the current conditional block.
 .
 .
 .TPx
@@ -2420,7 +2421,8 @@ Ignore input
 on auto-incrementing registers)
 until
 .BI . end
-is called at the start of a control line at the current brace scope.
+is called at the start of a control line in the current conditional
+block.
 .
 .
 .TPx

___
Groff-commit mailing list
Groff-commit@gnu.org

[groff] 17/26: [docs]: Clarify metrics in font description files.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit f23b3f9a3aeea5f5158a268f2e85a71f1cd77a00
Author: G. Branden Robinson 
AuthorDate: Mon Nov 15 06:33:39 2021 +1100

[docs]: Clarify metrics in font description files.

* Document that the numbers in the metrics field are in basic units.
* Break a long paragraph, starting a new one with the subfield
  definitions, after all the throat-clearing about the data format.
---
 doc/groff.texi   | 14 --
 man/groff_font.5.man |  8 +---
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 9da05b9..f20a892 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -18319,12 +18319,14 @@ The form of the @var{metrics} field is as follows.
 
 @noindent
 There must not be any spaces, tabs, or newlines between these subfields
-(it has been split here into two lines only for better legibility).
-Missing subfields are assumed to be@tie{}@code{0}.  The subfields are
-all decimal integers.  Since there is no associated binary format, these
-values are not required to fit into the C language data type @samp{char}
-as they are in @acronym{AT} device-independent @code{troff}.  The
-@var{width} subfield gives the width of the glyph.  The @var{height}
+(it has been split here into two lines only for better legibility).  The
+subfields are in basic units expressed as decimal integers.  Missing
+subfields are assumed to be@tie{}@code{0}.  Since there is no associated
+binary format, these values are not required to fit into the C language
+data type @samp{char} as they are in @acronym{AT} device-independent
+@code{troff}.
+
+The @var{width} subfield gives the width of the glyph.  The @var{height}
 subfield gives the height of the glyph (upwards is positive); if a glyph
 does not extend above the baseline, it should be given a zero height,
 rather than a negative height.  The @var{depth} subfield gives the depth
diff --git a/man/groff_font.5.man b/man/groff_font.5.man
index 97486ea..75259bc 100644
--- a/man/groff_font.5.man
+++ b/man/groff_font.5.man
@@ -7,7 +7,7 @@ groff_font \- GNU roff device and font description files
 .\" Legal Terms
 .\" 
 .\"
-.\" Copyright (C) 1989-2020 Free Software Foundation, Inc.
+.\" Copyright (C) 1989-2021 Free Software Foundation, Inc.
 .\"
 .\" This file is part of groff (GNU roff), which is a free software
 .\" project.
@@ -787,17 +787,19 @@ There must not be any spaces,
 tabs,
 or newlines between these subfields.
 .
+The subfields are in basic units expressed as decimal integers.
+.
 Missing subfields are assumed to
 .RB be\~ 0 .
 .
-The subfields are all decimal integers.
-.
 Since there is no associated binary format,
 these values are not required to fit into the C language data type
 .B char
 as they are in AT device-independent
 .IR troff . \" AT
 .
+.
+.P
 The
 .I width
 subfield gives the width of the glyph.

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 14/26: [docs]: Update discussion of `sp` request.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit f7bbcd8fae43c41bf495697f056eb02bd4b9aa8e
Author: G. Branden Robinson 
AuthorDate: Sun Nov 14 01:59:21 2021 +1100

[docs]: Update discussion of `sp` request.

* Explicitly refer to the "drawing position".  I anticipate using this
  term much more.
* Document the fact that the argument is ignored in a diversion.  (You
  can have any vector of vertical space you like, as long as it's +1v.)
* Move concept index entries to precede the beginning of the relevant
  discussion.
* Use Texinfo @result command idiomatically, to present example output.
* Tighten and clarify--shrink and grow.
---
 doc/groff.texi  | 56 +---
 man/groff.7.man | 28 +++-
 2 files changed, 48 insertions(+), 36 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 40ef73b..f70f721 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -8008,17 +8008,16 @@ The hyphenation space adjustment threshold is available 
in the
 @cindex spacing, manipulating
 
 @Defreq {sp, [@Var{distance}]}
-Space downwards @var{distance}.  With no argument it advances
-1@tie{}line.  A negative argument causes @code{gtroff} to move up the
-page the specified distance.  If the argument is preceded by a @samp{|}
-then @code{gtroff} moves that distance from the top of the page.  This
-request causes a line break, and that adds the current line spacing to
-the space you have just specified.  The default scaling indicator is
-@samp{v}.
+Space downwards by @var{distance}.  With no argument, the drawing
+position is advanced downward by one vee.  Inside a diversion, any
+@var{distance} argument is ignored.  Otherwise, a negative argument
+moves the drawing position up the page.   If the argument is preceded by
+the @samp{|} operator, GNU @code{troff} moves that distance from the top
+of the page, plus the current line spacing.  The default scaling
+indicator is @samp{v}.  This request causes a break.
 
-For convenience you may wish to use the following macros to set the
-height of the next line at a given distance from the top or the bottom
-of the page:
+You may wish to use the following macros to set the baseline of the next
+output text at a given distance from the top or the bottom of the page.
 
 @Example
 .de y-from-top-down
@@ -8031,11 +8030,15 @@ of the page:
 @endExample
 
 @noindent
-A call to @samp{.y-from-bot-up 10c} means that the bottom of the next
-line will be at 10@tie{}cm from the paper edge at the bottom.
+A call to @samp{.y-from-bot-up 10c} means that the next text baseline
+will be at 10@tie{}cm from the bottom edge of the paper.
 
-If a vertical trap is sprung during execution of @code{sp}, the amount
-of vertical space after the trap is discarded.  For example, this
+@cindex @code{sp} request, and traps
+@cindex discarded space in traps
+@cindex space, discarded, in traps
+@cindex traps, and discarded space
+If a vertical position trap is sprung during execution of @code{sp}, the
+amount of vertical space after the trap is discarded.
 
 @Example
 .de xxx
@@ -8049,28 +8052,19 @@ foo
 bar
 .sp 50
 baz
+@result{} foo
+@result{}
+@result{}
+@result{} bar
+@result{}
+@result{} baz
 @endExample
 
-@noindent
-results in
-
-@Example
-foo
-
-
-bar
-
-baz
-@endExample
-
-@cindex @code{sp} request, and traps
-@cindex discarded space in traps
-@cindex space, discarded, in traps
-@cindex traps, and discarded space
 The amount of discarded space is available in the register
 @code{.trunc}.
 
-To protect @code{sp} against vertical traps, use the @code{vpt} request:
+To protect @code{sp} against vertical position traps, use the @code{vpt}
+request to disable them.
 
 @Example
 .vpt 0
diff --git a/man/groff.7.man b/man/groff.7.man
index 273eac4..1ada6ce 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -2977,17 +2977,35 @@ does not exist.
 .
 .TPx
 .REQ .sp
-Skip one line vertically.
+Move the drawing position down one vee.
+.
 .
 .TPx
-.REQ .sp "N"
-Space vertical distance
-.I N
-up or down according to sign of
+.REQ .sp N
+Move the drawing position vertically by
 .I N
 (default scaling indicator\~\c
 .scaleindicator v ).
 .
+Positive values are downwards.
+.
+Prefixing
+.I N
+with the
+.B |
+operator moves to a position relative to the page top for positive
+.IR N ,
+and the bottom if
+.I N
+is negative;
+in all cases,
+one line height (vee) is added
+.RI to\~ N .
+.
+.I N
+is ignored inside a diversion.
+.
+.
 .TPx
 .REQ .special
 Reset global list of special fonts to be empty.

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 06/26: [m4]: Clean up shell variable quoting and bracing.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 5ee740e6a5aed63d0e2a53a2c757349427e28bc0
Author: G. Branden Robinson 
AuthorDate: Sun Nov 14 01:15:35 2021 +1100

[m4]: Clean up shell variable quoting and bracing.

* m4/groff.m4 (GROFF_PROG_YACC, GROFF_MAKEINFO,
  GROFF_BROKEN_SPOOLER_FLAGS, GROFF_TARGET_PATH_SEPARATOR): Stop bracing
  shell variable expansions that don't require it; the shell is not
  make(1).

  (GROFF_PROG_YACC, GROFF_MAKEINFO): Double-quote shell variable
  expansions that might produce whitespace.

  (GROFF_MAKEINFO): Drop unnecessary leading zeroes from version number
  component construction.  Drop unnecessary escaping of plus sign in
  expr(1) input.
---
 ChangeLog   | 14 ++
 m4/groff.m4 | 23 ---
 2 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 88a0c86..b0e5025 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2021-11-13  G. Branden Robinson 
 
+   [m4]: Clean up shell variable quoting and bracing.
+
+   * m4/groff.m4 (GROFF_PROG_YACC, GROFF_MAKEINFO,
+   GROFF_BROKEN_SPOOLER_FLAGS, GROFF_TARGET_PATH_SEPARATOR): Stop
+   bracing shell variable expansions that don't require it; the
+   shell is not make(1).
+   (GROFF_PROG_YACC, GROFF_MAKEINFO): Double-quote shell variable
+   expansions that might produce whitespace.
+   (GROFF_MAKEINFO): Drop unnecessary leading zeroes from version
+   number component construction.  Drop unnecessary escaping of
+   plus sign in expr(1) input.
+
+2021-11-13  G. Branden Robinson 
+
[m4]: Clean up test(1) usage.
 
Get rid of string (non-)nullity tests and comparisons involving
diff --git a/m4/groff.m4 b/m4/groff.m4
index dd7324e..45f1d23 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -57,7 +57,7 @@ AC_DEFUN([GROFF_PRINT],
 
 AC_DEFUN([GROFF_PROG_YACC],
   [AC_CHECK_PROGS([YACC], [byacc 'bison -y' yacc], [missing])
-  if test "$YACC" = missing -a -d ${srcdir}/.git; then
+  if test "$YACC" = missing -a -d "$srcdir"/.git; then
 AC_MSG_ERROR([Could not find 'yacc' or 'bison'], 1)
   fi
   ])
@@ -167,15 +167,16 @@ AC_DEFUN([GROFF_MAKEINFO],
missing="missing 'makeinfo'"
  else
AC_MSG_CHECKING([for makeinfo version])
-   # We need an additional level of quoting to make sed's regexps work.
+   # We need an additional level of quoting to make sed's regexps
+   # work.
[makeinfo_version=`$MAKEINFO --version 2>&1 \
 | sed -e 's/^.* \([^ ][^ ]*\)$/\1/' -e '1q'`]
AC_MSG_RESULT([$makeinfo_version])
# Consider only the first two numbers in version number string.
-   makeinfo_version_major=`IFS=.; set x $makeinfo_version; echo 0${2}`
-   makeinfo_version_minor=`IFS=.; set x $makeinfo_version; echo 0${3}`
+   makeinfo_version_major=`IFS=.; set x $makeinfo_version; echo ${2}`
+   makeinfo_version_minor=`IFS=.; set x $makeinfo_version; echo ${3}`
makeinfo_version_numeric=`
- expr ${makeinfo_version_major}000 \+ ${makeinfo_version_minor}`
+ expr ${makeinfo_version_major}000 + $makeinfo_version_minor`
if test $makeinfo_version_numeric -lt 5000; then
  missing="'makeinfo' is too old."
  MAKEINFO=
@@ -184,9 +185,9 @@ AC_DEFUN([GROFF_MAKEINFO],
 
  if test -n "$missing"; then
infofile=doc/groff.info
-   test -f ${infofile} || infofile=${srcdir}/${infofile}
-   if test ! -f ${infofile} \
-   || test "${srcdir}"/doc/groff.texi -nt ${infofile}; then
+   test -f $infofile || infofile="$srcdir"/$infofile
+   if test ! -f $infofile \
+   || test "$srcdir"/doc/groff.texi -nt $infofile; then
 AC_MSG_ERROR($missing
 [Get the 'texinfo' package version 5.0 or newer.])
fi
@@ -871,7 +872,7 @@ main()
 
 AC_DEFUN([GROFF_BROKEN_SPOOLER_FLAGS],
   [AC_MSG_CHECKING([default value for grops -b option])
-   test -n "${BROKEN_SPOOLER_FLAGS}" || BROKEN_SPOOLER_FLAGS=0
+   test -n "$BROKEN_SPOOLER_FLAGS" || BROKEN_SPOOLER_FLAGS=0
AC_MSG_RESULT([$BROKEN_SPOOLER_FLAGS])
AC_SUBST([BROKEN_SPOOLER_FLAGS])])
 
@@ -1489,11 +1490,11 @@ AC_DEFUN([GROFF_UINTMAX_T],
 # MS-DOS/Win32=';').
 #
 # The logic to resolve this test is already encapsulated in
-# '${srcdir}/src/include/nonposix.h'.
+# '$srcdir/src/include/nonposix.h'.
 
 AC_DEFUN([GROFF_TARGET_PATH_SEPARATOR],
   [AC_MSG_CHECKING([separator character to use in groff search paths])
-   cp ${srcdir}/src/include/nonposix.h conftest.h
+   cp "$srcdir"/src/include/nonposix.h conftest.h
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[


___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 15/26: [docs]: Tweak style of `\n` description.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 1266cb5e0a5c7283632703beedbc5855e6daedaa
Author: G. Branden Robinson 
AuthorDate: Sun Nov 14 03:04:28 2021 +1100

[docs]: Tweak style of `\n` description.
---
 doc/groff.texi  | 9 +
 man/groff.7.man | 6 +++---
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index f70f721..384287b 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -6676,12 +6676,8 @@ ignored.  @xref{Debugging}, for information about 
warnings.
 @cindex register, removing alias for (@code{aln})
 To remove a register alias, call @code{rr} on its name.  A register's
 contents do not become inaccessible until it has no more names.
-
 @endDefreq
 
-@codequotebacktick off
-@codequoteundirected off
-
 @c -
 
 @node Interpolating Registers, Auto-increment, Setting Registers, Registers
@@ -6689,7 +6685,7 @@ contents do not become inaccessible until it has no more 
names.
 @cindex interpolating registers (@code{\n})
 @cindex registers, interpolating (@code{\n})
 
-Numeric registers can be accessed via the @code{\n} escape.
+Register contents are interpolated with the @code{\n} escape sequence.
 
 @DefescList {\\n, , i, }
 @DefescItem {\\n, (, id, }
@@ -6723,9 +6719,6 @@ interpreted even in copy mode (@pxref{Copy Mode}).
 
 @c -
 
-@codequotebacktick on
-@codequoteundirected on
-
 @node Auto-increment, Assigning Register Formats, Interpolating Registers, 
Registers
 @subsection Auto-increment
 @cindex auto-incrementation of a register
diff --git a/man/groff.7.man b/man/groff.7.man
index 1ada6ce..924af51 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -4066,19 +4066,19 @@ Switch to previous fill color.
 .
 .TP
 .ESC n r
-Interpolate value stored in register with one-character
+Interpolate contents of register with one-character
 .RI name\~ r .
 .
 .
 .TP
 .ESC n( rg
-Interpolate value stored in register with two-character
+Interpolate contents of register with two-character
 .RI name\~ rg .
 .
 .
 .TP
 .ESC[] n reg
-Interpolate value stored in register with arbitrarily long
+Interpolate contents of register with arbitrarily long
 .RI name\~ reg .
 .
 .

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 09/26: groff_man_style(7): Update font selection advice.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit ecd7eb791a1aa057d7eb81f6e5f997162a04aef1
Author: G. Branden Robinson 
AuthorDate: Fri Nov 12 20:50:21 2021 +1100

groff_man_style(7): Update font selection advice.

* Identify C data types as italic fodder.
* Drop identification of works of software as italic fodder; usage
  outside of man page cross reference contexts is too varied (or even
  opposed), and now that we have MR, the main motivation for this point
  has evaporated.
* Erect shield against a Kemper notectomy.
* Note the typographical distinction most style guides make between
  "short" works on the one hand (for man page purposes, usually journal
  articles) and long ones (books, the journal names themselves).

Thanks to Alejandro Colomar for the discussion[1].

[1] https://lore.kernel.org/linux-man/\
2022093536.hvifxgdtb2y6jzge@localhost.localdomain/\
T/#m7cb247658ef0904ed402d24d28e07252b0dd679c
---
 tmac/groff_man.7.man.in | 18 +-
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index d6ac5b4..2322e42 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -1506,14 +1506,11 @@ _ifstyle()dnl
 Use italics
 for file and path names,
 for environment variables,
+for C data types,
 for enumeration or preprocessor constants in C,
 for variable (user-determined) portions of syntax synopses,
 for the first occurrence (only) of a technical concept being introduced,
-for names of works of software
-(including commands and functions,
-.\" The following is an interesting exception that seems to have arisen
-.\" organically and nearly universally.
-but excluding names of operating systems or their kernels),
+for names of journals and of literary works longer than an article,
 and anywhere a parameter requiring replacement by the user is
 encountered.
 .
@@ -1588,13 +1585,13 @@ it will be hidden from readers using such devices.
 .
 .
 .P
-Note what is
+Observe what is
 .I not
 prescribed for setting in bold or italics above:
 elements of \(lqsynopsis language\(rq such as ellipses and brackets
 around options;
 proper names and adjectives;
-titles of anything other than works of literature or software;
+titles of anything other than major works of literature;
 identifiers for standards documents or technical reports such as
 CSTR\~#54,
 RFC\~1918,
@@ -1604,17 +1601,12 @@ POSIX.1-2017;
 acronyms;
 and occurrences after the first of a technical term or piece of jargon.
 .
-Again,
-the names of operating systems and their kernels are,
-by practically universal convention,
-set in roman.
-.
 .
 .P
 Be frugal with italics for emphasis,
 and particularly with bold.
 .
-Brief runs of literal text,
+Article titles and brief runs of literal text,
 such as references to individual characters or short strings,
 including section and subsection headings of man pages,
 are suitable objects for quotation;

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 04/26: m4/groff.m4: Couple Texinfo-related macros.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit a1270cf002158179741f3e6d93b207df8691d895
Author: G. Branden Robinson 
AuthorDate: Fri Nov 12 12:56:01 2021 +1100

m4/groff.m4: Couple Texinfo-related macros.

[build]: This completes "revamp[ing] Texinfo manual handling", near as I
can tell.

* m4/groff.m4 (GROFF_TEXI2DVI): Add dependency on `GROFF_MAKEINFO`
  macro.  Rewrite to also test `MAKEINFO` variable, which is empty if
  the `makeinfo` command is not installed or too old.  Consequently
  ignore `texi2dvi` if is too old without having to do a version check
  (since it and `makeinfo` are distributed together, both being part of
  GNU Texinfo).

* doc/doc.am (.texi.dvi, .texi.pdf): Update error message to indicate
  that `texi2dvi` is _either_ missing or too old.
---
 ChangeLog   | 13 +
 doc/doc.am  |  6 --
 m4/groff.m4 | 16 +---
 3 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5c1eef0..c9948a1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
 2021-11-12  G. Branden Robinson 
 
+   * m4/groff.m4 (GROFF_TEXI2DVI): Add dependency on
+   `GROFF_MAKEINFO` macro.  Rewrite to also test `MAKEINFO`
+   variable, which is empty if the `makeinfo` command is not
+   installed or too old.  Consequently ignore `texi2dvi` if is too
+   old without having to do a version check (since it and
+   `makeinfo` are distributed together, both being part of GNU
+   Texinfo).
+
+   * doc/doc.am (.texi.dvi, .texi.pdf): Update error message to
+   indicate that `texi2dvi` is _either_ missing or too old.
+
+2021-11-12  G. Branden Robinson 
+
* m4/groff.m4 (GROFF_MAKEINFO): Stop throwing a warning if the
installed `makeinfo` is old but the distributed Info manual is
up to date.  This is not a configure-time problem; the user will
diff --git a/doc/doc.am b/doc/doc.am
index 70394a7..b3f7cb4 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -409,7 +409,8 @@ if HAVE_TEXI2DVI
$(TEXI2DVI) -e --batch --build-dir=doc/`basename $@`.t2d \
  -o $@ $<
 else
-   @echo "program texi2dvi is missing; cannot generate $@" >&2; \
+   @echo "program texi2dvi is missing or too old;" \
+ "cannot generate $@" >&2; \
exit 1
 endif
 
@@ -423,7 +424,8 @@ if HAVE_TEXI2DVI
$(TEXI2DVI) -e --batch --pdf --build-dir=doc/`basename $@`.t2p \
  -o $@ $<
 else
-   @echo "program texi2dvi is missing; cannot generate $@" >&2; \
+   @echo "program texi2dvi is missing or too old;" \
+ "cannot generate $@" >&2; \
exit 1
 endif
 
diff --git a/m4/groff.m4 b/m4/groff.m4
index b2c5c49..35e42ce 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -205,14 +205,16 @@ AC_DEFUN([GROFF_MAKEINFO],
AC_SUBST([make_install_infodoc])
AC_SUBST([make_uninstall_infodoc])])
 
+# 'makeinfo' and 'texi2dvi' are distributed together, so if the former
+# is too old, the latter is too.
 AC_DEFUN([GROFF_TEXI2DVI],
-  [AC_CHECK_PROG([PROG_TEXI2DVI], [texi2dvi], [found], [missing])
-   if test "x$PROG_TEXI2DVI" = "xfound"; then
-  groff_have_texi2dvi=yes;
-   else
-  groff_have_texi2dvi=no;
-   fi
-   ])
+  [AC_REQUIRE([GROFF_MAKEINFO])
+   AC_CHECK_PROG([PROG_TEXI2DVI], [texi2dvi], [found], [missing])
+   groff_have_texi2dvi=no
+   if test "x$PROG_TEXI2DVI" = "xfound" && test "x$MAKEINFO" != "x"
+   then
+  groff_have_texi2dvi=yes
+   fi])
 
 # The following programs are needed for grohtml.
 

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 13/26: [docs]: Update description of `sizes` request.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 7eebe71904f0c77bba9bcce497eca5875de4a4c0
Author: G. Branden Robinson 
AuthorDate: Sat Nov 13 18:57:28 2021 +1100

[docs]: Update description of `sizes` request.
---
 doc/groff.texi   |  8 
 man/groff.7.man  |  9 +++--
 man/groff_diff.7.man | 17 +++--
 3 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index 5a48020..40ef73b 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -11004,10 +11004,10 @@ a single character as an argument) to change the font 
on the fly:
 .mc \s[20]x\s[0]
 @endExample
 
-@Defreq {sizes, s1 s2 @dots{} sn [0]}
-Some devices may only have certain permissible sizes, in which case
-@code{gtroff} rounds to the nearest permissible size.  The @file{DESC}
-file specifies which sizes are permissible for the device.
+@Defreq {sizes, s1 s2 @dots{} sn [@t{0}]}
+Some devices may permit only certain type sizes, in which case GNU
+@code{troff} rounds to the nearest permissible size.  The @file{DESC}
+file normally specifies which type sizes are allowed by the device.
 
 Use the @code{sizes} request to change the permissible sizes for the
 output device.  Arguments are in scaled points; the @code{sizescale}
diff --git a/man/groff.7.man b/man/groff.7.man
index 182b568..273eac4 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -2947,12 +2947,17 @@ positions.
 .TPx
 .REQ .sizes "s1 s2 \fR\&.\|.\|.\&\fP s\fRn\~\c
 [\f[CB]0\f[]]
-Set available font sizes similar to the
+Set available type sizes similarly to the
 .B sizes
-command in a
+directive in a
 .I DESC
 file.
 .
+Each
+.IR s i
+is interpreted in units of scaled points (\c
+.scaleindicator z ).
+.
 .
 .TPx
 .REQ .so file
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index 2c4993a..dda325a 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -2955,17 +2955,12 @@ is missing, arguments are shifted by\~1.
 .
 Shifting by negative amounts is currently undefined.
 .
+.
 .TP
 .BI .sizes\~ "s1 s2\~"\c
 .RI .\|.\|.\~ sn\~\c
 .RB [ 0 ]
-This request is similar to the
-.B sizes
-command of a
-.I DESC
-file.
-.
-It sets the available font sizes for the current font to
+Set the available type sizes to
 .IR s1 ,
 .IR s2 ,
 \&.\|.\|.\&
@@ -2977,11 +2972,13 @@ The list of sizes can be terminated by an
 .
 Each
 .I si
-can also be a range of sizes
+can also be a range
 .IR m \(en n .
 .
-Contrary to the font file command, the list can't extend over more
-than a single line.
+In contrast to the device description file directive of the same name
+(see
+.MR groff_font @MAN5EXT@ ),
+the argument list can't extend over more than one line.
 .
 .
 .TP

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 03/26: m4/groff.m4 (GROFF_MAKEINFO): Simplify.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 976ccf5118f0d5156d19d10505407a7ecf2a471b
Author: G. Branden Robinson 
AuthorDate: Fri Nov 12 12:50:06 2021 +1100

m4/groff.m4 (GROFF_MAKEINFO): Simplify.

* m4/groff.m4 (GROFF_MAKEINFO): Stop throwing a warning if the installed
  `makeinfo` is old but the distributed Info manual is up to date.  This
  is not a configure-time problem; the user will be notified when they
  run 'make doc'.  Empty the `MAKEINFO` variable immediately if a
  too-old version is detected.  Drop needless `AC_SUBST`itution of the
  detected `makeinfo` version.
---
 ChangeLog   | 9 +
 m4/groff.m4 | 9 ++---
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 15bb0c0..5c1eef0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2021-11-12  G. Branden Robinson 
 
+   * m4/groff.m4 (GROFF_MAKEINFO): Stop throwing a warning if the
+   installed `makeinfo` is old but the distributed Info manual is
+   up to date.  This is not a configure-time problem; the user will
+   be notified when they run 'make doc'.  Empty the `MAKEINFO`
+   variable immediately if a too-old version is detected.  Drop
+   needless `AC_SUBST`itution of the detected `makeinfo` version.
+
+2021-11-12  G. Branden Robinson 
+
* m4/groff.m4 (GROFF_HTML_PROGRAMS): Clarify message; it is only
groff-generated HTML that is disabled by the absence of the
programs checked for.  (`makeinfo` can still generate our
diff --git a/m4/groff.m4 b/m4/groff.m4
index 353c56a..b2c5c49 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -178,6 +178,7 @@ AC_DEFUN([GROFF_MAKEINFO],
  expr ${makeinfo_version_major}000 \+ ${makeinfo_version_minor}`
if test $makeinfo_version_numeric -lt 5000; then
  missing="'makeinfo' is too old."
+ MAKEINFO=
fi
  fi
 
@@ -188,10 +189,6 @@ AC_DEFUN([GROFF_MAKEINFO],
|| test ${srcdir}/doc/groff.texi -nt ${infofile}; then
 AC_MSG_ERROR($missing
 [Get the 'texinfo' package version 5.0 or newer.])
-   else
-AC_MSG_WARN($missing
-[Get the 'texinfo' package version 5.0 or newer if you want to convert
-'groff.texi' into a PDF or HTML document.])
fi
  fi
 
@@ -202,13 +199,11 @@ AC_DEFUN([GROFF_MAKEINFO],
  make_infodoc=
  make_install_infodoc=
  make_uninstall_infodoc=
- MAKEINFO=
fi
AC_SUBST([MAKEINFO])
AC_SUBST([make_infodoc])
AC_SUBST([make_install_infodoc])
-   AC_SUBST([make_uninstall_infodoc])
-   AC_SUBST([makeinfo_version_numeric])])
+   AC_SUBST([make_uninstall_infodoc])])
 
 AC_DEFUN([GROFF_TEXI2DVI],
   [AC_CHECK_PROG([PROG_TEXI2DVI], [texi2dvi], [found], [missing])

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 08/26: groff_man*(7): Fix content and style nits.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit bc4abc17116e7b12c03aa4d4917102ef6c44534c
Author: G. Branden Robinson 
AuthorDate: Fri Nov 12 12:00:10 2021 +1100

groff_man*(7): Fix content and style nits.

Content:
* Consistently say "escape sequence(s)" instead of "escape(s)".
* Swap parenthesization order when presenting "recto" and "verso"; give
  the typographical terms first and then explain them in parentheses on
  the presumption that most man page authors don't have a background in
  publishing or typography.
* Generalize claims of syntactical traditions regarding '-' and '\';
  they are on the order of 50 years old.
* De-document support for positive FT register settings; we un-supported
  them in commit 5a76dfb9 (17 May) and I'm guessing that few people use
  them intentionally.

Style:
* Make a relative inset's indentation less garish.
* Use passive voice consistently within a clause.
---
 tmac/groff_man.7.man.in | 67 +
 1 file changed, 34 insertions(+), 33 deletions(-)

diff --git a/tmac/groff_man.7.man.in b/tmac/groff_man.7.man.in
index 90c1469..d6ac5b4 100644
--- a/tmac/groff_man.7.man.in
+++ b/tmac/groff_man.7.man.in
@@ -23,9 +23,9 @@ These man pages serve multiple goals, one of which is to 
serve as a
 model for good man page writing by people who examine their sources.
 
 After processing by m4, both child pages in the above case will carry \c
-escapes followed by text lines starting with punctuation one normally
-does not find in that position (and in the case of the period, which has
-to be protected from interpretation as a control line).
+escape sequences followed by text lines starting with punctuation one
+normally does not find in that position (and in the case of the period,
+which has to be protected from interpretation as a control line).
 
 This is ugly, fragile, and unnecessary; all of these traits are
 offensive to good pedagogy.
@@ -219,7 +219,7 @@ and employ the Unix line-ending convention
 .\" The above distinction works well with filling.
 .\" Don't fill your input text yourself; let groff do the work.
 .\" Also good for diffs.
-.\" escapes--pretty much just "see Portability"
+.\" escape sequences--pretty much just "see Portability"
 .\"
 .\" 
 .\" .SS "Why have a tutorial and style guide?"
@@ -385,8 +385,8 @@ is positioned at the bottom left.
 .
 Otherwise,
 .I footer-inside
-appears at the bottom left on odd-numbered (recto) pages,
-and at the bottom right on even-numbered (verso) pages.
+appears at the bottom left on recto (odd-numbered) pages,
+and at the bottom right on verso (even-numbered) pages.
 .
 The outside footer is the page number,
 except in the continuous-rendering mode enabled by the option
@@ -499,7 +499,7 @@ must be the first section after the
 .B .TH
 call,
 and must contain only a line of the form
-.RS \" Invisibly move left margin to current .IP indent.
+.RS \" Invisibly move left margin to current .IP indentation.
 .RS \" Now indent further, visibly.
 .IR topic [\c
 .BI , " another-topic"\c
@@ -819,8 +819,8 @@ Two convenient uses for
 are
 .
 .
-.RS \" Invisibly move left margin to current .IP indent.
-.RS \" Now indent further, visibly.
+.RS \" Invisibly move left margin to current .IP indentation.
+.RS 4n \" Now indent further, visibly.
 .IP (1) 4n
 to start a new paragraph with the same indentation as an immediately
 preceding
@@ -1624,7 +1624,7 @@ see the
 .BR \e(oq ,
 and
 .B \e(cq
-escapes in subsection \(lqPortability\(rq below.
+escape sequences in subsection \(lqPortability\(rq below.
 .
 .
 _endif()dnl
@@ -2236,13 +2236,13 @@ _ifstyle()dnl
 .
 The two major syntactical categories of
 .I roff
-languages are requests and escapes.
+languages are requests and escape sequences.
 .
 Since the
 .I man
 macros are implemented in terms of
 .I groff
-requests and escapes,
+requests and escape sequences,
 one can,
 in principle,
 supplement the functionality of
@@ -2295,7 +2295,7 @@ in section \(lqFiles\(rq below.
 .
 .
 .P
-Similar caveats apply to escapes.
+Similar caveats apply to escape sequences.
 .
 Some escape sequences are however required for correct typesetting
 even in man pages and usually do not cause portability problems.
@@ -2306,8 +2306,9 @@ in the Unicode basic Latin range
 that are handled specially in
 .I roff
 input;
-the escapes below must be used to render them correctly and portably
-when documenting material that uses them syntactically\(emnamely,
+the escape sequences below must be used to render them correctly and
+portably when documenting material that uses them
+syntactically\(emnamely,
 any of the set
 .B \(aq \- \(rs \(ha \(ga \(ti
 (apostrophe,
@@ -2437,8 +2438,9 @@ This escape sequence produces the Unix command-line 
option dash in the
 output.
 .
 .RB \(lq \- \(rq
-is a hyphen to
-.IR roff ;
+is a hyphen in
+.I 

[groff] 07/26: src/preproc/tbl/table.cpp: Fix code style nits.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit e53f81bc87bf2868fa837281bca6c06181cc8f38
Author: G. Branden Robinson 
AuthorDate: Sat Nov 13 06:09:52 2021 +1100

src/preproc/tbl/table.cpp: Fix code style nits.

* src/preproc/tbl/table.cpp (table::do_vspan): Fix code style nits.
  Swap order of null pointer and zero equality comparisons when a typo
  or thinko could lead to lvalue assignment.  Break a series of 6 and-ed
  assertion predicates into separate `assert()` calls--sure to be less
  maddening for anyone who has to debug such a contingency.  Clarify
  comment since C++98 didn't yet have `nullptr`.
---
 ChangeLog | 10 ++
 src/preproc/tbl/table.cpp | 16 +---
 2 files changed, 19 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b0e5025..48a0429 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2021-11-13  G. Branden Robinson 
 
+   * src/preproc/tbl/table.cpp (table::do_vspan): Fix code style
+   nits.  Swap order of null pointer and zero equality comparisons
+   when a typo or thinko could lead to lvalue assignment.  Break a
+   series of 6 and-ed assertion predicates into separate `assert()`
+   calls--sure to be less maddening for anyone who has to debug
+   such a contingency.  Clarify comment since C++98 didn't yet have
+   `nullptr`.
+
+2021-11-13  G. Branden Robinson 
+
[m4]: Clean up shell variable quoting and bracing.
 
* m4/groff.m4 (GROFF_PROG_YACC, GROFF_MAKEINFO,
diff --git a/src/preproc/tbl/table.cpp b/src/preproc/tbl/table.cpp
index 6b16625..444333c 100644
--- a/src/preproc/tbl/table.cpp
+++ b/src/preproc/tbl/table.cpp
@@ -1424,21 +1424,23 @@ void table::do_hspan(int r, int c)
 void table::do_vspan(int r, int c)
 {
   assert(r >= 0 && c >= 0 && r < nrows && c < ncolumns);
-  if (r == 0) {
+  if (0 == r) {
 error("first row cannot be vertically spanned");
 return;
   }
   table_entry *e = entry[r][c];
   if (e) {
-assert(e->start_row <= r && r <= e->end_row
-  && e->start_col <= c && c <= e->end_col
-  && e->end_row - e->start_row > 0
-  && e->end_col - e->start_col > 0);
+assert(e->start_row <= r);
+assert(r <= e->end_row);
+assert(e->start_col <= c);
+assert(c <= e->end_col);
+assert((e->end_row - e->start_row) > 0);
+assert((e->end_col - e->start_col) > 0);
 return;
   }
   e = entry[r-1][c];
-  // e can be 0 if we had an empty entry or an error
-  if (e == 0)
+  // e can be a null pointer if we had an empty entry or an error
+  if (0 == e)
 return;
   if (e->start_col != c) {
 /* l s

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


[groff] 01/26: ChangeLog: Clarify old entries.

2021-11-14 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit a7df9780a1b92d54a333d7c9f912f203b4e41a6f
Author: G. Branden Robinson 
AuthorDate: Sat Nov 13 05:45:56 2021 +1100

ChangeLog: Clarify old entries.
---
 ChangeLog | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index da558e2..8fd0a86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,7 @@
 2021-11-11  G. Branden Robinson 
 
-   Revamp Texinfo manual handling, 1/n.  Drop `BUILD_INFODOC`
-   symbol.  Ship manual in GNU Info, text, and HTML forms in
-   distribution archive.
+   [build]: Drop `BUILD_INFODOC` symbol.  Ship manual in GNU Info,
+   text, and HTML forms in distribution archive.
 
* Makefile.am (MAINTAINERCLEANFILES): Initialize.
(MOSTLYCLEANADD): Drop unused variable.
@@ -223,8 +222,8 @@
it.
* src/roff/groff/tests/artifacts/HONEYPOT: Add test artifact.
* src/roff/groff/tests/artifacts/devascii/README: ...and this;
-   we need an empty directory to make the test work but such things
-   tend to look unintentional.
+   we need a directory to make the test work but empty ones tend to
+   look unintentional.
* src/roff/groff/groff.am (groff_TESTS): Run test.
(EXTRA_DIST): Ship artifacts.
 
@@ -442,8 +441,8 @@
* src/roff/troff/input.cpp (encode_char): Rearrange
conditionals.  This is the logic that puts the "whatever" within
a \X'whatever' escape sequence into GNU troff's intermediate
-   output.  Handle stretchable and unstretchable space escape
-   sequences ("\ " and \~") first.  Then, if the token is a special
+   output.  Handle adjustable and nonadjustable space escape
+   sequences ("\~" and \ ") first.  Then, if the token is a special
character escape sequence, retrieve its "contents" (glyph name).
Move the basic Latin mapping for the seven glyph names '-',
'aq', 'dq', 'ga', 'ha', 'rs', and 'ti' here, before checking
@@ -501,7 +500,7 @@
 
[man]: Warn if `TE` table macro called but `TW` register (set by
tbl(1)) undefined.  Arrange it so that we warn only once per
-   man(7) document, not per table.
+   man(7) document, not per table region.
 
* tmac/an.tmac (TH): Remove `TW` register when processing new
document and clear `an-was-tbl-failure-reported` register.

___
Groff-commit mailing list
Groff-commit@gnu.org
https://lists.gnu.org/mailman/listinfo/groff-commit


Re: Use `strsave()`, not `strdup()`.

2021-11-14 Thread James K. Lowden
On Tue, 9 Nov 2021 20:17:56 +1100
"G. Branden Robinson"  wrote:

> We can either:
> * Use a nonstandard allocator; or
> * Handle exceptions.

Hi Brandon, 

If it's C++, you have only one choice: handle exceptions.  Otherwise,
you're using so little of the language that you might as well use C.  

class F {
F( int size ) { ... }
...
}; 

F foo(10);

How does F indictate a failure in its contructor, if not by throwing an
exception?  Are you going to guarantee no constructor throws an
exception, or never use constructors (amost the same thing)?  

The notion of using some acceptable subset of C++ strikes me as quaint
in 2021.  C++ was a controversial language back when compiled languages
could be controversial, but that hasn't been true since Javascript ate
the operating system.  

There was a time, 15 or more years ago, when gcc's C++ implementation
was sub-par.  It choked on valid templates and a variety of
valid-but-complex constructions I threw at it.  In those days I
routinely found errors in Microsoft's implementation, too, about once a
month.  

But those days are history.  C++ implementations are up to snuff now,
and groff would be mistaken not to lean on the compilers for what they
can do, and for what the language can deliver. 

Regards, 

--jkl



Re: macro returning a value?

2021-11-14 Thread Thomas Dupond
Ulrich Lauther  wrote:

> >   .de Pos
> >   \R'foo (\\n[.d]-\\n[.v]*254+1)/72000'\\n[foo]mm/10
> >   ..
> >
> > which allows you to enter
> >
> >   position: \n[.d] units, \*[Pos].
> >
>
> Wow! Works nicely.
>
> But why is "R" escaped only once? \\R works too.
> And I had to add a line ".sp -1v" at the end of the  macro; otherwise I get a
> blank line after position: ...
>
> ulrich
>

Hi Ulrich,

I think I know why, if I'm mistaken, please correct me.

To be executed, macros are effectively executed twice by groff.  Once to
be defined and once more at execution.  Backslashes are needed to
distinguish between definition and execution.

\\n[.d] is escaped twice because we need the number register .d at the
time of execution not at the time of definition.  As for \R foo, it is
equivalent to .nr foo so it is OK if it is executed at the time of
definition.

--
Regards,
Thomas




Re: macro returning a value?

2021-11-14 Thread Ulrich Lauther
On Sat, Nov 13, 2021 at 12:19:09PM -0500, Peter Schaffter wrote:
> On Sat, Nov 13, 2021, Ulrich Lauther wrote:
> > Is there a trick to make a macro or string return a value?
> 
> > The only solution I found looks like this:
> > 
> > .de Pos END
> > .nr foo (\\n[.d]u-\\[.v]u)*254+1)/72000
> > \\n[foo] mm/10
> > .END
> > 
> > .fi
> > position: \n[.d] units,
> > .Pos
> 
> .nr foo has an error -- s/b \\n[.v] -- and the u scaling indicators
> are superfluous.  Fixed, the macro could be written
> 
>   .de Pos
>   \R'foo (\\n[.d]-\\n[.v]*254+1)/72000'\\n[foo]mm/10
>   ..
> 
> which allows you to enter
> 
>   position: \n[.d] units, \*[Pos].
> 

Wow! Works nicely.

But why is "R" escaped only once? \\R works too.
And I had to add a line ".sp -1v" at the end of the  macro; otherwise I get a
blank line after position: ...

ulrich