Hi Branden,

On Wed, 5 Jul 2023, G. Branden Robinson wrote:

As far as I can tell, the EQN

        include

does not honour the GROFF_TMAC_PATH search path. I think I would to see it
default to

        . : the site-tmac directory : the standard tmac directory

but that might be a dumb idea. What does anybody else think?

I think it's a pretty good idea.  While eqn definitions aren't *roff
macro files, they're pretty close.

There is already a precedent. 'eqnrc' lives there.

Even if we don't re-use GROFF_TMAC_PATH for this purpose, we could add
an `-I` option to GNU eqn and have groff(1) pass any `-I` option it is
given along to eqn.  Precedent comes from groff(1):

   -I dir
       Works as troff's option (see below), but also implies -g and -s.
       It is passed to soelim(1) and the output driver, and grn is
       passed an -M option with dir as its argument.

Yes. That will still be a long name and there is not much difference between

  groff ... -e -I /usr/local/share/groff/site-tmac/ document-with-include
or
  groff ... -e /usr/local/share/groff/site-tmac/eqnrc.local document-no-include

Long winded. I prefer a default search path and I just do

        groff .... -e document-with0include

We could consider making the inclusion parser more strict.  It already
ignores lines that start with ".EQ" and ".EN".  We could make it use the
same rules that input reading already applies, ignoring everything
_except_ lines between ".EQ" and ".EN".

A user could then comment the file with troff comments outside of
.EQ/.EN (which already don't work within eqn input), or even with plain
text.

That would work for me. But disruptive as you note.

This would be a disruptive change, but to a feature that is already a
GNU extension and one that is a bit hard to use because of the
inflexibility of file name resolution, as you noted above.

To aid users to make the transition, we could have GNU eqn throw a
warning diagnostic if it finished reading an `include`d file without
finding any eqn input in it.

The result might be a net win.

You could also read

        $HOME/.eqnrc

immediately after you read the site-wide 'eqnrc' and stick all the
definitions you like in there. And 'eqnrc' does support comments.

That is non-disruptive.

I may be on the side of the engineers rather than the Unix/OS nerds.

I lnow a lot of really wise Unix/OS nerds.

Also, what is an equals sign with a dot over it used for?

Online sources claim that it can be a notation for "defined as".[1]

OK. I had missed that one in my search. It was on Wikipedia. It is quite
interesting that EQNCHAR has all the other ones covered except two tildes about an equals sign.

My conjecture is that its use is not standardized and its meaning should be presented before it is employed. That does make it harder for us to supply a predefined macro name that gives it a mellifluous name for reading aloud.

I can live with

        =dot

Thanks - Damian

Pacific Engineering Systems International ..... 20D Grose St, Glebe NSW 2037
Ph:+61-2-8571-0847 .. Fx:+61-2-9692-9623 | unsolicited email not wanted here
Views & opinions here are mine and not those of any past or present employer

Reply via email to