groff
[Top][All Lists]
Advanced

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

Re: [Groff] Critique this bold-italic private macro for man pages


From: G. Branden Robinson
Subject: Re: [Groff] Critique this bold-italic private macro for man pages
Date: Wed, 3 May 2017 16:47:21 -0400
User-agent: NeoMutt/20170113 (1.7.2)

At 2017-05-03T21:37:21+0200, Carsten Kunze wrote:
> > "G. Branden Robinson" <address@hidden> hat am 3. Mai 2017 um 17:30 
> > geschrieben:
> > 
> > Nope.  By "private macro" I mean one defined and used only within one
> > document.
> 
> A manpage is "one document". Or what do you refer to?

It's a man page for xtrs, a TRS-80 emulator, for which I've been the
Debian package maintainer for (off and on) almost 20 years.

My uptsream doesn't has a long and sophisticated man page (in terms of
content) but is not very idiomatic man(7) markup.

See the attachment.  You may want to brew a pot of coffee.

> > Most \n(.g tests I've seen in man pages are to try to _achieve_
> > portability, not break it.
> > 
> > E.g., ncurses uses these conditionals in many of its pages:
> > 
> > .ie \n(.g .ds `` \(lq
> > .el       .ds `` ``
> > .ie \n(.g .ds '' \(rq
> > .el       .ds '' ''
> 
> So all formatters except groff are only allowed to have second class
> output?

I think the idea here is to degrade in a predictable way.

> Exactly because of this poor code Heirloom sets .g to 1.  I
> assume also mandoc(1) reads \(.g as 1.  Had this been the intention
> behind register .g in groff?  So when all relevant tools set .g to 1,
> what is the point of this register? ;)

I think the idea, as with so many GNU tools, was to be able to
feature-gate GNU extensions.  Heirloom Troff--_after_ Gunnar Ritter took
it over--decided to implement so many GNU Troff extensions that he
decided to get behind the same feature gate.

That's not a wrong or bad decision.  It's an independent implementation
that has decided to follow GNU's (de facto) standard.

But not every Troff implementation chooses to follow GNU.

We've seen the same story play out over many software systems in the
past few decades.  Some people ignore GNU innovations, some people copy
them, and some try wipe GNU off the face of earth.

I think either of the first two options are defensible.  :)

> Three tools know of these special characters.  Either change other
> tools to support groff_char(7), groff_man(7) and groff_mdoc(7) or
> replace them with with one of the three tools.

Well, how about this?

There's a "c glyph" predicate that can be fed to .if and .ie requests:

https://www.gnu.org/software/groff/manual/html_node/Operators-in-Conditionals.html

So ncurses should be gating on the definition of the glyph rather than
on whether groff is the typesetter, right?

.ie c \(lq .ds `` \(lq
.el        .ds `` ``
.ie c \(rq .ds '' \(rq
.el        .ds '' ''

What do you think?

Regards,
Branden

Attachment: xtrs-idiomatize-manpage.patch
Description: Text Data

Attachment: signature.asc
Description: PGP signature


reply via email to

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