Hi Alejandro, Alejandro Colomar wrote on Wed, Jan 08, 2025 at 07:31:04PM +0100:
> I have a proposal for SY: a third parameter, optional (of course), > allowing me to specify the width at which to wrap: That sounds like an extremely bad idea. New syntax ought to support semantic markup. Introducing new syntax to specify presentational details sounds very short-sighted, weakening both the quality of the markup language and inviting new compatibility problems between different output modes. It would already have been short-sighted two decades ago and would be inexcusable today. You are doing 1980s style markup language design right here. > alx@devuan:~/tmp/groff$ cat sy.man > .TH a s d f > .SH g > .SY 123456789_123456789_123456789 > 123456789_123456789_123456789_123456789_123456789_123456789 So you are talking about a combination of very long command names with very long arguments causing ugly formatting by overrunning the right margin (in some output modes). None of that requires author intervention to solve because if desired, the macro set can automatically detect overruns and take appropriate action. Actually, none of that *can* even be solved by the author because the problem depends on the output mode and even on mode-specific output parameters like the paper width (in typeset output) or the line length (in terminal output). > .SY 123456789_123456789_123456789 " " 10 This is atrocious. Very few existing man(7) macros take width arguments, so adding another one doing that certainly does not make the language better. Those few that do - .HP .IP .TP .TQ .RS - all take scaling widths rather than bare numbers. Yet, i dont think telling people to write '.SY foo " " 10n' would be much better. > int dl_iterate_phdr( > typeof(int (struct dl_phdr_info *info, size_t size, void *data)) > *callback, > void *data); A particularly simple way to achieve that would be to build a maximum indentation into .SY and let man(7) wrap the line before the arguments if the length of the command name exceeds that maximum, similar to what the groff_man(7) manual page describes for .TP, except that a modern language should not allow the document author to manually specify the width like .TP does - at least not for a macro that is intended to be semantic, like .SY. If you want to be more fancy, you can apply the maximum only if any of the arguments would otherwise violate the right margin. There may be other good solutions that do not require new syntax - the above two are merely naive examples off the top of my head, without doing a thorough anaalysis. > Does that make sense? No, absolutely none whatsoever. You failed to properly understand the problem and then rushed to suggest a conceptually and technically horrific "solution" before even trying to consider what could be done about the problem, the properties of which you didn't sufficiently inspect to begin with. Yours, Ingo