[bug #64231] [eqn] use italic face for lowercase Greek letters in nroff mode

2024-01-10 Thread G. Branden Robinson
Follow-up Comment #2, bug#64231 (group groff):

Bug #64232 turned out to be invalid; what I wanted was already the case.

This matter was explored more deeply by Tadziu and me in a thread on the
_groff_ list.

https://lists.gnu.org/archive/html/groff/2024-01/msg00019.html
https://lists.gnu.org/archive/html/groff/2024-01/msg00032.html
https://lists.gnu.org/archive/html/groff/2024-01/msg00040.html
https://lists.gnu.org/archive/html/groff/2024-01/msg00041.html
https://lists.gnu.org/archive/html/groff/2024-01/msg00048.html
https://lists.gnu.org/archive/html/groff/2024-01/msg00050.html

The most pertinent part for this ticket is likely the following.


...[N]othing in eqn documents its sensitivity to the font mounting
order when determining the typefaces to be used.  In fact that
sensitivity overrides explicit configuration!

Source:
$ cat ATTIC/to-slant-or-not-to-slant.roff
.\" "letter" means "slanted" in GNU eqn
.\" This is actually redundant with the default configuration.
.EQ
chartype "letter" \[*a]\[*b]\[*g]\[*d]\[*e]\[*z]
chartype "letter" \[*y]\[*h]\[*i]\[*k]\[*l]\[*m]
chartype "letter" \[*n]\[*c]\[*o]\[*p]\[*r]\[*s]
chartype "letter" \[*t]\[*u]\[*f]\[*x]\[*q]\[*w]
.EN
.fp 5 S
.fp 6 SS
\(*A\(*a \(-> upright lowercase alpha
.br
.EQ
sin ( 2 theta ) ~ = ~ 2 ~ sin theta cos theta
.EN
.sp
.fp 5 SS
.fp 6 S
\(*A\(*a \(-> slanted lowercase alpha
.br
.EQ
sin ( 2 theta ) ~ = ~ 2 ~ sin theta cos theta
.EN

Rendering:
[see attached image]

> Example:
> 
>   .fp 5 S
>   .fp 6 SS
>   \(*A\(*a --> upright lowercase alpha.
>   .fp 5 SS
>   .fp 6 S
>   \(*A\(*a --> slanted lowercase alpha.

This is fine, but it's raw *roff, not eqn input.  I am concerned with
eqn output, and nothing I propose would break your exhibit above.

At 2024-01-10T02:10:12+0100, Tadziu Hoffmann wrote:
> > I never knew this.  Where is the reference please?
> > I would like to mention this in my new EQN manual.
> 
> The Troff User's Manual (section 2, "Font and Character Size
> Control") says:
> 
>   The troff character set is defined by a description file
>   specific to each output device.  There are normally several
>   regular fonts and one or more special fonts.
> 
>   Troff begins execution by reading information for a set of
>   defaults fonts, said to be mounted; conventionally, the first
>   four are Times Roman (R), Times Italic (I), Times Bold (B),
>   and Times Bold Italic (BI), and the last is a Special font (S)
>   containing miscellaneous characters.  The set of fonts and
>   positions is determined by the device description file.
> 
>   It is not necessary to change to the Special font;
>   characters on that font are automatically handled as if
>   they were physically part of the current font.  The Special
>   font may actually be several fonts; the name S is reserved
>   and is generally used for one of these.  All special fonts
>   must be mounted after regular fonts.
> 
> However, it does not explicitly say that the special fonts
> are searched in mount-position order.  (I think it is a
> reasonable assumption, but I may be biased.)
> 
> The groff Info file (section 5.17.4, "Using Symbols") is more
> specific:
> 
>   Here are the exact rules how 'gtroff' searches a given symbol:
> 
>[... current font and explicit declarations using
>  .char and .fspecial ...]
> 
>* As a last resort, consult all fonts loaded up to now for
>  special fonts and check them, starting with the lowest
>  font number.  [...]
> 
> Since both S and SS contain lowercase Greek characters, placing
> SS before S will result in gtroff picking the slanted alpha for
> \(*a, whereas placing S before SS with pick the upright alpha.
> (Unless of course the current font also contains a \(*a character,
> in which case this will be used, or any other font declared
> as special and containing \(*a is mounted before S and SS.)

I don't propose to change any of this.  It seems to work well and can be
apprehended by users.

...

[3] This in turn means that the definitions of the eqn Greek-letter-name
macros will _have_ to come out of the lexer and be put in
eqn-device-specific startup logic--in eqnrc, say--so that the code
can be appropriately conditionalized.  Only the "ps" device has
(though, soon, "pdf" will have) a font called "SS" by default.

So I envision something like this in eqnrc:

ifdef utf8 ! define Alpha \*(A !
ifdef utf8 ! define ALPHA \*(A !
ifdef utf8 ! define alpha \fI\*(a\fP !

ifdef ps|pdf ! define Alpha \*(A !
ifdef ps|pdf ! define ALPHA \*(A !
ifdef ps|pdf ! define alpha \f(SS\*(a\fP !

   ...and so on for the other 23 Greek letters.




___

Reply to this item at:

  

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




[bug #64231] [eqn] use italic face for lowercase Greek letters in nroff mode

2024-01-10 Thread G. Branden Robinson
Update of bug#64231 (group groff):

  Dependency Removed: => bugs #64232


___

Reply to this item at:

  

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




[bug #64232] [devices] stop assigning `*[a-ik-uw-z]` special characters to italic fonts

2024-01-10 Thread G. Branden Robinson
Update of bug#64232 (group groff):

  Status:None => Invalid
 Assigned to:None => gbranden   
 Open/Closed:Open => Closed 

___

Follow-up Comment #3:

[comment #0 original submission:]
> We should stop forcing lowercase Greek special characters to be italic (by
assigning these names only in italic font description files) anywhere this is
possible.

Apparently I had assumed, rather than verifying, my claim in parentheses.  Our
font description files _already_ have lowercase Greek coverage in upright
faces where applicable.


$ git grep '^\*[A-Za-z]' font | cat
font/devX100-12/S:*A12,11   0   0101
font/devX100-12/S:*B11,11   0   0102
font/devX100-12/S:*X12,11   0   0103
font/devX100-12/S:*D10,11   0   0104
font/devX100-12/S:*E10,11   0   0105
font/devX100-12/S:*F12,11   0   0106
font/devX100-12/S:*G10,11   0   0107
font/devX100-12/S:*Y12,11   0   0110
font/devX100-12/S:*I6,110   0111
font/devX100-12/S:*K12,11   0   0113
font/devX100-12/S:*L11,11   0   0114
font/devX100-12/S:*M14,11   0   0115
font/devX100-12/S:*N11,11   0   0116
font/devX100-12/S:*O12,11   0   0117
font/devX100-12/S:*P12,11   0   0120
font/devX100-12/S:*H12,11   0   0121
font/devX100-12/S:*R9,110   0122
font/devX100-12/S:*S10,11   0   0123
font/devX100-12/S:*T10,11   0   0124
font/devX100-12/S:*W12,12   0   0127
font/devX100-12/S:*C11,11   0   0130
font/devX100-12/S:*Q13,11   0   0131
font/devX100-12/S:*Z10,11   0   0132
font/devX100-12/S:*a11,90   0141
font/devX100-12/S:*b9,13,4  0   0142
font/devX100-12/S:*x9,9,3   0   0143
font/devX100-12/S:*d8,120   0144
font/devX100-12/S:*e7,9 0   0145
font/devX100-12/S:*f9,11,3  0   0146
font/devX100-12/S:*g7,9,4   0   0147
font/devX100-12/S:*y10,9,3  0   0150
font/devX100-12/S:*i5,9 0   0151
font/devX100-12/S:*k9,9 0   0153
font/devX100-12/S:*l9,130   0154
font/devX100-12/S:*m9,9,4   0   0155
font/devX100-12/S:*n8,9 0   0156
font/devX100-12/S:*o9,9 0   0157
font/devX100-12/S:*p9,9 0   0160
font/devX100-12/S:*h9,120   0161
font/devX100-12/S:*r9,9,4   0   0162
font/devX100-12/S:*s10,90   0163
font/devX100-12/S:*t7,9 0   0164
font/devX100-12/S:*u9,9 0   0165
font/devX100-12/S:*w11,90   0167
font/devX100-12/S:*c8,13,4  0   0170
font/devX100-12/S:*q11,9,4  0   0171
font/devX100-12/S:*z8,13,4  0   0172
font/devX100-12/S:*U10,11   0   0241
font/devX100/S:*A   11,10   0   0101
font/devX100/S:*B   9,100   0102
font/devX100/S:*X   11,10   0   0103
font/devX100/S:*D   9,100   0104
font/devX100/S:*E   9,100   0105
font/devX100/S:*F   11,10   0   0106
font/devX100/S:*G   9,100   0107
font/devX100/S:*Y   11,10   0   0110
font/devX100/S:*I   5,100   0111
font/devX100/S:*K   10,10   0   0113
font/devX100/S:*L   10,10   0   0114
font/devX100/S:*M   13,10   0   0115
font/devX100/S:*N   11,10   0   0116
font/devX100/S:*O   10,10   0   0117
font/devX100/S:*P   11,10   0   0120
font/devX100/S:*H   10,10   0   0121
font/devX100/S:*R   8,100   0122
font/devX100/S:*S   9,100   0123
font/devX100/S:*T   9,100   0124
font/devX100/S:*W   11,10   0   0127
font/devX100/S:*C   9,100   0130
font/devX100/S:*Q   11,10   0   0131
font/devX100/S:*Z   9,100   0132
font/devX100/S:*a   9,7 0   0141
font/devX100/S:*b   8,11,3  0   0142
font/devX100/S:*x   8,7,3   0   0143
font/devX100/S:*d   7,110   0144
font/devX100/S:*e   6,7 0   0145
font/devX100/S:*f   9,10,3  0   0146
font/devX100/S:*g   6,7,3   0   0147
font/devX100/S:*y   8,7,3   0   0150
font/devX100/S:*i   5,7 0   0151
font/devX100/S:*k   8,7 0   0153
font/devX100/S:*l   8,100   0154
font/devX100/S:*m   8,7,2   0   0155
font/devX100/S:*n   8,7 0   0156
font/devX100/S:*o   8,7 0   0157
font/devX100/S:*p   8,7 0   0160
font/devX100/S:*h   7,100   0161
font/devX100/S:*r   8,7,3   0   0162
font/devX100/S:*s   8,7 0   0163
font/devX100/S:*t   6,7 0   0164
font/devX100/S:*u   8,7 0   0165
font/devX100/S:*w   11,70   0167
font/devX100/S:*c   7,12,3  0   0170
font/devX100/S:*q   9,7,3   0   0171

[groff] 01/01: ChangeLog: Fix incorrect Savannah ticket number.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 2a90579de71129f7ed536de72d35661264b08bde
Author: G. Branden Robinson 
AuthorDate: Wed Jan 10 23:02:25 2024 -0600

ChangeLog: Fix incorrect Savannah ticket number.
---
 ChangeLog | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index a055185f6..f15ab215f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,7 +30,7 @@
`device` request behavior; a partially collected line in the
top-level diversion must exist at least once.
 
-   Fixes .
+   Fixes .
 
 2024-01-08  G. Branden Robinson 
 

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


[bug #65138] [troff] `device` request silently fails before first page begins

2024-01-10 Thread G. Branden Robinson
Update of bug#65138 (group groff):

  Status: In Progress => Fixed  
 Open/Closed:Open => Closed 
 Planned Release:None => 1.24.0 

___

Follow-up Comment #3:

Argh, I screwed up the bug number in the commit message AND ChangeLog.


commit c8935f2361b44414be83a34f5e7e4b2ad57cd8b2
Author: G. Branden Robinson 
Date:   Mon Jan 8 19:02:34 2024 -0600

[docs]: Fix Savannah #65118 (`device` behavior).

* doc/groff.texi (Postprocessor Access):
* man/groff_diff.7.man (New requests): Clarify a point of `device`
  request behavior; a partially collected line in the top-level
  diversion must exist at least once.

Fixes .




___

Reply to this item at:

  

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




[bug #64959] [troff] add unit tests for `device` and `output` requests

2024-01-10 Thread G. Branden Robinson
Update of bug#64959 (group groff):

  Status: In Progress => Fixed  
 Open/Closed:Open => Closed 
 Planned Release:None => 1.24.0 

___

Follow-up Comment #3:


commit 76b48901e8815939636edb91040c4ff2ac2bca1a
Author: G. Branden Robinson 
Date:   Mon Jan 8 19:31:59 2024 -0600

[troff]: Add unit test for `device` request.

* src/roff/groff/tests/device-request-works.sh: Add test.
* src/roff/groff/groff.am (groff_TESTS): Run test.

Fixes .

commit 587316f3b4beaae9f56458b5026abcad6a5299c0
Author: G. Branden Robinson 
Date:   Mon Jan 8 06:39:28 2024 -0600

[troff]: Add tests of "early" formatter features.

[troff]: Add tests of early usage of formatter features that throw fatal
errors when called "too early", but for which this error handling
appears to be dead code.  Further test the `output` request in
furtherance of Savannah #64959.

* src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh:
* src/roff/groff/tests/cf-request-early-does-not-fail.sh:
* src/roff/groff/tests/output-request-works.sh: Add tests.

* src/roff/groff/groff.am (groff_TESTS): Run tests.




___

Reply to this item at:

  

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




[groff] 10/16: [troff]: Trivially refactor (boolify begin_page).

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit c42b396a21abec2454bcfd105220461266f35ab0
Author: G. Branden Robinson 
AuthorDate: Mon Jan 8 10:05:07 2024 -0600

[troff]: Trivially refactor (boolify begin_page).

* src/roff/troff/div.cpp (top_level_diversion::begin_page): Demote
  return type from `int` to `bool`.  Return Boolean instead of integer
  literals.

* src/roff/troff/div.h (class top_level_diversion): Update declaration.

Also:
Wrap long lines.  Annotate null pointers with `nullptr` comment to ease
any future transition to C++11, which defines it as a keyword.
---
 ChangeLog  | 11 +++
 src/roff/troff/div.cpp | 15 ---
 src/roff/troff/div.h   |  2 +-
 3 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fcbf260cb..437f38ef1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-01-08  G. Branden Robinson 
+
+   [troff]: Trivially refactor.
+
+   * src/roff/troff/div.cpp (top_level_diversion::begin_page):
+   Demote return type from `int` to `bool`.  Return Boolean instead
+   of integer literals.
+
+   * src/roff/troff/div.h (class top_level_diversion): Update
+   declaration.
+
 2024-01-08  G. Branden Robinson 
 
[troff]: Enhance new tests.
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index da6a00282..36cf11773 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -601,9 +601,9 @@ void cleanup_and_exit(int exit_code)
   exit(exit_code);
 }
 
-// Returns non-zero if it sprung a top-of-page trap.
+// Returns `true` if beginning the page sprung a top-of-page trap.
 // The optional parameter is for the .trunc register.
-int top_level_diversion::begin_page(vunits n)
+bool top_level_diversion::begin_page(vunits n)
 {
   if (is_exit_underway) {
 if (page_count == last_page_count
@@ -634,19 +634,20 @@ int top_level_diversion::begin_page(vunits n)
   vertical_position = V0;
   high_water_mark = V0;
   ejecting_page = 0;
-  // If before_first_page was 2, then the top of page transition was undone
-  // using eg .nr nl 0-1.  See nl_reg::set_value.
+  // If before_first_page was 2, then the top of page transition was
+  // undone using eg .nr nl 0-1.  See nl_reg::set_value.
   if (before_first_page != 2)
 the_output->begin_page(page_number, page_length);
   before_first_page = 0;
   nl_reg_contents = vertical_position.to_units();
-  if (vertical_position_traps_flag && next_trap != 0 && next_trap_pos == V0) {
+  if ((vertical_position_traps_flag && next_trap != 0 /* nullptr */)
+  && next_trap_pos == V0) {
 truncated_space = n;
 spring_trap(next_trap->nm);
-return 1;
+return true;
   }
   else
-return 0;
+return false;
 }
 
 void continue_page_eject()
diff --git a/src/roff/troff/div.h b/src/roff/troff/div.h
index 6180caa0b..1ffc8cc23 100644
--- a/src/roff/troff/div.h
+++ b/src/roff/troff/div.h
@@ -137,7 +137,7 @@ public:
   int get_page_number() { return page_number; }
   int get_next_page_number();
   void set_page_number(int n) { page_number = n; }
-  int begin_page(vunits = V0);
+  bool begin_page(vunits = V0);
   void set_next_page_number(int);
   void set_page_length(vunits);
   void copy_file(const char *filename);

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


[groff] 09/16: [troff]: Enhance new tests.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit c04df6c2538a67a06b8310eaeb263ba251f56fc5
Author: G. Branden Robinson 
AuthorDate: Mon Jan 8 07:35:26 2024 -0600

[troff]: Enhance new tests.

* src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh:
* src/roff/groff/tests/output-request-early-does-not-fail.sh: Check that
  escape/request parameters don't get emitted before the output leader,
  and that they do show up in the output.
---
 ChangeLog  | 10 ++
 .../groff/tests/backslash-exclamation-early-does-not-fail.sh   |  4 
 src/roff/groff/tests/output-request-works.sh   |  3 +++
 3 files changed, 17 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 823983e9a..fcbf260cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-01-08  G. Branden Robinson 
+
+   [troff]: Enhance new tests.
+
+   * src/roff/groff/tests/\
+   backslash-exclamation-early-does-not-fail.sh:
+   * src/roff/groff/tests/output-request-early-does-not-fail.sh:
+   Check that escape/request parameters don't get emitted before
+   the output leader, and that they do show up in the output.
+
 2024-01-08  G. Branden Robinson 
 
[troff]: Add tests of early usage of formatter features that
diff --git a/src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh 
b/src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh
index 7dcf20b75..eb29d44ca 100755
--- a/src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh
+++ b/src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh
@@ -33,6 +33,10 @@ do
   echo "checking early backslash-? escape on $device device" >&2
   output=$(printf '\\!cA\n' "$input" | "$groff" -T $device -Z) || wail
   echo "$output"
+  echo "checking that leader starts on line 1 for $device device" >&2
+  echo "$output" | sed -n '1p' | grep -Eq '^x *T' || wail
+  echo "checking that expected output is present for $device device" >&2
+  echo "$output" | grep -Eq 'c *A' || wail
 done
 
 test -z "$fail"
diff --git a/src/roff/groff/tests/output-request-works.sh 
b/src/roff/groff/tests/output-request-works.sh
index 4b197f0e9..e1070bc11 100755
--- a/src/roff/groff/tests/output-request-works.sh
+++ b/src/roff/groff/tests/output-request-works.sh
@@ -43,6 +43,9 @@ do
 || wail
   echo "$output"
 
+  echo "checking that leader starts on line 1 for $device device" >&2
+  echo "$output" | sed -n '1p' | grep -Eq '^x *T' || wail
+
   echo "checking simple 'output' request on $device device" >&2
   output=$(printf "%s\n" "$input_simple" | "$groff" -T $device -Z) \
 || wail

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


[groff] 07/16: groff(7): `\?` is ignored in top-level diversion.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit b265609d97a89e99368bc6242769455b69027275
Author: G. Branden Robinson 
AuthorDate: Mon Jan 8 06:26:06 2024 -0600

groff(7): `\?` is ignored in top-level diversion.
---
 man/groff.7.man | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/man/groff.7.man b/man/groff.7.man
index 6357f38ad..7538dd51b 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -4757,6 +4757,8 @@ read in copy mode,
 in a diversion,
 or unformatted as an output comparand in a conditional expression.
 .
+Ignored in the top-level diversion.
+.
 .
 .\" = spaces and fixed-width horizontal motions =
 .

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


[groff] 02/16: ChangeLog: Update old entries with function info.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 0529eab08267c14c10f4e785fc70716f424a2bfe
Author: G. Branden Robinson 
AuthorDate: Tue Jan 9 08:35:56 2024 -0600

ChangeLog: Update old entries with function info.

...for better agreement with GNU Coding Standards regarding change logs.
---
 ChangeLog | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bb6d559fc..fd26376f3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,7 +6,7 @@
 
 2024-01-07  Deri James  
 
-   * src/devices/gropdf/gropdf.pl: Comment out line causing
+   * src/devices/gropdf/gropdf.pl (do_x): Comment out line causing
incorrect table of contents relocation.
 
Thanks to Peter Schaffter for the report.
@@ -23,8 +23,9 @@
light that some PDFs have a "skeleton" object that contains the
stream, while the rest of the object is held in an ObjStm.
 
-   * src/devices/gropdf/gropdf.pl: If a skeleton object exists at
-   the top level and in an ObjStm stream, merge the two objects.
+   * src/devices/gropdf/gropdf.pl (LoadPDF, ObjMerge): If a
+   skeleton object exists at the top level and in an ObjStm stream,
+   merge the two objects.
 
 2024-01-07  Deri James  
 

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


[groff] 04/16: [troff]: Trivially refactor (rename encode_char).

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit df0c6b23d3e8874c77b6b8503dbee7cee8247c57
Author: G. Branden Robinson 
AuthorDate: Tue Jan 9 07:52:42 2024 -0600

[troff]: Trivially refactor (rename encode_char).

* src/roff/troff/input.cpp (encode_char): Rename this...
  (encode_char_for_troff_output): ...to this.

  (do_special): Update call site.
---
 ChangeLog| 9 +
 src/roff/troff/input.cpp | 4 ++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0bc0226b5..af8863151 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-01-08  G. Branden Robinson 
+
+   [troff]: Trivially refactor.
+
+   * src/roff/troff/input.cpp (encode_char): Rename this...
+   (encode_char_for_troff_output): ...to this.
+
+   (do_special): Update call site.
+
 2024-01-08  G. Branden Robinson 
 
[troff]: Restore diagnostic from groff 1.22.4.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index cf24bbcfd..7455d6077 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5571,7 +5571,7 @@ static node *do_non_interpreted()
   return new non_interpreted_node(mac);
 }
 
-static void encode_char(macro *mac, char c)
+static void encode_char_for_troff_output(macro *mac, char c)
 {
   if (c == '\0') {
 if (tok.is_stretchable_space()
@@ -5671,7 +5671,7 @@ static node *do_special()
   c = '\b';
 else
   c = tok.ch();
-encode_char(, c);
+encode_char_for_troff_output(, c);
   }
   return new special_node(mac);
 }

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


[groff] 08/16: [troff]: Add tests of "early" formatter features.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 587316f3b4beaae9f56458b5026abcad6a5299c0
Author: G. Branden Robinson 
AuthorDate: Mon Jan 8 06:39:28 2024 -0600

[troff]: Add tests of "early" formatter features.

[troff]: Add tests of early usage of formatter features that throw fatal
errors when called "too early", but for which this error handling
appears to be dead code.  Further test the `output` request in
furtherance of Savannah #64959.

* src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh:
* src/roff/groff/tests/cf-request-early-does-not-fail.sh:
* src/roff/groff/tests/output-request-works.sh: Add tests.

* src/roff/groff/groff.am (groff_TESTS): Run tests.
---
 ChangeLog  | 14 +
 src/roff/groff/groff.am|  3 ++
 .../backslash-exclamation-early-does-not-fail.sh   | 40 ++
 .../groff/tests/cf-request-early-does-not-fail.sh  | 42 +++
 src/roff/groff/tests/output-request-works.sh   | 61 ++
 5 files changed, 160 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index b8195d6e9..823983e9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-01-08  G. Branden Robinson 
+
+   [troff]: Add tests of early usage of formatter features that
+   throw fatal errors when called "too early", but for which this
+   error handling appears to be dead code.  Further test the
+   `output` request in furtherance of Savannah #64959.
+
+   * src/roff/groff/tests/\
+   backslash-exclamation-early-does-not-fail.sh:
+   * src/roff/groff/tests/cf-request-early-does-not-fail.sh:
+   * src/roff/groff/tests/output-request-works.sh: Add tests.
+
+   * src/roff/groff/groff.am (groff_TESTS): Run tests.
+
 2024-01-08  G. Branden Robinson 
 
[troff]: Revise diagnostics.
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 782768c11..c90756552 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -38,7 +38,9 @@ EXTRA_DIST += src/roff/groff/groff.1.man
 groff_TESTS = \
   src/roff/groff/tests/ab_works.sh \
   src/roff/groff/tests/adjustment_works.sh \
+  src/roff/groff/tests/backslash-exclamation-early-does-not-fail.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/detect-evil-link-time-optimizer.sh \
   src/roff/groff/tests/device_control_escapes_express_basic_latin.sh \
   src/roff/groff/tests/do_not_loop_infinitely_when_breaking_cjk.sh \
@@ -64,6 +66,7 @@ groff_TESTS = \
   src/roff/groff/tests/localization_works.sh \
   src/roff/groff/tests/msoquiet_works.sh \
   src/roff/groff/tests/on_latin1_device_oq_is_0x27.sh \
+  src/roff/groff/tests/output-request-works.sh \
   src/roff/groff/tests/output_driver_C_and_G_options_work.sh \
   src/roff/groff/tests/recognize_end_of_sentence.sh \
   src/roff/groff/tests/regression_savannah_56555.sh \
diff --git a/src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh 
b/src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh
new file mode 100755
index 0..7dcf20b75
--- /dev/null
+++ b/src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Copyright (C) 2024 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"
+
+fail=
+
+wail () {
+  echo ...FAILED >&2
+  fail=YES
+}
+
+for device in ascii cp1047 dvi html xhtml latin1 lbp lj4 pdf ps utf8 \
+  X75 X75-12 X100 X100-12
+do
+  echo "checking early backslash-? escape on $device device" >&2
+  output=$(printf '\\!cA\n' "$input" | "$groff" -T $device -Z) || wail
+  echo "$output"
+done
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:
diff --git a/src/roff/groff/tests/cf-request-early-does-not-fail.sh 
b/src/roff/groff/tests/cf-request-early-does-not-fail.sh
new file mode 100755
index 0..20878a8da
--- /dev/null
+++ b/src/roff/groff/tests/cf-request-early-does-not-fail.sh
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# Copyright (C) 2024 Free Software Foundation, Inc.
+#
+# This file is part of groff.
+#
+# groff is free software; you can redistribute it and/or modify it 

[groff] 15/16: [troff]: Add unit test for `\X` escape sequence.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 2f5f9c14ae897dd164a2cc4e9c7ef7288064774e
Author: G. Branden Robinson 
AuthorDate: Tue Jan 9 08:06:02 2024 -0600

[troff]: Add unit test for `\X` escape sequence.

[troff]: Add unit test for `\X` (device control) escape sequence.

* src/roff/groff/tests/backslash-X-works.sh: Add test.
* src/roff/groff/groff.am (groff_TESTS): Run test.
---
 ChangeLog |  8 +
 src/roff/groff/groff.am   |  1 +
 src/roff/groff/tests/backslash-X-works.sh | 57 +++
 3 files changed, 66 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index c660d4ec8..0137b4536 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-01-09  G. Branden Robinson 
+
+   [troff]: Add unit test for `\X` (device control) escape
+   sequence.
+
+   * src/roff/groff/tests/backslash-X-works.sh: Add test.
+   * src/roff/groff/groff.am (groff_TESTS): Run test.
+
 2024-01-08  G. Branden Robinson 
 
[troff]: Add unit test for `device` request.
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index 94c7249bd..99a8ced95 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -38,6 +38,7 @@ EXTRA_DIST += src/roff/groff/groff.1.man
 groff_TESTS = \
   src/roff/groff/tests/ab_works.sh \
   src/roff/groff/tests/adjustment_works.sh \
+  src/roff/groff/tests/backslash-X-works.sh \
   src/roff/groff/tests/backslash-exclamation-early-does-not-fail.sh \
   src/roff/groff/tests/break_zero-length_output_line_sanely.sh \
   src/roff/groff/tests/cf-request-early-does-not-fail.sh \
diff --git a/src/roff/groff/tests/backslash-X-works.sh 
b/src/roff/groff/tests/backslash-X-works.sh
new file mode 100755
index 0..6a8e7311d
--- /dev/null
+++ b/src/roff/groff/tests/backslash-X-works.sh
@@ -0,0 +1,57 @@
+#!/bin/sh
+#
+# Copyright (C) 2024 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"
+
+fail=
+
+wail () {
+  echo ...FAILED >&2
+  fail=YES
+}
+
+# Omit the trailing newlines from input; they are supplied below.
+# 4 backslashes
+input_plain=$(printf "X'ps: nop'")
+
+# 4, 8 backslashes
+input_special=$(printf "X'pdf: [u007E]\n")
+
+for device in ascii cp1047 dvi html xhtml latin1 lbp lj4 pdf ps utf8 \
+  X75 X75-12 X100 X100-12
+do
+  echo "checking device command escape operation on $device device" >&2
+  output=$(printf "%s\n" "$input_plain" | "$groff" -T $device -Z) \
+|| wail
+  echo "$output"
+  echo "$output" | grep -q 'x * X *ps: nop' || wail
+
+  echo "checking that Unicode escape sequence is preserved on $device" \
+   " device" >&2
+  output=$(printf "%s\n" "$input_special" | "$groff" -T $device -Z) \
+|| wail
+  echo "$output"
+  # 3 backslashes
+  echo "$output" | grep -q 'x * X *pdf: \\\[u007E\]' || wail
+done
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:

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


[groff] 06/16: src/roff/troff/div.cpp: Update code style.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 142f1eebdfb401d297a1600f411c52b6e52585bb
Author: G. Branden Robinson 
AuthorDate: Mon Jan 8 05:42:27 2024 -0600

src/roff/troff/div.cpp: Update code style.

Wrap long line and add annotations.
---
 src/roff/troff/div.cpp | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 6d313ab5d..da6a00282 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -391,15 +391,17 @@ const char *top_level_diversion::get_next_trap_name()
 return next_trap->nm.contents();
 }
 
+// This is used by more than just top-level diversions.
 void top_level_diversion::output(node *nd, int retain_size,
-vunits vs, vunits post_vs, hunits width)
+vunits vs, vunits post_vs,
+hunits width)
 {
   no_space_mode = 0;
   vunits next_trap_pos;
   trap *next_trap = find_next_trap(_trap_pos);
   if (before_first_page && begin_page())
-fatal("attempting output of top-level diversion before first page"
- " has started; invoke break or flush request earlier");
+fatal("attempting diversion output before first page has started;"
+ " invoke break or flush request earlier");
   vertical_size v(vs, post_vs);
   for (node *tem = nd; tem != 0; tem = tem->next)
 tem->set_vertical_size();
@@ -441,10 +443,12 @@ void top_level_diversion::output(node *nd, int 
retain_size,
 nl_reg_contents = vertical_position.to_units();
 }
 
+// The next two member functions implement the internals of `.output`
+// and `\!`.
+
 void top_level_diversion::transparent_output(unsigned char c)
 {
   if (before_first_page && begin_page())
-// This can only happen with the .output request.
 fatal("attempting transparent output of top-level diversion before"
  " first page has started; invoke break or flush request"
  " earlier");
@@ -461,6 +465,7 @@ void top_level_diversion::transparent_output(node * /*n*/)
 error("can't transparently output node at top level");
 }
 
+// Implement the internals of `.cf`.
 void top_level_diversion::copy_file(const char *filename)
 {
   if (before_first_page && begin_page())

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


[groff] 03/16: [troff]: Restore diagnostic from groff 1.22.4.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 363fac9d0c09da8c78919ebbbd70539eb0893be5
Author: G. Branden Robinson 
AuthorDate: Tue Jan 9 07:48:38 2024 -0600

[troff]: Restore diagnostic from groff 1.22.4.

* src/roff/troff/input.cpp (encode_char): Add `else` to `if` statement
  checking the output device for the "use_charnames_in_special"
  directive (used only by grohtml(1)).  This way we once again throw a
  diagnostic upon the following input, invalid with any other output
  device.

printf '\\X@pdf: \\[u1234]@\n' | groff

  Problem introduced by me in commit eb695ab2b5, 30 October 2021.

Also fix incorrect indentation.
---
 ChangeLog| 14 ++
 src/roff/troff/input.cpp |  7 +--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fd26376f3..0bc0226b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2024-01-08  G. Branden Robinson 
+
+   [troff]: Restore diagnostic from groff 1.22.4.
+
+   * src/roff/troff/input.cpp (encode_char): Add `else` to `if`
+   statement checking the output device for the
+   "use_charnames_in_special" directive (used only by grohtml(1)).
+   This way we once again throw a diagnostic upon the following
+   input, invalid with any other output device.
+
+   printf '\\X@pdf: \\[u1234]@\n' | groff
+
+   Problem introduced by me in commit eb695ab2b5, 30 October 2021.
+
 2024-01-05  G. Branden Robinson 
 
* font/devpdf/Foundry.in: More BMI, BMR mapping swap; swap the
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index a0b987634..cf24bbcfd 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5612,9 +5612,12 @@ static void encode_char(macro *mac, char c)
mac->append(']');
  }
  else
- error("special character '%1' cannot be used within"
-   " device control escape sequence", sc);
+   error("special character '%1' cannot be used within a"
+ " device control escape sequence", sc);
}
+   else
+ error("special character '%1' cannot be used within a device"
+   " control escape sequence", sc);
   }
 }
 else if (!(tok.is_hyphen_indicator()

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


[groff] 01/16: NEWS: Document updated Perl build-dependency.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 8316aeafb4441a066fda49a7a8f5affe64948faa
Author: G. Branden Robinson 
AuthorDate: Mon Jan 8 03:34:19 2024 -0600

NEWS: Document updated Perl build-dependency.

That's life on the bleeding edge, friends.
---
 NEWS | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/NEWS b/NEWS
index 82a0433fa..adf27d093 100644
--- a/NEWS
+++ b/NEWS
@@ -172,6 +172,9 @@ o grog(1) no longer supports the `--ligatures` and `--run` 
options.
   command substitution feature of your shell; see section "Examples" of
   groff(1).
 
+o The minimum version of Perl required to build groff is now 5.8 (18
+  July 2002), incremented from 5.6.1.
+
 o The groff_diff(7) man page no longer contains examples.  They remain
   in groff's Texinfo manual.
 

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


[groff] 05/16: [troff]: Revise diagnostics.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 30333bb2fa7e09716676e914d8f9e525af837dd5
Author: G. Branden Robinson 
AuthorDate: Mon Jan 8 05:00:39 2024 -0600

[troff]: Revise diagnostics.

* src/roff/troff/div.cpp (top_level_diversion::output)
  (top_level_diversion::transparent_output)
  (top_level_diversion::copy_file): Recast diagnostic messages to be
  distinguishable and provide more information about what the problem
  is.  Make the proffered advice agnostic with respect to choice of
  control character and request renaming.
---
 ChangeLog  | 11 +++
 src/roff/troff/div.cpp | 13 ++---
 2 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index af8863151..b8195d6e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2024-01-08  G. Branden Robinson 
+
+   [troff]: Revise diagnostics.
+
+   * src/roff/troff/div.cpp (top_level_diversion::output)
+   (top_level_diversion::transparent_output)
+   (top_level_diversion::copy_file): Recast diagnostic messages to
+   be distinguishable and provide more information about what the
+   problem is.  Make the proffered advice agnostic with respect to
+   choice of control character and request renaming.
+
 2024-01-08  G. Branden Robinson 
 
[troff]: Trivially refactor.
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 0cbae5c8e..6d313ab5d 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -398,7 +398,8 @@ void top_level_diversion::output(node *nd, int retain_size,
   vunits next_trap_pos;
   trap *next_trap = find_next_trap(_trap_pos);
   if (before_first_page && begin_page())
-fatal("sorry, I didn't manage to begin the first page in time: use an 
explicit .br request");
+fatal("attempting output of top-level diversion before first page"
+ " has started; invoke break or flush request earlier");
   vertical_size v(vs, post_vs);
   for (node *tem = nd; tem != 0; tem = tem->next)
 tem->set_vertical_size();
@@ -444,7 +445,9 @@ void top_level_diversion::transparent_output(unsigned char 
c)
 {
   if (before_first_page && begin_page())
 // This can only happen with the .output request.
-fatal("sorry, I didn't manage to begin the first page in time: use an 
explicit .br request");
+fatal("attempting transparent output of top-level diversion before"
+ " first page has started; invoke break or flush request"
+ " earlier");
   const char *s = asciify(c);
   while (*s)
 the_output->transparent_char(*s++);
@@ -452,6 +455,8 @@ void top_level_diversion::transparent_output(unsigned char 
c)
 
 void top_level_diversion::transparent_output(node * /*n*/)
 {
+  // TODO: Restore this diagnostic when Savannah #65371 is fixed;
+  // perhaps suggest use of \[u] notation.
   if (getenv("GROFF_ENABLE_TRANSPARENCY_WARNINGS") != 0 /* nullptr */)
 error("can't transparently output node at top level");
 }
@@ -459,7 +464,9 @@ void top_level_diversion::transparent_output(node * /*n*/)
 void top_level_diversion::copy_file(const char *filename)
 {
   if (before_first_page && begin_page())
-fatal("sorry, I didn't manage to begin the first page in time: use an 
explicit .br request");
+fatal("attempting transparent copy of file to top-level diversion"
+ " before first page has started; invoke break or flush"
+ " request earlier");
   the_output->copy_file(page_offset, vertical_position, filename);
 }
 

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


[groff] 16/16: [troff]: Fix code style nits (static functions).

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 688c4fb37425d81200018392c12d0d9a4ad30987
Author: G. Branden Robinson 
AuthorDate: Wed Jan 10 22:35:49 2024 -0600

[troff]: Fix code style nits (static functions).

* src/roff/troff/input.cpp (device_request, device_macro_request)
  (output_request): Declare functions `static` since they do not require
  external linkage.
---
 ChangeLog| 8 
 src/roff/troff/input.cpp | 6 +++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0137b4536..a055185f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-01-10  G. Branden Robinson 
+
+   [troff]: Fix code style nits.
+
+   * src/roff/troff/input.cpp (device_request)
+   (device_macro_request, output_request): Declare functions
+   `static` since they do not require external linkage.
+
 2024-01-09  G. Branden Robinson 
 
[troff]: Add unit test for `\X` (device control) escape
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 7455d6077..8f8df4f92 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5676,7 +5676,7 @@ static node *do_special()
   return new special_node(mac);
 }
 
-void device_request()
+static void device_request()
 {
   // We can't use `has_arg()` here because we want to read in copy mode.
   int c;
@@ -5708,7 +5708,7 @@ void device_request()
   tok.next();
 }
 
-void device_macro_request()
+static void device_macro_request()
 {
   symbol s = get_name(true /* required */);
   if (!(s.is_null() || s.is_empty())) {
@@ -5723,7 +5723,7 @@ void device_macro_request()
   skip_line();
 }
 
-void output_request()
+static void output_request()
 {
   // We can't use `has_arg()` here because we want to read in copy mode.
   int c;

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


[groff] 12/16: [docs]: Fix Savannah #65118 (`device` behavior).

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit c8935f2361b44414be83a34f5e7e4b2ad57cd8b2
Author: G. Branden Robinson 
AuthorDate: Mon Jan 8 19:02:34 2024 -0600

[docs]: Fix Savannah #65118 (`device` behavior).

* doc/groff.texi (Postprocessor Access):
* man/groff_diff.7.man (New requests): Clarify a point of `device`
  request behavior; a partially collected line in the top-level
  diversion must exist at least once.

Fixes .
---
 ChangeLog|  9 +
 doc/groff.texi   |  6 ++
 man/groff_diff.7.man | 12 
 3 files changed, 27 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 6c0fde1ce..ad0a6b8f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-01-08  G. Branden Robinson 
+
+   * doc/groff.texi (Postprocessor Access):
+   * man/groff_diff.7.man (New requests): Clarify a point of
+   `device` request behavior; a partially collected line in the
+   top-level diversion must exist at least once.
+
+   Fixes .
+
 2024-01-08  G. Branden Robinson 
 
* src/roff/troff/div.cpp (top_level_diversion::output)
diff --git a/doc/groff.texi b/doc/groff.texi
index f479f47c7..b4b7fe6b1 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -16461,6 +16461,12 @@ rendered as glyphs in the output; instead, they remain 
abstract
 characters---in a PDF bookmark or a URL, for example.} The use of any
 other escape sequence in @code{\X} parameters is normally an error.
 
+A device control command issued with the @code{device} request will not
+be reflected in the output unless a partially collected line exists at
+least once in the top-level diversion (recall @ref{Diversions}).  When
+experimenting with such device controls in minimal documents, a
+@code{br} request will ensure this to be the case.
+
 @kindex use_charnames_in_special
 @cindex @file{DESC} file, and @code{use_charnames_in_special} keyword
 @cindex @code{\X}, and special characters
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index 15479e74e..1ff305aed 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -2232,6 +2232,18 @@ is stripped to allow the embedding of
 leading spaces.
 .
 .
+.P
+A device control command issued with the
+.B device
+request will not be reflected in the output unless a partially collected
+line exists in the top-level diversion at least once.
+.
+When experimenting with such device controls in minimal documents,
+a
+.B br
+request will ensure this to be the case.
+.
+.
 .TP
 .BI .devicem\~ name
 Write contents of macro or string

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


[groff] 13/16: doc/groff.texi: Fix style nits.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit be2ec136145ef72d76c620866e28c56368207e84
Author: G. Branden Robinson 
AuthorDate: Mon Jan 8 18:56:00 2024 -0600

doc/groff.texi: Fix style nits.

* Stop capitalizing "troff" in document title.
* Mark up "troff" with @command command rather than @code in more
  places.
* Bump copyright year.
* Annotate material needing a parallel in groff(7).
---
 doc/groff.texi | 13 +++--
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/doc/groff.texi b/doc/groff.texi
index b4b7fe6b1..82fe75689 100644
--- a/doc/groff.texi
+++ b/doc/groff.texi
@@ -9,7 +9,7 @@
 
 @c %**start of header (This is for running Texinfo on a region.)
 @setfilename groff.info
-@settitle The GNU Troff Manual
+@settitle The GNU troff Manual
 @setchapternewpage odd
 @footnotestyle separate
 @c %**end of header (This is for running Texinfo on a region.)
@@ -24,9 +24,9 @@
 
 
 @copying
-This manual documents GNU @code{troff} version 1.23.0+Git.
+This manual documents GNU @command{troff} version 1.23.0+Git.
 
-Copyright @copyright{} 1994--2023 Free Software Foundation, Inc.
+Copyright @copyright{} 1994--2024 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -16410,6 +16410,7 @@ returned by the function @cite{getenv@r{(3)}}.
 
 @c =
 
+@c TODO: Add a corresponding section to groff(7).
 @node Postprocessor Access, Miscellaneous, I/O, GNU troff Reference
 @section Postprocessor Access
 @cindex postprocessor access
@@ -16425,8 +16426,8 @@ each output driver's man page, such as 
@cite{gropdf@r{(1)}},
 
 @DefreqList {device, xxx @r{@dots{}}}
 @DefescListEndx {\\X, @code{'}, xxx @r{@dots{}}, @code{'}}
-Embed all @var{xxx} arguments into GNU @code{troff} output as parameters
-to a device control command @w{@samp{x X}}.  The meaning and
+Embed all @var{xxx} arguments into GNU @command{troff} output as
+parameters to a device control command @w{@samp{x X}}.  The meaning and
 interpretation of such parameters is determined by the output driver or
 other postprocessor.
 
@@ -16488,7 +16489,7 @@ However, the contents of the string or macro @var{name} 
are not
 interpreted; also it is permitted for @var{name} to have been defined as
 a macro and thus contain newlines (it is not permitted for the argument
 to @code{\X} to contain newlines).  The inclusion of newlines requires
-an extension to the @acronym{AT} @code{troff} output format, and
+an extension to the @acronym{AT} @command{troff} output format, and
 confuses drivers that do not know about this extension (@pxref{Device
 Control Commands}).
 @endDefesc

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


[groff] 11/16: [troff]: Clarify diagnostic messages.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit a8be5f9dba98ab1f8c90de5c6c8e86971b94a540
Author: G. Branden Robinson 
AuthorDate: Mon Jan 8 10:25:07 2024 -0600

[troff]: Clarify diagnostic messages.

* src/roff/troff/div.cpp (top_level_diversion::output)
  (top_level_diversion::transparent_output)
  (top_level_diversion::copy_file): Clarify diagnostic messages.

They are lengthy--troff is not a simple machine, alas.
---
 ChangeLog  |  6 ++
 src/roff/troff/div.cpp | 15 ---
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 437f38ef1..6c0fde1ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-01-08  G. Branden Robinson 
+
+   * src/roff/troff/div.cpp (top_level_diversion::output)
+   (top_level_diversion::transparent_output)
+   (top_level_diversion::copy_file): Clarify diagnostic messages.
+
 2024-01-08  G. Branden Robinson 
 
[troff]: Trivially refactor.
diff --git a/src/roff/troff/div.cpp b/src/roff/troff/div.cpp
index 36cf11773..6ac9ef017 100644
--- a/src/roff/troff/div.cpp
+++ b/src/roff/troff/div.cpp
@@ -400,8 +400,9 @@ void top_level_diversion::output(node *nd, int retain_size,
   vunits next_trap_pos;
   trap *next_trap = find_next_trap(_trap_pos);
   if (before_first_page && begin_page())
-fatal("attempting diversion output before first page has started;"
- " invoke break or flush request earlier");
+fatal("attempting diversion output before first page has started,"
+ " when a top-of-page trap is defined; invoke break or flush"
+ " request beforehand");
   vertical_size v(vs, post_vs);
   for (node *tem = nd; tem != 0; tem = tem->next)
 tem->set_vertical_size();
@@ -449,9 +450,9 @@ void top_level_diversion::output(node *nd, int retain_size,
 void top_level_diversion::transparent_output(unsigned char c)
 {
   if (before_first_page && begin_page())
-fatal("attempting transparent output of top-level diversion before"
- " first page has started; invoke break or flush request"
- " earlier");
+fatal("attempting transparent output from top-level diversion"
+ " before first page has started, when a top-of-page trap is"
+ " defined; invoke break or flush request beforehand");
   const char *s = asciify(c);
   while (*s)
 the_output->transparent_char(*s++);
@@ -470,8 +471,8 @@ void top_level_diversion::copy_file(const char *filename)
 {
   if (before_first_page && begin_page())
 fatal("attempting transparent copy of file to top-level diversion"
- " before first page has started; invoke break or flush"
- " request earlier");
+ " before first page has started, when a top-of-page trap is"
+ " defined; invoke break or flush request beforehand");
   the_output->copy_file(page_offset, vertical_position, filename);
 }
 

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


[groff] 14/16: [troff]: Add unit test for `device` request.

2024-01-10 Thread G. Branden Robinson
gbranden pushed a commit to branch master
in repository groff.

commit 76b48901e8815939636edb91040c4ff2ac2bca1a
Author: G. Branden Robinson 
AuthorDate: Mon Jan 8 19:31:59 2024 -0600

[troff]: Add unit test for `device` request.

* src/roff/groff/tests/device-request-works.sh: Add test.
* src/roff/groff/groff.am (groff_TESTS): Run test.

Fixes .
---
 ChangeLog|  9 
 src/roff/groff/groff.am  |  1 +
 src/roff/groff/tests/device-request-works.sh | 75 
 3 files changed, 85 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index ad0a6b8f6..c660d4ec8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2024-01-08  G. Branden Robinson 
+
+   [troff]: Add unit test for `device` request.
+
+   * src/roff/groff/tests/device-request-works.sh: Add test.
+   * src/roff/groff/groff.am (groff_TESTS): Run test.
+
+   Fixes .
+
 2024-01-08  G. Branden Robinson 
 
* doc/groff.texi (Postprocessor Access):
diff --git a/src/roff/groff/groff.am b/src/roff/groff/groff.am
index c90756552..94c7249bd 100644
--- a/src/roff/groff/groff.am
+++ b/src/roff/groff/groff.am
@@ -42,6 +42,7 @@ groff_TESTS = \
   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/detect-evil-link-time-optimizer.sh \
+  src/roff/groff/tests/device-request-works.sh \
   src/roff/groff/tests/device_control_escapes_express_basic_latin.sh \
   src/roff/groff/tests/do_not_loop_infinitely_when_breaking_cjk.sh \
   src/roff/groff/tests/dot-cp_register_works.sh \
diff --git a/src/roff/groff/tests/device-request-works.sh 
b/src/roff/groff/tests/device-request-works.sh
new file mode 100755
index 0..f30853676
--- /dev/null
+++ b/src/roff/groff/tests/device-request-works.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+#
+# Copyright (C) 2024 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"
+
+fail=
+
+wail () {
+  echo ...FAILED >&2
+  fail=YES
+}
+
+# A break request is necessary to create a partially collected line in
+# the top-level diversion.
+
+input_plain='.device ps: nop
+.br'
+
+input_quoted='.device " ps: nop
+.br'
+
+# We need to portably get a backslash into the string, and we can't
+# change the escape character because despite appearances, this notation
+# isn't a groff escape sequence: it's passed to the output device.
+#
+# Omit the trailing newline; it is supplied below.
+#
+# 8 backslashes
+input_special=$(printf ".device pdf: [u007E]\n.br")
+
+for device in ascii cp1047 dvi html xhtml latin1 lbp lj4 pdf ps utf8 \
+  X75 X75-12 X100 X100-12
+do
+  echo "checking 'device' request basic operation on $device device" >&2
+  output=$(printf "%s\n" "$input_plain" | "$groff" -T $device -Z) \
+|| wail
+  echo "$output"
+  echo "$output" | grep -Eq 'x * X *ps: nop' || wail
+
+  echo "checking quoteful 'device' operation on $device device" >&2
+  output=$(printf "%s\n" "$input_quoted" | "$groff" -T $device -Z) \
+|| wail
+  echo "$output"
+  # 2 spaces before '*ps:'
+  echo "$output" | grep -Eq 'x * X  *ps: nop' || wail
+
+  echo "checking that Unicode escape sequence is preserved on $device" \
+   " device" >&2
+  output=$(printf "%s\n" "$input_special" | "$groff" -T $device -Z) \
+|| wail
+  echo "$output"
+  # 3 backslashes
+  echo "$output" | grep -Eq 'x * X *pdf: \\\[u007E\]' || wail
+done
+
+test -z "$fail"
+
+# vim:set autoindent expandtab shiftwidth=2 tabstop=2 textwidth=72:

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


Re: the 'SS' (slanted symbol) font (was: Original print of V7 manual? / My own version of troff)

2024-01-10 Thread Deri
On Thursday, 11 January 2024 00:31:18 GMT Tadziu Hoffmann wrote:
> > The ordering of the S and SS fonts is immaterial here because
> > the C/A/T _had_ no SS font.
> > Nor do I see any of evidence of an "SS" font for _any_ device
> > in Documenter's Workbench 3.3 troff.
> > Barring evidence of pre-groff usage, then, I submit that the
> > slanted symbol font must be a groffism.
> 
> No disagreement here.  Neither the C/A/T nor the APS 5 had an
> SS font.  But both had a symbol font containing upright Greek
> capitals and slanted Greek lowercase letters, specifically
> intended for typesetting mathematical expressions
> (based on a century of established mathematical typesetting
> conventions[*]).
> 
> The SS is a groffism introduced to replicate this behavior
> in a compatible manner without having a symbol font with
> the above properties, in such a way that eqn could simply
> request \(*A or \(*a and troff would automatically provide
> the correct character.
> 
> [*](I'm wondering whether these conventions might not have had
> much older roots, namely in the fonts (Garamond, Didot, Porson)
> historically used to typeset some of the Greek classics,
> which similarly had "roman" uppercase and "italic" lowercase
> Greek letters.)
> 
> > > and nothing needs to be changed.
> > 
> > I disagree, because nroff output is incorrect, failing to render
> > lowercase Greek letters in italics when troff output _does_.
> 
> I see.  Since groff does not provide a usable neqn, I had never
> considered using groff for typesetting math for the terminal.
> (But see below.)
> 
> > sin ( 2 theta ) ~ = ~ 2 ~ sin theta cos theta
> > (Note to self: an eqn full space should render as a space on
> > nroff devices.  File a bug.)
> 
> No bug, simply "set thick_space 100" in eqnrc for the terminal
> devices.
> 
> In addition to this, I'd suggest not to habitually try to
> override the default spacing rules of eqn,
> 
>   sin ( 2 theta ) = 2 sin theta cos theta
> 
> since eqn already inserts thick_space around relations.
> 
> > Further, nothing in eqn documents its sensitivity to the font
> > mounting order when determining the typefaces to be used.
> > In fact that sensitivity overrides explicit configuration!
> 
> I'd assume this is a good (= flexible) thing.  Eqn requests
> character "\(*h" (= theta), and troff provides this, from
> whatever font the user has supplied that contains this
> character.
> 
> > .\" "letter" means "slanted" in GNU eqn
> > .\" This is actually redundant with the default configuration.
> 
>   .EQ
>   chartype letter \(*h
>   sin ( 2 theta ) = 2 sin theta cos theta
>   .EN
>   \(*h
> 
> Interestingly enough, the "chartype letter \(*h" is already
> sufficient to switch the thetas from eqn into italic (or
> rather, underlined) on my terminal, while the \(*h from the
> last line remains normal, i.e., this simple change already
> achieves what your proposed modification is meant to do.  (?)
> 
> (I assume this is because on the utf8 device, the theta is
> provided by a normal text font, whereas in the postscript
> device it comes from the special font.)
> 
> > >   1-4: R, I, B, BI(standard text fonts)
> > >   5:   CW (computer/monospaced)
> > >   6-9: SS, S, ZD, ZDR (special)
> > 
> > Heavens no!  "CW" is a System-V-ism.  We have CR, CI, CB, and CBI.
> 
> Yes, but it explains why there are 5 empty positions in the
> "fonts" declaration before SS, S, ZD, and ZDR.  :-)

Hi Tadziu,

For people producing greek documents who wish to use eqn, I did some testing, 
using the Tinos family of fonts (R, I, B, BI) which include greek glyphs and 
SS font for gropdf. The attached pdf shows the results with the different 
fonts colour coded. If you want to see the slanted versions for alpha and 
beta, it is best to set the family to T and select TinosR as the main font.

Cheers 

Deri


eqn.pdf
Description: Adobe PDF document


Re: the 'SS' (slanted symbol) font (was: Original print of V7 manual? / My own version of troff)

2024-01-10 Thread Tadziu Hoffmann


> The ordering of the S and SS fonts is immaterial here because
> the C/A/T _had_ no SS font.
> Nor do I see any of evidence of an "SS" font for _any_ device
> in Documenter's Workbench 3.3 troff.
> Barring evidence of pre-groff usage, then, I submit that the
> slanted symbol font must be a groffism.

No disagreement here.  Neither the C/A/T nor the APS 5 had an
SS font.  But both had a symbol font containing upright Greek
capitals and slanted Greek lowercase letters, specifically
intended for typesetting mathematical expressions
(based on a century of established mathematical typesetting
conventions[*]).

The SS is a groffism introduced to replicate this behavior
in a compatible manner without having a symbol font with
the above properties, in such a way that eqn could simply
request \(*A or \(*a and troff would automatically provide
the correct character.

[*](I'm wondering whether these conventions might not have had
much older roots, namely in the fonts (Garamond, Didot, Porson)
historically used to typeset some of the Greek classics,
which similarly had "roman" uppercase and "italic" lowercase
Greek letters.)


> > and nothing needs to be changed.

> I disagree, because nroff output is incorrect, failing to render
> lowercase Greek letters in italics when troff output _does_.

I see.  Since groff does not provide a usable neqn, I had never
considered using groff for typesetting math for the terminal.
(But see below.)


> sin ( 2 theta ) ~ = ~ 2 ~ sin theta cos theta
> (Note to self: an eqn full space should render as a space on
> nroff devices.  File a bug.)

No bug, simply "set thick_space 100" in eqnrc for the terminal
devices.

In addition to this, I'd suggest not to habitually try to
override the default spacing rules of eqn,

  sin ( 2 theta ) = 2 sin theta cos theta

since eqn already inserts thick_space around relations.


> Further, nothing in eqn documents its sensitivity to the font
> mounting order when determining the typefaces to be used.
> In fact that sensitivity overrides explicit configuration!

I'd assume this is a good (= flexible) thing.  Eqn requests
character "\(*h" (= theta), and troff provides this, from
whatever font the user has supplied that contains this
character.


> .\" "letter" means "slanted" in GNU eqn
> .\" This is actually redundant with the default configuration.

  .EQ
  chartype letter \(*h
  sin ( 2 theta ) = 2 sin theta cos theta
  .EN
  \(*h

Interestingly enough, the "chartype letter \(*h" is already
sufficient to switch the thetas from eqn into italic (or
rather, underlined) on my terminal, while the \(*h from the
last line remains normal, i.e., this simple change already
achieves what your proposed modification is meant to do.  (?)

(I assume this is because on the utf8 device, the theta is
provided by a normal text font, whereas in the postscript
device it comes from the special font.)


> >   1-4: R, I, B, BI(standard text fonts)
> >   5:   CW (computer/monospaced)
> >   6-9: SS, S, ZD, ZDR (special)

> Heavens no!  "CW" is a System-V-ism.  We have CR, CI, CB, and CBI.

Yes, but it explains why there are 5 empty positions in the
"fonts" declaration before SS, S, ZD, and ZDR.  :-)





Re: [PATCH]: Set .lt to \n[.l] in papersize.tmac?

2024-01-10 Thread Robert Thorsby

On 11/1/24 01:28, Alexis wrote:

Can you be more specific about how the proposed change renders your
documents and tooling unworkable? I'm genuinely curious.
Providing a minimal working example would be quite helpful.

Maybe you'd also like to share your understanding as to "why such
'fault' occurs" or share pointers to where an answer could be found.


To cut down on the noise -- others have given good responses to Alexis's 
concerns -- I have replied directly to Alexis off-list.


Thanks,
Robert



the 'SS' (slanted symbol) font (was: Original print of V7 manual? / My own version of troff)

2024-01-10 Thread G. Branden Robinson
At 2024-01-10T14:23:24+0100, Tadziu Hoffmann wrote:
> > Note that there is no SS for 'devpdf'. So, from where does
> > -Tpdf find (or construct) the slanted versions of the Greek
> > letters if the standard symbol font has upright Greek letters?
> > Or are the two 'S' fonts different for -Tpdf and -Tps?
> 
> In the current groff release, the slanted Greek characters
> are constructed from the characters in the standard Symbol
> font using .char in pdf.tmac:

Not just the current groff release!  This approach goes back to 2011,
the very birth of gropdf(1).

https://git.savannah.gnu.org/cgit/groff.git/commit/?id=87046b294848179768c69bb01fbbadb86921e86e

Regards,
Branden


signature.asc
Description: PGP signature


Re: [PATCH]: Set .lt to \n[.l] in papersize.tmac?

2024-01-10 Thread Oliver Corff

Hi Alexis,

you are always free to rename a copy of the macro sources and modify it
to your heart's content --- for your personal use.

Insofar, the source invites for editing, and that is definitely welcome.

If, for your own convenience only, you modify the groff macro source in
your local system, that's perfectly fine.

However, if your edit modifies a *public* source that everybody relies
on, the problems begin.

The groff user community expects a *defined* behaviour from a given
macro or set of macros, and anything that behaves differently should be
named differently.

That includes the use case that you want to reproduce documents from
earlier sources expecting identical results, which is not guaranteed
anymore if metrics are changed. The changes may not, or may, affect your
documents, but you cannot be sure without direct comparison, and if you
do not know where to search for the origin of the changes it is hard to
undo these changes.

Another possibility is that groff is used for automated toolchains of
mass production of documents, and everything from preprinted company
stationary (coloured backgrounds? patterns? company logos?) to envelope
windows might be affected. You do not want to introduce problems because
you updated your groff version, with measures different from a previous
version.

Compare it to the files containing spelling variants of hyphenation
patterns: traditional vs. new German hyphenation rules, British vs.
American English hyphenation rules etc., all differences are expressed
in files with different names.

The boilerplate header of the TeX macro set plain.tex by Donald Knuth
says it:

% This is the plain TeX format that's described in The TeXbook.
% N.B.: A version number is defined at the very end of this file;
%   please change that number whenever the file is modified!
% And don't modify the file unless you change its name:
%   Everybody's "plain.tex" file should be the same, worldwide.

% Unlimited copying and redistribution of this file are permitted as long
% as this file is not modified. Modifications are permitted, but only if
% the resulting file is not named plain.tex.[1]

Regarding your problem, I suggest you solicit more user feedback in
order to find out how far your proposed changes meet a user requirement.
You can always post a macro file with all necessary adaptations here.

Best regards,

Oliver.

[1]  /usr/local/texlive/2023/texmf-dist/tex/plain/base/plain.tex

    My personal thought: wouldn't it be a good idea to include a
similar text with the groff macros?


On 10/01/2024 15:40, Alexis wrote:

Hi Oliver,

thank you for the suggesting to put my proposed modifications in
a local macro and source that in my documents.

What are (technical) reasons against the change that you can think of?

So if the "transparent source is not an invitation to edit", as you say,
is it only shared to serve as a reference?
And what is preferred procedure to propose a change to groff if it's
not through patches to this list?


Grüße vom Landwehrkanal
Alexis


--
Dr. Oliver Corff
mailto:oliver.co...@email.de




Re: [PATCH]: Set .lt to \n[.l] in papersize.tmac?

2024-01-10 Thread G. Branden Robinson
I'm not Robert, but...

At 2024-01-10T15:28:01+0100, Alexis wrote:
> But neither seem to provide an explanation as to why .lt defaults to
> 6.5i and should be kept that way.

It's for the same reason that the line length for everything except
titles defaults to 6.5i--that value works fine for portrait U.S. letter
paper (the original AT troff default paper format), and *generally*
people want the same line length for titles as for running text.

While I don't think it's crazy to change papersize.tmac to sync the
title line length with the overall line length, this is a really tedious
point to deal with (meaning: we'll want regression tests) because macro
packages adopt two conflicting strategies to configure these things.

1.  Some packages, like mm, man(7), and mdoc, expect you to configure
page/line-dimensioning registers before loading the macro package.

2.  Others, like ms and (IIRC) me(7), instead expect you to set
appropriate registers at the top of the document to achieve this.
Preloading their registers either gets ignored or results in
incorrect values.

3.  Most macro packages don't expose a register for configuring the
title line length in particular anyway.  man(7) (and, as of groff
1.23.0, mdoc(7)), unusually, do.

4.  I can't speak to mom(7) at all.

So it's a mess.

Regards,
Branden


signature.asc
Description: PGP signature


Re: [PATCH]: Set .lt to \n[.l] in papersize.tmac?

2024-01-10 Thread Alexis
Hi Oliver,

thank you for the suggesting to put my proposed modifications in
a local macro and source that in my documents.

What are (technical) reasons against the change that you can think of?

So if the "transparent source is not an invitation to edit", as you say,
is it only shared to serve as a reference?
And what is preferred procedure to propose a change to groff if it's
not through patches to this list?


Grüße vom Landwehrkanal
Alexis



Re: [PATCH]: Set .lt to \n[.l] in papersize.tmac?

2024-01-10 Thread Alexis
Hello Robert Thorsby,

thank you for taking the time to read and reply to my email.

Can you be more specific about how the proposed change renders your
documents and tooling unworkable? I'm genuinely curious.
Providing a minimal working example would be quite helpful.

Maybe you'd also like to share your understanding as to "why such
'fault' occurs" or share pointers to where an answer could be found.

As Dave Kemper pointed out section 5.15 Line Layout of the info page
features a "drawing show[ing] the dimensions that gtroff uses for
placing a line of output onto the page", yet the only dimensions
documented in said section are: po, in, and ll; whereas the .tl and .lt
requests are documented in section 5.17 Page Layout.
But neither seem to provide an explanation as to why .lt defaults to
6.5i and should be kept that way.
Mind going into more detail which parts of the documentation
exactly you were referring to and how they explain your disapproval to
the proposed change?


Best
Alexis



Re: [TUHS] Re: Original print of V7 manual? / My own version of troff

2024-01-10 Thread Tadziu Hoffmann


> Note that there is no SS for 'devpdf'. So, from where does
> -Tpdf find (or construct) the slanted versions of the Greek
> letters if the standard symbol font has upright Greek letters?
> Or are the two 'S' fonts different for -Tpdf and -Tps?

In the current groff release, the slanted Greek characters
are constructed from the characters in the standard Symbol
font using .char in pdf.tmac:

  .char \[*a] \S'16'\[*a]\S'0'
  (etc.)
  [note special anti-recursion feature of .char]

but since the font metrics are not adapted this has some
spacing issues.

For the upcoming release I believe Deri has provided a real PFB
font file containing the slanted font plus the corresponding
font metrics file "SS" which will resolve these issues.
(Discussion on this list from June 2023.)