groff
[Top][All Lists]
Advanced

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

Re: [Groff] Choosing a portability target


From: Werner LEMBERG
Subject: Re: [Groff] Choosing a portability target
Date: Fri, 12 Jan 2007 22:55:11 +0100 (CET)

> > > HOWEVER, if groff can be compiled and run on HP-UX,
> > > groff-oriented man pages will also need to be installed in the
> > > usual directories on HP-UX systems, and HP-UX users will expect
> > > to be able to run the man command on those pages.
> >
> > If groff finds another troff package already installed on the
> > system, it renames itself to gtroff, geqn, gtbl, etc.; macros have
> > to be called as `-mgms', `-mgan', and `-mgmm'.
>
> If groff is going to go to this much trouble, maybe we should drop
> back to two-character macros and \*( only in the groff pages.
> Otherwise aren't they going to break?  Or does .mso have magic
> behavior that prevents this?

There's done some magic during installation which assures that the
platform's man macro set is read also.  Have a look at the `stam-wrap'
target in tmac/Makefile.sub: It creates a small `an.tmac' file (which
groff finds before the platform's `an' or `an.tmac' file), which
consists of the following three lines:

  .do mso andoc.tmac
  .cp 1
  .so /platform/specific/path/to/tmac.an

`andoc.tmac' defines .TH as

  .de TH
  .  rm TH
  .  do mso an-old.tmac
  \\*(TH\\
  ..

so that an-old.tmac isn't read yet.  Instead, the platform's man
macros are sourced first (which defines all the platform-specific
extension macros).  As soon as the first .TH is encountered in a man
page, groff reads `an-old.tmac', overriding the platform's macros (but
retaining the extensions).  Quite nice, I think.


    Werner




reply via email to

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