groff
[Top][All Lists]
Advanced

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

Re: [Groff] soelim and file names defined in string registers


From: Joerg van den Hoff
Subject: Re: [Groff] soelim and file names defined in string registers
Date: Mon, 21 Aug 2006 11:49:11 +0200
User-agent: Thunderbird 1.5.0.4 (Macintosh/20060530)

Werner LEMBERG wrote:
just an idea: the problem would go away if the `.so' request could
be told (by a second argument to the request) to rerun all necessary
preprocessors on the sourced file before inserting it (the
preprocessors could be those specified in the groff call or
explicitely specified to the `.so' reguest). would this be a good
idea (apart from the someone_has_to_implement_it aspect)?

I don't think that this is a good idea.  It is far too complicated to
implement, and I can easily construct examples where a second
expansion isn't enough, this is, you would need a third level of
expansion.

Why do you insist on passing the contents of a string register to
`.so'?  It's rather easy to construct an input file `so-data' on the
fly (using a Makefile, for example) which just contains a single line

  .so <your file>

and this file is then included with

  .so so-data

in the main data file.


    Werner

thanks for responding:

well, I don't really insist (how could I..). Ted and you have explained work arounds (a third one might be to trigger a small sed|awk|perl|python|ruby script from within the Makefile to simply look for corresponding .ds AFILE, .so \*[AFILE] pairs and performing the necessary editing of the .so request).

the desire to use string registers has a simple cause:  I would like

1. to modify only some string registers at the top of a document to control the "sourcing" without the need to look up the `.so' requests (essentially the same reason one prefers to define some constants at the top of a programm instead of hardcoding numbers all over the place).

2. to be able to source the same bit of troff input at several places within a document without having to globally `s/old/new/g'

no "hard" reasons, obviously (it just would be nice if the `.so' request _could_ interpolate the string register value) so I'll take one of the bypasses you told me.



joerg




reply via email to

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