groff-commit
[Top][All Lists]
Advanced

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

[groff] 17/47: [tmac]: Manage hyphenation mode more carefully.


From: G. Branden Robinson
Subject: [groff] 17/47: [tmac]: Manage hyphenation mode more carefully.
Date: Tue, 11 Jan 2022 06:33:15 -0500 (EST)

gbranden pushed a commit to branch master
in repository groff.

commit 2a36cf12b865be4c1df1c27139b1c58798cafb60
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Fri Jan 7 04:36:21 2022 +1100

    [tmac]: Manage hyphenation mode more carefully.
    
    ...in localization packages.
    
    * tmac/{cs,de,it,sv}.tmac: Localize the man(7) package's HY register.
    
    * tmac/{cs,de,fr,it,sv}.tmac: When localizing the ms(7) package, use
      mode "2" instead of "3": the 'hy' request complains of contradictory
      hyphenation modes if "3" is used (the semantics of the hyphenation
      mode are complex and non-orthogonal; see groff(7) or our Texinfo
      manual).
    
    * tmac/{cs,de,en,fr,it,sv}.tmac: If the one language-independent
      hyphenation bit (don't hyphenate just prior to a page location trap)
      is set, preserve it; this way a system's troffrc or a macro package
      can set it and it will not get turned off by the localization package,
      which for best results should be loaded after any full-service package
      (and any auxiliary package requiring localized strings, though none
      are yet distributed with groff).
    
    Also drop comments (regarding man page packages) that are growing stale.
---
 ChangeLog    | 23 +++++++++++++++++++++++
 tmac/cs.tmac | 22 +++++++++++++++++-----
 tmac/de.tmac | 20 +++++++++++++++-----
 tmac/en.tmac | 13 ++++++++-----
 tmac/fr.tmac | 14 +++++++++-----
 tmac/it.tmac | 21 ++++++++++++++++-----
 tmac/sv.tmac | 21 ++++++++++++++++-----
 7 files changed, 104 insertions(+), 30 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1115f3de..07a80ee0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+2022-01-06  G. Branden Robinson <g.branden.robinson@gmail.com>
+
+       [tmac]: Manage hyphenation mode more carefully in localization
+       packages.
+
+       * tmac/{cs,de,it,sv}.tmac: Localize the man(7) package's HY
+       register.
+
+       * tmac/{cs,de,fr,it,sv}.tmac: When localizing the ms(7) package,
+       use mode "2" instead of "3": the 'hy' request complains of
+       contradictory hyphenation modes if "3" is used (the semantics of
+       the hyphenation mode are complex and non-orthogonal; see
+       groff(7) or our Texinfo manual).
+
+       * tmac/{cs,de,en,fr,it,sv}.tmac: If the one language-independent
+       hyphenation bit (don't hyphenate just prior to a page location
+       trap) is set, preserve it; this way a system's troffrc or a
+       macro package can set it and it will not get turned off by the
+       localization package, which for best results should be loaded
+       after any full-service package (and any auxiliary package
+       requiring localized strings, though none are yet distributed
+       with groff).
+
 2022-01-06  G. Branden Robinson <g.branden.robinson@gmail.com>
 
        [tmac]: Add unit test for localization macro files.  Right now
diff --git a/tmac/cs.tmac b/tmac/cs.tmac
index 69a7c3a3..d7050866 100644
--- a/tmac/cs.tmac
+++ b/tmac/cs.tmac
@@ -114,12 +114,19 @@
 .mso trans.tmac
 .
 .
+.\" man package
+.if d an \{\
+.      ie \n[cR] .nr HY 1
+.      el        .nr HY 2
+.\}
+.
+.
 .\" ms package
 .if r GS \{\
 .      \" update the date
 .      ds DY \n[dy] \*[MO] \n[year]
 .      \" set hyphenation flags
-.      nr HY 3 \" 1+2
+.      nr HY 2
 .\}
 .
 .
@@ -157,7 +164,15 @@
 .ss 12 0
 .
 .\" Czech hyphenation (\lefthyphenmin=2, \righthyphenmin=2)
-.hy 1
+.\"
+.\" Hyphenation value 2 (bit 1) may already have been set by troffrc or
+.\" a macro package; preserve it.
+.ie (\n[.hy]%2=0 & (\n[.hy]%4)) \
+.      hy 2
+.el \
+.      hy 1
+.\}
+.
 .hcode � �  � �
 .hcode � �  � �
 .hcode � �  � �
@@ -179,9 +194,6 @@
 .hpfa hyphenex.cs
 .
 .
-.\" man, mdoc and mdoc-old are intentionally left untouched: usually
-.\" these packages are translated in the sources of the documents.
-.
 .cp \n[*groff_cs_tmac_C]
 .do rr *groff_cs_tmac_C
 .
diff --git a/tmac/de.tmac b/tmac/de.tmac
index 398b920a..3690349c 100644
--- a/tmac/de.tmac
+++ b/tmac/de.tmac
@@ -114,12 +114,19 @@
 .mso trans.tmac
 .
 .
+.\" man package
+.if d an \{\
+.      ie \n[cR] .nr HY 1
+.      el        .nr HY 2
+.\}
+.
+.
 .\" ms package
 .if r GS \{\
 .      \" update the date
 .      ds DY \n[dy].\~\*[MO] \n[year]
 .      \" set hyphenation flags
-.      nr HY 3 \" 1+2
+.      nr HY 2
 .\}
 .
 .
@@ -157,7 +164,13 @@
 .ss 12 0
 .
 .\" German hyphenation (\lefthyphenmin=2, \righthyphenmin=2)
-.hy 1
+.\"
+.\" Hyphenation value 2 (bit 1) may already have been set by troffrc or
+.\" a macro package; preserve it.
+.ie (\n[.hy]%2=0 & (\n[.hy]%4)) \
+.      hy 2
+.el \
+.      hy 1
 .
 .hcode � �  � �  � �  � �  � �  � �  � �
 .hcode � �
@@ -184,9 +197,6 @@
 .  hpf hyphen.det
 .
 .
-.\" man, mdoc and mdoc-old are intentionally left untouched: usually
-.\" these packages are translated in the sources of the documents.
-.
 .cp \n[*groff_de_tmac_C]
 .do rr *groff_de_tmac_C
 .
diff --git a/tmac/en.tmac b/tmac/en.tmac
index 6f0784fb..45dafa40 100644
--- a/tmac/en.tmac
+++ b/tmac/en.tmac
@@ -28,13 +28,16 @@
 .
 .ss 12
 .
-.\" Set the minimum hyphenation mode that works with the patterns.
-.hy 4
+.\" English hyphenation (\lefthyphenmin=2, \righthyphenmin=3)
+.\"
+.\" Hyphenation value 2 (bit 1) may already have been set by troffrc or
+.\" a macro package; preserve it.
+.ie (\n[.hy]%2=0 & (\n[.hy]%4)) \
+.      hy 6
+.el \
+.      hy 4
 .
-.\" Set the hyphenation language to English.
 .hla en
-.
-.\" Load hyphenation patterns and exceptions.
 .hpf hyphen.en
 .hpfa hyphenex.en
 .
diff --git a/tmac/fr.tmac b/tmac/fr.tmac
index 6043d9ee..0d81c436 100644
--- a/tmac/fr.tmac
+++ b/tmac/fr.tmac
@@ -119,7 +119,7 @@
 .      \" update the date
 .      ds DY \n[dy] \*[MO] \n[year]
 .      \" set hyphenation flags
-.      nr HY 6 \" 4+2
+.      nr HY 6
 .\}
 .
 .
@@ -157,7 +157,14 @@
 .ss 12 0
 .
 .\" French hyphenation (\lefthyphenmin=2, \righthyphenmin=3)
-.hy 4
+.\"
+.\" Hyphenation value 2 (bit 1) may already have been set by troffrc or
+.\" a macro package; preserve it.
+.ie (\n[.hy]%2=0 & (\n[.hy]%4)) \
+.      hy 6
+.el \
+.      hy 4
+.
 .hcode � �  � �
 .hcode � �  � �
 .hcode � �  � �
@@ -178,9 +185,6 @@
 .hpf hyphen.fr
 .
 .
-.\" man, mdoc and mdoc-old are intentionally left untouched: usually
-.\" these packages are translated in the sources of the documents.
-.
 .cp \n[*groff_fr_tmac_C]
 .do rr *groff_fr_tmac_C
 .
diff --git a/tmac/it.tmac b/tmac/it.tmac
index 539aef2f..29e385f8 100644
--- a/tmac/it.tmac
+++ b/tmac/it.tmac
@@ -114,12 +114,19 @@
 .mso trans.tmac
 .
 .
+.\" man package
+.if d an \{\
+.      ie \n[cR] .nr HY 1
+.      el        .nr HY 2
+.\}
+.
+.
 .\" ms package
 .if r GS \{\
 .      \" update the date
 .      ds DY \n[dy] \*[MO] \n[year]
 .      \" set hyphenation flags
-.      nr HY 3 \" 1+2
+.      nr HY 2
 .\}
 .
 .
@@ -155,14 +162,18 @@
 .
 .
 .\" Italian hyphenation (\lefthyphenmin=2, \righthyphenmin=2)
-.hy 1
+.\"
+.\" Hyphenation value 2 (bit 1) may already have been set by troffrc or
+.\" a macro package; preserve it.
+.ie (\n[.hy]%2=0 & (\n[.hy]%4)) \
+.      hy 2
+.el \
+.      hy 1
+.
 .hla it
 .hpf hyphen.it
 .
 .
-.\" man, mdoc and mdoc-old are intentionally left untouched: usually
-.\" these packages are translated in the sources of the documents.
-.
 .cp \n[*groff_it_tmac_C]
 .do rr *groff_it_tmac_C
 .
diff --git a/tmac/sv.tmac b/tmac/sv.tmac
index d41e4d5e..3e210227 100644
--- a/tmac/sv.tmac
+++ b/tmac/sv.tmac
@@ -114,12 +114,19 @@
 .mso trans.tmac
 .
 .
+.\" man package
+.if d an \{\
+.      ie \n[cR] .nr HY 32
+.      el        .nr HY 34
+.\}
+.
+.
 .\" ms package
 .if r GS \{\
 .      \" update the date
 .      ds DY \n[dy] \*[MO] \n[year]
 .      \" set hyphenation flags
-.      nr HY 34 \" 32+2
+.      nr HY 34
 .\}
 .
 .
@@ -139,7 +146,14 @@
 .ss 12 0
 .
 .\" Swedish hyphenation (\lefthyphenmin=1, \righthyphenmin=2)
-.hy 32
+.\"
+.\" Hyphenation value 2 (bit 1) may already have been set by troffrc or
+.\" a macro package; preserve it.
+.ie (\n[.hy]%2=0 & (\n[.hy]%4)) \
+.      hy 34
+.el \
+.      hy 32
+.
 .hcode � �  � �
 .hcode � �  � �
 .hcode � �  � �
@@ -149,9 +163,6 @@
 .hpf hyphen.sv
 .
 .
-.\" man, mdoc and mdoc-old are intentionally left untouched: usually
-.\" these packages are translated in the sources of the documents.
-.
 .cp \n[*groff_sv_tmac_C]
 .do rr *groff_sv_tmac_C
 .



reply via email to

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