At 2018-11-08T09:50:31-0500, Doug McIlroy wrote: > > a request that would print its argument with all hyphenation points visible > > ... > > it requires a contrivance to discover them > > The second bit of the quote seems to answer the first: there's > no need for such a request because the function can be > accomplished fairly easily. > > But I have no perspective on what uses drove the suggestion.
Nothing too specific yet; having taken a stand in defense of hyphenation in man page output, I'm exploring the consequences for man page writers. > What I see as the typical use is a nonce question about a > single word. That is trivially handled by > groff -a > .ll 1u > recapitulation > The result is marrred with "can't break line" diagnostics, > but it's quick and intelligible. Thanks! My bulky script is down to a 1-liner now: printf ".ll 1u\n$1\n" | nroff 2> /dev/null | sed '/^$/d' I prefer "nroff" to "groff -a" because it's easier to sed out the blank lines than "<beginning of page>", and I prefer real hyphen characters to "<hy>". > Another use would be to consruct hyphenations for a whole > list of words. That would be a rare enough activity to justify > building a "contrivance" for the job per the old Unix adage: > combine tools that do one thing well (in preference to > festooning existing tools with ad hoc features). I'm on that train; I simply do not yet think in idiomatic *roff as much as I would like. > Have I overlooked more compelling uses? I have a vague intuition right now that the hyphenation decisions, since they are made before pushing the document to the output driver, should be accessible without having to invoke the output driver. Consider the problem of making decisions in *roff code based on where a word gets hyphenated. Right now that is impossible, I think, to do in safer mode and clumsy otherwise; I'd have to .pso groff from within groff, just to find out where my word was broken. This "feels wrong", but I'm too ignorant of the conceptual landscape around me to be more articulate than that. -- Regards, Branden
signature.asc
Description: PGP signature