* m4sugar.m4 (m4_divert, m4_divert_push, m4_divert_pop): Keep
track of them in m4_divert_stack.
(m4_divert_pop): Accept the expected current diversion as
argument and m4_fatal if incorrect, or if there is nothing to pop.
(globally): Specify the known m4_divert_pop.
Preserve symbolic values when possible.
* acgeneral.m4: No longer push the first diversion.
Specify the known m4_divert_pop.
(AC_PLAIN_SCRIPT): When m4_divert_push a diversion, m4_wrap its
pop.
(AC_INIT): Run AC_PLAIN_SCRIPT first, not last.
* tests/m4sh.at (AS_DIRNAME & AS_DIRNAME_SED): Can't use m4_defun
without m4_init.
* m4sugar.m4: Likewise.
* autoreconf.sh: Likewise.
* autoheader.sh: Ditto.
* autoupdate.sh: Similarly.
* doc/autoconf.texi: Adjust.
* tests/atspecific.m4: Be sure to remove configure.in.
Adjust the test suite to use `configure.ac'.
visible.
* tests/atspecific.m4 (AT_CHECK_AUTOCONF): Support FLAGS, STDOUT
and STDERR.
(AT_CHECK_CONFIGURE): Support plenty, cleanup defs when needed.
Spread their use in the whole suite.
Simplify a few AT_CLEANUPs.
* doc/autoconf.texi (Limitations of Usual Tools) <expr>: More
information, thanks to Paul Berrevoets, Paul Eggert and David
Morgan.
* sh.m4 (_AS_EXPR_PREPARE): New.
(AS_DIRNAME): Use it.
* tests/atgeneral.m4 (AT_INIT): Initialize AT_banner_ordinal.
Execute the epilogue of the tests only if a test was run.
Don't built the value of `at_tests_all' by a for loop: expand
AT_TESTS_ALL.
(AT_SETUP): Build AT_TESTS_ALL.
(AT_BANNER): New.
Adjust all the former banners to use it.
(AT_CHECK): Don't trace the decoding of $?.
(AT_CLEANUP_FILES): New macros.
(AT_SETUP, AT_CHECK, AT_CLEANUP): Use them.
(AT_CHECK): Fix a use of at_verbose.
* tests/atspecific.m4 (AT_CHECK_AUTOCONF, AT_CHECK_AUTOHEADER)
(AT_CHECK_CONFIGURE): New macros.
* tests/atgeneral.m4: Import M4sh.
Adjust the differences on the names of the builtins (define etc.).
(AT_CASE): Remove, use m4_case.
(AT_SETUP): Don't use `AT_group_description', `$1' is OK.
* tests/atspecific.m4 (m4_for, m4_foreach): Remove, use those of
M4sugar.
* tests/m4sugar.at: Strengthen the quotation and adjust to the new
macro names.
* tests/m4sh.at: Ditto.
* tests/torture.at: Ditto.
* tests/base.at: Ditto.
* m4sh.m4: Import M4sugar.
* autoconf.m4: Don't import M4sugar, M4sh does.