autoconf-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

24-fyi-batsubst.patch


From: Akim Demaille
Subject: 24-fyi-batsubst.patch
Date: Mon, 08 Oct 2001 10:29:57 +0200

Index: ChangeLog
from  Akim Demaille  <address@hidden>
        * lib/autoconf/autoconf.m4, lib/autoconf/general.m4,
        * lib/autoconf/libs.m4, lib/autoconf/status.m4,
        * lib/autoconf/types.m4, lib/autotest/general.m4,
        * lib/m4sugar/m4sh.m4, lib/m4sugar/m4sugar.m4, tests/atspecific.m4,
        * tests/torture.at: Rename m4_regexp, m4_patsubst, and m4_match to
        m4_bregexp, m4_bpatsubst, and m4_bmatch.
        * doc/autoconf.texi (Redefined M4 Macros): Adjust.
        
        
Index: doc/autoconf.texi
--- doc/autoconf.texi Sun, 07 Oct 2001 14:20:55 +0200 akim
+++ doc/autoconf.texi Sun, 07 Oct 2001 18:47:52 +0200 akim
@@ -6836,12 +6836,26 @@ @node Redefined M4 Macros
 to recover the behavior of the builtin.
 @end defmac
 
address@hidden m4_bpatsubst (@var{string}, @var{regexp}, @ovar{replacement})
address@hidden bpatsubst
+This macro corresponds to @code{patsubst}.  The name @code{m4_patsubst}
+is kept for future versions of M4sh, on top of @sc{gnu} M4 which will
+provide extended regular expression syntax via @code{epatsubst}.
address@hidden defmac
+
 @defmac m4_popdef (@var{macro})
 @msindex defn
 Contrary to the M4 builtin, this macro fails if @var{macro} is not
 defined.  See @code{m4_undefine}.
 @end defmac
 
address@hidden m4_bregexp (@var{string}, @var{regexp}, @ovar{replacement})
address@hidden bregexp
+This macro corresponds to @code{regexp}.  The name @code{m4_regexp}
+is kept for future versions of M4sh, on top of @sc{gnu} M4 which will
+provide extended regular expression syntax via @code{eregexp}.
address@hidden defmac
+
 @defmac m4_wrap (@var{text})
 @msindex m4_wrap
 This macro corresponds to @code{m4wrap}.
@@ -7349,14 +7363,14 @@ @node Coding Style
 instead of:
 
 @example
-m4_patsubst([$1], [$"])
+m4_bpatsubst([$1], [$"])
 @end example
 
 @noindent
 use
 
 @example
-m4_patsubst([$1], [$""])
+m4_bpatsubst([$1], [$""])
 @end example
 
 @noindent
@@ -11811,7 +11825,7 @@ @node Why GNU m4
 @example
 m4_builtin
 m4_indir
-m4_patsubst
+m4_bpatsubst
 __file__
 __line__
 @end example
Index: lib/autoconf/autoconf.m4
--- lib/autoconf/autoconf.m4 Fri, 24 Aug 2001 09:53:17 +0200 akim
+++ lib/autoconf/autoconf.m4 Sun, 07 Oct 2001 18:58:13 +0200 akim
@@ -92,10 +92,10 @@
 m4_copy_unm4([m4_index])
 m4_copy_unm4([m4_indir])
 m4_copy_unm4([m4_len])
-m4_copy_unm4([m4_patsubst])
+m4_copy([m4_bpatsubst], [patsubst])
 m4_copy_unm4([m4_popdef])
 m4_copy_unm4([m4_pushdef])
-m4_copy_unm4([m4_regexp])
+m4_copy([m4_bregexp], [regexp])
 m4_copy_unm4([m4_sinclude])
 m4_copy_unm4([m4_syscmd])
 m4_copy_unm4([m4_sysval])
Index: lib/autoconf/general.m4
--- lib/autoconf/general.m4 Sun, 07 Oct 2001 16:25:47 +0200 akim
+++ lib/autoconf/general.m4 Sun, 07 Oct 2001 18:58:13 +0200 akim
@@ -291,7 +291,7 @@ m4_define([_AC_INIT_PACKAGE],
 AS_LITERAL_IF([$3], [],  [m4_warn([syntax], [AC_INIT: not a literal: $3])])
 m4_define([AC_PACKAGE_NAME],     [$1])
 m4_define([AC_PACKAGE_TARNAME],
-          m4_tolower(m4_patsubst([[[$1]]], [GNU ])))
+          m4_tolower(m4_bpatsubst([[[$1]]], [GNU ])))
 m4_define([AC_PACKAGE_VERSION],   [$2])
 m4_define([AC_PACKAGE_STRING],    [$1 $2])
 m4_define([AC_PACKAGE_BUGREPORT], [$3])
@@ -307,10 +307,10 @@ m4_define([AC_PACKAGE_BUGREPORT], [$3])
 # would have not been evaluated.  Another solution, a bit fragile,
 # would have be to use m4_quote to force an evaluation:
 #
-#     m4_patsubst(m4_quote($1), [^], [# ])
+#     m4_bpatsubst(m4_quote($1), [^], [# ])
 m4_define([AC_COPYRIGHT],
 [m4_divert_text([HEADER-COPYRIGHT],
-[m4_patsubst([
+[m4_bpatsubst([
 $1], [^], address@hidden:@ ])])dnl
 m4_divert_text(m4_default([$2], [VERSION_USER]),
 [
@@ -1159,7 +1159,7 @@ m4_define([_AC_INIT_PREPARE],
     echo
     AS_BOX([Cache variables.])
     echo
-    m4_patsubst(m4_patsubst(m4_dquote(m4_defn([_AC_CACHE_DUMP])),
+    m4_bpatsubst(m4_bpatsubst(m4_dquote(m4_defn([_AC_CACHE_DUMP])),
                             [^ *\(#.*\)?
 ]),
                 ['], ['"'"'])
@@ -1260,8 +1260,8 @@ AC_DEFUN([AC_ARG_ENABLE],
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]]])dnl
 m4_divert_once([HELP_ENABLE], [$2])dnl
 # Check whether --enable-$1 or --disable-$1 was given.
-if test "[${enable_]m4_patsubst([$1], -, _)+set}" = set; then
-  enableval="[$enable_]m4_patsubst([$1], -, _)"
+if test "[${enable_]m4_bpatsubst([$1], -, _)+set}" = set; then
+  enableval="[$enable_]m4_bpatsubst([$1], -, _)"
   $3
 m4_ifvaln([$4], [else
   $4])dnl
@@ -1288,8 +1288,8 @@ AC_DEFUN([AC_ARG_WITH],
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)]])
 m4_divert_once([HELP_WITH], [$2])dnl
 # Check whether --with-$1 or --without-$1 was given.
-if test "[${with_]m4_patsubst([$1], -, _)+set}" = set; then
-  withval="[$with_]m4_patsubst([$1], -, _)"
+if test "[${with_]m4_bpatsubst([$1], -, _)+set}" = set; then
+  withval="[$with_]m4_bpatsubst([$1], -, _)"
   $3
 m4_ifvaln([$4], [else
   $4])dnl
@@ -1733,7 +1733,7 @@ m4_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.
 m4_define([AC_CACHE_VAL],
-[m4_match([$2], [AC_DEFINE],
+[m4_bmatch([$2], [AC_DEFINE],
           [AC_DIAGNOSE(syntax,
 [$0($1, ...): suspicious presence of an AC_DEFINE in the second argument, ]dnl
 [where no actions should be taken])])dnl
Index: lib/autoconf/libs.m4
--- lib/autoconf/libs.m4 Tue, 21 Aug 2001 10:28:25 +0200 akim
+++ lib/autoconf/libs.m4 Sun, 07 Oct 2001 18:58:13 +0200 akim
@@ -152,7 +152,7 @@ m4_define([AH_CHECK_LIB],
 # it must be a literal name.
 AU_DEFUN([AC_HAVE_LIBRARY],
 [m4_pushdef([AC_Lib_Name],
-            m4_patsubst(m4_patsubst([[$1]],
+            m4_bpatsubst(m4_bpatsubst([[$1]],
                                     [lib\([^\.]*\)\.a], [\1]),
                         [-l], []))dnl
 AC_CHECK_LIB(AC_Lib_Name, main, [$2], [$3], [$4])dnl
Index: lib/autoconf/status.m4
--- lib/autoconf/status.m4 Mon, 01 Oct 2001 16:36:39 +0200 akim
+++ lib/autoconf/status.m4 Sun, 07 Oct 2001 18:58:13 +0200 akim
@@ -186,7 +186,7 @@ m4_define([_AC_SRCPATHS],
 # matching.  The big problem is then that the active characters should
 # be quoted.  Currently `+*.' are quoted.
 m4_define([AC_CONFIG_IF_MEMBER],
-[m4_match($2, [\(^\| \)]m4_re_escape([$1])[\(:\| \|$\)]),
+[m4_bmatch($2, [\(^\| \)]m4_re_escape([$1])[\(:\| \|$\)]),
           [$3], [$4])])
 
 
@@ -213,7 +213,7 @@ m4_define([_AC_CONFIG_DEPENDENCY],
 m4_define([_AC_CONFIG_DEPENDENCIES],
 [m4_divert_push([KILL])
 AC_FOREACH([AC_File], [$1],
-  [_AC_CONFIG_DEPENDENCY(m4_patsubst(AC_File, [:], [,]))])
+  [_AC_CONFIG_DEPENDENCY(m4_bpatsubst(AC_File, [:], [,]))])
 m4_divert_pop([KILL])dnl
 ])
 
@@ -230,7 +230,7 @@ m4_define([_AC_CONFIG_DEPENDENCIES],
 m4_define([_AC_CONFIG_UNIQUE],
 [m4_divert_push([KILL])
 AC_FOREACH([AC_File], [$1],
-[m4_pushdef([AC_Dest], m4_patsubst(AC_File, [:.*]))
+[m4_pushdef([AC_Dest], m4_bpatsubst(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],
@@ -282,7 +282,7 @@ AC_DEFUN([AC_CONFIG_COMMANDS],
 
 m4_if([$2],,, [AC_FOREACH([AC_Name], [$1],
 [m4_append([AC_LIST_COMMANDS_COMMANDS],
-[    ]m4_patsubst(AC_Name, [:.*])[ ) $2 ;;
+[    ]m4_bpatsubst(AC_Name, [:.*])[ ) $2 ;;
 ])])])
 _AC_CONFIG_COMMANDS_INIT([$3])
 m4_divert_pop([KILL])dnl
@@ -396,7 +396,7 @@ AC_DEFUN([AC_CONFIG_HEADERS],
 dnl Register the commands
 m4_ifval([$2], [AC_FOREACH([AC_File], [$1],
 [m4_append([AC_LIST_HEADERS_COMMANDS],
-[    ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
+[    ]m4_bpatsubst(AC_File, [:.*])[ ) $2 ;;
 ])])])
 _AC_CONFIG_COMMANDS_INIT([$3])
 m4_divert_pop([KILL])dnl
@@ -671,12 +671,12 @@ AC_DEFUN([AC_CONFIG_LINKS],
 [m4_divert_push([KILL])
 _AC_CONFIG_UNIQUE([$1])
 _AC_CONFIG_DEPENDENCIES([$1])
-m4_match([$1], [^\.:\| \.:], [m4_fatal([$0: invalid destination: `.'])])
+m4_bmatch([$1], [^\.:\| \.:], [m4_fatal([$0: invalid destination: `.'])])
 m4_append([AC_LIST_LINKS], [ $1])
 dnl Register the commands
 m4_ifval([$2], [AC_FOREACH([AC_File], [$1],
 [m4_append([AC_LIST_LINKS_COMMANDS],
-[    ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
+[    ]m4_bpatsubst(AC_File, [:.*])[ ) $2 ;;
 ])])])
 _AC_CONFIG_COMMANDS_INIT([$3])
 m4_divert_pop([KILL])dnl
@@ -803,7 +803,7 @@ AC_DEFUN([AC_CONFIG_FILES],
 dnl Register the commands.
 m4_ifval([$2], [AC_FOREACH([AC_File], [$1],
 [m4_append([AC_LIST_FILES_COMMANDS],
-[    ]m4_patsubst(AC_File, [:.*])[ ) $2 ;;
+[    ]m4_bpatsubst(AC_File, [:.*])[ ) $2 ;;
 ])])])
 _AC_CONFIG_COMMANDS_INIT([$3])
 m4_divert_pop([KILL])dnl
@@ -1425,19 +1425,19 @@ Usage: $[0] [[OPTIONS]] [[FILE]]...
   case "$ac_config_target" in
   # Handling of arguments.
 AC_FOREACH([AC_File], AC_LIST_FILES,
-[  "m4_patsubst(AC_File, [:.*])" )dnl
+[  "m4_bpatsubst(AC_File, [:.*])" )dnl
  CONFIG_FILES="$CONFIG_FILES AC_File" ;;
 ])dnl
 AC_FOREACH([AC_File], AC_LIST_LINKS,
-[  "m4_patsubst(AC_File, [:.*])" )dnl
+[  "m4_bpatsubst(AC_File, [:.*])" )dnl
  CONFIG_LINKS="$CONFIG_LINKS AC_File" ;;
 ])dnl
 AC_FOREACH([AC_File], AC_LIST_COMMANDS,
-[  "m4_patsubst(AC_File, [:.*])" )dnl
+[  "m4_bpatsubst(AC_File, [:.*])" )dnl
  CONFIG_COMMANDS="$CONFIG_COMMANDS AC_File" ;;
 ])dnl
 AC_FOREACH([AC_File], AC_LIST_HEADERS,
-[  "m4_patsubst(AC_File, [:.*])" )dnl
+[  "m4_bpatsubst(AC_File, [:.*])" )dnl
  CONFIG_HEADERS="$CONFIG_HEADERS AC_File" ;;
 ])dnl
   *) AC_MSG_ERROR([invalid argument: $ac_config_target]);;
Index: lib/autoconf/types.m4
--- lib/autoconf/types.m4 Fri, 05 Oct 2001 19:29:25 +0200 akim
+++ lib/autoconf/types.m4 Sun, 07 Oct 2001 18:58:13 +0200 akim
@@ -193,7 +193,7 @@ m4_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.
 m4_define([_AC_CHECK_TYPE_REPLACEMENT_TYPE_P],
-[m4_match([$1],
+[m4_bmatch([$1],
           
[^\(_Bool\|bool\|char\|double\|float\|int\|long\|short\|\(un\)?signed\|[_a-zA-Z][_a-zA-Z0-9]*_t\)[][_a-zA-Z0-9()
 *]*$],
           1, 0)dnl
 ])# _AC_CHECK_TYPE_REPLACEMENT_TYPE_P
@@ -203,7 +203,7 @@ m4_define([_AC_CHECK_TYPE_REPLACEMENT_TY
 # -----------------------------------
 # Return `1' if STRING looks like a C/C++ type.
 m4_define([_AC_CHECK_TYPE_MAYBE_TYPE_P],
-[m4_match([$1], [^[_a-zA-Z0-9 ]+\([_a-zA-Z0-9() *]\|\[\|\]\)*$],
+[m4_bmatch([$1], [^[_a-zA-Z0-9 ]+\([_a-zA-Z0-9() *]\|\[\|\]\)*$],
           1, 0)dnl
 ])# _AC_CHECK_TYPE_MAYBE_TYPE_P
 
@@ -418,16 +418,16 @@ AC_DEFUN([AC_CHECK_SIZEOF],
 AC_DEFUN([AC_CHECK_MEMBER],
 [AS_LITERAL_IF([$1], [],
                [AC_FATAL([$0: requires literal arguments])])dnl
-m4_match([$1], [\.], ,
+m4_bmatch([$1], [\.], ,
          [m4_fatal([$0: Did not see any dot in `$1'])])dnl
 AS_VAR_PUSHDEF([ac_Member], [ac_cv_member_$1])dnl
 dnl Extract the aggregate name, and the member name
 AC_CACHE_CHECK([for $1], ac_Member,
 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT([$4])],
 [dnl AGGREGATE ac_aggr;
-static m4_patsubst([$1], [\..*]) ac_aggr;
+static m4_bpatsubst([$1], [\..*]) ac_aggr;
 dnl ac_aggr.MEMBER;
-if (ac_aggr.m4_patsubst([$1], [^[^.]*\.]))
+if (ac_aggr.m4_bpatsubst([$1], [^[^.]*\.]))
 return 0;])],
                 [AS_VAR_SET(ac_Member, yes)],
                 [AS_VAR_SET(ac_Member, no)])])
@@ -445,9 +445,9 @@ AC_DEFUN([AC_CHECK_MEMBERS],
 [m4_foreach([AC_Member], [$1],
   [AC_CHECK_MEMBER(AC_Member,
          [AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_[]AC_Member), 1,
-                            [Define if `]m4_patsubst(AC_Member,
+                            [Define if `]m4_bpatsubst(AC_Member,
                                                      [^[^.]*\.])[' is
-                             member of `]m4_patsubst(AC_Member, [\..*])['.])
+                             member of `]m4_bpatsubst(AC_Member, [\..*])['.])
 $2],
                  [$3],
                  [$4])])])
Index: lib/autotest/general.m4
--- lib/autotest/general.m4 Sun, 07 Oct 2001 14:11:51 +0200 akim
+++ lib/autotest/general.m4 Sun, 07 Oct 2001 18:58:13 +0200 akim
@@ -73,7 +73,7 @@ m4_define([_m4_divert(TAIL)],         60
 #
 # Gee, we can't use simply
 #
-#  m4_patsubst(__file__, [^.*/\(.*\)], [[\1]])
+#  m4_bpatsubst(__file__, [^.*/\(.*\)], [[\1]])
 #
 # since then, since `dnl' doesn't match the pattern, it is returned
 # with once quotation level less, so you lose, dammit!  And since GNU M4
@@ -81,7 +81,7 @@ m4_define([_m4_divert(TAIL)],         60
 # even think about using `?' or `\?'.  Bah, `*' will do.
 # Pleeeeeeeease, Gary, provide us with dirname and ERE!
 m4_define([AT_LINE],
-[m4_patsubst(__file__, [^\(.*/\)*\(.*\)], [[\2]]):__line__])
+[m4_bpatsubst(__file__, [^\(.*/\)*\(.*\)], [[\2]]):__line__])
 
 
 # AT_INIT([TESTSUITE-NAME])
@@ -681,7 +681,7 @@ m4_define([_AT_CLEANUP_FILE],
 # -----------------------
 # Declare a list of FILES to clean.
 m4_define([AT_CLEANUP_FILES],
-[m4_foreach([AT_File], m4_quote(m4_patsubst([$1], [  *], [,])),
+[m4_foreach([AT_File], m4_quote(m4_bpatsubst([$1], [  *], [,])),
             [_AT_CLEANUP_FILE(AT_File)])])
 
 
Index: lib/m4sugar/m4sh.m4
--- lib/m4sugar/m4sh.m4 Sun, 07 Oct 2001 18:39:23 +0200 akim
+++ lib/m4sugar/m4sh.m4 Sun, 07 Oct 2001 18:58:13 +0200 akim
@@ -270,7 +270,7 @@ m4_define([AS_IF],
 # ---------------------------------
 # Escape the CHARS in STRING.
 m4_define([AS_ESCAPE],
-[m4_patsubst([$1],
+[m4_bpatsubst([$1],
              m4_ifval([$2], [[\([$2]\)]], [[\([\"$`]\)]]),
              [\\\1])])
 
@@ -284,7 +284,7 @@ m4_define([AS_ESCAPE],
 # Otherwise it's modern.
 # We use two quotes in the pattern to keep highlighting tools at peace.
 m4_define([_AS_QUOTE_IFELSE],
-[m4_match([$1],
+[m4_bmatch([$1],
           [\\[\\$]], [$2],
           [\\[`""]], [$3],
           [$2])])
@@ -704,7 +704,7 @@ m4_define([_AS_BOX_INDIR],
 # This is an *approximation*: for instance EXPRESSION = `\$' is
 # definitely a literal, but will not be recognized as such.
 m4_define([AS_LITERAL_IF],
-[m4_match([$1], [[`$]],
+[m4_bmatch([$1], [[`$]],
           [$3], [$2])])
 
 
@@ -811,7 +811,7 @@ m4_define([AS_UNAME],
 m4_defun([AS_TR_SH],
 [AS_REQUIRE([_$0_PREPARE])dnl
 AS_LITERAL_IF([$1],
-              [m4_patsubst(m4_translit([[$1]], [*+], [pp]),
+              [m4_bpatsubst(m4_translit([[$1]], [*+], [pp]),
                            [[^a-zA-Z0-9_]], [_])],
               [`echo "$1" | $as_tr_sh`])])
 
@@ -833,7 +833,7 @@ m4_define([AS_UNAME],
 m4_defun([AS_TR_CPP],
 [AS_REQUIRE([_$0_PREPARE])dnl
 AS_LITERAL_IF([$1],
-              [m4_patsubst(m4_translit([[$1]],
+              [m4_bpatsubst(m4_translit([[$1]],
                                        [*abcdefghijklmnopqrstuvwxyz],
                                        [PABCDEFGHIJKLMNOPQRSTUVWXYZ]),
                            [[^A-Z0-9_]], [_])],
@@ -883,7 +883,7 @@ m4_define([AS_VAR_SET],
 m4_define([AS_VAR_GET],
 [AS_LITERAL_IF([$1],
                [$$1],
-               [`eval echo '${'m4_patsubst($1, [[\\`]], [\\\&])'}'`])])
+               [`eval echo '${'m4_bpatsubst($1, [[\\`]], [\\\&])'}'`])])
 
 
 # AS_VAR_TEST_SET(VARIABLE)
Index: lib/m4sugar/m4sugar.m4
--- lib/m4sugar/m4sugar.m4 Sun, 07 Oct 2001 16:25:47 +0200 akim
+++ lib/m4sugar/m4sugar.m4 Sun, 07 Oct 2001 18:58:13 +0200 akim
@@ -111,7 +111,7 @@ m4_define([m4_rename_m4],
 # ---------------------------
 # Copy m4_MACRO-NAME as MACRO-NAME.
 m4_define([m4_copy_unm4],
-[m4_copy([$1], m4_patsubst([$1], [^m4_\(.*\)], [[\1]]))])
+[m4_copy([$1], m4_bpatsubst([$1], [^m4_\(.*\)], [[\1]]))])
 
 
 # Some m4 internals have names colliding with tokens we might use.
@@ -139,10 +139,10 @@ m4_define([m4_copy_unm4],
 m4_rename([m4exit], [m4_exit])
 m4_rename([m4wrap], [m4_wrap])
 m4_rename_m4([maketemp])
-m4_rename_m4([patsubst])
+m4_rename([patsubst], [m4_bpatsubst])
 m4_undefine([popdef])
 m4_rename_m4([pushdef])
-m4_rename_m4([regexp])
+m4_rename([regexp], [m4_bregexp])
 m4_rename_m4([shift])
 m4_rename_m4([sinclude])
 m4_rename_m4([substr])
@@ -403,8 +403,8 @@ m4_define([m4_case],
        [m4_case([$1], m4_shiftn(3, $@))])])
 
 
-# m4_match(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
-# ----------------------------------------------------
+# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
+# -----------------------------------------------------
 # m4 equivalent of
 #
 # if (SWITCH =~ RE1)
@@ -418,11 +418,11 @@ m4_define([m4_case],
 #
 # All the values are optional, and the macro is robust to active symbols
 # properly quoted.
-m4_define([m4_match],
+m4_define([m4_bmatch],
 [m4_if([$#], 0, [],
        [$#], 1, [],
        [$#], 2, [$2],
-       m4_regexp([$1], [$2]), -1, [m4_match([$1], m4_shiftn(3, $@))],
+       m4_bregexp([$1], [$2]), -1, [m4_bmatch([$1], m4_shiftn(3, $@))],
        [$3])])
 
 
@@ -1342,8 +1342,8 @@ m4_define([m4_cr_symbols2],
 # --------------------
 # Escape BRE active characters in STRING.
 m4_define([m4_re_escape],
-[m4_patsubst([$1],
-             [[][+*.]], [\\\&])])
+[m4_bpatsubst([$1],
+              [[][+*.]], [\\\&])])
 
 
 # m4_re_string
@@ -1403,9 +1403,9 @@ m4_define(<<m4_split>>,
 <<m4_changequote(``, '')dnl
 [dnl Can't use m4_default here instead of m4_if, because m4_default uses
 dnl [ and ] as quotes.
-m4_patsubst(````$1'''',
-           m4_if(``$2'',, ``[  ]+'', ``$2''),
-           ``], ['')]dnl
+m4_bpatsubst(````$1'''',
+            m4_if(``$2'',, ``[         ]+'', ``$2''),
+            ``], ['')]dnl
 m4_changequote([, ])>>)
 m4_changequote([, ])
 
@@ -1422,7 +1422,7 @@ m4_define(<<m4_split>>,
 #    ive])end
 #    => active activeend
 m4_define([m4_flatten],
-[m4_translit(m4_patsubst([[[$1]]], [\\
+[m4_translit(m4_bpatsubst([[[$1]]], [\\
 ]), [
 ], [ ])])
 
@@ -1449,10 +1449,10 @@ m4_define([m4_flatten],
 # the *third* character, since there are two leading `['; Equally for
 # the outer patsubst.
 m4_define([m4_strip],
-[m4_patsubst(m4_patsubst(m4_patsubst([[[[$1]]]],
-                            [[         ]+], [ ]),
-                   [^\(..\) ], [\1]),
-          [ \(.\)$], [\1])])
+[m4_bpatsubst(m4_bpatsubst(m4_bpatsubst([[[[$1]]]],
+                                        [[     ]+], [ ]),
+                           [^\(..\) ], [\1]),
+              [ \(.\)$], [\1])])
 
 
 # m4_normalize(STRING)
@@ -1525,8 +1525,8 @@ m4_define([m4_append],
 # As `m4_append', but append only if not yet present.
 m4_define([m4_append_uniq],
 [m4_ifdef([$1],
-          [m4_match([$3]m4_defn([$1])[$3], m4_re_escape([$3$2$3]), [],
-                    [m4_append($@)])],
+          [m4_bmatch([$3]m4_defn([$1])[$3], m4_re_escape([$3$2$3]), [],
+                     [m4_append($@)])],
           [m4_append($@)])])
 
 
@@ -1615,9 +1615,9 @@ m4_define([m4_Separator], [ ])])dnl
 # m4_text_box(MESSAGE, [FRAME-CHARACTER = `-'])
 # ---------------------------------------------
 m4_define([m4_text_box],
address@hidden:@@%:@ m4_patsubst([$1], [.], m4_if([$2], [], [[-]], [[$2]])) 
@%:@@%:@
address@hidden:@@%:@ m4_bpatsubst([$1], [.], m4_if([$2], [], [[-]], [[$2]])) 
@%:@@%:@
 @%:@@%:@ $1 @%:@@%:@
address@hidden:@@%:@ m4_patsubst([$1], [.], m4_if([$2], [], [[-]], [[$2]])) 
@%:@@%:@[]dnl
address@hidden:@@%:@ m4_bpatsubst([$1], [.], m4_if([$2], [], [[-]], [[$2]])) 
@%:@@%:@[]dnl
 ])
 
 
@@ -1631,10 +1631,10 @@ m4_define([m4_text_box],
 #
 # The sign of the integer A.
 m4_define([m4_sign],
-[m4_match([$1],
-          [^-], -1,
-          [^0+], 0,
-                 1)])
+[m4_bmatch([$1],
+           [^-], -1,
+           [^0+], 0,
+                  1)])
 
 # m4_cmp(A, B)
 # ------------
@@ -1684,13 +1684,13 @@ m4_define([m4_list_cmp],
 # 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],
-[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]),
+[m4_translit(m4_bpatsubst(m4_bpatsubst(m4_bpatsubst([$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])])
 
Index: tests/atspecific.m4
--- tests/atspecific.m4 Sun, 07 Oct 2001 17:44:39 +0200 akim
+++ tests/atspecific.m4 Sun, 07 Oct 2001 18:58:13 +0200 akim
@@ -28,8 +28,8 @@
 # Escape the invalid tokens with @&address@hidden
 m4_define([AT_DATA_M4SUGAR],
 [AT_DATA([$1],
-[m4_patsubst(m4_patsubst([[$2]], [\(m4\)_], [\1@&address@hidden),
-                         [dnl], [d@&address@hidden)])])
+[m4_bpatsubst(m4_bpatsubst([[$2]], [\(m4\)_], [\1@&address@hidden),
+                           [dnl], [d@&address@hidden)])])
 
 
 # AT_CHECK_M4SUGAR(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
@@ -51,8 +51,8 @@ m4_define([AT_CHECK_M4SUGAR],
 # Escape the invalid tokens with @&address@hidden
 m4_define([AT_DATA_M4SH],
 [AT_DATA([$1],
-[m4_patsubst(m4_patsubst([[$2]], [\(m4\|AS\)_], [\1@&address@hidden),
-                         [dnl], [d@&address@hidden)])])
+[m4_bpatsubst(m4_bpatsubst([[$2]], [\(m4\|AS\)_], [\1@&address@hidden),
+                           [dnl], [d@&address@hidden)])])
 
 
 # AT_CHECK_M4SH(FLAGS, [EXIT-STATUS = 0], STDOUT, STDERR)
Index: tests/torture.at
--- tests/torture.at Sun, 19 Aug 2001 18:05:20 +0200 akim
+++ tests/torture.at Sun, 07 Oct 2001 18:58:13 +0200 akim
@@ -373,9 +373,9 @@ m4_define([AT_DESCRIPTION],
 # turned into ac_uummy during the construction of config.status.  Yes,
 # 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.*.
-m4_pattern_allow([^m4_patsubst$])
+m4_pattern_allow([^m4_bpatsubst$])
 m4_define([AT_DUMMY_VAR],
-[ac_Dummy_[]m4_patsubst([000$1], [.*\(...\)$], [\1])])
+[ac_Dummy_[]m4_bpatsubst([000$1], [.*\(...\)$], [\1])])
 
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]