[groff] 14/28: [doc,man]: Revise `open` and `opena` descriptions.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 07e2f211f185d5948764798fb57c24e061a70a87
Author: G. Branden Robinson 
AuthorDate: Fri Mar 7 06:27:01 2025 -0600

[doc,man]: Revise `open` and `opena` descriptions.

Also sync their wording between documents.
---
 doc/groff.texi.in| 22 +-
 man/groff.7.man  |  8 +---
 man/groff_diff.7.man | 27 ---
 3 files changed, 38 insertions(+), 19 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 138610c73..2099412b6 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -464,7 +464,7 @@ Documentation License''.
 @title groff
 @subtitle The GNU implementation of @code{troff}
 @subtitle version @VERSION@
-@subtitle February 2025
+@subtitle March 2025
 @author Trent@tie{}A.@: Fisher
 @author Werner Lemberg
 @author G.@tie{}Branden Robinson
@@ -16844,11 +16844,23 @@ output.
 @cindex file, opening (@code{open})
 @cindex appending to a file (@code{opena})
 @cindex file, appending to (@code{opena})
-Open the specified @var{file} for writing and associates the specified
-@var{stream} with it.
+Open
+@var{file}
+for writing and associate a stream named
+@var{ident}
+with it,
+making it available for
+@code{write}
+requests.
 
-The @code{opena} request is like @code{open}, but if the file exists,
-append to it instead of truncating it.
+The
+@code{opena}
+request is like
+@code{open},
+but if
+@var{file}
+already exists,
+appends to it instead of overwriting it.
 
 @cindex safer mode
 @cindex mode, safer
diff --git a/man/groff.7.man b/man/groff.7.man
index 79a557190..542d22dc4 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -4044,9 +4044,11 @@ disabled by default.
 .TPx
 .REQ .opena "ident file"
 As
-.RB \[lq] open \[rq] ,
-but append to
-.I file.
+.RB \[lq] open \[rq],
+but if
+.I file
+already exists,
+appends to it instead of overwriting it.
 .
 Unsafe request;
 disabled by default.
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index 419d3c6ea..11444fede 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -3290,31 +3290,36 @@ See
 .
 .
 .TP
-.BI .open\~ "stream\~\c
+.BI .open\~ "ident\~\c
 .RB [ \[dq] ]\c
 .I file
 Open
 .I file
-for writing and associate
-.I stream
-with it.
+for writing and associate a stream named
+.I ident
+with it,
+making it available for
+.RB \[lq] write \[rq]
+requests.
 .
-See
-.B write
-and
-.BR close .
+Unsafe request;
+disabled by default.
 .
+Also see
+.B writec
+and
+.RB \[lq] close \[rq].
 .
 .TP
-.BI .opena\~ "stream\~\c
+.BI .opena\~ "ident\~\c
 .RB [ \[dq] ]\c
 .I file
 As
 .RB \[lq] open \[rq],
 but if
 .I file
-exists,
-append to it instead of truncating it.
+already exists,
+appends to it instead of overwriting it.
 .
 .
 .TP

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


[groff] 08/28: doc/groff.texi.in: Drop redundant material.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 79484b1c3580a9a8455ca5f049400a0fd5909ba6
Author: G. Branden Robinson 
AuthorDate: Fri Feb 28 17:39:36 2025 -0600

doc/groff.texi.in: Drop redundant material.

The introduction to node/section "I/O" makes this point.
---
 doc/groff.texi.in | 24 
 1 file changed, 24 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index b927de377..17903036a 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -16499,9 +16499,6 @@ the directories specified by @option{-I} command-line 
option.  If
 and the request has no further effect.  @xref{Warnings}, for
 information about the enablement and suppression of warnings.
 
-GNU @command{troff} strips a leading neutral double quote from the
-argument, allowing embedded leading spaces in @var{file}.
-
 @code{so} can be useful for large documents; e.g., allowing each chapter
 of a book to be kept in a separate file.  However, files interpolated
 with @code{so} are not preprocessed; to overcome this limitation, see
@@ -16581,9 +16578,6 @@ Both requests break the line before reading
 @var{file},
 unless invoked with the no-break control character.
 
-GNU @command{troff} strips a leading neutral double quote from the
-argument, allowing embedded leading spaces in @var{file}.
-
 When used in a diversion, these requests embed a node (@pxref{Gtroff
 Internals}) in it that, when interpolated, causes the contents of
 @var{file} to be copied to the output.  In @acronym{AT&T} @code{troff},
@@ -16631,9 +16625,6 @@ from becoming part of the diversion 
(@pxref{Diversions}).
 @cindex next file, read (@code{nx})
 Stop processing the input file.  If @var{file} is specified, read it;
 otherwise, read the next pending input file, if any.
-
-GNU @command{troff} strips a leading neutral double quote from the
-argument, allowing embedded leading spaces in @var{file}.
 @endDefreq
 
 @Defreq {rd, [@Var{prompt} [@Var{arg1} @Var{arg2} @dots{}]]}
@@ -16720,9 +16711,6 @@ The formatter reads the remainder of the input line 
into @var{command}
 and passes it to @cite{popen@r{(3)}}.  Output produced by the
 command(s) is not captured by GNU @command{troff}.
 
-GNU @command{troff} strips a leading neutral double quote from the
-argument, allowing embedded leading spaces in @var{command}.
-
 Multiple @code{pi} requests construct a multi-stage pipeline in the same
 order as the formatter encounters the requests.
 
@@ -16758,14 +16746,6 @@ The formatter reads the remainder of the input line 
into a buffer
 and passes it to
 @cite{system@r{(3)}}.
 The formatter does not capture the output produced by the command(s).
-GNU
-@command{troff}
-strips a leading leading neutral double quote from
-@var{command},
-which it reads in copy mode
-(recall
-@pxref{Copy Mode}),
-allowing it to contain embedded leading spaces.
 
 @cindex safer mode
 @cindex mode, safer
@@ -16853,10 +16833,6 @@ Write @var{contents} to @var{stream}, which must 
previously have been
 the subject of an @code{open} (or @code{opena}) request.  GNU
 @command{troff} flushes the stream after writing to it.
 
-A leading neutral double quote in the second argument is stripped from
-it, allowing embedded leading spaces in @var{contents}, which is read to
-the end of the input line in copy mode.
-
 The @code{writec} request is like @code{write}, but only @code{write}
 appends a newline to @var{contents}.
 @endDefreq

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


[groff] 22/28: [groff]: Regression-test Savannah #66863.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 09060903cf50ee396992889efbf1c21b145c92dd
Author: G. Branden Robinson 
AuthorDate: Mon Mar 3 00:19:33 2025 -0600

[groff]: Regression-test Savannah #66863.

* src/roff/groff/tests/cf-request-works.sh:
* src/roff/groff/tests/trf-request-works.sh: Add tests.
* src/roff/groff/tests/artifacts/throughput-file: Add their input
  artifact.
* src/roff/groff/groff.am (groff_TESTS): Run tests.

Tests fail at this commit.
---
 ChangeLog  | 10 +
 src/roff/groff/groff.am|  2 +
 src/roff/groff/tests/artifacts/throughput-file |  1 +
 src/roff/groff/tests/cf-request-works.sh   | 56 ++
 src/roff/groff/tests/trf-request-works.sh  | 56 ++
 5 files changed, 125 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 59771bb49..21822139f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-03-02  G. Branden Robinson 
+
+   [groff]: Regression-test Savannah #66863.
+
+   * src/roff/groff/tests/cf-request-works.sh:
+   * src/roff/groff/tests/trf-request-works.sh: Add tests.
+   * src/roff/groff/tests/artifacts/throughput-file: Add their
+   input artifact.
+   * src/roff/groff/groff.am (groff_TESTS): Run tests.
+
 2025-03-07  G. Branden Robinson 
 
* src/roff/troff/input.cpp (token::next): Clarify warning
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 747dbb672..722d22a7f 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -44,6 +44,7 @@ groff_TESTS = \
   src/roff/groff/tests/backslash-s-works-with-single-digit-argument.sh \
   src/roff/groff/tests/break-zero-length-output-line-sanely.sh \
   src/roff/groff/tests/cf-request-early-does-not-fail.sh \
+  src/roff/groff/tests/cf-request-works.sh \
   src/roff/groff/tests/check-delimiter-validity.sh \
   src/roff/groff/tests/current-language-and-environment-in-sync.sh \
   src/roff/groff/tests/degenerate-control-flow-works.sh \
@@ -101,6 +102,7 @@ groff_TESTS = \
   src/roff/groff/tests/stringup-request-transforms-non-basic-latin.sh \
   src/roff/groff/tests/substring-request-works.sh \
   src/roff/groff/tests/sy-request-works.sh \
+  src/roff/groff/tests/trf-request-works.sh \
   src/roff/groff/tests/unencodable-things-in-grout.sh \
   src/roff/groff/tests/using-diversion-as-character-works.sh \
   src/roff/groff/tests/write-request-handles-empty-second-arg.sh
diff --git a/src/roff/groff/tests/artifacts/throughput-file 
b/src/roff/groff/tests/artifacts/throughput-file
new file mode 100644
index 0..371fe6a5e
--- /dev/null
+++ b/src/roff/groff/tests/artifacts/throughput-file
@@ -0,0 +1 @@
+# this is a trout/grout comment
diff --git a/src/roff/groff/tests/cf-request-works.sh 
b/src/roff/groff/tests/cf-request-works.sh
new file mode 100755
index 0..1527c2899
--- /dev/null
+++ b/src/roff/groff/tests/cf-request-works.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# Copyright (C) 2025 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+# Regression-test Savannah #66863.
+#
+# The `cf` request should not excessively advance the input stream
+# pointer.
+
+# Locate directory containing our test artifacts.
+artifact_dir=
+base=src/roff/groff/tests
+dir=artifacts
+
+for buildroot in . .. ../..
+do
+d=$buildroot/$base/$dir
+if [ -d "$d" ]
+then
+artifact_dir=$d
+break
+fi
+done
+
+# If we can't find it, we can't test.
+test -z "$artifact_dir" && exit 77 # skip
+
+input=".
+hello
+.cf $artifact_dir/throughput-file
+world
+."
+
+output=$(printf "%s" "$input" | "$groff" -b -ww -Ua)
+echo "$output"
+echo "$output" | grep -Fqx world
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:
diff --git a/src/roff/groff/tests/trf-request-works.sh 
b/src/roff/groff/tests/trf-request-works.sh
new file mode 100755
index 0..87d33963a
--- /dev/null
+++ b/src/roff/groff/tests/trf-request-works.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+# Copyright (C) 2025 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Soft

[groff] 20/28: doc/groff.texi.in (Deferring Output): Recast.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit d25d16935fa7fe8585c3862f331b80704de30a1b
Author: G. Branden Robinson 
AuthorDate: Fri Mar 7 15:45:50 2025 -0600

doc/groff.texi.in (Deferring Output): Recast.
---
 doc/groff.texi.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index f79714f72..f8fb2719f 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -14904,7 +14904,7 @@ The author calls the first macro where a footnote 
marker is desired.
 The macro establishes a diversion so that the footnote text is collected
 at the place in the body text where its corresponding marker appears.
 It further creates an environment for the footnote so that it
-sets at a smaller typeface.
+sets using a smaller typeface.
 The footnote text is formatted in the diversion using that environment
 but it does not yet appear in the output.
 The document author calls the footnote end macro,

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


[groff] 06/28: [doc,man]: Clarify behavior of `nn` request.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 97c7c479318f7f4c8f66625e353b1b55167c34f0
Author: G. Branden Robinson 
AuthorDate: Fri Feb 28 16:36:56 2025 -0600

[doc,man]: Clarify behavior of `nn` request.
---
 doc/groff.texi.in | 21 +
 man/groff.7.man   |  4 ++--
 2 files changed, 19 insertions(+), 6 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index dfee47600..16c44be7f 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -17116,10 +17116,23 @@ This guy's arrogance takes your breath away.
 
 @DefreqList {nn, [@Var{skip}]}
 @DefregListEndx {.nn}
-Suppress numbering of the next @var{skip} output lines that would
-otherwise be numbered.  The default is@tie{}1.  @code{nn} can be invoked
-when line numbering is not active; suppression of numbering will take
-effect for @var{skip} lines once @code{nm} enables it.
+Suppress numbering of the next
+@var{skip}
+output lines counted by the
+@code{nm}
+request.
+If
+@var{skip}=0,
+@c XXX: negative values accepted; check AT&T troff
+cancel suppression.
+The default is@tie{}1.
+@code{nn}
+can be invoked when line numbering is not active;
+suppression of numbering takes effect for
+@var{skip}
+lines once
+@code{nm}
+enables it.
 
 The @code{.nn} register stores the count of output lines still to have
 their numbering suppressed.
diff --git a/man/groff.7.man b/man/groff.7.man
index ccdd290e1..ff67bb3df 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -3926,14 +3926,14 @@ numeral widths
 .
 .TPx
 .REQ .nn
-Suppress numbering of the next output line to be numbered with
+Suppress numbering of the next output line counted by
 .BR nm .
 .
 .TPx
 .REQ .nn n
 Suppress numbering of the next
 .I n
-output lines to be numbered with
+output lines counted by
 .BR nm .
 .
 If

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


[groff] 04/28: [doc,man]: Clarify indexed character usage.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit edb9758c881526cc777f3d853d2fa68ffbbb817e
Author: G. Branden Robinson 
AuthorDate: Fri Feb 28 16:28:50 2025 -0600

[doc,man]: Clarify indexed character usage.
---
 doc/groff.texi.in| 4 +++-
 man/groff.7.man  | 2 +-
 man/groff_diff.7.man | 4 +++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index ffb413860..c16adc39a 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -17515,7 +17515,9 @@ or are interested @emph{only} in diagnostic output, you 
can suppress GNU
 @Defreq {pchar, c @r{@dots{}}}
 Report,
 to the standard error stream,
-information about each ordinary or special
+information about each ordinary,
+special,
+or indexed
 character@tie{}@var{c}.
 @endDefreq
 
diff --git a/man/groff.7.man b/man/groff.7.man
index 8c9747d2e..ccdd290e1 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -5590,7 +5590,7 @@ Interpolate value of register with arbitrarily long
 .
 .TP
 .ESCq N n
-Interpolate glyph with
+Interpolate glyph of character with
 .RI index\~ n
 in the current font.
 .
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index e12f05848..2ad254ea1 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -3329,7 +3329,9 @@ in the top-level diversion.
 \&.\|.\|.
 Report,
 to the standard error stream,
-information about each ordinary or special
+information about each ordinary,
+special,
+or indexed
 .RI character\~ c .
 .
 .

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


[groff] 07/28: [doc,man]: Clarify postprocessor access features.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 309079129baa19c450e0f777964c81e197194055
Author: G. Branden Robinson 
AuthorDate: Fri Feb 28 17:31:33 2025 -0600

[doc,man]: Clarify postprocessor access features.
---
 doc/groff.texi.in | 27 ---
 man/groff.7.man   | 13 +
 2 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 16c44be7f..b927de377 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -16924,13 +16924,26 @@ as returned by @cite{getenv@r{(3)}}.
 @cindex postprocessor access
 @cindex access to postprocessor
 
-Two escape sequences and two requests enable documents to pass
-information directly to a postprocessor.  These are useful for
-exercising device-specific capabilities that the @code{groff} language
-does not abstract or generalize; examples include the embedding of
-hyperlinks and image files.  Device-specific functions are documented in
-each output driver's man page, such as @cite{gropdf@r{(1)}},
-@cite{grops@r{(1)}}, or @cite{grotty@r{(1)}}.
+Beyond the
+@code{cf}
+and
+@code{trf}
+requests
+(recall
+@ref{I/O}),
+two escape sequences and two requests enable documents
+to pass information directly to a postprocessor.
+These are useful for exercising device-specific capabilities that the
+@code{groff}
+language does not abstract or generalize;
+examples include the embedding of hyperlinks and image files.
+Device-specific functions are documented
+in each output driver's man page,
+such as
+@cite{gropdf@r{(1)}},
+@cite{grops@r{(1)}},
+or
+@cite{grotty@r{(1)}}.
 
 @DefreqList {device, [@code{"}]@Var{contents}}
 @DefescListEndx {\\X, @code{'}, contents @r{@dots{}}, @code{'}}
diff --git a/man/groff.7.man b/man/groff.7.man
index ff67bb3df..e024d385e 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -8404,16 +8404,21 @@ copies a named environment's parameters to the current 
one.
 .
 .\" BEGIN Keep (roughly) parallel with groff.texi node "Postprocessor
 .\" Access".
-Two escape sequences and two requests enable documents to pass
-information directly to an output driver or other postprocessor.
+Beyond the
+.B cf
+and
+.B trf
+requests,
+two escape sequences and two requests enable documents
+to pass information directly to a postprocessor.
 .
 These are useful for exercising device-specific capabilities that the
 .I groff
 language does not abstract or generalize;
 examples include the embedding of hyperlinks and image files.
 .
-Device-specific functions are documented in each output driver's man
-page,
+Device-specific functions are documented
+in each output driver's man page,
 such as
 .MR gropdf @MAN1EXT@ ,
 .MR grops @MAN1EXT@ ,

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


[groff] 25/28: src/roff/troff/node.h: Fix code style nit.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 723ea3203726c08df85d317da72902cdc25bc964
Author: G. Branden Robinson 
AuthorDate: Sun Mar 2 12:47:56 2025 -0600

src/roff/troff/node.h: Fix code style nit.

* src/roff/troff/node.h (node::node): Explicitly compare variable of
  pointer type to null pointer literal instead of letting it pun down to
  a Boolean.
---
 ChangeLog | 6 ++
 src/roff/troff/node.h | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 84f6ca9cb..bd21ecc59 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-03-02  G. Branden Robinson 
+
+   * src/roff/troff/node.h (node::node): Fix code style nit;
+   explicitly compare variable of pointer type to null pointer
+   literal instead of letting it pun down to a Boolean.
+
 2025-03-02  G. Branden Robinson 
 
* src/roff/troff/node.cpp (hline_node::~hline_node)
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index fe96fa1c6..a56714777 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -138,7 +138,7 @@ inline node::node(node *n, statem *s, int divlevel)
   push_state(0 /* nullptr */),
   div_nest_level(divlevel), is_special(false)
 {
-  if (s)
+  if (s != 0 /* nullptr */)
 state = new statem(s);
   else
 state = 0 /* nullptr */;

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


[groff] 10/28: doc/groff.texi.in: Use better verb.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit f6d0e0f9a9d2c2b040d7cee9265e86a50046959c
Author: G. Branden Robinson 
AuthorDate: Fri Feb 28 17:42:59 2025 -0600

doc/groff.texi.in: Use better verb.
---
 doc/groff.texi.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index fd55c88c4..57d685e8e 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -16484,7 +16484,7 @@ Suffixing the file name or command with a comment,
 even an empty one,
 prevents unwanted space from creeping into it during source document
 maintenance.
-See the discussion of the
+Recall the discussion of the
 @code{ds}
 request in @ref{Strings}.
 

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


[groff] 05/28: doc/groff.texi.in: Fix Texinfo usage nit.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 7b5c88bb372b39eb96d443492ed343fede123bb0
Author: G. Branden Robinson 
AuthorDate: Fri Feb 28 16:31:14 2025 -0600

doc/groff.texi.in: Fix Texinfo usage nit.

We were producing the text "recall see".
---
 doc/groff.texi.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index c16adc39a..dfee47600 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -17452,7 +17452,7 @@ strips a leading leading neutral double quote from
 @var{file-identifier},
 which it reads in copy mode
 (recall
-@pxref{Copy Mode}),
+@ref{Copy Mode}),
 allowing it to contain embedded leading spaces.
 
 @code{lf}'s primary purpose is to aid the debugging of documents that

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


[groff] 03/28: NEWS: Clarify `pcomposite` item.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit dff0742151e40eb2886e6320676d395a5ddd580b
Author: G. Branden Robinson 
AuthorDate: Thu Feb 27 03:26:40 2025 -0600

NEWS: Clarify `pcomposite` item.
---
 NEWS | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 93f0f3314..8d1181bd5 100644
--- a/NEWS
+++ b/NEWS
@@ -192,7 +192,7 @@ troff
their details unknown to the formatter.)
 
 *  A new request, `pcomposite`, reports to the standard error stream the
-   list of defined composite characters.
+   list of defined composite character mappings.
 
 *  A new request, `phw`, reports to the standard error stream the
list of hyphenation exceptions associated with the current

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


[groff] 13/28: [doc,man]: Fix content and style nits.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 7e8ea73418fed81a13cd9294408f3a1b9a495950
Author: G. Branden Robinson 
AuthorDate: Sun Mar 2 08:54:31 2025 -0600

[doc,man]: Fix content and style nits.

Clarify and tighten discussions of reading the rest of the input line
into request arguments.  Update examples.  Parallelize wording.  Favor
active voice over passive.
---
 doc/groff.texi.in| 193 ---
 man/groff.7.man  | 101 ++-
 man/groff_diff.7.man |  66 ++
 3 files changed, 228 insertions(+), 132 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index b954bf528..138610c73 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -7430,8 +7430,6 @@ Start a comment; read everything up to the next newline 
in copy mode
 
 It can be tricky to keep the comments from interfering with the
 appearance of the output.
-@cindex @code{ds}, @code{ds1} requests, and comments
-@cindex @code{as}, @code{as1} requests, and comments
 If the escape sequence is to the right of some text or a request, that
 portion of the line is ignored, but GNU @command{troff} processes spaces
 preceding it normally.  This affects requests that read the remainder of
@@ -11468,9 +11466,13 @@ If
 is absent,
 the character is defined with empty contents.
 
-A leading neutral double quote in the second argument is stripped from
-it, allowing embedded leading spaces in @var{contents}, which is read to
-the end of the input line in copy mode.
+GNU
+@command{troff} @c GNU
+removes a leading neutral double quote from
+@var{contents}
+permitting initial embedded spaces,
+and reads it to the end of the input line in copy mode.
+@xref{Copy Mode}.
 
 Defining (or redefining) a character @var{c} creates a formatter object
 that is recognized like any other ordinary or special character on
@@ -12780,9 +12782,9 @@ Gray codes are explored in \*[cite Morgan 1998].
 @cindex @code{ds} request, and comments
 @cindex @code{ds1} request, and comments
 @strong{Caution:@:}
-The
-@code{ds}
-request treats the remainder of the input line as its second argument,
+After the formatter has read the space character that ends the first
+argument,
+it treats the remainder of the input line as the second argument,
 including trailing spaces,
 up to a newline or comment escape sequence.
 Ending string definitions
@@ -12793,37 +12795,48 @@ prevents unwanted space from creeping into them 
during source document
 maintenance.
 
 @Example
-.ds H2O H\v'+.3m'\s'-2'2\v'-.3m'\s0O \" water
+.ds Si silicon \" use chemical symbol
+We observed a \*[Si]-based life form.
+@result{} We observed a silicon -based life form.
 @endExample
 
 @noindent
-Instead, place the comment on another line or put the comment escape
-sequence immediately adjacent to the last character of the string.
+Instead,
+place the comment on another line
+or put the comment escape sequence immediately adjacent
+to the last character of the string.
 
 @Example
-.ds H2O H\v'+.3m'\s'-2'2\v'-.3m'\s0O\" water
+.ds Si silicon\" use chemical symbol
+We observed a \*[Si]-based life form.
+@result{} We observed a silicon-based life form.
 @endExample
 
-Ending string definitions (and appendments) with a comment, even an
-empty one, prevents unwanted space from creeping into them during source
-document maintenance.
+Because the first space after the string name separates the arguments,
+you can retain it while using a comment to document an empty string.
 
 @Example
 .ds author Alice Pleasance Liddell\"
 .ds friends \" empty; append to with .as
 @endExample
 
-@cindex trailing double quotes in strings
-@cindex double quotes, trailing, in strings
-@cindex @code{ds} request, and double quotes
-@cindex leading spaces with @code{ds}
-@cindex spaces with @code{ds}
-@cindex @code{ds} request, and leading spaces
-The formatter removes a leading neutral double quote @code{"} in
-@var{contents} to permit the embedding of leading spaces.  Any other
-@code{"} is interpreted literally, but it is wise to use the special
-character escape sequence @code{\[dq]} instead if the string might be
-interpolated as part of a macro argument; see @ref{Calling Macros}.
+@cindex @code{ds} and @code{ds1} requests, arguments starting with double 
quote @code{"}, and comments
+@cindex leading spaces in @code{ds} and @code{ds1} argument
+@cindex spaces in @code{ds} and @code{ds1} argument, leading
+@cindex @code{ds} and @code{ds1} request, and leading spaces
+The formatter removes a leading neutral double quote
+@samp{"}
+from
+@var{contents}
+to permit the embedding of leading spaces.
+It interprets any other
+@samp{"}
+literally,
+but the wise author uses the special character escape sequence
+@code{\[dq]}
+instead if the string
+might be interpolated as part of a macro argument;
+see @ref{Calling Macros}.
 
 @c Examples should be more accessible than Unix nerd stuff like this,
 @c but in general 

[groff] 28/28: [troff]: Unit-test `.devicem` and `\Y`.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 55d6077463806294bd7e38c633f438a90c02a9a5
Author: G. Branden Robinson 
AuthorDate: Wed Mar 5 05:36:15 2025 -0600

[troff]: Unit-test `.devicem` and `\Y`.

* src/roff/groff/tests/backslash-Y-works.sh:
* src/roff/groff/tests/devicem-request-works.sh: Do it.
* src/roff/groff/groff.am (groff_TESTS): Run tests.
---
 ChangeLog |  9 ++
 src/roff/groff/groff.am   |  2 ++
 src/roff/groff/tests/backslash-Y-works.sh | 40 +++
 src/roff/groff/tests/devicem-request-works.sh | 40 +++
 4 files changed, 91 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 2f0a2e8af..58cc300cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2025-03-05  G. Branden Robinson 
+
+   [troff]: Add unit tests for `devicem` request and `\Y` escape
+   sequence.
+
+   * src/roff/groff/tests/backslash-Y-works.sh:
+   * src/roff/groff/tests/devicem-request-works.sh: Do it.
+   * src/roff/groff/groff.am (groff_TESTS): Run tests.
+
 2025-03-02  G. Branden Robinson 
 
* src/roff/troff/mtsm.cpp (statem::display_state):
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 722d22a7f..15c752e3d 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -40,6 +40,7 @@ groff_TESTS = \
   src/roff/groff/tests/adjustment-works.sh \
   src/roff/groff/tests/arithmetic-works.sh \
   src/roff/groff/tests/backslash-X-works.sh \
+  src/roff/groff/tests/backslash-Y-works.sh \
   src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh \
   src/roff/groff/tests/backslash-s-works-with-single-digit-argument.sh \
   src/roff/groff/tests/break-zero-length-output-line-sanely.sh \
@@ -53,6 +54,7 @@ groff_TESTS = \
   src/roff/groff/tests/device-control-special-character-handling.sh \
   src/roff/groff/tests/device-request-passes-most-escape-sequences.sh \
   src/roff/groff/tests/device-request-works.sh \
+  src/roff/groff/tests/devicem-request-works.sh \
   src/roff/groff/tests/do-not-loop-infinitely-when-breaking-cjk.sh \
   src/roff/groff/tests/dot-cp-register-works.sh \
   src/roff/groff/tests/dot-nm-register-works.sh \
diff --git a/src/roff/groff/tests/backslash-Y-works.sh 
b/src/roff/groff/tests/backslash-Y-works.sh
new file mode 100755
index 0..697b8e4f3
--- /dev/null
+++ b/src/roff/groff/tests/backslash-Y-works.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Copyright (C) 2025 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+input='.
+.de mac
+This
+is
+a
+macro.
+..
+hello
+\Y[mac]
+.'
+
+output=$(printf "%s\n" "$input" | "$groff" -T ps -Z)
+echo "$output"
+
+oneline=$(echo "$output" | tr '\n' ' ')
+echo "$oneline" | grep -Fq ' x X This +is +a +macro. + '
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:
diff --git a/src/roff/groff/tests/devicem-request-works.sh 
b/src/roff/groff/tests/devicem-request-works.sh
new file mode 100755
index 0..f82465ca7
--- /dev/null
+++ b/src/roff/groff/tests/devicem-request-works.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Copyright (C) 2025 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see .
+#
+
+groff="${abs_top_builddir:-.}/test-groff"
+
+input='.
+.de mac
+This
+is
+a
+macro.
+..
+hello
+.devicem mac
+.'
+
+output=$(printf "%s\n" "$input" | "$groff" -T ps -Z)
+echo "$output"
+
+oneline=$(echo "$output" | tr '\n' ' ')
+echo "$oneline" | grep -Fq ' x X This +is +a +macro. + '
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:

___
groff-commit mailing lis

[groff] 18/28: [doc,man]: Revise intro to output format.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 21f234189f937e6fbfd079a849950b05b404ce22
Author: G. Branden Robinson 
AuthorDate: Fri Mar 7 15:28:09 2025 -0600

[doc,man]: Revise intro to output format.

...and sync between our Texinfo manual and groff_out(5) man page.
---
 doc/groff.texi.in   | 43 +--
 man/groff_out.5.man |  7 ---
 2 files changed, 33 insertions(+), 17 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 45208643a..ef330e1e1 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -18685,20 +18685,35 @@ were no longer as tight.
 @subsection Language Concepts
 
 @c BEGIN Keep parallel with introductory paragraph of groff_out(5).
-The fundamental operation of the GNU @code{troff} formatter is the
-translation of the @code{groff} input language into a device-independent
-form primarily concerned with what has to be written or drawn at
-specific positions on the output device.  This language is simple and
-imperative.  In the following discussion, the term @dfn{command} always
-refers to this device-independent output language, and never to the
-@code{groff} language intended for direct use by document authors.
-Device-independent output commands comprise several categories: glyph
-output; font, color, and text size selection; motion of the printing
-position; page advancement; drawing of geometric objects; and device
-control commands, a catch-all for operations not easily classified as
-any of the foregoing, such as directives to start and stop output,
-identify the intended output device, or place URL hyperlinks in
-supported output formats.
+The fundamental operation of the GNU
+@code{troff} @c GNU
+formatter is the translation of the
+@code{groff}
+input language
+into a series of instructions concerned primarily
+with placing glyphs or geometric objects
+at specific positions on a rectangular page.
+In the following discussion,
+the term
+@dfn{command}
+always refers to this device-independent output language,
+and never to the
+@code{groff}
+language intended for direct use by document authors.
+Device-independent output commands comprise several categories:@:
+glyph output;
+font,
+color,
+and text size selection;
+motion of the printing position;
+page advancement;
+drawing of geometric objects;
+and device control commands,
+a catch-all for operations not easily classified
+as any of the foregoing,
+such as directives to start and stop output,
+identify the intended output device,
+or place URL hyperlinks in supported output formats.
 @c END Keep parallel with introductory paragraph of groff_out(5).
 
 @menu
diff --git a/man/groff_out.5.man b/man/groff_out.5.man
index 1f5a7094d..3a342a025 100644
--- a/man/groff_out.5.man
+++ b/man/groff_out.5.man
@@ -122,9 +122,10 @@ The fundamental operation of the
 .MR @g@troff @MAN1EXT@
 formatter is the translation of the
 .MR groff @MAN7EXT@
-input language into a series of instructions concerned primarily with
-placing glyphs or geometric objects at specific positions on a
-rectangular page.
+input language
+into a series of instructions concerned primarily
+with placing glyphs or geometric objects
+at specific positions on a rectangular page.
 .
 In the following discussion,
 the term

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


[groff] 11/28: doc/groff.texi.in: Recast "I/O" node introduction.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit f59d1ce6c6e087df5eb1257f9c299562f008133f
Author: G. Branden Robinson 
AuthorDate: Fri Feb 28 17:46:10 2025 -0600

doc/groff.texi.in: Recast "I/O" node introduction.
---
 doc/groff.texi.in | 13 -
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 57d685e8e..b862eff2a 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -16456,11 +16456,14 @@ escape sequences.
 @cindex requests for input and output
 @cindex output and input requests
 
-Occasionally a document wants to access the file system or other
-services provided by the operating environment.  GNU @command{troff}
-permits the reading of files and, when unsafe mode is enabled at the
-command line, the execution of an external commands, with or without
-inclusion of their output in the document.
+Occasionally a document wants to access the file system
+or other services provided by the operating environment.
+GNU
+@command{troff} @c GNU
+permits the reading of files into the input stream.
+Enabling unsafe mode at the command line permits
+the writing of files and execution of external commands,
+with or without inclusion of their output in the document.
 
 @cindex trailing spaces in file name or system command arguments
 @cindex comments, after file name or system command arguments

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


[groff] 19/28: [doc,man]: Clarify and correct font measurements.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit a2750b3a8021e29c9276b95577b5f19b2983b545
Author: G. Branden Robinson 
AuthorDate: Fri Mar 7 15:41:42 2025 -0600

[doc,man]: Clarify and correct font measurements.

Sync language and line breaks between our Texinfo manual and
groff_font(5) man page.
---
 doc/groff.texi.in| 37 +++--
 man/groff_font.5.man | 17 +
 2 files changed, 40 insertions(+), 14 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index ef330e1e1..f79714f72 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -19970,13 +19970,24 @@ The form of the @var{metrics} field is as follows.
 @end display
 
 @noindent
-There must not be any spaces, tabs, or newlines between these
-@dfn{subfields} (which have been split here into two lines only for
-better legibility).  The subfields are in basic units expressed as
-decimal integers.  Unspecified subfields default to@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&T} device-independent @code{troff}.
+Spaces,
+tabs,
+and newlines are prohibited
+between these
+@dfn{subfields},
+which are expressed as decimal integers
+(and have been split here into two lines only for better legibility).
+The unit of measure is that established by the
+@code{unitwidth}
+directive and scaled to the type size.
+Unspecified subfields default
+to@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&T} device-independent
+@code{troff}. @c AT&T
 
 The @var{width} subfield gives the width of the glyph.  The @var{height}
 subfield gives the height of the glyph (upward is positive); if a glyph
@@ -20084,9 +20095,15 @@ of lines formatted as follows.
 @endExample
 
 @noindent
-The foregoing means that when glyph @var{g1} is typeset immediately
-before @var{g2}, the space between them should be increased
-by@tie{}@var{n}.  Most kerning pairs should have a negative value
+The foregoing means that when glyph
+@var{g1}
+is typeset immediately before @var{g2},
+the space between them should be increased
+by@tie{}@var{n}.
+The unit of measure is that established by the
+@code{unitwidth}
+directive and scaled to the type size.
+Most kerning pairs should have a negative value
 for@tie{}@var{n}.
 @c END Keep parallel with groff_font(5).
 
diff --git a/man/groff_font.5.man b/man/groff_font.5.man
index 37e27aa19..a0f581119 100644
--- a/man/groff_font.5.man
+++ b/man/groff_font.5.man
@@ -818,18 +818,23 @@ it may be broken here for readability).
 .
 .
 .P
-There must not be any spaces,
+Spaces,
 tabs,
-or newlines between these
+and newlines are prohibited
+between these
 .I subfields,
+which are expressed as decimal integers.
 .
-which are in basic units expressed as decimal integers.
+The unit of measure is that established by the
+.B \%unitwidth
+directive and scaled to the type size.
 .
 Unspecified subfields default
 .RB to\~ 0 .
 .
 Since there is no associated binary format,
-these values are not required to fit into the C language data type
+these values are not required to fit
+into the C language data type
 .B char
 as they are in AT&T device-independent
 .IR troff . \" AT&T
@@ -1056,6 +1061,10 @@ is typeset immediately before
 the space between them should be increased
 .RI by\~ n .
 .
+The unit of measure is that established by the
+.B \%unitwidth
+directive and scaled to the type size.
+.
 Most kerning pairs should have a negative value
 .RI for\~ n .
 .\" END Keep parallel with groff.texi node "Device and Font Description

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


[groff] 23/28: [troff]: Fix Savannah #66863 (`cf`, `trf` broken).

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 372155264ca71c29f5170608995a77bb0b1dad2a
Author: G. Branden Robinson 
AuthorDate: Sun Mar 2 23:59:43 2025 -0600

[troff]: Fix Savannah #66863 (`cf`, `trf` broken).

* src/roff/troff/input.cpp (copy_file, transparent_file): Drop
  extraneous `tok.next()` calls; they are already performed just prior
  to function return.  They caused the input stream pointer to advance
  too far.

Fixes .  Problem introduced by me
in commit f087165933, 7 December.
---
 ChangeLog| 10 ++
 src/roff/troff/input.cpp |  2 --
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 21822139f..dafc3875f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-03-02  G. Branden Robinson 
+
+   * src/roff/troff/input.cpp (copy_file, transparent_file): Drop
+   extraneous `tok.next()` calls; they are already performed just
+   prior to function return.  They caused the input stream pointer
+   to advance too far.
+
+   Fixes .  Problem
+   introduced by me in commit f087165933, 7 December.
+
 2025-03-02  G. Branden Robinson 
 
[groff]: Regression-test Savannah #66863.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 20d14a102..4faf6f287 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8689,7 +8689,6 @@ void copy_file()
 return;
   }
   char *filename = read_string();
-  tok.next();
   if (want_break)
 curenv->do_break();
   if (filename != 0 /* nullptr */)
@@ -8733,7 +8732,6 @@ void transparent_file()
 return;
   }
   char *filename = read_string();
-  tok.next();
   if (want_break)
 curenv->do_break();
   if (filename != 0 /* nullptr */) {

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


[groff] 21/28: [troff]: Clarify warning message on `\N'-5'`.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 15142133a43afa778d513538a528a1bee8fe52e2
Author: G. Branden Robinson 
AuthorDate: Fri Mar 7 15:44:41 2025 -0600

[troff]: Clarify warning message on `\N'-5'`.

* src/roff/troff/input.cpp (token::next): Clarify warning diagnostic; in
  `\N'-5'`, the index is invalid and the character is ignored.
---
 ChangeLog| 6 ++
 src/roff/troff/input.cpp | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fb28ff0fc..59771bb49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-03-07  G. Branden Robinson 
+
+   * src/roff/troff/input.cpp (token::next): Clarify warning
+   diagnostic; in `\N'-5'`, the index is invalid and the character
+   is ignored.
+
 2025-02-27  G. Branden Robinson 
 
* src/roff/troff/input.cpp (report_character_request):
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 549aaab2d..20d14a102 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2424,8 +2424,8 @@ void token::next()
if (!read_delimited_number(&val, 0))
  break;
if (val < 0) {
- warning(WARN_CHAR, "ignoring negative character index %1",
- val);
+ warning(WARN_CHAR, "character with negative index %1 is"
+ " invalid; ignoring", val);
  break;
}
type = TOKEN_INDEXED_CHAR;

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


[groff] 17/28: doc/groff.texi.in: Revise cautionary notes.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 3040f875a068d6f432b109f77f733a363ce8cc9e
Author: G. Branden Robinson 
AuthorDate: Fri Mar 7 10:43:14 2025 -0600

doc/groff.texi.in: Revise cautionary notes.
---
 doc/groff.texi.in | 33 +++--
 1 file changed, 27 insertions(+), 6 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 026cbb886..45208643a 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -15999,12 +15999,21 @@ permitting initial embedded spaces,
 and reads it to the end of the input line in copy mode.
 Recall @ref{Copy Mode}.
 
-@strong{Caution:@:} Use of these features can put syntactically invalid
-content into GNU @command{troff}'s output, which @code{groff}'s output
-drivers then fail to process.  @code{output} and use of @code{\!} from
-the top-level diversion are normally needed only for instructions to a
-postprocessor that does something with the output before sending it to
-the output device, filtering out @var{contents} again.
+@strong{Caution:@:}
+Use of these features can put syntactically invalid content
+into the formatter's output,
+which
+@code{groff}'s
+output drivers then fail to process.
+One application of
+@code{output}
+and of
+@code{\!}
+from the top-level diversion is to pass instructions
+to a postprocessor that interprets
+@var{anything}
+and filters it out
+before sending it to the output device.
 @c TODO: Once the dust settles from Savannah #63074, document how these
 @c can be used to construct device extension commands without special
 @c character processing.
@@ -16680,6 +16689,18 @@ For @code{cf}, within a diversion, ``completely 
unprocessed'' means that
 each line of a file to be inserted is handled as if it were preceded by
 @code{\!\\!}.
 
+@strong{Caution:@:}
+Use of these requests can put syntactically invalid content
+into the formatter's output,
+which
+@code{groff}'s
+output drivers then fail to process.
+One application is to pass instructions
+to a postprocessor that interprets
+@var{file}'s
+contents and filters it out
+before sending it to the output device.
+
 To define a macro@tie{}@code{x} containing the contents of
 file@tie{}@file{f}, use
 

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


[groff] 02/28: NEWS: Update `pnr` item.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 8c341b799f29ac90abf8ceb7ee87f0568184f670
Author: G. Branden Robinson 
AuthorDate: Thu Feb 27 03:20:32 2025 -0600

NEWS: Update `pnr` item.
---
 NEWS | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 471835a57..93f0f3314 100644
--- a/NEWS
+++ b/NEWS
@@ -202,8 +202,9 @@ troff
of output nodes (an internal data structure) corresponding to the
pending output line.  The list is empty if no such nodes exist.
 
-*  The `pnr` request now additionally reports the interpolation format
-   of each register (if it is not string-valued).
+*  The `pnr` request now additionally reports the autoincrementation
+   amount and interpolation format of each register (if it is not
+   string-valued).
 
 *  The `pnr` request now accepts arguments.  It treats each as
identifying a register and reports its properties to the standard

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


[groff] 12/28: doc/groff.texi.in: Fix request syntax synopses.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit a38fc4038a6786d87d925d8987bf28d49224e4ef
Author: G. Branden Robinson 
AuthorDate: Sun Mar 2 08:51:46 2025 -0600

doc/groff.texi.in: Fix request syntax synopses.
---
 doc/groff.texi.in | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index b862eff2a..b954bf528 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -12722,8 +12722,8 @@ sequence does not exist, it is defined as empty, 
nothing is
 interpolated, and a warning in category @samp{mac} is emitted.
 @xref{Warnings}, regarding the enablement and suppression of warnings.
 
-@DefreqList {ds, name [@code{"}][@Var{contents}]}
-@DefreqItemx {ds1, name [@code{"}][@Var{contents}]}
+@DefreqList {ds, name [[@code{"}]@Var{contents}]}
+@DefreqItemx {ds1, name [[@code{"}]@Var{contents}]}
 @DefescItemx {\\*, , n, }
 @DefescItem {\\*, (, nm, }
 @c XXX: Can't mark the parameters with @Var because @Var gets called
@@ -12884,8 +12884,8 @@ save} token is inserted at the beginning of 
@var{contents}, and a
 @endExample
 @endDefreq
 
-@DefreqList {as, name [@code{"}][@Var{contents}]}
-@DefreqListEndx {as1, name [@code{"}][@Var{contents}]}
+@DefreqList {as, name [[@code{"}]@Var{contents}]}
+@DefreqListEndx {as1, name [[@code{"}]@Var{contents}]}
 @cindex appending to a string (@code{as})
 @cindex string, appending (@code{as})
 The @code{as} request is similar to @code{ds} but appends @var{contents}
@@ -12912,7 +12912,7 @@ can be manipulated through renaming, removal, and 
aliasing (@code{rn},
 @cindex trailing spaces in string length measurement
 @cindex comments, with string length measurements
 @cindex @code{length} request, and comments
-@Defreq {length, reg contents}
+@Defreq {length, reg [[@code{"}]@Var{contents}]}
 @cindex length of a string (@code{length})
 @cindex string, length of (@code{length})
 @cindex @code{length} request, and copy mode

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


[groff] 26/28: [troff]: Add new constructor for `node` type.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 1a33ff617ccd5b6f6f43a16a215e9eb3847f6952
Author: G. Branden Robinson 
AuthorDate: Sun Mar 2 12:51:35 2025 -0600

[troff]: Add new constructor for `node` type.

...permitting `is_special` member variable to be initialized in
initializer lists.

* src/roff/troff/node.h (struct node, node::node): Do it.
* src/roff/troff/node.cpp (device_extension_node::device_extension_node)
  (suppress_node::suppress_node): Migrate constructors of derived
  classes to it where applicable.
---
 ChangeLog   | 12 
 src/roff/troff/node.cpp | 16 +++-
 src/roff/troff/node.h   | 12 
 3 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bd21ecc59..193150596 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2025-03-02  G. Branden Robinson 
+
+   [troff]: Add new constructor for `node` type, permitting
+   `is_special` member variable to be initialized in initializer
+   lists.
+
+   * src/roff/troff/node.h (struct node, node::node): Do it.
+   * src/roff/troff/node.cpp
+   (device_extension_node::device_extension_node)
+   (suppress_node::suppress_node): Migrate constructors of derived
+   classes to it where applicable.
+
 2025-03-02  G. Branden Robinson 
 
* src/roff/troff/node.h (node::node): Fix code style nit;
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 507b21bf2..576bfbd5a 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -3926,7 +3926,8 @@ int node::interpret(macro *)
 }
 
 device_extension_node::device_extension_node(const macro &m, bool b)
-: mac(m), lacks_command_prefix(b)
+: node(0 /* nullptr */, 0 /* nullptr */, 0, true), mac(m),
+  lacks_command_prefix(b)
 {
   font_size fs = curenv->get_font_size();
   int char_height = curenv->get_char_height();
@@ -3937,17 +3938,15 @@ device_extension_node::device_extension_node(const 
macro &m, bool b)
 tf = tf->get_plain();
   gcol = curenv->get_stroke_color();
   fcol = curenv->get_fill_color();
-  is_special = 1;
 }
 
 device_extension_node::device_extension_node(const macro &m, tfont *t,
   color *gc, color *fc,
   statem *s, int divlevel,
   bool b)
-: node(0, s, divlevel), mac(m), tf(t), gcol(gc), fcol(fc),
-  lacks_command_prefix(b)
+: node(0 /* nullptr */, s, divlevel, true), mac(m), tf(t), gcol(gc),
+  fcol(fc), lacks_command_prefix(b)
 {
-  is_special = 1;
 }
 
 bool device_extension_node::is_same_as(node *n)
@@ -4018,9 +4017,9 @@ suppress_node::suppress_node(int on_or_off, int 
issue_limits)
 }
 
 suppress_node::suppress_node(symbol f, char p, int id)
-: is_on(2), emit_limits(0), filename(f), position(p), image_id(id)
+: node(0 /* nullptr */, 0 /* nullptr */, 0, true), is_on(2),
+  emit_limits(0), filename(f), position(p), image_id(id)
 {
-  is_special = 1;
 }
 
 suppress_node::suppress_node(int issue_limits, int on_or_off,
@@ -4054,9 +4053,8 @@ node *suppress_node::copy()
 /* tag_node */
 
 tag_node::tag_node()
-: delayed(0)
+: node(0 /* nullptr */, 0 /* nullptr */, 0, true), delayed(false)
 {
-  is_special = 1;
 }
 
 tag_node::tag_node(string s, int delay)
diff --git a/src/roff/troff/node.h b/src/roff/troff/node.h
index a56714777..32418065e 100644
--- a/src/roff/troff/node.h
+++ b/src/roff/troff/node.h
@@ -59,6 +59,7 @@ struct node {
   node();
   node(node *);
   node(node *, statem *, int);
+  node(node *, statem *, int, bool);
   node *add_char(charinfo *, environment *, hunits *, int *,
 node ** /* glyph_comp_np */ = 0 /* nullptr */);
 
@@ -144,6 +145,17 @@ inline node::node(node *n, statem *s, int divlevel)
 state = 0 /* nullptr */;
 }
 
+inline node::node(node *n, statem *s, int divlevel, bool special)
+: next(n), last(0 /* nullptr */),
+  push_state(0 /* nullptr */),
+  div_nest_level(divlevel), is_special(special)
+{
+  if (s != 0 /* nullptr */)
+state = new statem(s);
+  else
+state = 0 /* nullptr */;
+}
+
 inline node::~node()
 {
   if (state != 0 /* nullptr */)

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


[groff] 24/28: [troff]: Fix code style nit.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit bcbe9e8a1d4e5838bc051edf9ef26a9b8355c3a5
Author: G. Branden Robinson 
AuthorDate: Sun Mar 2 10:36:52 2025 -0600

[troff]: Fix code style nit.

* src/roff/troff/node.cpp (hline_node::~hline_node)
  (vline_node::~vline_node): Fix code style nit, simplifying.

It is not necessary to make conditional the `delete[]` of a null
pointer.  "If the _delete-expression_ calls the implementation
deallocation function (3.7.3.2), and if the operand of the delete
expression is not the null pointer constant, the deallocation function
will deallocate the storage referenced by the pointer thus rendering the
pointer invalid" (ISO/IEC 14882-1998, ยง5.3.5, paragraph 4).  Or as
Stroustrup puts it, "Applying _delete_ to zero has no effect." (_The C++
Programming Language, Special Edition_, p. 128).
---
 ChangeLog   | 5 +
 src/roff/troff/node.cpp | 6 ++
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index dafc3875f..84f6ca9cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-03-02  G. Branden Robinson 
+
+   * src/roff/troff/node.cpp (hline_node::~hline_node)
+   (vline_node::~vline_node): Fix code style nit, simplifying.
+
 2025-03-02  G. Branden Robinson 
 
* src/roff/troff/input.cpp (copy_file, transparent_file): Drop
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 4ba404a39..507b21bf2 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -3040,8 +3040,7 @@ node *transparent_dummy_node::copy()
 
 hline_node::~hline_node()
 {
-  if (n)
-delete n;
+  delete n;
 }
 
 hline_node::hline_node(hunits i, node *c, node *nxt)
@@ -3078,8 +3077,7 @@ vline_node::vline_node(vunits i, node *c, statem *s,
 
 vline_node::~vline_node()
 {
-  if (n)
-delete n;
+  delete n;
 }
 
 node *vline_node::copy()

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


[groff] 01/28: Revert "[troff]: Improve `node` types' const-correctness."

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit f017b8e4b2b2b709ec45cb8edb1660ba0c89371e
Author: G. Branden Robinson 
AuthorDate: Sun Mar 2 09:56:17 2025 -0600

Revert "[troff]: Improve `node` types' const-correctness."

This inadvertently broke the fix for Savannah #66815--in record time!

The problem is that I marked as `const` some objects that had `FILE *`
member variables, and writing to the output stream does, in fact, mutate
its state.  (Recall our friend the stream pointer, exposed via fseek(3)
and ftell(3).)

This reverts commit d667af72e162c3ef269f7da269ab75f186ad9e4c.
---
 ChangeLog   | 33 --
 src/roff/troff/node.cpp | 54 -
 src/roff/troff/node.h   | 12 +--
 3 files changed, 32 insertions(+), 67 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 27f311eb6..fb28ff0fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,39 +40,6 @@
defined in "Makefile.am" to locate `pdfmom` executable; as with
`GROFFBIN`, that's what it's there for.
 
-2025-02-26  G. Branden Robinson 
-
-   * src/roff/troff/node.{h,cpp}: Improve `const`-correctness of
-   `ascii_output_file` class and related helper functions.
-
-   * src/roff/troff/node.h (struct node, class space_node)
-   (class hmotion_node, class space_char_hmotion_node)
-   (class zero_width_node, class left_italic_corrected_node): Mark
-   `ascii_print()` member functions' `ascii_output_file` pointer
-   argument as `const`.
-
-   * src/roff/troff/node.cpp (class ascii_output_file): Declare
-   `outc()` and `outs()` member functions as `const` (for our
-   C-only readers, this means they don't mutate the object upon
-   which they're called).
-   (ascii_output_file::outc, ascii_output_file::outs): Mark them
-   as `const` in corresponding definitions.
-   (class glyph_node, class ligature_node, class kern_pair_node)
-   (class dbreak_node, class glyph_node, class ligature_node)
-   (class italic_corrected_node, class break_char_node)
-   (class composite_node): Mark `ascii_print()` member functions'
-   `ascii_output_file` pointer argument as `const`.
-   (italic_corrected_node::ascii_print)
-   (break_char_node::ascii_print, dbreak_node::ascii_print)
-   (kern_pair_node::ascii_print, node::ascii_print)
-   (space_node::ascii_print, hmotion_node::ascii_print)
-   (space_char_hmotion_node::ascii_print)
-   (zero_width_node::ascii_print, composite_node::ascii_print)
-   (left_italic_corrected_node::ascii_print): Mark them as `const`
-   in corresponding definitions.
-   (ascii_print_node_list, ascii_print_reverse_node_list): Mark
-   `ascii_output_file` pointer argument as `const`.
-
 2025-02-26  G. Branden Robinson 
 
* src/roff/troff/node.cpp: Fix code style nit.
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 58e9148a8..4ba404a39 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -765,17 +765,17 @@ public:
   void really_transparent_char(unsigned char);
   void really_print_line(hunits x, vunits y, node *n, vunits, vunits, hunits 
width);
   void really_begin_page(int pageno, vunits page_length);
-  void outc(unsigned char c) const;
-  void outs(const char *s) const;
+  void outc(unsigned char c);
+  void outs(const char *s);
 };
 
-void ascii_output_file::outc(unsigned char c) const
+void ascii_output_file::outc(unsigned char c)
 {
   if (fp != 0 /* nullptr */)
 fputc(c, fp);
 }
 
-void ascii_output_file::outs(const char *s) const
+void ascii_output_file::outs(const char *s)
 {
   if (fp != 0 /* nullptr */) {
 fputc('<', fp);
@@ -1925,7 +1925,7 @@ public:
   void zero_width_tprint(troff_output_file *);
   hyphen_list *get_hyphen_list(hyphen_list *, int *);
   node *add_self(node *, hyphen_list **);
-  void ascii_print(const ascii_output_file *);
+  void ascii_print(ascii_output_file *);
   void asciify(macro *);
   int character_type();
   bool is_same_as(node *);
@@ -1953,7 +1953,7 @@ public:
   node *copy();
   node *add_self(node *, hyphen_list **);
   hyphen_list *get_hyphen_list(hyphen_list *, int *);
-  void ascii_print(const ascii_output_file *);
+  void ascii_print(ascii_output_file *);
   void asciify(macro *);
   bool is_same_as(node *);
   const char *type();
@@ -1981,7 +1981,7 @@ public:
   void tprint(troff_output_file *);
   hyphenation_type get_hyphenation_type();
   int ends_sentence();
-  void ascii_print(const ascii_output_file *);
+  void ascii_print(ascii_output_file *);
   void asciify(macro *);
   bool is_same_as(node *);
   const char *type();
@@ -2012,7 +2012,7 @@ public:
   int ends_sentence();
   void split(int, node **, node **);
   hyphenation_type get_hyphenation_type();
-  void ascii_print(const ascii_output_file *);
+  void ascii_print(ascii_output_file *);
   void asciify(macro *);
   bool

[groff] 27/28: [troff]: Tweak debugging output.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit acc2f84d6d89192d5bbc9b73452a56ca38072a8d
Author: G. Branden Robinson 
AuthorDate: Sun Mar 2 10:11:16 2025 -0600

[troff]: Tweak debugging output.

* src/roff/troff/mtsm.cpp (statem::display_state):
* src/roff/troff/node.cpp (glyph_node::dump_node, node::dump_node)
  (composite_node::dump_node, dbreak_node::dump_node): Tweak format of
  debugging output.
---
 ChangeLog   |  7 +++
 src/roff/troff/mtsm.cpp | 16 
 src/roff/troff/node.cpp | 34 ++
 3 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 193150596..2f0a2e8af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2025-03-02  G. Branden Robinson 
+
+   * src/roff/troff/mtsm.cpp (statem::display_state):
+   * src/roff/troff/node.cpp (glyph_node::dump_node)
+   (node::dump_node, composite_node::dump_node)
+   (dbreak_node::dump_node): Tweak format of debugging output.
+
 2025-03-02  G. Branden Robinson 
 
[troff]: Add new constructor for `node` type, permitting
diff --git a/src/roff/troff/mtsm.cpp b/src/roff/troff/mtsm.cpp
index ce8552dbf..7c8252168 100644
--- a/src/roff/troff/mtsm.cpp
+++ b/src/roff/troff/mtsm.cpp
@@ -469,26 +469,26 @@ void mtsm::flush(FILE *fp, statem *s, string tag_list)
 
 void statem::display_state()
 {
-  fprintf(stderr, " ");
+  fprintf(stderr, ">\"");
   fflush(stderr);
 }
 
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 576bfbd5a..241459219 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -2220,12 +2220,13 @@ void glyph_node::dump_node()
 fprintf(stderr, "\"%c\"", c);
   else
 fprintf(stderr, "\"\\%s\"", ci->nm.contents());
-  fputs(", ", stderr);
   if (push_state)
-fprintf(stderr, "push_state, ");
-  if (state)
+fprintf(stderr, ", push_state");
+  if (state) {
+fprintf(stderr, ", state: ");
 state->display_state();
-  fprintf(stderr, "diversion level: %d", div_nest_level);
+  }
+  fprintf(stderr, ", diversion level: %d", div_nest_level);
   fputs("}", stderr);
   fflush(stderr);
 }
@@ -2588,12 +2589,12 @@ units node::size()
 
 void node::dump_node()
 {
-  fprintf(stderr, "{type: %s, ", type());
+  fprintf(stderr, "{type: %s", type());
   if (push_state)
-fputs(", ", stderr);
+fputs(", ", stderr);
   if (state)
-fputs(", ", stderr);
-  fprintf(stderr, "diversion level: %d", div_nest_level);
+fputs(", ", stderr);
+  fprintf(stderr, ", diversion level: %d", div_nest_level);
   fputs("}", stderr);
   fflush(stderr);
 }
@@ -4988,12 +4989,13 @@ void composite_node::dump_node()
 fprintf(stderr, "\"%c\"", c);
   else
 fprintf(stderr, "\"\\%s\"", ci->nm.contents());
-  fputs(", ", stderr);
   if (push_state)
-fprintf(stderr, "push_state, ");
-  if (state)
+fprintf(stderr, ", push_state, ");
+  if (state) {
+fprintf(stderr, ", state: ");
 state->display_state();
-  fprintf(stderr, "diversion level: %d", div_nest_level);
+  }
+  fprintf(stderr, ", diversion level: %d", div_nest_level);
   fputs("}", stderr);
   fflush(stderr);
 }
@@ -5871,12 +5873,12 @@ bool dbreak_node::is_tag()
 
 void dbreak_node::dump_node()
 {
-  fprintf(stderr, "{type: %s, ", type());
+  fprintf(stderr, "{type: %s", type());
   if (push_state)
-fprintf(stderr, ", ");
+fprintf(stderr, ", ");
   if (state)
-fprintf(stderr, ", ");
-  fprintf(stderr, "diversion level: %d", div_nest_level);
+fprintf(stderr, ", ");
+  fprintf(stderr, ", diversion level: %d", div_nest_level);
   if (none != 0 /* nullptr */) {
 fputs(", none: ", stderr);
 none->dump_node();

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


[groff] 16/28: [doc,man]: Revise `mso` request description.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 19234ae6f9a406deef76e7ba0d1ecbd46cadf9a0
Author: G. Branden Robinson 
AuthorDate: Fri Mar 7 10:35:07 2025 -0600

[doc,man]: Revise `mso` request description.
---
 doc/groff.texi.in| 23 +++
 man/groff.7.man  | 16 
 man/groff_diff.7.man | 14 +-
 3 files changed, 40 insertions(+), 13 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 549615f86..026cbb886 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -16605,10 +16605,25 @@ The cautionary note regarding a final newline in the 
stream read by the
 
 @DefreqList {mso, [@code{"}]@Var{file}}
 @DefreqListEndx {msoquiet, [@code{"}]@Var{file}}
-Identical to the @code{so} and @code{soquiet} requests, respectively,
-except that GNU @command{troff} searches for the specified @var{file} in
-the same directories as macro files for the @option{-m} command-line
-option.
+As the
+@code{so}
+and
+@code{soquiet}
+requests,
+respectively,
+except that GNU
+@command{troff} @c GNU
+searches for the specified
+@var{file}
+in the same directories as macro files;
+see
+@env{GROFF_TMAC_PATH}
+in
+@ref{Environment}
+and
+@option{-m}
+in
+@ref{Groff Options}.
 @endDefreq
 
 @DefreqList {trf, [@code{"}]@Var{file}}
diff --git a/man/groff.7.man b/man/groff.7.man
index 3c5ccf34d..c3bffc5d4 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -3880,11 +3880,19 @@ Mark vertical drawing position in register
 .REQ .mso file
 As
 .request .so ,
-except that
+except that GNU
+.I troff \" GNU
+searches for the specified
 .I file
-is sought in the
-.I tmac
-directories.
+in the same directories as macro files;
+see
+.I GROFF_TMAC_PATH
+in section \[lq]Environment\[rq] of
+.MR groff @MAN1EXT@
+and
+.B \-m
+in section \[lq]Options\[rq]
+of the same page.
 .
 .TPx
 .REQ .msoquiet file
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index 11444fede..7bb79f3a3 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -3226,15 +3226,19 @@ word spaces).
 .I file
 As
 .RB \[lq] so \[rq],
-except that
+except that GNU
+.I troff \" GNU
+searches for the specified
 .I file
-is sought in the same directories as arguments to the
+in the same directories as macro files;
+see
+.I GROFF_TMAC_PATH
+in section \[lq]Environment\[rq] of
 .MR groff @MAN1EXT@
 and
-.MR @g@troff @MAN1EXT@
 .B \-m
-command-line option are
-(the \[lq]tmac path\[rq]).
+in section \[lq]Options\[rq]
+of the same page.
 .
 If
 .I file

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


[groff] 09/28: doc/groff.texi.in: Fix missing word.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 21c4ecd90111c31e46b6f0647a18fe139820627d
Author: G. Branden Robinson 
AuthorDate: Fri Feb 28 17:41:37 2025 -0600

doc/groff.texi.in: Fix missing word.
---
 doc/groff.texi.in | 18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 17903036a..fd55c88c4 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -16504,12 +16504,18 @@ of a book to be kept in a separate file.  However, 
files interpolated
 with @code{so} are not preprocessed; to overcome this limitation, see
 the @cite{gsoelim@r{(1)}} man page.
 
-@strong{Caution:@:} Since the formatter replaces the entire control line
-with the contents of a file, @var{file} must end with a newline, or the
-formatter will continue reading the next input line of the @code{roff}
-file as if were part of the last line of the sourced file.  Consider a
-file @file{xxx} containing only the word @samp{foo} without a trailing
-newline.
+@strong{Caution:@:}
+Since the formatter replaces the entire control line
+with the contents of a file,
+@var{file}
+must end with a newline,
+or the formatter will continue reading the next input line
+of the
+@code{roff}
+file as if it were part of the last line of the sourced file.
+Consider a file
+@file{xxx}
+containing only the word @samp{foo} without a trailing newline.
 
 @Example
 $ printf 'foo' > xxx

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


[groff] 15/28: [doc,man]: Revise `so` request description.

2025-03-08 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 07284323f75c4993325b0a35799c22ead863ae73
Author: G. Branden Robinson 
AuthorDate: Fri Mar 7 06:43:40 2025 -0600

[doc,man]: Revise `so` request description.

Also sync wording between documents.
---
 doc/groff.texi.in | 41 ++---
 man/groff.7.man   |  3 ++-
 2 files changed, 32 insertions(+), 12 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 2099412b6..549615f86 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -16529,17 +16529,36 @@ request in @ref{Strings}.
 @DefreqListEndx {soquiet, [@code{"}]@Var{file}}
 @cindex including a file (@code{so})
 @cindex file, inclusion (@code{so})
-Replace the @code{so} request's control line with the text of the
-file named by the argument, ``sourcing'' it.  @var{file} is sought in
-the directories specified by @option{-I} command-line option.  If
-@var{file} does not exist, a warning in category @samp{file} is produced
-and the request has no further effect.  @xref{Warnings}, for
-information about the enablement and suppression of warnings.
-
-@code{so} can be useful for large documents; e.g., allowing each chapter
-of a book to be kept in a separate file.  However, files interpolated
-with @code{so} are not preprocessed; to overcome this limitation, see
-the @cite{gsoelim@r{(1)}} man page.
+Replace the request's control line
+with the contents of
+@var{file},
+``sourcing'' it.
+GNU
+@command{troff} @c GNU
+searches for
+@var{file}
+in the directories specified by the @option{-I} command-line option.
+If
+@var{file}
+does not exist,
+GNU
+@command{troff} @c GNU
+emits a warning in category
+@samp{file}
+and the request has no further effect.
+@xref{Warnings}.
+
+@code{so} can be useful for large documents,
+allowing each chapter of a book,
+for example,
+to be maintained in a separate file.
+However,
+files interpolated with
+@code{so}
+are not preprocessed;
+to overcome this limitation,
+see
+@cite{gsoelim@r{(1)}}.
 
 @strong{Caution:@:}
 Since the formatter replaces the entire control line
diff --git a/man/groff.7.man b/man/groff.7.man
index 542d22dc4..3c5ccf34d 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -4487,7 +4487,8 @@ read in copy mode and continue to the end of the input 
line.
 .
 .TPx
 .REQ .so file
-Replace the request's control line with the text of
+Replace the request's control line
+with the contents of
 .IR file ,
 \[lq]sourcing\[rq] it.
 .

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