[looping in groff@gnu list]

[was: Re: [PATCH 01/21] man/curs_extend.3x.in: NetBSD curses supports
`curses_version()`.]

Hi Thomas,

At 2025-10-05T14:59:09-0400, Thomas Dickey wrote:
> I added a one-liner, though last night's update has a couple of typos
> which I fixed today

Thank you for already catching the ones I submitted with my last batch
of patches.  When I diffed my branch with "master" I spotted my howlers.
I had forgotten to run my "checkman.sh" script before submitting.

> while checking over a regression in groff which I hadn't noticed
> before (subsection titles are double-overstruck, which is inconsistent
> which section titles).

I don't think "regression" is an accurate characterization of groff's
behavior.

You did not state that you're referring to grotty(1)'s "legacy output
format".[1]  That's necessary to understand your report.

$ cat <<EOF | ~/groff-1.23.0/bin/nroff -c -man -Tascii | od -c
.TH foo 1 2025-10-06 "groff test suite"
.SH Name
foo
.SS Alternative
bar
EOF
0000000   _  \b   f   _  \b   o   _  \b   o   (   1   )                
0000020                                                                
0000040           G   e   n   e   r   a   l       C   o   m   m   a   n
0000060   d   s       M   a   n   u   a   l                            
0000100                                                           _  \b
0000120   f   _  \b   o   _  \b   o   (   1   )  \n  \n   N  \b   N   a
0000140  \b   a   m  \b   m   e  \b   e  \n                            
0000160   f   o   o  \n  \n               A  \b   A   l  \b   l   t  \b
0000200   t   e  \b   e   r  \b   r   n  \b   n   a  \b   a   t  \b   t
0000220   i  \b   i   v  \b   v   e  \b   e  \n                        
0000240       b   a   r  \n  \n   g   r   o   f   f       t   e   s   t
0000260       s   u   i   t   e                                        
0000300                                   2   0   2   5   -   1   0   -
0000320   0   6                                                        
0000340                                                           _  \b
0000360   f   _  \b   o   _  \b   o   (   1   )  \n
0000373

Here we see overstriking occurring only once for each character in each
(sub)section heading.  What you may be observing is that "italic"
characters in (sub)section headings get overstricken twice; once because
they are bold, and again because they are underlined.

$ cat <<EOF | ~/groff-1.23.0/bin/nroff -c -man -Tascii | od -c
.TH foo 1 2025-10-06 "groff test suite"
.SH Name
foo
.SS Alternative \fITentacles
bar
EOF
0000000   _  \b   f   _  \b   o   _  \b   o   (   1   )
0000020
0000040           G   e   n   e   r   a   l       C   o   m   m   a   n
0000060   d   s       M   a   n   u   a   l
0000100                                                           _  \b
0000120   f   _  \b   o   _  \b   o   (   1   )  \n  \n   N  \b   N   a
0000140  \b   a   m  \b   m   e  \b   e  \n
0000160   f   o   o  \n  \n               A  \b   A   l  \b   l   t  \b
0000200   t   e  \b   e   r  \b   r   n  \b   n   a  \b   a   t  \b   t
0000220   i  \b   i   v  \b   v   e  \b   e       _  \b   T  \b   T   _
0000240  \b   e  \b   e   _  \b   n  \b   n   _  \b   t  \b   t   _  \b
0000260   a  \b   a   _  \b   c  \b   c   _  \b   l  \b   l   _  \b   e
0000300  \b   e   _  \b   s  \b   s  \n                               b
0000320   a   r  \n  \n   g   r   o   f   f       t   e   s   t       s
0000340   u   i   t   e
0000360                           2   0   2   5   -   1   0   -   0   6
0000400
0000420                                                   _  \b   f   _
0000440  \b   o   _  \b   o   (   1   )  \n
0000451

I do not regard this as a regression, but as a feature; the inconsistent
font weight exhibited before was noticeable, even on terminals.[2]

Regards,
Branden

[1] grotty(1):

   Legacy output format
     The -c option tells grotty to use an output format compatible with
     paper terminals, like the Teletype machines for which roff and
     nroff were first developed but which are no longer in wide use.
     SGR escape sequences are not emitted; bold, italic, and underlining
     character attributes are thus not manipulated.  Instead, grotty
     overstrikes, representing a bold character c with the sequence
     “c BACKSPACE c”, an italic character c with the sequence
     “_ BACKSPACE c”, and bold italics with “_ BACKSPACE c BACKSPACE c”.
     This rendering is inherently ambiguous when the character c is
     itself the underscore.

     The legacy output format can be rendered on a video terminal (or
     emulator) by piping grotty’s output through ul(1), which may render
     bold italics as reverse video.  Some implementations of more(1)
     also are able to display these sequences; you may wish to
     experiment with that command’s -b option.  less renders legacy bold
     and italics without requiring options.  In contrast to the terminal
     output drivers of some other roff implementations, grotty never
     outputs reverse line feeds.  There is therefore no need to filter
     its output through col(1).

(That's the man page text as of groff Git's master branch, but the
1.23.0 release had almost the same language.  This subsection has seen
only one change in four years.[3]  A couple of source lines are still
James Clark's from 1991. :) )

[2] 
https://cgit.git.savannah.gnu.org/cgit/groff.git/commit/?id=5ea945c8720ba102bbd30b3e36ca0a03d3149bb0
[3] 
https://cgit.git.savannah.gnu.org/cgit/groff.git/commit/?id=a85239bfc7e07d7e0bd663858c79439e9ba1d8fc

Attachment: signature.asc
Description: PGP signature

Reply via email to