On Tue, Nov 07, 2017, G. Branden Robinson wrote: > Hi folks, > > I've been inspecting the operation of tmac/strip.sed, and > > I noticed that the following substitution: > > s/\([^/]\)doc-/\1/g > > has an impact outside what I presume is its intension to shorten mdoc > symbol names. It also does this: > > diff -urN STOCK/om.tmac HACKED2/om.tmac > --- STOCK/om.tmac 2017-11-07 13:00:57.786695535 -0500 > +++ HACKED2/om.tmac 2017-11-07 13:13:43.424234377 -0500 > @@ -5178,7 +5178,7 @@ > .ds cover-type \\$0 > .substring cover-type 0 2 > .ie '\\*[cover-type]'COV' .ds cover-type cover > -.el .ds cover-type cover > +.el .ds cover-type doc-cover > .tm1 "[mom]: \\$0 at line \\n[.c] of '\\n[.F]' is no longer valid. > .tm1 " Leading of \\*[cover-type] MISC items is now set with > \\*[replacement], which > .tm1 " takes an absolute leading value. Please update your document. > > ...which makes the conditional a no-op. > > All of the other substitutions in strip.sed are agnostic about symbol > names, and work only at the syntactical level. > > Maybe mdoc should get its own sed one-liner that runs separately from > strip.sed? > > I think that would be cheaper than expecting all future contributors to > groff to remember not to name any strings or macros doc-whatever if they > want their macro packages stripped.
Even though only om.tmac is affected, and there only in a macro whose sole function is to emit a warning, I'm inclined to agree. strip.sed should remove comments and indentation but otherwise make no changes in the file. mdoc needs to be treated as an exception. -- Peter Schaffter http://www.schaffter.ca