groff
[Top][All Lists]
Advanced

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

the portability of an-ext.tmac


From: G. Branden Robinson
Subject: the portability of an-ext.tmac
Date: Sat, 30 May 2020 01:29:20 +1000
User-agent: NeoMutt/20180716

Our an-ext.tmac (extensions to the man macros) says:

.\" The code below provides extension macros for the 'man' macro
.\" package.  Care has been taken to make the code portable; groff
.\" extensions are properly hidden so that all troff implementations can
.\" use it without changes.

...and this seems mostly true.  For example:

.\" Map mono-width fonts to standard fonts for groff's TTY device.
.if n \{\
.  do ftr CR R
.  do ftr CI I
.  do ftr CB B
.\}

This is fine because .do is undefined in AT&T troff and it, like groff,
by default, blithely ignores calls to undefined macros.

However, we reach something else entirely in the UE and ME macros.

I'm posting the entire macro defs so you can challenge yourself to spot
the problem.  Scroll down if you don't want the exercise.  :)

.\" End URL.
.de UE
.  ie \\n(mH \{\
.    br
.    di
.    ev
.
.    \" Has there been one or more input lines for the link text?
.    ie \\n(dn \{\
.      do HTML-NS "<a href=""\\*(m1"">"
.      \" Yes, strip off final newline of diversion and emit it.
.      do chop URL-div
.      do URL-div
\c
.      do HTML-NS </a>
.    \}
.    el \
.      do HTML-NS "<a href=""\\*(m1"">\\*(m1</a>"
\&\\$*\"
.  \}
.  el \
\\*(la\\*(m1\\*(ra\\$*\"
.
.  hy \\n(HY
..

.\" End email address.
.de ME
.  ie \\n(mH \{\
.    br
.    di
.    ev
.
.    \" Has there been one or more input lines for the link text?
.    ie \\n(dn \{\
.      do HTML-NS "<a href=""mailto:\\*(m1"">"
.      \" Yes, strip off final newline of diversion and emit it.
.      do chop URL-div
.      do URL-div
\c
.      do HTML-NS </a>
.    \}
.    el \
.      do HTML-NS "<a href=""mailto:\\*(m1"">\\*(m1</a>"
\&\\$*\"
.  \}
.  el \
\\*(la\\*(m1\\*(ra\\$*\"
.
.  hy \\n(HY
..

Did you spot the problem?

\\*(la\\*(m1\\*(ra\\$*\"

Look closer:

\$*

This is not defined in CSTR #54.  Heirloom troff added support for it in
release 050816 (2005-08-05)  Plan 9 troff still doesn't suppot it.
(In both, the relevant code is in the seta() function in n3.c).

What should we do about this?  Anything?

Regards,
Branden

Attachment: signature.asc
Description: PGP signature


reply via email to

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