[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 'man groff' reports end of file while defining macro `TP'
From: |
Werner LEMBERG |
Subject: |
Re: 'man groff' reports end of file while defining macro `TP' |
Date: |
Sat, 07 Jun 2003 11:12:41 +0200 (CEST) |
> /opt/reb/share/man/man1/groff.1:57: error: end of file while defining macro
> `TP'
> troff: warning: numeric expression expected (got `\')
>
> SUGGESTED FIX [optional]:
>
> I tried renaming the "TP+" macro to "Tq", and this changed the error
> message to talk about the macro "Te", so I'm lost. Perhaps it's a
> bug in groff itself, rather than in the macros?
groff is called in compatibility mode. This is caused by the wrapper
files for Sun's troff macro packages which explicitly call `.cp 1'.
It's not easy to solve this problem. Some suggestions:
1. Install groff with
make install tmac_wrap=""
to use groff's macro packages instead of Sun's. Then the extended
groff syntax is the default, and man pages using the old troff
syntax (this is, no whitespace between a two-character command and
its first argument) can be handled by adding groff's -C command
line switch to activate compatibility mode on demand.
2. Surround all man pages which actually use long macro names with
.nr _C \n(.C
.cp 0
<man page>
.cp \n[_C]
to switch off compatibility mode while processing the man page with
Sun's man macros. This might still cause failures since groff's
man package is more powerful; for example, it can handle an
arbitrary number of arguments to .B and friends (and some groff man
pages actually use this).
3. Filter all man pages through the `fixmacros.sed' script (which
comes with groff) and avoid the use of wrapper files so that
groff's macro files are input.
4. Write a small script which tests the location of the man page. If
it is in the `local' tree, -mgan should be used and -man
otherwise.
I like item 3 most, but I don't know how reliable the fixmacros.sed
script is (I think it should be OK for man pages which are assumed to
not use weird troff features).
Werner