On Fri, Mar 03, 2000 at 04:05:57PM +0100, Akim Demaille wrote:
: >>>>> "Lars" == Lars J Aas <[EMAIL PROTECTED]> writes:
: 
: Lars> I want to use diverts in some macros, and wonder if there is any
: Lars> divert management system for reserving/freeing divert numbers in
: Lars> autoconf (couldn't find any with a quick grep at least).  The
: Lars> point is, if other macros are using diverts too, I don't want my
: Lars> diverts to clash with those diverts and vice versa.  If I just
: Lars> pick a random divert number off the top of my head, it's only a
: Lars> question of time before diverts start to clash, which I'm really
: Lars> going to appreciate debugging :-P If divert numbers are
: Lars> reserved/freed dynamically OTOH, this can be avoided.

: Starting at a high number, you shouldn't meet any problems :)

Exactly - that's what the other dude will be thinking too...

: Using diversion is (currently) limited to Autoconf internals, so
: currently there is no means to know which ones are used.  you may find
: the list of diversions used at the top of acgeneral.m4:
: 
: define(AC_DIVERSION_KILL,    -1)# suppress output
: define(AC_DIVERSION_BINSH,    0)# AC_REQUIRE'd #! /bin/sh line
: define(AC_DIVERSION_NOTICE,   1)# copyright notice & option help strings
: define(AC_DIVERSION_INIT,     2)# initialization code
: define(AC_DIVERSION_NORMAL_4, 3)# AC_REQUIRE'd code, 4 level deep
: define(AC_DIVERSION_NORMAL_3, 4)# AC_REQUIRE'd code, 3 level deep
: define(AC_DIVERSION_NORMAL_2, 5)# AC_REQUIRE'd code, 2 level deep
: define(AC_DIVERSION_NORMAL_1, 6)# AC_REQUIRE'd code, 1 level deep
: define(AC_DIVERSION_NORMAL,   7)# the tests and output code
: define(AC_DIVERSION_CMDS,     8)# extra shell commands in config.status
: define(AC_DIVERSION_ICMDS,    9)# extra initialization in config.status

In my book, this would be

  m4_diversion_reserve([AC_DIVERSION_KILL], -1)
  ...

Later on, I would be able to do something like:

  m4_divert_new([lja_divert])

  AC_DIVERT_PUSH(lja_divert)
  ...
  AC_DIVERT_POP()
  ...
  undivert(lja_divert)

  m4_divert_free([lja_divert])

Something along these lines would make me sleep better at night ;)

  Lars J

Reply via email to