gbranden pushed a commit to branch master
in repository groff.

commit 0629380a9d464c74d6dd205384bc255e1015c2f4
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Aug 3 18:36:42 2024 -0500

    tmac/*: Refactor hyphenation code declarations.
    
    Move `hcode` invocations from language-specific macro files (those that
    define a "groff locale", such as "english" or "german") to the macro
    files that support 8-bit character encodings, because in the formatter,
    hyphenation codes are global, not environment-specific like other
    hyphenation data.  (That design decision is worth reconsidering in the
    future, but feels less urgent than adding UTF-8 input support to the
    formatter, which may obviate some encoding-related issues.)
    
    * tmac/LOCALIZATION: Relieve groff locale contributor of hyphenation
      code definition duty.
    * tmac/de.tmac: Move Latin-1 hyphenation code definitions from here...
    * tmac/latin1.tmac: ...to here.  Reorganize and cover _every_ letter
      glyph in ISO 8859-1, including Icelandic letters that German
      hyphenation patterns don't require.
    * tmac/ru.tmac: Move KOI8-R hyphenation code definitions from here...
    * tmac/koi8-r.tmac: ...to here.
    * tmac/latin2.tmac: Define Latin-2 hyphenation codes.
    * tmac/latin5.tmac: Define Latin-5 hyphenation codes.  Include the
      notorious special case for the Turkish capital dotted I, and annotate
      it for migration in the event we ever get a "tr.tmac" file, because
      this is a language-specific case mapping, not one strictly implied by
      the character encoding.
    * tmac/latin9.tmac: Define Latin-9 (ISO 8859-15) hyphenation codes.
    
    Thanks to Werner Lemberg for the discussion in <https://lists.gnu.org/
    archive/html/groff/2024-08/msg00001.html>.
---
 ChangeLog         | 35 ++++++++++++++++++++
 tmac/LOCALIZATION |  8 ++---
 tmac/de.tmac      | 18 -----------
 tmac/koi8-r.tmac  | 42 +++++++++++++++++++++++-
 tmac/latin1.tmac  | 67 +++++++++++++++++++++++++++++++++++++++
 tmac/latin2.tmac  | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 tmac/latin5.tmac  | 75 ++++++++++++++++++++++++++++++++++++++++++-
 tmac/latin9.tmac  | 77 +++++++++++++++++++++++++++++++++++++++++++-
 tmac/ru.tmac      | 36 +--------------------
 9 files changed, 391 insertions(+), 62 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 496be617a..b3c23e58a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,38 @@
+2024-08-03  G. Branden Robinson <[email protected]>
+
+       tmac/*: Refactor hyphenation code declarations.
+
+       Move `hcode` invocations from language-specific macro files
+       {those that define a "groff locale", such as "english" or
+       "german"} to the macro files that support 8-bit character
+       encodings, because in the formatter, hyphenation codes are
+       global, not environment-specific like other hyphenation data.
+       {That design decision is worth reconsidering in the future,
+       but feels less urgent than adding UTF-8 input support to the
+       formatter, which may obviate some encoding-related issues.}
+
+       * tmac/LOCALIZATION: Relieve groff locale contributor of
+       hyphenation code definition duty.
+       * tmac/de.tmac: Move Latin-1 hyphenation code definitions from
+       here...
+       * tmac/latin1.tmac: ...to here.  Reorganize and cover _every_
+       letter glyph in ISO 8859-1, including Icelandic letters that
+       German hyphenation patterns don't require.
+       * tmac/ru.tmac: Move KOI8-R hyphenation code definitions from
+       here...
+       * tmac/koi8-r.tmac: ...to here.
+       * tmac/latin2.tmac: Define Latin-2 hyphenation codes.
+       * tmac/latin5.tmac: Define Latin-5 hyphenation codes.  Include
+       the notorious special case for the Turkish capital dotted I, and
+       annotate it for migration in the event we ever get a "tr.tmac"
+       file, because this is a language-specific case mapping, not one
+       strictly implied by the character encoding.
+       * tmac/latin9.tmac: Define Latin-9 (ISO 8859-15) hyphenation
+       codes.
+
+       Thanks to Werner Lemberg for the discussion in <https://
+       lists.gnu.org/archive/html/groff/2024-08/msg00001.html>.
+
 2024-07-31  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp (set_hyphenation_codes): Accept a
diff --git a/tmac/LOCALIZATION b/tmac/LOCALIZATION
index f123fe716..ed9b6c5ca 100644
--- a/tmac/LOCALIZATION
+++ b/tmac/LOCALIZATION
@@ -20,12 +20,10 @@ hyphenation pattern files.
             \lefthyphenmin=2, \righthyphenmin=2 => 1
             \lefthyphenmin=2, \righthyphenmin=3 => 4
             \lefthyphenmin=1, \righthyphenmin=2 => 32
-    F.  Hyphenation codes appropriate to the hyphenation pattern files
-        for the locale are set with the .hcode request.
-    G.  The hyphenation language is set with the .hla request.
-    H.  Support for the character encoding used by the hyphenation
+    F.  The hyphenation language is set with the .hla request.
+    G.  Support for the character encoding used by the hyphenation
         pattern files is loaded with the .mso request.
-    I.  Hyphenation pattern and exception files are loaded with the .hpf
+    H.  Hyphenation pattern and exception files are loaded with the .hpf
         and .hpfa requests.
 
 2.  A locale-independent file (trans.tmac) activates the localized
diff --git a/tmac/de.tmac b/tmac/de.tmac
index 64d6a2339..8a1169626 100644
--- a/tmac/de.tmac
+++ b/tmac/de.tmac
@@ -172,24 +172,6 @@
 .
 .rr locale*use-trap-hyphenation-mode
 .
-.hcode � �  � �  � �  � �  � �  � �  � �
-.hcode � �
-.hcode � �  � �  � �  � �
-.hcode � �  � �  � �  � �
-.hcode � �
-.hcode � �  � �  � �  � �  � �
-.hcode � �  � �  � �
-.
-.hcode � �  � �  � �  � �  � �  � �  � �
-.hcode � �
-.hcode � �  � �  � �  � �
-.hcode � �  � �  � �  � �
-.hcode � �
-.hcode � �  � �  � �  � �  � �
-.hcode � �  � �  � �
-.
-.hcode � �
-.
 .hla de
 .ie r \*[locale]-new-hyphenation-patterns \
 .  hpf hyphen.den
diff --git a/tmac/koi8-r.tmac b/tmac/koi8-r.tmac
index dd1402908..ea9447858 100644
--- a/tmac/koi8-r.tmac
+++ b/tmac/koi8-r.tmac
@@ -71,11 +71,51 @@
 .trin \[char253]\[u0429]
 .trin \[char254]\[u0427]
 .trin \[char255]\[u042A]
+.
+.\" Set up hyphenation codes for letter-like characters above.
+.\" Each small letter from KOI8-R gets its own hyphenation code; each
+.\" capital letter is assigned the code of its small counterpart.
+.
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.hcode � �  � �
+.
 .cp \n[*groff_koi8-r_tmac_C]
 .do rr *groff_koi8-r_tmac_C
 .
 .\" Local Variables:
 .\" mode: nroff
+.\" coding: cyrillic-koi8
 .\" fill-column: 72
 .\" End:
-.\" vim: set filetype=groff textwidth=72:
+.\" vim: set fileencoding=koi8-r filetype=groff textwidth=72:
diff --git a/tmac/latin1.tmac b/tmac/latin1.tmac
index 19e6e5e9d..6ade0582d 100644
--- a/tmac/latin1.tmac
+++ b/tmac/latin1.tmac
@@ -107,11 +107,78 @@
 .trin \[char253]\['y]
 .trin \[char254]\[Tp]
 .trin \[char255]\[:y]
+.
+.\" Set up hyphenation codes for letter-like characters above.
+.\" Each small letter from ISO 8859-1 gets its own hyphenation code;
+.\" each capital letter is assigned the code of its small counterpart.
+.\" Some small letters have no capital form in the encoding.
+.
+.hcode � �
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.
+.hcode � �
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.
 .cp \n[*groff_latin1_tmac_C]
 .do rr *groff_latin1_tmac_C
 .
 .\" Local Variables:
 .\" mode: nroff
+.\" coding: latin-1
 .\" fill-column: 72
 .\" End:
 .\" vim: set filetype=groff textwidth=72:
diff --git a/tmac/latin2.tmac b/tmac/latin2.tmac
index b45c7a962..ee81be0b0 100644
--- a/tmac/latin2.tmac
+++ b/tmac/latin2.tmac
@@ -233,11 +233,104 @@
 .trin \[char253]\['y]
 .trin \[char254]\[t ac]
 .trin \[char255]\[a.]
+.
+.\" Set up hyphenation codes for letter-like characters above.
+.\" Each small letter from ISO 8859-2 gets its own hyphenation code;
+.\" each capital letter is assigned the code of its small counterpart.
+.\" Some small letters have no capital form in the encoding.
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.
+.hcode � �
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.
 .cp \n[*groff_latin2_tmac_C]
 .do rr *groff_latin2_tmac_C
 .
 .\" Local Variables:
 .\" mode: nroff
+.\" coding: latin-2
 .\" fill-column: 72
 .\" End:
-.\" vim: set filetype=groff textwidth=72:
+.\" vim: set fileencoding=iso-8859-2 filetype=groff textwidth=72:
diff --git a/tmac/latin5.tmac b/tmac/latin5.tmac
index 0cdc63c5e..75ebb33c5 100644
--- a/tmac/latin5.tmac
+++ b/tmac/latin5.tmac
@@ -125,11 +125,84 @@
 .trin \[char253]\[.i]
 .trin \[char254]\[s ,]
 .trin \[char255]\[:y]
+.
+.\" Set up hyphenation codes for letter-like characters above.
+.\" Each small letter from ISO 8859-9 gets its own hyphenation code;
+.\" each capital letter is assigned the code of its small counterpart.
+.\" Some small letters have no capital form in the encoding.
+.
+.hcode � �
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.
+.hcode � �
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � i \" exceptional case; move to tr.tmac if we ever get one
+.hcode � �
+.
 .cp \n[*groff_latin5_tmac_C]
 .do rr *groff_latin5_tmac_C
 .
 .\" Local Variables:
 .\" mode: nroff
+.\" coding: latin-5
 .\" fill-column: 72
 .\" End:
-.\" vim: set filetype=groff textwidth=72:
+.\" vim: set fileencoding=iso-8859-9 filetype=groff textwidth=72:
diff --git a/tmac/latin9.tmac b/tmac/latin9.tmac
index 4b80075c5..be23f0d60 100644
--- a/tmac/latin9.tmac
+++ b/tmac/latin9.tmac
@@ -129,11 +129,86 @@
 .trin \[char253]\['y]
 .trin \[char254]\[Tp]
 .trin \[char255]\[:y]
+.
+.\" Set up hyphenation codes for letter-like characters above.
+.\" Each small letter from ISO 8859-1 gets its own hyphenation code;
+.\" each capital letter is assigned the code of its small counterpart.
+.\" Some small letters have no capital form in the encoding.
+.
+.hcode � �
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.hcode � �
+.
 .cp \n[*groff_latin9_tmac_C]
 .do rr *groff_latin9_tmac_C
 .
 .\" Local Variables:
 .\" mode: nroff
+.\" coding: latin-9
 .\" fill-column: 72
 .\" End:
-.\" vim: set filetype=groff textwidth=72:
+.\" vim: set fileencoding=iso-8859-15 filetype=groff textwidth=72:
diff --git a/tmac/ru.tmac b/tmac/ru.tmac
index 2914072ed..b55c1eec6 100644
--- a/tmac/ru.tmac
+++ b/tmac/ru.tmac
@@ -182,39 +182,6 @@ Cyrillic script
 .  \}
 .\}
 .
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
-.hcode � �  � �
 .
 .hla ru
 .hpf hyphen.ru
@@ -240,5 +207,4 @@ Cyrillic script
 .\" coding: cyrillic-koi8
 .\" fill-column: 72
 .\" End:
-.\" XXX: Vim 8.2 does not handle koi8-r correctly.
-.\" vim: set filetype=groff textwidth=72:
+.\" vim: set fileencoding=koi8-r filetype=groff textwidth=72:

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to