gbranden pushed a commit to branch master
in repository groff.

commit b9c70aa5942100828535ed91bd072cc70e3e4273
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sun Aug 11 00:50:28 2024 -0500

    [troff]: Deprecate `hpfcode` request.
    
    * src/roff/troff/input.cpp (hyphenation_patterns_file_code): Throw error
      warning of future withdrawal.
    
    * doc/groff.texi.in (Manipulating Hyphenation):
    * man/groff_diff.7.man (New requests):
    * man/groff.7.man (Request short reference):
    * NEWS: Document deprecation.
---
 ChangeLog                | 10 ++++++++++
 NEWS                     |  5 +++++
 doc/groff.texi.in        | 29 ++++++++++++++++-------------
 man/groff.7.man          | 17 ++++++++++++-----
 man/groff_diff.7.man     | 19 +++++++++++--------
 src/roff/troff/input.cpp |  2 ++
 6 files changed, 56 insertions(+), 26 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fbcc2e4af..9b6045f3e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2024-08-11  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (hyphenation_patterns_file_code):
+       Throw error warning of future withdrawal.
+
+       * doc/groff.texi.in (Manipulating Hyphenation):
+       * man/groff_diff.7.man (New requests):
+       * man/groff.7.man (Request short reference):
+       * NEWS: Document deprecation.
+
 2024-08-10  G. Branden Robinson <[email protected]>
 
        * tmac/tty.tmac: Revise fallback character for `\[em]` on UTF-8
diff --git a/NEWS b/NEWS
index 208370027..c9998e868 100644
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,11 @@ VERSION next
 troff
 -----
 
+o The `hpfcode` request now emits an error when used, advising of its
+  planned withdrawal, but then proceeds with normal behavior.  The
+  replacement mechanism, the `hcode` request, has existed since groff
+  1.02 (June 1991) at the latest.
+
 o The `mso` request no longer attempts to open a macro file named, say,
   "tmac.s" if "s.tmac" was specified in the argument and not found, or
   vice versa.  This feature was a convenience for some old AT&T troff
diff --git a/doc/groff.texi.in b/doc/groff.texi.in
index 643bd9032..43cb660da 100644
--- a/doc/groff.texi.in
+++ b/doc/groff.texi.in
@@ -8861,8 +8861,7 @@ register @samp{.hydefault}; it is associated with the 
environment
 
 @need 200
 @DefreqList {hpf, pattern-file}
-@DefreqItemx {hpfa, pattern-file}
-@DefreqListEndx {hpfcode, a b [c d] @dots{}}
+@DefreqListEndx {hpfa, pattern-file}
 @cindex hyphenation patterns (@code{hpf})
 @cindex patterns for hyphenation (@code{hpf})
 Read hyphenation patterns from @var{pattern-file}, which is sought
@@ -8909,17 +8908,6 @@ file is treated as a list of hyphenation patterns 
(except that the
 
 The @code{hpfa} request appends a file of patterns to the current list.
 
-The @code{hpfcode} request defines mapping values for character codes in
-pattern files.  It is an older mechanism no longer used by GNU
-@code{troff}'s own macro files; for its successor, see @code{hcode}
-below.  @code{hpf} or @code{hpfa} apply the mapping after reading the
-patterns but before replacing or appending to the active list of
-patterns.  Its arguments are pairs of character codes---integers from 0
-to@tie{}255.  The request maps character code@tie{}@var{a} to
-code@tie{}@var{b}, code@tie{}@var{c} to code@tie{}@var{d}, and so on.
-Character codes that would otherwise be invalid in GNU @code{troff} can
-be used.
-
 @cindex localization
 @pindex troffrc
 @pindex cs.tmac
@@ -9001,6 +8989,21 @@ The @code{phcode} request may be helpful to troubleshoot 
hyphenation
 code assignments.  @xref{Debugging}.
 @endDefreq
 
+@Defreq {hpfcode, a b [c d] @dots{}}
+@strong{Caution:@:} This request will be withdrawn in a future
+@code{groff} release.  Use @code{hcode} instead.
+
+The @code{hpfcode} request defines mapping values for character codes in
+pattern files.  It is an older mechanism no longer used by GNU
+@command{troff}'s own macro files.  @code{hpf} or @code{hpfa} apply the
+mapping after reading the patterns but before replacing or appending to
+the active list of patterns.  Its arguments are pairs of character
+codes---integers from 0 to@tie{}255.  The request maps character
+code@tie{}@var{a} to code@tie{}@var{b}, code@tie{}@var{c} to
+code@tie{}@var{d}, and so on.  Character codes that would otherwise be
+invalid in GNU @command{troff} can be used.
+@endDefreq
+
 @DefreqList {hla, [@Var{lang}]}
 @DefregListEndx {.hla}
 @cindex @code{hpf} request, and hyphenation language
diff --git a/man/groff.7.man b/man/groff.7.man
index 03c798bb6..b3c1ef163 100644
--- a/man/groff.7.man
+++ b/man/groff.7.man
@@ -3396,11 +3396,18 @@ Append hyphenation patterns from
 .
 .TPx
 .REQ .hpfcode "a b \fR[\fPc d\fR] .\|.\|.\fP"
-Define mappings for character codes in hyphenation pattern files read
-with
-.request .hpf
-and
-.request .hpfa .
+.B Caution:
+This request will be withdrawn in a future
+.I groff
+release.
+.
+Use
+.B hcode
+instead.
+.
+.
+.IP
+Define mappings for character codes in hyphenation pattern files.
 .
 .TPx
 .REQ .hw "word \fR.\|.\|.\fP"
diff --git a/man/groff_diff.7.man b/man/groff_diff.7.man
index e4eed9709..43392cd5c 100644
--- a/man/groff_diff.7.man
+++ b/man/groff_diff.7.man
@@ -2837,7 +2837,7 @@ character is still recognized as the start of a comment).
 .
 .IP
 Use the
-.B hpfcode
+.B hcode
 request
 (see below)
 to map the encoding used in hyphenation pattern files to
@@ -2923,15 +2923,18 @@ of the environment.
 .TP
 .BI .hpfcode\~ "a b"\c
 .RI \~[ "c d" "] .\|.\|."
-Define mapping values for character codes in pattern files.
+.B Caution:
+This request will be withdrawn in a future
+.I groff
+release.
 .
-This is an older mechanism no longer used by
-.IR groff 's
-own macro files;
-for its successor,
-see
+Use
 .B hcode
-above.
+instead.
+.
+.
+.IP
+Define mapping values for character codes in pattern files.
 .
 .B hpf
 or
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 7a4426c16..86c1d5997 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -7379,6 +7379,8 @@ static void report_hyphenation_codes()
 
 void hyphenation_patterns_file_code()
 {
+  error("'hpfcode' request will be withdrawn in a future groff release;"
+        " migrate to 'hcode'");
   tok.skip();
   while (!tok.is_newline() && !tok.is_eof()) {
     int n1, n2;

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

Reply via email to