]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* lib/m4sugar/m4sugar.m4 (m4_init): Merge the two m4_wrap
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 20 Jun 2006 05:35:38 +0000 (05:35 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 20 Jun 2006 05:35:38 +0000 (05:35 +0000)
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.

ChangeLog
lib/autotest/general.m4
lib/m4sugar/m4sh.m4
lib/m4sugar/m4sugar.m4
tests/m4sugar.at

index 777ef8bfb146dcd82af2754e98991a58c5d15fa0..c9522f0663765fbe0e3246313136b27f06c07dce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,21 @@
+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.
index 8ee3bcddc43171bd5925036e1b59ab6be969c469..1faecd28b4faefdf3ee6e5a151ae2b88c4a9a678 100644 (file)
@@ -1012,8 +1012,8 @@ m4_divert_pop([TESTS_END])dnl
 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
 
 
index 074a185ae1f7f70d85f979d6aa17d6983703625a..f81d86a3fa7f40793bc881cfbdaeb6b2ce459f57 100644 (file)
@@ -1493,6 +1493,6 @@ m4_divert_text([M4SH-SANITIZE], [AS_SHELL_SANITIZE])
 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
 ])
index 4e7d0d69dbb9d734fc0247db420d76a70cc0578d..f9e7cd07b77486917f4ef96b71388b4012bda844 100644 (file)
@@ -1770,10 +1770,11 @@ m4_define([m4_init],
 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])[]])
 ])
index 843ae0664f7947ca9b5a3af7e925e8c700650b4b..486f805ad166bbb7f36dc2d288cbf30c464069df 100644 (file)
@@ -62,7 +62,7 @@ AT_DATA_M4SUGAR([script.4s],
 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
@@ -135,7 +135,7 @@ m4_defun([baz],
 [m4_require([foo])])
 
 m4_init
-m4_divert_push([0])m4_wrap([m4_divert_pop([0])[]])dnl
+m4_divert([0])dnl
 baz
 ]])
 
@@ -161,7 +161,7 @@ AT_SETUP([m4@&t@_text_wrap])
 # 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)
@@ -303,7 +303,7 @@ outer value
 
 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])
 ]])
 
@@ -315,7 +315,7 @@ autom4te: m4 failed with exit status: 1
 
 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])
 ]])
 
@@ -327,7 +327,7 @@ autom4te: m4 failed with exit status: 1
 
 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])
 ]])