Update of bug #67617 (group groff):

                  Status:             In Progress => Fixed
             Open/Closed:                    Open => Closed
         Planned Release:                    None => 1.24.0
                 Summary: [troff] `pchar` request should resolve and report
properties of character classes => [troff] `pchar` request should resolve
character classes and report their properties

    _______________________________________________________

Follow-up Comment #2:

I neglected to close this ticket after my last push.


commit f6b05898bf9cd5d539b6d173febaf1a4ff154c86
Author: G. Branden Robinson <[email protected]>
Date:   Fri Nov 14 16:02:02 2025 -0600

    [troff]: Describe character classes better (1/2).
    
    * src/roff/troff/input.cpp (token::description): Describe character
      class objects distinctly from special characters.
    
      (print_character_request): Update error diagnostic to recognize that a
      character class is also worthy argument fodder to the `pchar` request.
    
      (charinfo::dump): Report totally different information for a character
      class.  Call the `dump()` member function of the its associated
      (empty) macro from the previous change.  This way the user
      troubleshooting character classes (or character class/special
      character collisions) can simply _ask_ the formatter where a character
      class is defined.  Report the only properties a character class has: a
      list of (potentially singleton) code point ranges and a list of nested
      classes.
    
    This commit refrains from updating indentation to clarify the change.

commit 8a61d010bdf9c9fc203f7794f0a08f55216fc4f7
Author: G. Branden Robinson <[email protected]>
Date:   Fri Nov 14 16:02:50 2025 -0600

    [troff]: Describe character classes better (2/2).
    
    * src/roff/troff/input.cpp (charinfo::dump): Update indentation.


**However**, two points are worthy of note.  Exercising the feature is useful
to illustrate.


$ printf '.pchar \\C"[CJKnormal]"\n' | groff -mja
/home/branden/groff-HEAD/share/groff/1.23.0/tmac/ja.tmac: warning: font TR may
lack coverage of Japanese script
character class '[CJKnormal]'
  defined at: file name:
"/home/branden/groff-HEAD/share/groff/1.23.0/tmac/ja.tmac", line number: 44
  contains ranges: U+3041-U+3096 U+3096 U+30A0-U+30FF U+30FF U+4E00-U+9FFF
U+9FFF 
  contains nested classes: (none)


1.  The second end point of a code point range gets repeated as a singleton
range.  This is not a defect in the reporting but in the population of the STL
vectors used to implement character class ranges.  See bug #67718.

2.  It may be that character classes have more properties than shown above.
Dave and I are in disagreement and, so far, Werner, the feature's implementor,
has not weighed in with (what he can recollect of) his authorial intentions.
See this [https://lists.gnu.org/archive/html/groff/2025-11/msg00026.html
_groff_ discussion list thread].


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?67617>

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

Attachment: signature.asc
Description: PGP signature

Reply via email to