On Sat, Aug 22, 2020 at 04:42:34AM +1000, G. Branden Robinson wrote: > In man-db's src/man.c, we see the following: [...] > The above is to support the --nh and --nj options. > > I've pushed some changes to groff's man macros that enable greatly > improved user control of adjustment and hyphenation. However, it > interacts badly with the above because of the redefinition of the .hy > and .ad requests. > > It should be possible in the future for man-db man, #ifdef > TROFF_IS_GROFF, to discard injection of requests into groff's input > stream in favor of simply calling it with options. > > man --nh -> groff -man -rHY=0 > man --nj -> groff -man -dAD=l > > I get the feeling you'd have happily used these facilities if they > existed in 2008-2009 when you implemented the man(1) options.
I'd definitely be in favour of simplifying this if possible. What about mdoc, though? man doesn't know which macro set the manual page uses when it invokes groff. (It could try to discover it, but that's a whole new set of complexity.) Admittedly, --no-justification is a no-op for mdoc anyway, but --no-hyphenation isn't. > What do you think? No one has mentioned a release time table for groff > 1.22.5, and Bertrand is pretty busy with life and fatherhood lately, so > there should be plenty of time to coördinate migration strategies. I'm > also mindful of the possibility that it would suck for you to have to > query an installed groff for its version string, parse it, and adapt to > it, so I'm open to suggestions. Yeah, this is a bit tricky. But ... although it does suck, it's not unheard of for man to use \n[.x], \n[.y], and \n[.Y] to work out the groff version at run-time (see the horror that is locale_macros). Perhaps we could do that here so that the injected requests are a no-op with a sufficiently new version of groff, and then drop those at some point in the future when old versions of groff are no longer interesting to support? Thanks, -- Colin Watson (he/him) [cjwat...@debian.org]