At 2020-09-30T14:01:21+1000, John Gardner wrote: > > .SH id=foo class=bar > > Your title here > > Another problem my earlier idea > <https://lists.gnu.org/archive/html/groff/2020-09/msg00031.html> would > solve: > > .SH Your title here > \!x X meta: set id foo > \!x X meta: set class bar > > Or, given that \! is subject to diversions, something like: > > .SH Your title here\ > \X'meta: set id foo'\ > \X'meta: set class bar' > > Sorry I keep mentioning a solution that doesn't exist yet, I'm just > amazed how well it meshes with everyday use, yet manages to solve our > current difficulties…
One problem with the above is that's not a workable ms(7) example; it's using man(7) syntax, which is different. It's a frustrating fact that man and ms have many macro names in common, often with the same or similar functions, but the two packages corresponding macro names often take different parameters. In AT&T ms, .SH took no arguments. Here's the implementation from Version 6 Unix (1975): . SH - (unnumbered) section heading .de SH .RT .if \\n(1T .sp 1 .if !\\n(1T .BG .RT .ne 7 .ft B .if n .ul 1000 .. Not only does it pay any attention to arguments, it doesn't even set an input trap. To understand it you have to know what RT and BG do. . RT - reset everything to normal state [...] . BG - begin, execute at first PP (Yes, those were *roff comments in 1975.) So, if I understand their definitions, which I'm not quoting, correctly, classic ms .SH: 1. Resets some stuff like centering, underlining, point size and leading (.vs). 2. Initializes the macro package (which RT also does) in case someone started their document with this macro. 3. Inserts one vee of vertical space if this _isn't_ the first macro seen on the page. 4. Says that 7 vees of vertical space are needed. Seems kind of ad hoc but I reckon it worked well enough for their documents. 5. Sets the font to bold (which would have been ignored on Teletypes of the era, I think). 6. Tells the Teletypes to underline the next 1000 lines. In practice this would be canceled by the next call to .RT, and I guess everything that should call it, does, like the numbered section heading macro NH and the paragraphing macros. The above is one reason I suggested the .nr MS-CLASS and .nr MS-ID approach. Regards, Branden
signature.asc
Description: PGP signature