Hi Eric, * Eric Blake wrote on Tue, Mar 11, 2008 at 02:22:53PM CET: > > I'm committing the first two in the series as is, since there were no > nits. As for the remaining two, here is the revised version for another > round of reviews. Rather than adding a cleanup parameter to > m4_init/AS_INIT, I made m4_wrap guarantee FIFO behavior and added > m4_wrap_lifo, then used these calls in the proper order. I tested with > both M4 1.4.10b (where m4wrap is LIFO) and the M4 argv_ref branch (will > become M4 1.4.11 or maybe 1.5, where m4wrap is FIFO).
These are OK, with a nit below; and the naming is much better now. Thanks! Cheers, Ralf > --- a/lib/m4sugar/m4sugar.m4 > +++ b/lib/m4sugar/m4sugar.m4 > @@ -607,6 +606,30 @@ m4_define([m4_undefine], > [m4_fatal([$0: undefined macro: $1])])]dnl > [m4_builtin([undefine], [$1])]) > > +# _m4_wrap(PRE, POST) > +# ------------------- > +# Allows nested calls to m4_wrap within wrapped text. "Helper macro for m4_wrap and m4_wrap_lifo. It allows to nest calls to m4_wrap within wrapped text." Should this feature (the nesting) be documented in the manual? > +m4_define([_m4_wrap], > +[m4_ifdef([$0_text], > + [m4_define([$0_text], [$1]m4_builtin([defn], [$0_text])[$2])], > + [m4_builtin([m4wrap], [$0_text(m4_builtin([popdef], > + [$0_text]))])m4_define([$0_text], [$1$2])])])
