[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
18-m4-regexp.patch
From: |
Akim Demaille |
Subject: |
18-m4-regexp.patch |
Date: |
02 Nov 2000 12:24:33 +0100 |
User-agent: |
Gnus/5.0807 (Gnus v5.8.7) XEmacs/21.1 (Channel Islands) |
Index: ChangeLog
from Akim Demaille <address@hidden>
* m4sugar.m4 (m4_rename_m4, m4_copy_unm4): New macros.
Use them.
(debugfile, debugmode, m4exit, m4wrap, maketemp, patsubst, regexp)
(substr, translit, m4_wrap): Rename as...
(m4_debugfile, m4_debugmode, m4_exit, m4_wrap, m4_maketemp)
(m4_patsubst, m4_regexp, m4_substr, m4_translit, m4_text_wrap): these.
Adjust all dependencies.
* acgeneral.m4: Adjust.
* tests/m4sugar.at: Adjust.
* autoconf.m4 (m4exit, patsubst, regexp, substr, translit):
Reestablish them.
Index: acgeneral.m4
--- acgeneral.m4 Tue, 31 Oct 2000 02:06:47 +0100 akim (ace/27_acgeneral.
1.169.8.78 664)
+++ acgeneral.m4 Wed, 01 Nov 2000 11:36:10 +0100 akim (ace/27_acgeneral.
1.169.8.78 664)
@@ -353,7 +353,7 @@ define([AH_VERBATIM],
# DESCRIPTION (properly wrapped), and then #undef KEY.
define([AH_TEMPLATE],
[AH_VERBATIM([$1],
- m4_wrap([$2 */], [ ], [/* ])[
+ m4_text_wrap([$2 */], [ ], [/* ])[
#undef $1])])
@@ -396,7 +396,7 @@ define([_AH_COUNTER], [0])
# If EXPRESSION has shell indirections ($var or `expr`), expand
# IF-INDIR, else IF-NOT-INDIR.
define([AC_VAR_INDIR_IFELSE],
-[ifelse(regexp([$1], [[`$]]),
+[ifelse(m4_regexp([$1], [[`$]]),
-1, [$3],
[$2])])
@@ -418,7 +418,7 @@ define([AC_VAR_SET],
# else into the appropriate `eval' sequence.
define([AC_VAR_GET],
[AC_VAR_INDIR_IFELSE([$1],
- [`eval echo '${'patsubst($1, [[\\`]], [\\\&])'}'`],
+ [`eval echo '${'m4_patsubst($1, [[\\`]], [\\\&])'}'`],
[$[]$1])])
@@ -503,10 +503,10 @@ define([AC_VAR_POPDEF],
define([AC_TR_CPP],
[AC_VAR_INDIR_IFELSE([$1],
[`echo "$1" | $ac_tr_cpp`],
- [patsubst(translit([[$1]],
- [*abcdefghijklmnopqrstuvwxyz],
- [PABCDEFGHIJKLMNOPQRSTUVWXYZ]),
- [[^A-Z0-9_]], [_])])])
+ [m4_patsubst(m4_translit([[$1]],
+ [*abcdefghijklmnopqrstuvwxyz],
+ [PABCDEFGHIJKLMNOPQRSTUVWXYZ]),
+ [[^A-Z0-9_]], [_])])])
# AC_TR_SH(EXPRESSION)
@@ -517,8 +517,8 @@ define([AC_TR_CPP],
define([AC_TR_SH],
[AC_VAR_INDIR_IFELSE([$1],
[`echo "$1" | $ac_tr_sh`],
- [patsubst(translit([[$1]], [*+], [pp]),
- [[^a-zA-Z0-9_]], [_])])])
+ [m4_patsubst(m4_translit([[$1]], [*+], [pp]),
+ [[^a-zA-Z0-9_]], [_])])])
@@ -595,7 +595,7 @@ define([AC_FOREACH],
define([AC_HELP_STRING],
[m4_pushdef([AC_Prefix], m4_default([$3], [ ]))dnl
m4_pushdef([AC_Prefix_Format], [ %-]m4_eval(len(AC_Prefix) - 3)[s ])dnl [
%-23s ]
-m4_wrap([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnl
+m4_text_wrap([$2], AC_Prefix, m4_format(AC_Prefix_Format, [$1]))dnl
m4_popdef([AC_Prefix_Format])dnl
m4_popdef([AC_Prefix])dnl
])
@@ -638,10 +638,10 @@ define([AC_PACKAGE_BUGREPORT], [$3])dnl
# would have not been evaluated. Another solution, a bit fragile,
# would have be to use m4_quote to force an evaluation:
#
-# patsubst(m4_quote($1), [^], [# ])
+# m4_patsubst(m4_quote($1), [^], [# ])
define([AC_COPYRIGHT],
[m4_divert([NOTICE],
-[patsubst([
+[m4_patsubst([
$1], [^], address@hidden:@ ])])dnl
m4_divert([VERSION_BEGIN],
[
@@ -1620,8 +1620,8 @@ AC_DEFUN([AC_ARG_ENABLE],
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]]])dnl
AC_DIVERT_ONCE([HELP_ENABLE], [$2])dnl
# Check whether --enable-$1 or --disable-$1 was given.
-if test "[${enable_]patsubst([$1], -, _)+set}" = set; then
- enableval="[$enable_]patsubst([$1], -, _)"
+if test "[${enable_]m4_patsubst([$1], -, _)+set}" = set; then
+ enableval="[$enable_]m4_patsubst([$1], -, _)"
$3
m4_ifvanl([$4], [else
$4])dnl
@@ -1648,8 +1648,8 @@ AC_DEFUN([AC_ARG_WITH],
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)]])
AC_DIVERT_ONCE([HELP_WITH], [$2])dnl
# Check whether --with-$1 or --without-$1 was given.
-if test "[${with_]patsubst([$1], -, _)+set}" = set; then
- withval="[$with_]patsubst([$1], -, _)"
+if test "[${with_]m4_patsubst([$1], -, _)+set}" = set; then
+ withval="[$with_]m4_patsubst([$1], -, _)"
$3
m4_ifvanl([$4], [else
$4])dnl
@@ -2060,8 +2060,8 @@ define([AC_CACHE_SAVE],
# The name of shell var CACHE-ID must contain `_cv_' in order to get saved.
# Should be dnl'ed. Try to catch common mistakes.
define([AC_CACHE_VAL],
-[ifelse(regexp([$2], [AC_DEFINE]), [-1], [],
- [m4_warn([syntax],
+[ifelse(m4_regexp([$2], [AC_DEFINE]), [-1], [],
+ [m4_warn([syntax],
[$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
[where no actions should be taken])])dnl
AC_VAR_SET_IFELSE([$1],
@@ -2206,8 +2206,8 @@ define([AC_FATAL],
# Otherwise it's modern.
# We use two quotes in the pattern to keep highlighting tools at peace.
define([_AC_SH_QUOTE_IFELSE],
-[ifelse(regexp([$1], [\\[\\$]]),
- [-1], [ifelse(regexp([$1], [\\[`""]]),
+[ifelse(m4_regexp([$1], [\\[\\$]]),
+ [-1], [ifelse(m4_regexp([$1], [\\[`""]]),
[-1], [$2],
[$3])],
[$2])])
@@ -2222,7 +2222,7 @@ define([_AC_SH_QUOTE_IFELSE],
# the transition (for Libtool for instance).
define([_AC_SH_QUOTE],
[_AC_SH_QUOTE_IFELSE([$1],
- [patsubst([$1], [\([`""]\)], [\\\1])],
+ [m4_patsubst([$1], [\([`""]\)], [\\\1])],
[m4_warn([obsolete],
[backquotes and double quotes should not be backslashed in: $1])dnl
$1])])
@@ -2411,7 +2411,7 @@ define([AC_INCLUDES_DEFAULT],
AC_DEFUN([AC_CHECK_MEMBER],
[AC_VAR_INDIR_IFELSE([$1],
[AC_FATAL([$0: requires literal arguments])])dnl
-ifelse(regexp([$1], [\.]), -1,
+ifelse(m4_regexp([$1], [\.]), -1,
[AC_FATAL([$0: Did not see any dot in `$1'])])dnl
AC_REQUIRE([AC_HEADER_STDC])dnl
AC_VAR_PUSHDEF([ac_Member], [ac_cv_member_$1])dnl
@@ -2419,9 +2419,9 @@ AC_DEFUN([AC_CHECK_MEMBER],
AC_CACHE_CHECK([for $1], ac_Member,
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
[dnl AGGREGATE foo;
-patsubst([$1], [\..*]) foo;
+m4_patsubst([$1], [\..*]) foo;
dnl foo.MEMBER;
-foo.patsubst([$1], [^[^.]*\.]);])],
+foo.m4_patsubst([$1], [^[^.]*\.]);])],
AC_VAR_SET(ac_Member, yes),
AC_VAR_SET(ac_Member, no))])
AS_IFELSE([test AC_VAR_GET(ac_Member) = yes],
@@ -2439,8 +2439,9 @@ AC_DEFUN([AC_CHECK_MEMBERS],
[m4_foreach([AC_Member], [$1],
[AC_CHECK_MEMBER(AC_Member,
[AC_DEFINE_UNQUOTED(AC_TR_CPP(HAVE_[]AC_Member), 1,
- [Define if `]patsubst(AC_Member, [^[^.]*\.])[' is
- member of `]patsubst(AC_Member, [\..*])['.])
+ [Define if `]m4_patsubst(AC_Member,
+ [^[^.]*\.])[' is
+ member of `]m4_patsubst(AC_Member, [\..*])['.])
$2],
[$3],
[$4])])])
@@ -2779,7 +2780,9 @@ define([AH_CHECK_LIB],
# it must be a literal name.
AU_DEFUN([AC_HAVE_LIBRARY],
[m4_pushdef([AC_Lib_Name],
- patsubst(patsubst([[$1]], [lib\([^\.]*\)\.a], [\1]), [-l], []))dnl
+ m4_patsubst(m4_patsubst([[$1]],
+ [lib\([^\.]*\)\.a], [\1]),
+ [-l], []))dnl
AC_CHECK_LIB(AC_Lib_Name, main, [$2], [$3], [$4])dnl
ac_cv_lib_[]AC_Lib_Name()=ac_cv_lib_[]AC_Lib_Name()_main
m4_popdef([AC_Lib_Name])dnl
@@ -3388,7 +3391,7 @@ define([_AC_CHECK_TYPE_OLD],
# Because many people have used `off_t' and `size_t' too, they are added
# for better common-useward backward compatibility.
define([_AC_CHECK_TYPE_REPLACEMENT_TYPE_P],
-[ifelse(regexp([$1],
+[ifelse(m4_regexp([$1],
[^\(_Bool\|bool\|char\|double\|float\|int\|long\|short\|\(un\)?signed\|size_t\|off_t\)\([_a-zA-Z0-9()
*]\|\[\|\]\)*$]),
0, 1, 0)dnl
])# _AC_CHECK_TYPE_REPLACEMENT_TYPE_P
@@ -3398,7 +3401,7 @@ define([_AC_CHECK_TYPE_REPLACEMENT_TYPE_
# -----------------------------------
# Return `1' if STRING looks like a C/C++ type.
define([_AC_CHECK_TYPE_MAYBE_TYPE_P],
-[ifelse(regexp([$1], [^[_a-zA-Z0-9 ]+\([_a-zA-Z0-9() *]\|\[\|\]\)*$]),
+[ifelse(m4_regexp([$1], [^[_a-zA-Z0-9 ]+\([_a-zA-Z0-9() *]\|\[\|\]\)*$]),
0, 1, 0)dnl
])# _AC_CHECK_TYPE_MAYBE_TYPE_P
@@ -3515,8 +3518,8 @@ AC_DEFUN([AC_CHECK_TYPE],
# matching. The big problem is then that the active characters should
# be quoted. Currently `+*.' are quoted.
define([AC_CONFIG_IF_MEMBER],
-[ifelse(regexp($2, [\(^\| \)]patsubst([$1],
- [\([+*.]\)], [\\\1])[\(:\| \|$\)]),
+[ifelse(m4_regexp($2, [\(^\| \)]m4_patsubst([$1],
+ [\([+*.]\)], [\\\1])[\(:\| \|$\)]),
-1, [$4], [$3])])
@@ -3543,7 +3546,7 @@ define([_AC_CONFIG_DEPENDENCY],
define([_AC_CONFIG_DEPENDENCIES],
[m4_divert_push([KILL])
AC_FOREACH([AC_File], [$1],
- [_AC_CONFIG_DEPENDENCY(patsubst(AC_File, [:], [,]))])
+ [_AC_CONFIG_DEPENDENCY(m4_patsubst(AC_File, [:], [,]))])
m4_divert_pop()dnl
])
@@ -3560,7 +3563,7 @@ define([_AC_CONFIG_DEPENDENCIES],
define([_AC_CONFIG_UNIQUE],
[m4_divert_push([KILL])
AC_FOREACH([AC_File], [$1],
-[m4_pushdef([AC_Dest], patsubst(AC_File, [:.*]))
+[m4_pushdef([AC_Dest], m4_patsubst(AC_File, [:.*]))
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_HEADERS],
[AC_FATAL(`AC_Dest' [is already registered with AC_CONFIG_HEADER or
AC_CONFIG_HEADERS.])])
AC_CONFIG_IF_MEMBER(AC_Dest, [AC_LIST_LINKS],
@@ -3605,7 +3608,7 @@ AC_DEFUN([AC_CONFIG_COMMANDS],
ifelse([$2],,, [AC_FOREACH([AC_Name], [$1],
[m4_append([AC_LIST_COMMANDS_COMMANDS],
-[ ]patsubst(AC_Name, [:.*])[ ) $2 ;;
+[ ]m4_patsubst(AC_Name, [:.*])[ ) $2 ;;
])])])
_AC_CONFIG_COMMANDS_INIT([$3])
m4_divert_pop()dnl
@@ -3683,7 +3686,7 @@ AC_DEFUN([AC_CONFIG_HEADERS],
dnl Register the commands
ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
[m4_append([AC_LIST_HEADERS_COMMANDS],
-[ ]patsubst(AC_File, [:.*])[ ) $2 ;;
+[ ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
])])])
_AC_CONFIG_COMMANDS_INIT([$3])
m4_divert_pop()dnl
@@ -3714,13 +3717,13 @@ AC_DEFUN([AC_CONFIG_LINKS],
[m4_divert_push([KILL])
_AC_CONFIG_UNIQUE([$1])
_AC_CONFIG_DEPENDENCIES([$1])
-ifelse(regexp([$1], [^\.:\| \.:]), -1,,
+ifelse(m4_regexp([$1], [^\.:\| \.:]), -1,,
[AC_FATAL([$0: invalid destination: `.'])])
m4_append([AC_LIST_LINKS], [ $1])
dnl Register the commands
ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
[m4_append([AC_LIST_LINKS_COMMANDS],
-[ ]patsubst(AC_File, [:.*])[ ) $2 ;;
+[ ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
])])])
_AC_CONFIG_COMMANDS_INIT([$3])
m4_divert_pop()dnl
@@ -3791,7 +3794,7 @@ AC_DEFUN([AC_CONFIG_FILES],
dnl Register the commands.
ifelse([$2],,, [AC_FOREACH([AC_File], [$1],
[m4_append([AC_LIST_FILES_COMMANDS],
-[ ]patsubst(AC_File, [:.*])[ ) $2 ;;
+[ ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
])])])
_AC_CONFIG_COMMANDS_INIT([$3])
m4_divert_pop()dnl
@@ -4045,19 +4048,19 @@ define([_AC_OUTPUT_CONFIG_STATUS],
# Handling of arguments.
AC_FOREACH([AC_File], AC_LIST_FILES,
-[ 'patsubst(AC_File, [:.*])' )dnl
+[ 'm4_patsubst(AC_File, [:.*])' )dnl
CONFIG_FILES="$CONFIG_FILES AC_File" ;;
])dnl
AC_FOREACH([AC_File], AC_LIST_LINKS,
-[ 'patsubst(AC_File, [:.*])' )dnl
+[ 'm4_patsubst(AC_File, [:.*])' )dnl
CONFIG_LINKS="$CONFIG_LINKS AC_File" ;;
])dnl
AC_FOREACH([AC_File], AC_LIST_COMMANDS,
-[ 'patsubst(AC_File, [:.*])' )dnl
+[ 'm4_patsubst(AC_File, [:.*])' )dnl
CONFIG_COMMANDS="$CONFIG_COMMANDS AC_File" ;;
])dnl
AC_FOREACH([AC_File], AC_LIST_HEADERS,
-[ 'patsubst(AC_File, [:.*])' )dnl
+[ 'm4_patsubst(AC_File, [:.*])' )dnl
CONFIG_HEADERS="$CONFIG_HEADERS AC_File" ;;
])dnl
Index: autoconf.m4
--- autoconf.m4 Tue, 31 Oct 2000 02:06:47 +0100 akim (ace/28_autoconf.m 1.9 664)
+++ autoconf.m4 Wed, 01 Nov 2000 11:40:19 +0100 akim (ace/28_autoconf.m 1.9 664)
@@ -24,20 +24,23 @@
# yet when Autoconf is frozen.
# Do not sinclude ./aclocal.m4 here, to prevent it from being frozen.
-m4_include(m4sh.m4)
+m4_include([m4sh.m4])
# M4sugar and M4sh use exclusively the `m4_' prefix, but Autoconf,
# for historical reasons, uses the old names.
-m4_copy([m4_define], [define])
-m4_copy([m4_defn], [defn])
-m4_copy([m4_popdef], [popdef])
-m4_copy([m4_pushdef], [pushdef])
-m4_copy([m4_undefine], [undefine])
+m4_copy_unm4([m4_define])
+m4_copy_unm4([m4_defn])
+m4_copy_unm4([m4_patsubst])
+m4_copy_unm4([m4_popdef])
+m4_copy_unm4([m4_pushdef])
+m4_copy_unm4([m4_regexp])
+m4_copy_unm4([m4_translit])
+m4_copy_unm4([m4_undefine])
-m4_include(acversion.m4)
-m4_include(acgeneral.m4)
-m4_include(aclang.m4)
-m4_include(acfunctions.m4)
-m4_include(acspecific.m4)
-m4_include(acoldnames.m4)
+m4_include([acversion.m4])
+m4_include([acgeneral.m4])
+m4_include([aclang.m4])
+m4_include([acfunctions.m4])
+m4_include([acspecific.m4])
+m4_include([acoldnames.m4])
Index: m4sugar.m4
--- m4sugar.m4 Tue, 31 Oct 2000 02:06:47 +0100 akim (ace/b/27_libm4.m4 1.28 644)
+++ m4sugar.m4 Wed, 01 Nov 2000 11:47:24 +0100 akim (ace/b/27_libm4.m4 1.28 644)
@@ -91,14 +91,38 @@ define([m4_undefine], defn([undefine]))
m4_define([m4_rename],
[m4_copy([$1], [$2])m4_undefine([$1])])
+
+# m4_rename_m4(MACRO-NAME)
+# ------------------------
+# Rename MACRO-NAME as m4_MACRO-NAME.
+m4_define([m4_rename_m4],
+[m4_rename([$1], [m4_$1])])
+
+
+# m4_copy_unm4(m4_MACRO-NAME)
+# ---------------------------
+# Copy m4_MACRO-NAME as MACRO-NAME.
+m4_define([m4_copy_unm4],
+[m4_copy([$1], m4_patsubst([[$1]], [[m4_]]))])
+
+
# Some m4 internals have names colliding with tokens we might use.
# Rename them a` la `m4 --prefix-builtins'.
-m4_rename([eval], [m4_eval])
-m4_rename([format], [m4_format])
-m4_rename([popdef], [m4_popdef])
-m4_rename([pushdef], [m4_pushdef])
-m4_rename([shift], [m4_shift])
-m4_rename([symbols], [m4_symbols])
+m4_rename_m4([debugfile])
+m4_rename_m4([debugmode])
+m4_rename_m4([eval])
+m4_rename_m4([format])
+m4_rename([m4exit], [m4_exit])
+m4_rename([m4wrap], [m4_wrap])
+m4_rename_m4([maketemp])
+m4_rename_m4([patsubst])
+m4_rename_m4([popdef])
+m4_rename_m4([pushdef])
+m4_rename_m4([regexp])
+m4_rename_m4([shift])
+m4_rename_m4([substr])
+m4_rename_m4([symbols])
+m4_rename_m4([translit])
## ------------------- ##
@@ -131,7 +155,7 @@ define([m4_undefine], defn([undefine]))
m4_define([m4_fatal],
[m4_errprint(m4_location[: error: $1])dnl
m4_expansion_stack_dump()dnl
-m4exit(ifelse([$2],, 1, [$2]))])
+m4_exit(ifelse([$2],, 1, [$2]))])
# m4_assert( EXPRESSION [, EXIT-STATUS = 1 ])
@@ -358,7 +382,7 @@ define([m4_undefine], defn([undefine]))
[ifelse([$#], 0, [],
[$#], 1, [],
[$#], 2, [$2],
- regexp([$1], [$2]), -1, [m4_match([$1], m4_shiftn(3, $@))],
+ m4_regexp([$1], [$2]), -1, [m4_match([$1], m4_shiftn(3, $@))],
[$3])])
@@ -1150,14 +1174,14 @@ define([m4_undefine], defn([undefine]))
# ------------------
# These macros lowercase and uppercase strings.
m4_define([m4_tolower],
-[translit([$1],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ],
- [abcdefghijklmnopqrstuvwxyz])])
+[m4_translit([$1],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ],
+ [abcdefghijklmnopqrstuvwxyz])])
m4_define([m4_toupper],
-[translit([$1],
- [abcdefghijklmnopqrstuvwxyz],
- [ABCDEFGHIJKLMNOPQRSTUVWXYZ])])
+[m4_translit([$1],
+ [abcdefghijklmnopqrstuvwxyz],
+ [ABCDEFGHIJKLMNOPQRSTUVWXYZ])])
# m4_split(STRING, [REGEXP])
@@ -1189,9 +1213,9 @@ define([m4_undefine], defn([undefine]))
<<changequote(``, '')dnl
[dnl Can't use m4_default here instead of ifelse, because m4_default uses
dnl [ and ] as quotes.
-patsubst(````$1'''',
- ifelse(``$2'',, ``[ ]+'', ``$2''),
- ``], ['')]dnl
+m4_patsubst(````$1'''',
+ ifelse(``$2'',, ``[ ]+'', ``$2''),
+ ``], ['')]dnl
changequote([, ])>>)
changequote([, ])
@@ -1208,7 +1232,7 @@ define([m4_undefine], defn([undefine]))
# ive])end
# => active activeend
m4_define([m4_join],
-[translit(patsubst([[[$1]]], [\\
+[m4_translit(m4_patsubst([[[$1]]], [\\
]), [
], [ ])])
@@ -1235,7 +1259,7 @@ define([m4_undefine], defn([undefine]))
# the *third* character, since there are two leading `['; Equally for
# the outer patsubst.
m4_define([m4_strip],
-[patsubst(patsubst(patsubst([[[[$1]]]],
+[m4_patsubst(m4_patsubst(m4_patsubst([[[[$1]]]],
[[ ]+], [ ]),
[^\(..\) ], [\1]),
[ \(.\)$], [\1])])
@@ -1301,8 +1325,8 @@ define([m4_undefine], defn([undefine]))
[$3])])])
-# m4_wrap(STRING, [PREFIX], [FIRST-PREFIX], [WIDTH])
-# --------------------------------------------------
+# m4_text_wrap(STRING, [PREFIX], [FIRST-PREFIX], [WIDTH])
+# -------------------------------------------------------
# Expands into STRING wrapped to hold in WIDTH columns (default = 79).
# If prefix is set, each line is prefixed with it. If FIRST-PREFIX is
# specified, then the first line is prefixed with it. As a special
@@ -1311,21 +1335,21 @@ define([m4_undefine], defn([undefine]))
#
# Typical outputs are:
#
-# m4_wrap([Short string */], [ ], [/* ], 20)
+# m4_text_wrap([Short string */], [ ], [/* ], 20)
# => /* Short string */
#
-# m4_wrap([Much longer string */], [ ], [/* ], 20)
+# m4_text_wrap([Much longer string */], [ ], [/* ], 20)
# => /* Much longer
# => string */
#
-# m4_wrap([Short doc.], [ ], [ --short ], 30)
+# m4_text_wrap([Short doc.], [ ], [ --short ], 30)
# => --short Short doc.
#
-# m4_wrap([Short doc.], [ ], [ --too-wide ], 30)
+# m4_text_wrap([Short doc.], [ ], [ --too-wide ], 30)
# => --too-wide
# => Short doc.
#
-# m4_wrap([Super long documentation.], [ ], [ --too-wide ], 30)
+# m4_text_wrap([Super long documentation.], [ ], [ --too-wide ], 30)
# => --too-wide
# => Super long
# => documentation.
@@ -1338,7 +1362,7 @@ define([m4_undefine], defn([undefine]))
# what complicates it a bit. The algorithm is stupid simple: all the
# words are preceded by m4_Separator which is defined to empty for the
# first word, and then ` ' (single space) for all the others.
-m4_define([m4_wrap],
+m4_define([m4_text_wrap],
[m4_pushdef([m4_Prefix], m4_default([$2], []))dnl
m4_pushdef([m4_Prefix1], m4_default([$3], [m4_Prefix]))dnl
m4_pushdef([m4_Width], m4_default([$4], 79))dnl
@@ -1429,15 +1453,15 @@ define([m4_undefine], defn([undefine]))
# This macro is absolutely not robust to active macro, it expects
# reasonable version numbers and is valid up to `z', no double letters.
m4_define([m4_version_unletter],
-[translit(patsubst(patsubst(patsubst([$1],
- [\([0-9]+\)\([abcdefghi]\)],
- [m4_eval(\1 + 1).-1.\2]),
- [\([0-9]+\)\([jklmnopqrs]\)],
- [m4_eval(\1 + 1).-1.1\2]),
- [\([0-9]+\)\([tuvwxyz]\)],
- [m4_eval(\1 + 1).-1.2\2]),
- abcdefghijklmnopqrstuvwxyz,
- 12345678901234567890123456)])
+[m4_translit(m4_patsubst(m4_patsubst(m4_patsubst([$1],
+ [\([0-9]+\)\([abcdefghi]\)],
+ [m4_eval(\1 + 1).-1.\2]),
+ [\([0-9]+\)\([jklmnopqrs]\)],
+ [m4_eval(\1 + 1).-1.1\2]),
+ [\([0-9]+\)\([tuvwxyz]\)],
+ [m4_eval(\1 + 1).-1.2\2]),
+ [abcdefghijklmnopqrstuvwxyz],
+ [12345678901234567890123456])])
# m4_version_compare(VERSION-1, VERSION-2)
Index: tests/atspecific.m4
--- tests/atspecific.m4 Thu, 26 Oct 2000 21:03:04 +0200 akim
(ace/b/24_atspecific 1.17 664)
+++ tests/atspecific.m4 Wed, 01 Nov 2000 12:28:51 +0100 akim
(ace/b/24_atspecific 1.17 664)
@@ -22,10 +22,12 @@
include(atgeneral.m4)divert(-1)
-# Until the day Autotest, Ad'HoC and Autoconf share the same m4sugar, we
+# Until the day Autotest, Ad'HoC and Autoconf share the same M4sugar, we
# have to reinstall some m4 builtins that atgeneral.m4 undefined.
AT_DEFINE([m4_shift],
[builtin([shift], $@)])
+AT_DEFINE([m4_patsubst],
+[builtin([patsubst], $@)])
AT_DEFINE([define],
[builtin([define], $@)])
Index: tests/m4sugar.at
--- tests/m4sugar.at Thu, 26 Oct 2000 21:03:04 +0200 akim (ace/b/45_m4sugar.at
1.1 644)
+++ tests/m4sugar.at Wed, 01 Nov 2000 11:37:53 +0100 akim (ace/b/45_m4sugar.at
1.1 644)
@@ -6,29 +6,29 @@
EOF
-## ------- ##
-## m4_wrap ##
-## ------- ##
+## -------------- ##
+## m4_text_wrap. ##
+## -------------- ##
-AT_SETUP(m4_wrap)
+AT_SETUP(m4_text_wrap)
-# m4_wrap is used to display the help strings. Also, check that
+# m4_text_wrap is used to display the help strings. Also, check that
# commas are not swallowed. This can easily happen because of
# m4-listification.
AT_DATA(configure.in,
[[AC_PLAIN_SCRIPT()dnl
-m4_wrap([Short string */], [ ], [/* ], 20)
+m4_text_wrap([Short string */], [ ], [/* ], 20)
-m4_wrap([Much longer string */], [ ], [/* ], 20)
+m4_text_wrap([Much longer string */], [ ], [/* ], 20)
-m4_wrap([Short doc.], [ ], [ --short ], 30)
+m4_text_wrap([Short doc.], [ ], [ --short ], 30)
-m4_wrap([Short doc.], [ ], [ --too-wide], 30)
+m4_text_wrap([Short doc.], [ ], [ --too-wide], 30)
-m4_wrap([Super long documentation.], [ ], [ --too-wide], 30)
+m4_text_wrap([Super long documentation.], [ ], [ --too-wide], 30)
-m4_wrap([First, second , third, [,quoted]])
+m4_text_wrap([First, second , third, [,quoted]])
]])
AT_DATA(expout,
Index: tests/torture.at
--- tests/torture.at Sun, 15 Oct 2000 09:30:12 +0200 akim (ace/b/26_torture.m4
1.14 644)
+++ tests/torture.at Tue, 31 Oct 2000 03:59:47 +0100 akim (ace/b/26_torture.m4
1.14 644)
@@ -34,7 +34,7 @@ define(DEFINE_Description,
# this is admittedly a bug, but it would be too hard to fix this.
# There is really no point in AC_DEFINE a var named ac_d.*.
define(AT_DUMMY_VAR,
-[ac_Dummy_[]patsubst([000$1], [.*\(...\)$], [\1])])
+[ac_Dummy_[]m4_patsubst([000$1], [.*\(...\)$], [\1])])
dnl This call was quite delicate to write because we didn't want to
dnl produce the 100 commands by hand. Be very careful if you want to
- 18-m4-regexp.patch,
Akim Demaille <=