diff options
author | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-02-23 00:55:29 +1100 |
---|---|---|
committer | G. Branden Robinson <g.branden.robinson@gmail.com> | 2022-02-23 01:58:28 +1100 |
commit | 920fff1cf59d38bacd9b1b99b3d1ce3ce4e1e13f (patch) | |
tree | 070ba59e2aa69b7c6f3a2d79c9710812a26d7eaf /tmac/sv.tmac | |
parent | 254a2cc54e685289d460ddc50090fecc2ad291f0 (diff) | |
download | groff-git-920fff1cf59d38bacd9b1b99b3d1ce3ce4e1e13f.tar.gz |
[man,mdoc,me]: Revise hyphenation localization.
* tmac/an.tmac (an*reset-hyphenation-mode): New macro sets the
hyphenation mode appropriate to the locale depending on the values of
`cR` (continuous rendering mode) and `HY` (hyphenation enablement);
the latter is now interpreted as a Boolean. Define new register
`an*hyphenation-mode` reflecting these conditions.
(TH): Call the foregoing instead of invoking `hy` request.
(MR): Restore hyphenation mode to `an*hyphenation-mode`.
(initializtion): Simplify; if not defined, set `HY` to 1.
* tmac/e.tmac (ld): Set the hyphenation mode here instead of in
initialization (which already calls this macro). Set the mode to 6
for the benefit of anyone borrowing our me(7) changes, but then
immediately change to the mode determinated by the localization file.
* tmac/mdoc/doc-common (doc-hyphen-flags): Set an hyphenation mode
appropriate to the locale depending on the values of `cR` and `HY`.
* tmac/mdoc/doc-ditroff:
* tmac/mdoc/doc-nroff: Simplify initialization; if not defined, set `HY`
to 1.
* tmac/cs.tmac:
* tmac/de.tmac:
* tmac/en.tmac:
* tmac/fr.tmac:
* tmac/it.tmac:
* tmac/sv.tmac: Before switching locales, set a flag if troublesome bit
2 of the hyphenation mode is set so that we can preserve it. Shift
man(7) and me(7) logic to follow setup of the new hyphenation mode;
for the former, call the new `an*reset-hyphenation-mode`.
* tmac/groff_man.7.man.in:
* tmac/groff_mdoc.7.man: Document updated meaning of `HY` register.
* NEWS: Add item noting change of man(7) `HY`'s meaning. Update
existing item regarding mdoc(7)'s support for it (groff 1.22.4 mdoc(7)
didn't recognize the register at all).
Fixes <https://savannah.gnu.org/bugs/?61734> (for real this time?).
Diffstat (limited to 'tmac/sv.tmac')
-rw-r--r-- | tmac/sv.tmac | 52 |
1 files changed, 31 insertions, 21 deletions
diff --git a/tmac/sv.tmac b/tmac/sv.tmac index 3e2102272..f2fbef401 100644 --- a/tmac/sv.tmac +++ b/tmac/sv.tmac @@ -1,6 +1,6 @@ .\" Swedish localization for groff .\" -.\" Copyright (C) 2006-2020 Free Software Foundation, Inc. +.\" Copyright (C) 2006-2022 Free Software Foundation, Inc. .\" Written by Werner Lemberg (wl@gnu.org) .\" .\" This file is part of groff. @@ -25,6 +25,14 @@ .cp 0 . . +.\" If changing from an existing locale, we need to preserve the state +.\" of the "suppress hyphenation before a page location trap" bit. +.nr locale*use-trap-hyphenation-mode 0 +.if d locale \ +. if \n[.hy]=\n[\*[locale]*hyphenation-mode-trap] \ +. nr locale*use-trap-hyphenation-mode 1 +. +. .ds locale swedish\" . . @@ -114,13 +122,6 @@ .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 @@ -133,26 +134,23 @@ .\" mm package -- additional Swedish localization is done in mse.tmac . . -.\" me package -.if d @R \{\ -. ds _td_format \En(dy \E*(mo \En(y4 -. ld -.\} -. -. .\" Default encoding .mso latin1.tmac . .ss 12 0 . +.\" Set up hyphenation. +. .\" Swedish hyphenation (\lefthyphenmin=1, \righthyphenmin=2) -.\" -.\" 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 +.nr \*[locale]*hyphenation-mode-base 32 +.nr \*[locale]*hyphenation-mode-trap 34 +. +.ie \n[locale*use-trap-hyphenation-mode] \ +. hy \n[\*[locale]*hyphenation-mode-trap] .el \ -. hy 32 +. hy \n[\*[locale]*hyphenation-mode-base] +. +.rr locale*use-trap-hyphenation-mode . .hcode å å Å å .hcode ä ä Ä ä @@ -163,6 +161,18 @@ .hpf hyphen.sv . . +.\" man package +.if d an \ +. an*reset-hyphenation-mode +. +. +.\" me package +.if d @R \{\ +. ds _td_format \En(dy \E*(mo \En(y4 +. ld +.\} +. +. .cp \n[*groff_sv_tmac_C] .do rr *groff_sv_tmac_C . |