[groff] 20/20: [troff]: Trivially refactor.

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

commit 889fb755b53e4e41c09a68163e4b2b4f1bac0d4b
Author: G. Branden Robinson 
AuthorDate: Thu Feb 27 02:43:14 2025 -0600

[troff]: Trivially refactor.

* src/roff/troff/input.cpp (report_character_request, remove_character)
  (get_char, get_charinfo, get_charinfo_by_index): Rename `lookup_only`
  function arguments to `suppress_creation`, a name already used by
  register classes for the same purpose.
---
 ChangeLog |  8 
 src/roff/troff/charinfo.h |  2 +-
 src/roff/troff/input.cpp  | 24 +---
 src/roff/troff/token.h|  2 +-
 4 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index a3212a1ee..27f311eb6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-02-27  G. Branden Robinson 
+
+   * src/roff/troff/input.cpp (report_character_request):
+   (remove_character, get_char, get_charinfo)
+   (get_charinfo_by_index): Trivially refactor.  Rename
+   `lookup_only` function arguments to `suppress_creation`, a name
+   already used by register classes for the same purpose.
+
 2025-02-27  G. Branden Robinson 
 
[troff]: Make `pnr` request report autoincrement amounts.
diff --git a/src/roff/troff/charinfo.h b/src/roff/troff/charinfo.h
index 93c1ca8a1..9f507b840 100644
--- a/src/roff/troff/charinfo.h
+++ b/src/roff/troff/charinfo.h
@@ -114,7 +114,7 @@ public:
   void dump();
 };
 
-charinfo *get_charinfo(symbol, bool /* lookup_only */ = false);
+charinfo *get_charinfo(symbol, bool /* suppress_creation */ = false);
 extern charinfo *charset_table[];
 
 inline bool charinfo::overlaps_horizontally()
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 6d8496c84..549aaab2d 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -4696,7 +4696,8 @@ static void report_character_request()
   }
   charinfo *ci;
   do {
-ci = tok.get_char(false /* required */, true /* lookup only */);
+ci = tok.get_char(false /* required */,
+ true /* suppress creation */);
 if (!tok.is_character()) {
   error("character report request expects characters as arguments;"
" got %1", tok.description());
@@ -4736,7 +4737,7 @@ static void remove_character()
 if (!tok.is_space() && !tok.is_tab()) {
   if (tok.is_character()) {
charinfo *ci = tok.get_char(true /* required */,
-   true /* lookup only */);
+   true /* suppress creation */);
if (0 /* nullptr */ == ci) {
  if (!tok.is_indexed_character())
warning(WARN_CHAR, "%1 is not defined", tok.description());
@@ -8188,16 +8189,17 @@ void define_class()
 }
 
 // forward declaration
-static charinfo *get_charinfo_by_index(int n, bool lookup_only = false);
+static charinfo *get_charinfo_by_index(int n,
+  bool suppress_creation = false);
 
-charinfo *token::get_char(bool required, bool lookup_only)
+charinfo *token::get_char(bool required, bool suppress_creation)
 {
   if (type == TOKEN_CHAR)
 return charset_table[c];
   if (type == TOKEN_SPECIAL_CHAR)
-return get_charinfo(nm, lookup_only);
+return get_charinfo(nm, suppress_creation);
   if (type == TOKEN_INDEXED_CHAR)
-return get_charinfo_by_index(val, lookup_only);
+return get_charinfo_by_index(val, suppress_creation);
   if (type == TOKEN_ESCAPE) {
 if (escape_char != 0)
   return charset_table[escape_char];
@@ -10029,12 +10031,12 @@ void debug_with_file_and_line(const char *filename,
 
 dictionary charinfo_dictionary(501);
 
-charinfo *get_charinfo(symbol nm, bool lookup_only)
+charinfo *get_charinfo(symbol nm, bool suppress_creation)
 {
   void *p = charinfo_dictionary.lookup(nm);
   if (p != 0 /* nullptr */)
 return static_cast(p);
-  if (lookup_only)
+  if (suppress_creation)
 return static_cast(0 /* nullptr */);
   else {
 charinfo *cp = new charinfo(nm);
@@ -10258,13 +10260,13 @@ symbol UNNAMED_SYMBOL("---");
 
 dictionary indexed_charinfo_dictionary(11);
 
-static charinfo *get_charinfo_by_index(int n, bool lookup_only)
+static charinfo *get_charinfo_by_index(int n, bool suppress_creation)
 {
   static charinfo *index_table[256];
 
   if (n >= 0 && n < 256) {
 charinfo *ci = index_table[n];
-if ((0 /*nullptr */ == ci) && !lookup_only) {
+if ((0 /*nullptr */ == ci) && !suppress_creation) {
   ci = new charinfo(UNNAMED_SYMBOL);
   ci->set_number(n);
   index_table[n] = ci;
@@ -10274,7 +10276,7 @@ static charinfo *get_charinfo_by_index(int n, bool 
lookup_only)
   else {
 symbol ns(i_to_a(n));
 charinfo *ci = (charinfo *)indexed_charinfo_dictionary.lookup(ns);
-if ((0 /*nullptr */ == ci) && !lookup_only) {
+if ((0 /*nullptr */ == ci) && !suppress_creation) {
   ci = new charinfo(UNNAMED_SYMBOL);
   ci->set_number(n);
   (void) in

[groff] 06/20: [mm]: Regression-test Savannah #66439.

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

commit b0c3b87d3b4d569845c2a33449e2c8c9c37cbb21
Author: G. Branden Robinson 
AuthorDate: Mon Feb 24 23:56:36 2025 -0600

[mm]: Regression-test Savannah #66439.

The bottom block feature BS/BE should work with LT letters.

* contrib/mm/tests/letter-with-bottom-block-works.sh: Do it.
* contrib/mm/tests/artifacts/letter_with_bottom_block: Add expected
  rendering.
* contrib/mm/mm.am (mm_TESTS): Run test.

Test fails at this commit.
---
 contrib/mm/ChangeLog   | 10 +++
 contrib/mm/mm.am   |  2 +
 .../mm/tests/artifacts/letter_with_bottom_block| 66 +++
 contrib/mm/tests/letter-with-bottom-block-works.sh | 93 ++
 4 files changed, 171 insertions(+)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 62f4ab835..482bce032 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,13 @@
+2025-02-24  G. Branden Robinson 
+
+   Regression-test Savannah #66439 (the bottom block feature BS/BE
+   should work with LT letters).
+
+   * tests/letter-with-bottom-block-works.sh: Do it.
+   * tests/artifacts/letter_with_bottom_block: Add expected
+   rendering.
+   * mm.am (mm_TESTS): Run test.
+
 2025-02-08  Colin Watson 
 
* m.tmac (pg@print-footer): Fix missing brace escape sequence.
diff --git a/contrib/mm/mm.am b/contrib/mm/mm.am
index 77fe84258..d17f5be59 100644
--- a/contrib/mm/mm.am
+++ b/contrib/mm/mm.am
@@ -79,6 +79,7 @@ mm_TESTS = \
   contrib/mm/tests/date-localization-works.sh \
   contrib/mm/tests/flush-long-displays-at-end-of-input.sh \
   contrib/mm/tests/indexing-works.sh \
+  contrib/mm/tests/letter-with-bottom-block-works.sh \
   contrib/mm/tests/letters-format-correctly.sh \
   contrib/mm/tests/lists-indent-correctly.sh \
   contrib/mm/tests/memoranda-format-correctly.sh \
@@ -96,6 +97,7 @@ EXTRA_DIST += \
   contrib/mm/tests/artifacts/letter.FB \
   contrib/mm/tests/artifacts/letter.SB \
   contrib/mm/tests/artifacts/letter.SP \
+  contrib/mm/tests/artifacts/letter_with_bottom_block \
   contrib/mm/tests/artifacts/memorandum.0 \
   contrib/mm/tests/artifacts/memorandum.1 \
   contrib/mm/tests/artifacts/memorandum.2 \
diff --git a/contrib/mm/tests/artifacts/letter_with_bottom_block 
b/contrib/mm/tests/artifacts/letter_with_bottom_block
new file mode 100644
index 0..b6b1dc544
--- /dev/null
+++ b/contrib/mm/tests/artifacts/letter_with_bottom_block
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+ 123 Main Street
+ Anytown, ST  10101
+
+ 24 February 2025
+
+
+
+
+   Rufus T. Arbogast
+   Autovectorization Guru
+   456 Elsewhere Avenue
+   Nirvana, PA  20406
+
+   We  have a research leak!  The next person I catch embedding
+   engineering samples of our  Lightspeed  Overdrive  2048-core
+   processors  in  cork  coasters distributed at trade shows is
+   going to regret it.
+
+ Yours very truly,
+
+
+
+ Epi G. Netic
+ Head of Research
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   ContactTax ID  Bank Account/IBAN
+   me@org  98765   DE12123121231212
+
+
+
+
+
diff --git a/contrib/mm/tests/letter-with-bottom-block-works.sh 
b/contrib/mm/tests/letter-with-bottom-block-works.sh
new file mode 100755
index 0..acc4d654d
--- /dev/null
+++ b/contrib/mm/tests/letter-with-bottom-block-works.sh
@@ -0,0 +1,93 @@
+#!/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 #66439.
+#
+# The BS/BE bottom block feature should work with LT letters.
+
+fail=
+
+wail () {
+echo FAILED >&2
+fail=YES
+}
+
+# Locate directory containing our test artifacts.
+artifacts_dir=
+
+for buildroot in . .. ../..
+do
+a=$buildroot/contrib/mm/tests/artifacts
+if [ -d "$a" ]
+then
+artifacts_dir=$a
+break
+fi
+done
+
+# If we can't find it, we can't test.
+test -z "$artifacts_dir" && exit 77 # sk

[groff] 01/20: [eqn,pic,preconv,refer,soelim,tbl]: Fix lf reqs.

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

commit 25ef9f6bdad8f410749388e20caaa5c2d5e9ddee
Author: G. Branden Robinson 
AuthorDate: Wed Feb 26 04:55:59 2025 -0600

[eqn,pic,preconv,refer,soelim,tbl]: Fix lf reqs.

Use `lf` requests _even more_ carefully.

* src/preproc/eqn/main.cpp (do_file):
* src/preproc/pic/troff.cpp (troff_output::set_location):
* src/preproc/preconv/preconv.cpp (do_file):
* src/preproc/refer/refer.cpp (do_file, output_pending_line):
* src/preproc/soelim/soelim.cpp (set_location):
* src/preproc/tbl/main.cpp (main):
* src/preproc/tbl/table.cpp (set_troff_location): Output file name with
  leading double quote in generated `lf` request only if it doesn't
  already start with one.

Avoids misleading output like:

troff: backtrace: file '"man/groff_char.7':1062
troff:"man/groff_char.7:1062: warning: special character '.j' not defined
---
 ChangeLog   | 15 +++
 src/preproc/eqn/main.cpp|  3 ++-
 src/preproc/pic/troff.cpp   |  3 ++-
 src/preproc/preconv/preconv.cpp |  3 ++-
 src/preproc/refer/refer.cpp |  7 ---
 src/preproc/soelim/soelim.cpp   |  3 ++-
 src/preproc/tbl/main.cpp| 10 +++---
 src/preproc/tbl/table.cpp   |  4 +++-
 8 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 05d4eaeae..6e1dc1271 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2025-02-26  G. Branden Robinson 
+
+   [eqn,pic,preconv,refer,soelim,tbl]: Use `lf` requests _even
+   more_ carefully.
+
+   * src/preproc/eqn/main.cpp (do_file):
+   * src/preproc/pic/troff.cpp (troff_output::set_location):
+   * src/preproc/preconv/preconv.cpp (do_file):
+   * src/preproc/refer/refer.cpp (do_file, output_pending_line):
+   * src/preproc/soelim/soelim.cpp (set_location):
+   * src/preproc/tbl/main.cpp (main):
+   * src/preproc/tbl/table.cpp (set_troff_location): Output file
+   name with leading double quote in generated `lf` request only if
+   it doesn't already start with one.
+
 2025-02-24  G. Branden Robinson 
 
Implement approximate (`troff -a`) output of zero-width nodes
diff --git a/src/preproc/eqn/main.cpp b/src/preproc/eqn/main.cpp
index e537d206a..35f7a0550 100644
--- a/src/preproc/eqn/main.cpp
+++ b/src/preproc/eqn/main.cpp
@@ -106,7 +106,8 @@ void do_file(FILE *fp, const char *filename)
   current_lineno = 1;
   current_filename = fn.contents();
   if (output_format == troff)
-(void) printf(".lf %d \"%s\n", current_lineno, current_filename);
+(void) printf(".lf %d %s%s\n", current_lineno,
+   ('"' == current_filename[0]) ? "" : "\"", current_filename);
   while (read_line(fp, &linebuf)) {
 if (linebuf.length() >= 4
&& linebuf[0] == '.' && linebuf[1] == 'l' && linebuf[2] == 'f'
diff --git a/src/preproc/pic/troff.cpp b/src/preproc/pic/troff.cpp
index 2a416780e..0687b0ff0 100644
--- a/src/preproc/pic/troff.cpp
+++ b/src/preproc/pic/troff.cpp
@@ -600,7 +600,8 @@ void troff_output::set_location(const char *s, int n)
 }
   }
   if (update_file_name)
-printf(".lf %d \"%s\n", n, s);
+printf(".lf %d %s%s\n", current_lineno,
+   ('"' == current_filename[0]) ? "" : "\"", current_filename);
   else
 printf(".lf %d\n", n);
 }
diff --git a/src/preproc/preconv/preconv.cpp b/src/preproc/preconv/preconv.cpp
index cd3d34a2a..b8517389f 100644
--- a/src/preproc/preconv/preconv.cpp
+++ b/src/preproc/preconv/preconv.cpp
@@ -1197,7 +1197,8 @@ do_file(const char *filename)
 string fn(filename);
 fn += '\0';
 normalize_for_lf(fn);
-(void) printf(".lf 1 \"%s\n", fn.contents());
+(void) printf(".lf 1 %s%s\n", ('"' == filename[0]) ? "" : "\"",
+ fn.contents());
   }
   int success = 1;
   // Call converter (converters write to stdout).
diff --git a/src/preproc/refer/refer.cpp b/src/preproc/refer/refer.cpp
index a51518360..66eeda84f 100644
--- a/src/preproc/refer/refer.cpp
+++ b/src/preproc/refer/refer.cpp
@@ -475,8 +475,8 @@ static void do_file(const char *filename)
   normalize_for_lf(fn);
   current_lineno = 1;
   current_filename = fn.contents();
-  (void) fprintf(outfp, ".lf %d \"%s\n", current_lineno,
-current_filename);
+  (void) fprintf(outfp, ".lf %d %s%s\n", current_lineno,
+   ('"' == current_filename[0]) ? "" : "\"", current_filename);
   string line;
   for (;;) {
 line.clear();
@@ -691,7 +691,8 @@ static void output_pending_line()
   if (!accumulate)
 immediately_output_references();
   if (need_syncing) {
-fprintf(outfp, ".lf %d \"%s\n", current_lineno, current_filename);
+fprintf(outfp, ".lf %d %s%s\n", current_lineno,
+ ('"' == current_filename[0]) ? "" : "\"", current_filename);
 need_syncing = 0;
   }
 }
diff --git a/src/preproc/soelim/soelim.cpp b/src/preproc/soelim/soelim.cpp
index 4364d335d..1f66cc395 100644
--- a/src/preproc/soelim/soelim.cp

[groff] 15/20: doc/groff.texi.in: Clarify `device`/`\X` behavior.

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

commit 01d2bc9439aedf0ac0d39f610d9a37957615624d
Author: G. Branden Robinson 
AuthorDate: Wed Feb 26 18:35:35 2025 -0600

doc/groff.texi.in: Clarify `device`/`\X` behavior.
---
 doc/groff.texi.in | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index de96e12ba..f42ba2994 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -16993,12 +16993,21 @@ in an author's name in document metadata or as a 
usefully named bookmark
 or hyperlink anchor, GNU @command{troff} maps other special characters
 to Unicode special character notation.  @xref{Using Symbols}.
 
-Special characters without a Unicode representation, and escape
-sequences that do not interpolate a sequence of ordinary and/or special
-characters, produce warnings in category @samp{char}.
+GNU
+@command{troff} @c GNU
+does not write special characters
+without a Unicode representation
+and escape sequences that do not interpolate
+a sequence of ordinary and/or special characters
+as arguments to device extension commands;
+when encountered,
+these produce warnings in category @samp{char}.
+@xref{Warnings}.
 @endDefesc
 
-GNU @command{troff} also permits the interpolation of macro contents
+GNU
+@command{troff}
+also permits the interpolation of macro contents
 as a device extension command.
 
 @DefreqList {devicem, name}

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


[groff] 02/20: doc/groff.texi.in: Fix copy-and-paste error.

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

commit b0c992f9aa029faad03dc68720858fac660fbffc
Author: G. Branden Robinson 
AuthorDate: Thu Feb 27 01:00:54 2025 -0600

doc/groff.texi.in: Fix copy-and-paste error.
---
 doc/groff.texi.in | 1 -
 1 file changed, 1 deletion(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 5749e3014..1a1b3fa84 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -17420,7 +17420,6 @@ is a sequence of ordinary characters and/or spaces.
 @c ...limiting the file names you can express; see Savannah #65108.
 GNU
 @command{troff}
-.I troff \" GNU
 strips a leading leading neutral double quote from
 @var{file-identifier},
 allowing it to contain embedded leading spaces.

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


[groff] 07/20: [mm]: Fix Savannah #66439 (BS/BE with LT).

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

commit ded58835f82c659ba452d1bde638eaf5e7027247
Author: G. Branden Robinson 
AuthorDate: Tue Feb 25 00:10:46 2025 -0600

[mm]: Fix Savannah #66439 (BS/BE with LT).

* contrib/mm/m.tmac (BS, BE): Use box diversion instead of a regular one
  to populate the bottom block.  This fixes interaction of the bottom
  block feature--when `BS` and `BE` are called prior to formatting any
  other text--with `LT` letters specifically but might also resolve
  other similar problems with BS/BE use.  Using a regular diversion
  moved the vertical drawing position from its "pre-page" location of
  "-1" (because the `BS` macro called `br` to ensure that the bottom
  block didn't absorb any partially collected line).  That in turn
  sprung the default header trap that writes a centered page number.
  The `LT` macro is written such that if the drawing position is not at
  the top of the page, it fails to format the pre-body letter material
  (writer's address, date, inside address, salutation, etc.).  (Because
  the first page has already started and the drawing position was
  non-negative, the `LT` macro was also too late to turn off the default
  header on the first page.)

  (BE): Annotate explicit `br` retained here; we don't want to
  silently discard a partially collected line when closing the box
  diversion.  The document author should delete from a bottom
  block any undesired content on a partially collected line.

Fixes .  Thanks to Oliver Corff
for prompting detection of this bug.
---
 contrib/mm/ChangeLog | 26 ++
 contrib/mm/m.tmac|  7 +++
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/contrib/mm/ChangeLog b/contrib/mm/ChangeLog
index 482bce032..cd7c7e205 100644
--- a/contrib/mm/ChangeLog
+++ b/contrib/mm/ChangeLog
@@ -1,3 +1,29 @@
+2025-02-24  G. Branden Robinson 
+
+   * m.tmac (BS, BE): Use box diversion instead of a regular one to
+   populate the bottom block.  This fixes interaction of the bottom
+   block feature--when `BS` and `BE` are called prior to formatting
+   any other text--with `LT` letters specifically but might also
+   resolve other similar problems with BS/BE use.  Using a regular
+   diversion moved the vertical drawing position from its
+   "pre-page" location of "-1" (because the `BS` macro called `br`
+   to ensure that the bottom block didn't absorb any partially
+   collected line).  That in turn sprung the default header trap
+   that writes a centered page number.  The `LT` macro is written
+   such that if the drawing position is not at the top of the page,
+   it fails to format the pre-body letter material (writer's
+   address, date, inside address, salutation, etc.).  (Because the
+   first page has already started and the drawing position was
+   non-negative, the `LT` macro was also too late to turn off the
+   default header on the first page.)
+   (BE): Annotate explicit `br` retained here; we don't want to
+   silently discard a partially collected line when closing the box
+   diversion.  The document author should delete from a bottom
+   block any undesired content on a partially collected line.
+
+   Fixes .  Thanks to Oliver
+   Corff for prompting detection of this bug.
+
 2025-02-24  G. Branden Robinson 
 
Regression-test Savannah #66439 (the bottom block feature BS/BE
diff --git a/contrib/mm/m.tmac b/contrib/mm/m.tmac
index b74bc7ce3..6b540271f 100644
--- a/contrib/mm/m.tmac
+++ b/contrib/mm/m.tmac
@@ -1707,13 +1707,12 @@ numeric; got '\\$1'
 .de BS
 .misc@ev-keep pg*block-ev
 .@reset
-.br
-.debug@di pg*block-div
+.debug@box pg*block-div
 ..
 .\"-
 .de BE
-.br
-.debug@di
+.br \" in case the user forgot
+.debug@box
 .nr pg*block-size \\n[dn]u
 .ev
 .pg@move-trap

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


[groff] 19/20: [troff]: `pnr` request reports autoincr amounts.

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

commit 5dcf31ee541676d74f59684bbe61a05e4f287690
Author: G. Branden Robinson 
AuthorDate: Thu Feb 27 02:15:16 2025 -0600

[troff]: `pnr` request reports autoincr amounts.

* src/roff/troff/reg.h (class reg): Declare `const` virtual functions
  `get_increment()` and `can_autoincrement()` returning `int` and
  `bool`, respectively.  These exist at the root of the register class
  hierarchy because the `dictionary` class that tracks defined registers
  effectively erases details of their types.  (groff doesn't use RTTI
  anywhere, and doing so seemed unnecessary, so I didn't explore it.)

  (class general_reg): Declare non-virtual versions of `get_increment()`
  and `can_autoincrement()`.

* src/roff/troff/reg.cpp: Include "lib.h" since we now need its
  `INT_DIGITS` symbol.

  (reg::get_increment): Define as returning constant zero.

  (reg::can_autoincrement): Define as returning constant false.

  (general_reg::get_increment): Define.

  (general_reg::can_autoincrement): Define as returning constant true.

  (dump_register): If the register can autoincrement, report the
  autoincrement amount, with an explicit sign for clarity and easy
  distinction from the register's value and number format.

* doc/groff.texi.in (Debugging) :
* man/groff.7.man (Request short reference) :
* man/groff_diff.7.man (New requests) : Document it.

Illustration:

$ printf '.nr a 1\n.nr b 2 2\n.nr c 3 99\n.nr d 4 -2\n.nr e 2147483647 
2147483647\n.af b i\n.pnr .a a b c d e\n' | ./build/test-groff
.a  0
a   1   +0  0
b   2   +2  i
c   3   +99 0
d   4   -2  0
e   2147483647  +2147483647 0
---
 ChangeLog  | 28 
 doc/groff.texi.in  | 11 ---
 man/groff.7.man|  6 --
 man/groff_diff.7.man   |  2 +-
 src/roff/troff/reg.cpp | 29 -
 src/roff/troff/reg.h   |  6 +-
 6 files changed, 74 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index adbd4ee0f..a3212a1ee 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,31 @@
+2025-02-27  G. Branden Robinson 
+
+   [troff]: Make `pnr` request report autoincrement amounts.
+
+   * src/roff/troff/reg.h (class reg): Declare `const` virtual
+   functions `get_increment()` and `can_autoincrement()` returning
+   `int` and `bool`, respectively.  These exist at the root of the
+   register class hierarchy because the `dictionary` class that
+   tracks defined registers effectively erases details of their
+   types.  (groff doesn't use RTTI anywhere, and doing so seemed
+   unnecessary, so I didn't explore it.)
+   (class general_reg): Declare non-virtual versions of
+   `get_increment()` and `can_autoincrement()`.
+   * src/roff/troff/reg.cpp: Include "lib.h" since we now need its
+   `INT_DIGITS` symbol.
+   (reg::get_increment): Define as returning constant zero.
+   (reg::can_autoincrement): Define as returning constant false.
+   (general_reg::get_increment): Define.
+   (general_reg::can_autoincrement): Define as returning constant
+   true.
+   (dump_register): If the register can autoincrement, report the
+   autoincrement amount, with an explicit sign for clarity and easy
+   distinction from the register's value and number format.
+
+   * doc/groff.texi.in (Debugging) :
+   * man/groff.7.man (Request short reference) :
+   * man/groff_diff.7.man (New requests) : Document it.
+
 2025-02-26  G. Branden Robinson 
 
* doc/doc.am: In `DOC_PDFMOM` macro, use `PDFMOMBIN` macro
diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 51890e3ff..ffb413860 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -17580,9 +17580,14 @@ strings, and diversions with their sizes in bytes.
 @Defreq {pnr, [@Var{reg} @r{@dots{}}]}
 @cindex dumping registers (@code{pnr})
 @cindex registers, dumping (@code{pnr})
-Report the name and value and, if the value is numeric, the assigned
-format of each register @var{reg}, or, without arguments, those of all
-defined registers, to the standard error stream.
+Report the name and value and,
+if the value is numeric,
+the autoincrement amount and assigned format of each register
+@var{reg},
+or,
+without arguments,
+those of all defined registers,
+to the standard error stream.
 @endDefreq
 
 @Defreq {pstream, }
diff --git a/man/groff.7.man b/man/groff.7.man
index b53338a5d..8c9747d2e 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -4173,14 +4173,16 @@ Report the names,
 values,
 and
 (as applicable)
+autoincrement amounts and
 assigned formats of all defined registers to the standard error stream.
 .
 .TPx
 .REQ .pnr "reg \fR\&.\|.\|.\&\fP"
 Report the name and value and,
 if t

[groff] 12/20: [mom]: Tidy up Automake macro definition.

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

commit 2939e64dc8b663967c1a4f187d0758edfd26c612
Author: G. Branden Robinson 
AuthorDate: Wed Feb 26 05:01:08 2025 -0600

[mom]: Tidy up Automake macro definition.

* contrib/mom/mom.am: Stop specifying `PDFMOM_BIN_PATH` environment
  variable in `MOMPDFMOM` macro housing shell command.  Nothing checks
  the environment for this variable, and according to `git log -p`
  history going all the way back to 2012 when pdfmom(1) landed, nothing
  ever has.
---
 contrib/mom/ChangeLog | 8 
 contrib/mom/mom.am| 1 -
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/contrib/mom/ChangeLog b/contrib/mom/ChangeLog
index 8d4ebd53b..1ba589e12 100644
--- a/contrib/mom/ChangeLog
+++ b/contrib/mom/ChangeLog
@@ -1,3 +1,11 @@
+2025-02-26  G. Branden Robinson 
+
+   * mom.am: Stop specifying `PDFMOM_BIN_PATH` environment
+   variable in `MOMPDFMOM` macro housing shell command.  Nothing
+   checks the environment for this variable, and according to `git
+   log -p` history going all the way back to 2012 when pdfmom(1)
+   landed, nothing ever has.
+
 2024-10-15
 
* om.tmac: [PDF_IMAGE]: remove superfluous \!
diff --git a/contrib/mom/mom.am b/contrib/mom/mom.am
index cecd67108..77ecd54bb 100644
--- a/contrib/mom/mom.am
+++ b/contrib/mom/mom.am
@@ -26,7 +26,6 @@ mom_srcdir = $(top_srcdir)/contrib/mom
 MOMPDFMOM = \
   GROFF_COMMAND_PREFIX= \
   GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
-  PDFMOM_BIN_PATH="$(top_builddir)" \
   $(PDFMOMBIN) $(FFLAG) $(MFLAG) -M$(mom_srcdir) -K utf8 -p -e -t \
   -wall -b
 

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


[groff] 18/20: doc/groff.texi.in: Clarify handling of text files.

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

commit 4ffc6177cf360657f6ed0a3f9689eca650ce28e3
Author: G. Branden Robinson 
AuthorDate: Thu Feb 27 00:56:31 2025 -0600

doc/groff.texi.in: Clarify handling of text files.
---
 doc/groff.texi.in | 14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 779b99300..51890e3ff 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -18465,8 +18465,18 @@ the top-level diversion) at the end of input; GNU 
@code{troff} will not.
 @cindex file formats
 @cindex formats, file
 
-All files read and written by @command{gtroff} are text files.  The
-following two sections describe their format.
+All files that GNU
+@command{troff} @c GNU
+reads and writes are text files.@footnote{GNU
+@command{troff} @c GNU
+also reads files that don't satisfy
+the strict POSIX definition of a text file---for example,
+those lacking a final newline character---and the
+@code{cf}
+and
+@code{trf} requests read arbitrary files.
+Recall @ref{I/O}.}
+The next two sections describe their format.
 
 @menu
 * gtroff Output::

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


[groff] 11/20: [troff]: Improve `node` types' const-correctness.

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

commit d667af72e162c3ef269f7da269ab75f186ad9e4c
Author: G. Branden Robinson 
AuthorDate: Wed Feb 26 04:40:23 2025 -0600

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

* 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`.
---
 ChangeLog   | 33 ++
 src/roff/troff/node.cpp | 54 +
 src/roff/troff/node.h   | 12 +--
 3 files changed, 67 insertions(+), 32 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0c8e08c44..5eb4dc56e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,36 @@
+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 4ba404a39..58e9148a8 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);
-  void outs(const char *s);
+  void outc(unsigned char c) const;
+  void outs(const char *s) const;
 };
 
-void ascii_output_file::outc(unsigned char c)
+void ascii_output_file::outc(unsigned char c) const
 {
   if (fp != 0 /* nullptr */)
 fputc(c, fp);
 }
 
-void ascii_output_file::outs(const char *s)
+void ascii_output_file::outs(const char *s) const
 {
   if (fp != 0 /* nullptr */) {
 fputc('<', fp);
@@ -1925,7 +1925,7 @@ public:
   void zero_width_tprint(troff_output_file *);
   hyphen_list *ge

[groff] 14/20: [doc,man]: Clarify trap/diversion/enviro intro.

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

commit 82e865fe756a6fa3470c236b6e591376772606f2
Author: G. Branden Robinson 
AuthorDate: Wed Feb 26 18:30:17 2025 -0600

[doc,man]: Clarify trap/diversion/enviro intro.

Also align breaks in text mirrored between Texinfo and man(7) document.
---
 doc/groff.texi.in | 43 ++-
 man/roff.7.man|  2 +-
 2 files changed, 27 insertions(+), 18 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index f1df9a969..de96e12ba 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -14871,20 +14871,27 @@ later use.  A @dfn{trap} is a condition on the input 
or output, tested
 automatically by the formatter, that is associated with a macro:
 fulfilling the condition @dfn{springs} the trap---calls the macro.
 
-Footnote support often exercises all three of the foregoing features.  A
-simple implementation might work as follows.  The author writes a pair
-of macros: one starts a footnote and the other ends it.  They further
-set a trap a small distance above the page bottom, reserving a footnote
-area.  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.  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, which returns
-to the previous environment and ends the diversion.  Later, after body
-text nearly fills the page, the trap springs.  The macro called by the
-trap draws a line across the page and emits the stored diversion.  Thus,
+Footnote support often exercises all three of the foregoing features.
+A simple implementation might work as follows.
+The author writes a pair of macros:@:
+one starts a footnote and the other ends it.
+They further set a trap a small distance above the page bottom,
+reserving a footnote area.
+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.
+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,
+which returns to the previous environment and ends the diversion.
+Later,
+after body
+text nearly fills the page, the trap springs.
+The macro called by the trap draws a line across the page
+and emits the stored diversion by calling it like a macro.
+Thus,
 the footnote renders.
 
 Diversions and traps make the text formatting process non-linear.  Let
@@ -14892,15 +14899,17 @@ us imagine a set of text lines or paragraphs labelled 
@samp{A},
 @samp{B}, and so on.  If we set up a trap that produces text @samp{T}
 (as a page footer, say), and we also use a diversion to store the
 formatted text @samp{D}, then a document with input text in the order
-@samp{A B C D E F} might render as @samp{A B C E T F}.  The diversion
-@samp{D} will never be output if we do not call for it.
+@samp{A B C D E F} might render as @samp{A B C E T F}.
+The diversion
+@samp{D}
+is never output if we do not call it.
 
 Environments of themselves are not a source of non-linearity in document
 formatting:@: environment switches have immediate effect.  One could
 always write a macro to change as many formatting parameters as desired
 with a single convenient call.  But because diversions can be nested and
 macros called by traps that are sprung by other trap-called macros, they
-may be called upon in varying contexts.  For example, consider a page
+may be interpolated in varying contexts.  For example, consider a page
 header that is always to be set in Helvetica.  A document that uses
 Times for most of its body text, but Courier for displayed code
 examples, poses a challenge if a page break occurs in the middle of a
diff --git a/man/roff.7.man b/man/roff.7.man
index aa0a52613..bd6204e06 100644
--- a/man/roff.7.man
+++ b/man/roff.7.man
@@ -841,7 +841,7 @@ after body text nearly fills the page,
 the trap springs.
 .
 The macro called by the trap draws a line across the page
-and emits the stored diversion.
+and emits the stored diversion by calling it like a macro.
 .
 Thus,
 the footnote is rendered.

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


[groff] 17/20: [doc,man]: Improve explanation of "special" fonts.

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

commit f9b67f86afe8cc03bc5dd4de68e1e6a7aa389e57
Author: G. Branden Robinson 
AuthorDate: Wed Feb 26 18:46:08 2025 -0600

[doc,man]: Improve explanation of "special" fonts.
---
 doc/groff.texi.in| 13 ++---
 man/groff_font.5.man | 10 --
 2 files changed, 18 insertions(+), 5 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index a1a89eaa0..779b99300 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -19705,9 +19705,16 @@ must not extend over more than one line.
 @item special
 @cindex special fonts
 @kindex special
-The font is @dfn{special}:@: when a glyph is requested that is not
-present in the formatter's currently selected font, the glyph is sought
-in any mounted fonts that bear this property.
+The font is @dfn{special}:@:
+when the document attempts to format a glyph
+that is not present in the formatter's currently selected font,
+the glyph is sought in any mounted fonts that bear this property.
+Often,
+such fonts are
+@dfn{unstyled},
+having no heavy (bold) or oblique
+(slanted or italic)
+variants.
 @end table
 
 Other directives in this section are ignored by GNU
diff --git a/man/groff_font.5.man b/man/groff_font.5.man
index de1f1a33e..37e27aa19 100644
--- a/man/groff_font.5.man
+++ b/man/groff_font.5.man
@@ -676,9 +676,15 @@ The list of ligatures must not extend over more than one 
line.
 .B special
 The font is
 .IR special :
-when a glyph is requested that is not present in the formatter's
-currently selected font,
+when the document attempts to format a glyph
+that is not present in the formatter's currently selected font,
 the glyph is sought in any mounted fonts that bear this property.
+Often,
+such fonts are
+.IR unstyled ,
+having no heavy (bold) or oblique
+(slanted or italic)
+variants.
 .
 .
 .P

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


[groff] 04/20: doc/groff.texi.in: Clarify warning management.

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

commit c7a9722b15b192cdfc85b8626c27cc0cc0b7b06e
Author: G. Branden Robinson 
AuthorDate: Thu Feb 27 01:04:34 2025 -0600

doc/groff.texi.in: Clarify warning management.
---
 doc/groff.texi.in | 10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 5cc102b35..a5e1c4658 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -17378,9 +17378,13 @@ multi-stage pipeline processing in the surrounding 
system.  Nevertheless
 there exist several features useful for troubleshooting.
 
 Preprocessors use the @code{lf} request to preserve the identity of the
-line numbers and names of input files.  GNU @code{troff} emits a variety
-of error diagnostics and supports several categories of warning; the
-output of these can be selectively suppressed.  A trace of the
+line numbers and names of input files.
+GNU
+@command{troff} @c GNU
+emits a variety of error diagnostics
+and supports several categories of warning;
+the output of each category can be selectively enabled or suppressed.
+A trace of the
 formatter's input processing stack can be emitted when errors or
 warnings occur by means of GNU @code{troff}'s @option{-b} option, or
 produced on demand with the @code{backtrace} request.  The @code{tm}

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


[groff] 05/20: doc/groff.texi.in: Clarify `sy` request behavior.

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

commit a4219e5880679cc4e4cd49ad07a75741e834aec3
Author: G. Branden Robinson 
AuthorDate: Thu Feb 27 01:11:37 2025 -0600

doc/groff.texi.in: Clarify `sy` request behavior.
---
 doc/groff.texi.in | 20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index a5e1c4658..d56b76a53 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -16744,13 +16744,19 @@ is the same as @w{@samp{.pi foo | bar}}.
 @cindex running system commands
 @DefreqList {sy, [@code{"}]@Var{command}}
 @DefregListEndx {systat}
-Execute the specified shell command(s).  The formatter reads the
-remainder of the input line into @var{command} and passes it to
-@cite{system@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}.
+Execute the specified shell command(s).
+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

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


[groff] 10/20: [troff]: Fix code style nit (`\0` character).

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

commit 989c3045387530b82f67e6b56585007e3ea75d54
Author: G. Branden Robinson 
AuthorDate: Wed Feb 26 04:19:41 2025 -0600

[troff]: Fix code style nit (`\0` character).

* src/roff/troff/node.cpp: Fix code style nit.

  (glyph_node::ascii_print): Spell null character using the C/C++
  language literal for expressing it.
---
 ChangeLog   | 6 ++
 src/roff/troff/node.cpp | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 9accfe587..0c8e08c44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-02-26  G. Branden Robinson 
+
+   * src/roff/troff/node.cpp: Fix code style nit.
+   (glyph_node::ascii_print): Spell null character using the C/C++
+   language literal for expressing it.
+
 2025-02-26  G. Branden Robinson 
 
* tmac/an.tmac: Trivially refactor to align with terminology
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 0edd47644..4ba404a39 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -2204,7 +2204,7 @@ hyphenation_type glyph_node::get_hyphenation_type()
 void glyph_node::ascii_print(ascii_output_file *ascii)
 {
   unsigned char c = ci->get_ascii_code();
-  if (c != 0)
+  if (c != '\0')
 ascii->outc(c);
   else
 ascii->outs(ci->nm.contents());

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


[groff] 13/20: doc/doc.am: Slightly refactor.

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

commit 1532a5584db7bd703b0e49769ebbdd6993c1
Author: G. Branden Robinson 
AuthorDate: Wed Feb 26 05:03:44 2025 -0600

doc/doc.am: Slightly refactor.

* doc/doc.am: In `DOC_PDFMOM` macro, use `PDFMOMBIN` macro defined in
  "Makefile.am" to locate `pdfmom` executable; as with `GROFFBIN`,
  that's what it's there for.
---
 ChangeLog  | 6 ++
 doc/doc.am | 4 +++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 5eb4dc56e..adbd4ee0f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-02-26  G. Branden Robinson 
+
+   * doc/doc.am: In `DOC_PDFMOM` macro, use `PDFMOMBIN` macro
+   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
diff --git a/doc/doc.am b/doc/doc.am
index a4f0df6cf..a1c4ad635 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -33,6 +33,8 @@ DOC_SED = $(SED) \
 # It includes flags to locate its tmac and device/font description
 # directories and to produce verbose diagnostics in the event of syntax
 # or formatting problems.
+#
+# `-M $(doc_srcdir)` is so that grn can find "grnexampl.g".
 DOC_GROFF = \
   GROFF_COMMAND_PREFIX= \
   GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
@@ -41,7 +43,7 @@ DOC_GROFF = \
 DOC_PDFMOM = \
   GROFF_COMMAND_PREFIX= \
   GROFF_BIN_PATH="$(GROFF_BIN_PATH)" \
-  $(GROFF_BIN_PATH)/pdfmom -M $(doc_srcdir) $(MFLAG) $(FFLAG) -ww -b --roff
+  $(PDFMOMBIN) $(MFLAG) $(FFLAG) -ww -b --roff
 
 # This image file is used by several documents in the groff source tree.
 DOC_GNU_EPS = doc/gnu.eps

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


[groff] 16/20: doc/groff.texi.in: Drop duplicate paragraph.

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

commit 52891b5d7493d79918a50bb7920934b849ae648e
Author: G. Branden Robinson 
AuthorDate: Wed Feb 26 18:42:05 2025 -0600

doc/groff.texi.in: Drop duplicate paragraph.

...and recast.
---
 doc/groff.texi.in | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index f42ba2994..a1a89eaa0 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -16939,16 +16939,16 @@ Embed @var{contents} into GNU @command{troff} output 
as parameters to an
 The interpretation of such parameters is determined by the output driver
 or other postprocessor.
 
-A leading neutral double quote in the argument to @code{device} is
-stripped from it, allowing embedded leading spaces in @var{contents},
-which is read to the end of the input line in copy mode.
-
 @cindex @code{device} request, and copy mode
 @cindex copy mode, and @code{device} request
 @cindex mode, copy, and @code{device} request
-The @code{device} request processes its arguments in copy mode
-(@pxref{Copy Mode}).  An initial neutral double quote in @var{contents}
-is stripped to allow embedding of leading spaces.
+GNU
+@command{troff} @c GNU
+strips a leading neutral double quote from
+@var{contents}
+to permit initial embedded spaces,
+and reads it to the end of the input line in copy mode.
+Recall @ref{Copy Mode}.
 
 @cindex nodes, in device extension commands
 @cindex special characters, in device extension commands

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


[groff] 03/20: doc/groff.texi.in: Clarify `lf` request behavior.

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

commit 73b03ba1304b7fdb8b36f9fa46368078b259530f
Author: G. Branden Robinson 
AuthorDate: Thu Feb 27 01:11:19 2025 -0600

doc/groff.texi.in: Clarify `lf` request behavior.
---
 doc/groff.texi.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 1a1b3fa84..5cc102b35 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -17422,6 +17422,9 @@ GNU
 @command{troff}
 strips a leading leading neutral double quote from
 @var{file-identifier},
+which it reads in copy mode
+(recall
+@pxref{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] 08/20: [man]: Trivially refactor.

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

commit e8ae5bb844f8f54456b65e40fb849fd4f08eb85f
Author: G. Branden Robinson 
AuthorDate: Wed Feb 26 03:57:52 2025 -0600

[man]: Trivially refactor.

* tmac/an.tmac: Trivially refactor to align with terminology used in
  groff_man(7).

  (an*abbreviate-page-topic): Rename this...
  (an*abbreviate-page-identifier): ...to this.

  (TH): Update call site.
---
 ChangeLog| 8 
 tmac/an.tmac | 6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 6e1dc1271..9accfe587 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-02-26  G. Branden Robinson 
+
+   * tmac/an.tmac: Trivially refactor to align with terminology
+   used in groff_man(7).
+   (an*abbreviate-page-topic): Rename this...
+   (an*abbreviate-page-identifier): ...to this.
+   (TH): Update call site.
+
 2025-02-26  G. Branden Robinson 
 
[eqn,pic,preconv,refer,soelim,tbl]: Use `lf` requests _even
diff --git a/tmac/an.tmac b/tmac/an.tmac
index 80f60aa21..d32f41422 100644
--- a/tmac/an.tmac
+++ b/tmac/an.tmac
@@ -363,7 +363,7 @@
 .  ps \\n[PS]u
 .  vs \\n[VS]u
 .  lt \\n[LT]u
-.  an*abbreviate-page-topic
+.  an*abbreviate-page-identifier
 .  \" If AT or UC is called, we will need to abbreviate again.
 .  an*abbreviate-inner-footer
 .  ev
@@ -475,11 +475,11 @@
 .tl '\\*[an*ifoot]'\\*[an-extra1]'\\*[an*ofoot]'
 ..
 .
-.\" Abbreviate the page topic if it's too long for the header.  Leaves
+.\" Abbreviate page identifier if it's too long for the header.  Leaves
 .\" string an-pageref defined for use in .PT and .an-footer.  Also
 .\" leaves an*ident-abbv for possible use by .PT and .BT re-definers.
 .\" Call this only from within the header/footer environment.
-.de an*abbreviate-page-topic
+.de an*abbreviate-page-identifier
 .  ds an*ident-abbv \\*[an*ident]\" might not get abbreviated at all
 .  ds an*ident-string \\*[an*ident]\"
 .  ds an-ellipsis \|.\|.\|.\|\"

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


[groff] 09/20: doc/groff.texi.in: Align with groff_font(5).

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

commit 73e4f6da97b97cf46def424cb33f126cea11feaf
Author: G. Branden Robinson 
AuthorDate: Wed Feb 26 04:01:09 2025 -0600

doc/groff.texi.in: Align with groff_font(5).
---
 doc/groff.texi.in | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index d56b76a53..f1df9a969 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -19842,8 +19842,15 @@ The glyph can be specified to
 using this index by means of the
 @code{\N}
 escape sequence.
-The index can be any integer.@footnote{that is, any integer parsable by the C
-standard library's @cite{strtol@r{(3)}} function}
+The index can be any integer.@footnote{that is, any integer parsable by
+the C standard library's
+@cite{strtol@r{(3)}}
+function}
+An
+@var{index}
+is limited to the range of the C language
+@code{int}
+type on the system.
 
 The @var{entity-name} field defines an identifier for the glyph that the
 postprocessor uses to print the GNU @code{troff} glyph @var{name}.  This

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