[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [groff] Rate this hack on a scale of 0 to stupid
From: |
Ingo Schwarze |
Subject: |
Re: [groff] Rate this hack on a scale of 0 to stupid |
Date: |
Mon, 7 Jan 2019 11:13:30 +0100 |
User-agent: |
Mutt/1.8.0 (2017-02-23) |
Hi John,
oh, and a few more remarks:
John Gardner wrote on Mon, Jan 07, 2019 at 08:08:51PM +1100:
> 1. I want/need a way to programmatically (and *reliably*) locate the
> directories containing a Groff installation's .tmac files.
Plural for good reasons. There is no guarantee all tmac files are in
the same directory.
> $ GROFF_TMAC_PATH=`pwd` groff -Tutf8 -z -mtrace-paths -man `man -w man`
> /usr/share/groff/1.19.2/tmac/an.tmac
> /usr/share/groff/1.19.2/tmac/troffrc-end
> /usr/share/man/man1/man.1
But this gives you only one directory, whereever an.tmac or tmac.an
is located.
That said, no need for the man -w actually:
> GROFF_TMAC_PATH=`pwd` groff -Tutf8 -z -mtrace-paths -man /dev/null
/opt/csw/lib/64/groff/site-tmac/an.tmac
/opt/csw/share/groff/1.22.2/tmac/troffrc-end
> 3. The containing directories are scooped up by Roff.js and scanned for
> `.tmac` files, which is a preparatory step to determine what macros are
> available and which aren't.
In that case, why not probe for the macros directly?
It doesn't matter where they are, or does it?
> groff -man /dev/null > /dev/null ; echo $?
0
> groff -mfoo /dev/null > /dev/null ; echo $?
gtroff: fatal error: can't find macro file foo
1
Yours,
Ingo