+2006-06-20 Stepan Kasal <kasal@ucw.cz>
+
+ * lib/m4sugar/m4sugar.m4 (m4_init): Merge the two m4_wrap
+ calls, so that we do not care whether they are LIFO or FIFO;
+ in the m4_wrap, do not check which diversion is the topmost
+ one, just check that the stack is balanced at the end.
+ * lib/m4sugar/m4sh.m4 (AS_INIT): We are going to change the
+ base diversion forever--pop the previous diversion before
+ opening the new one; consequently, remove the m4_wrap call.
+ * lib/autotest/general.m4 (AT_INIT): Likewise.
+ * tests/m4sugar.at: Do not use
+ m4_wrap([m4_diversion_pop([..])]), for educational purposes.
+
2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
and Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
* NEWS: Document that m4wrap/m4_wrap might not be LIFO.
- * doc/autoconf.texi (): Likewise.
+ * doc/autoconf.texi (Redefined M4 Macros): Likewise.
Rework example of m4wrap token-pasting trouble so that it doesn't
care whether it's LIFO or FIFO.
Fix some "contrary to"s that are awkward in English.
dnl End of AT_INIT: divert to KILL, only test groups are to be
dnl output, the rest is ignored. Current diversion is BODY, inherited
dnl from M4sh.
+m4_divert_pop([BODY])
m4_divert_push([KILL])
-m4_wrap([m4_divert_pop([KILL])[]])
])# AT_INIT
AS_REQUIRE([_AS_SHELL_FN_SPY])
# Let's go!
-m4_wrap([m4_divert_pop([BODY])[]])
+m4_divert_pop([KILL])[]dnl
m4_divert_push([BODY])[]dnl
])
m4_pattern_forbid([^_?m4_])
m4_pattern_forbid([^dnl$])
+# _m4_divert_diversion should be defined:
+m4_divert_push([KILL])
+
# Check the divert push/pop perfect balance.
-m4_wrap([m4_ifdef([_m4_divert_diversion],
+m4_wrap([m4_divert_pop([])
+ m4_ifdef([_m4_divert_diversion],
[m4_fatal([$0: unbalanced m4_divert_push:]_m4_divert_n_stack)])[]])
-
-m4_divert_push([KILL])
-m4_wrap([m4_divert_pop([KILL])[]])
])
m4_defun([cross_warning],
[m4_warn([cross], [cross])])
-m4_divert_push([0])m4_wrap([m4_divert_pop([0])[]])dnl
+m4_divert([0])dnl
m4_warn([obsolete], [obsolete])dnl
cross_warning[]dnl
m4_warn([syntax], [syntax])dnl
[m4_require([foo])])
m4_init
-m4_divert_push([0])m4_wrap([m4_divert_pop([0])[]])dnl
+m4_divert([0])dnl
baz
]])
# m4-listification.
AT_DATA_M4SUGAR([script.4s],
-[[m4_divert_push([0])m4_wrap([m4_divert_pop([0])])dnl
+[[m4_divert([0])dnl
m4_text_wrap([Short string */], [ ], [/* ], 20)
m4_text_wrap([Much longer string */], [ ], [/* ], 20)
AT_DATA_M4SUGAR([script.4s],
[[m4_init
-m4_divert_push([0])m4_wrap([m4_divert_pop([0])[]])dnl
+m4_divert([0])dnl
m4_for([myvar], 1, 3,-1, [ myvar])
]])
AT_DATA_M4SUGAR([script.4s],
[[m4_init
-m4_divert_push([0])m4_wrap([m4_divert_pop([0])[]])dnl
+m4_divert([0])dnl
m4_for([myvar], 1, 2, 0, [ myvar])
]])
AT_DATA_M4SUGAR([script.4s],
[[m4_init
-m4_divert_push([0])m4_wrap([m4_divert_pop([0])[]])dnl
+m4_divert([0])dnl
m4_for([myvar], 2, 1, 0, [ myvar])
]])