groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: man(7), hyphen, and minus


From: Russ Allbery
Subject: Re: man(7), hyphen, and minus
Date: Fri, 23 Dec 2022 10:03:13 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

"G. Branden Robinson" <g.branden.robinson@gmail.com> writes:

> That's fair, and it isn't the first time I've heard capable people
> express the opinion that having a document translator produce idiomatic
> man(7) font alternation macro calls rather than chains of font selection
> escape sequences was Just Too Damned Hard.  If I could show people how
> to do it, I might do so with a swagger, but I confess I can't cash that
> check at present.

Yeah, the difficulty lies mostly in the layering, because people can write
POD source that is nonsensical in a man page context but that I still have
to do something with.  Stuff like C<<< B<< L<foo(1)> >> >>>.  It makes no
sense to make the man page reference, which one could otherwise nicely
represent as:

.BR foo (1)

also bold and fixed-width, but if that's what someone wrote in the POD
source, I have to do *something* with it.  And that means either trying to
analyze global state or having to parse the *roff that I output in an
earlier stage.

> Here, I know your pain.  I took it upon myself to document this shit.

Thanks for this, I should have thought to look at the groff manual about
it.  That corrected a few of my misconceptions about macro arguments.
(It's very easy for this stuff to all become cargo-cult.  I refer to CSTR
54 all the time, but of course that's limited in its detail.)

> I sure hope the reason this was done the way it was because any more
> accessible approach ran the PDP-11 out of memory.  Murray Hill's
> agonizingly slow adoption of 'aq' and 'dq' special character identifiers
> I find difficult to explain given that they bought and paid for a font
> that included these glyphs on their very first typesetting device.

Yes, it's frustrating that one can't portably just use the special
character escapes everywhere.

The additional problem that Pod::Man has is that I want to add double
quotes around literal text if and only if I'm rendering with nroff.  With
troff, the font change is sufficient and I don't want to add quotes.  The
simplest way to do that normally is with a string that's defined to either
the empty string or the quote mark depending on whether rendering is with
nroff or troff, but this causes no end of hassles when it's inside macro
arguments, not to mention the need to work around Solaris bugs with font
changes.

I'm fairly sure there's some better way of handling this than what I'm
currently doing, but my brain has not managed to come up with it yet.

> Whither this antipathy for the neutral apostrophe?

This has been an interesting long-term struggle.  It was the GNU coding
style for years to use `' as matched quotes.  I think they've finally
switched to Unicode quotes instead.  Technically, of course, the English
apostrophe isn't neutral; it's curved to the left.  But the ASCII
character is used and abused for a bunch of different things that aren't
really apostrophes.

> With the last proprietary Unixes finally retiring to their coffins or at
> least throwing in the towel on any delusions of troff maintenance, maybe
> people will take up some of these conveniences at last.

Speaking as someone maintaining a generator, it's very difficult to know
when I can drop support for old Unixes.  It's also very painful to be
wrong; if I delete a bunch of compatibility code, and then later someone
really wants it back, adding it back in is awful.

-- 
Russ Allbery (eagle@eyrie.org)             <https://www.eyrie.org/~eagle/>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]