]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
Allow m4sugar to be used without autom4te, such as in bison.
authorEric Blake <ebb9@byu.net>
Tue, 28 Oct 2008 16:28:04 +0000 (10:28 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 28 Oct 2008 19:45:45 +0000 (13:45 -0600)
* lib/m4sugar/m4sugar.m4 (m4_text_wrap, m4_qlen): Document that
alternate escape sequences can be used.
(m4_text_box): Likewise.  Don't output quadrigraphs.
(m4_qdelta): Delete unused macro.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/m4sugar/m4sugar.m4

index d0296c06c8f6ef07e787b0cda2657ab3e560be2f..720f4b061c2ad684cf66590b1d858e13902e7be4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-10-28  Eric Blake  <ebb9@byu.net>
+
+       Allow m4sugar to be used without autom4te, such as in bison.
+       * lib/m4sugar/m4sugar.m4 (m4_text_wrap, m4_qlen): Document that
+       alternate escape sequences can be used.
+       (m4_text_box): Likewise.  Don't output quadrigraphs.
+       (m4_qdelta): Delete unused macro.
+
 2008-10-28  Paolo Bonzini  <bonzini@gnu.org>
 
        Add m4_stack_foreach and m4_stack_foreach_lifo.
@@ -9,7 +17,7 @@
        * tests/m4sugar.at (m4_stack_foreach): New test.
 
 2008-10-28  Paolo Bonzini  <bonzini@gnu.org>
-    
+
        use a shell function for AC_TYPE_INTx_T
        * lib/autoconf/types.m4 (_AC_TYPE_INT_BODY, _AC_TYPE_UNSIGNED_INT_BODY):
        New.
index eb5d4260cf695f270f378edf8242694a95bdff08..a17776c1a8466d5172cfe25db74e14575a47c397 100644 (file)
@@ -2232,7 +2232,9 @@ m4_define([m4_append_uniq_w],
 # FIRST-PREFIX will be left alone on the first line.
 #
 # No expansion occurs on the contents STRING, PREFIX, or FIRST-PREFIX,
-# although quadrigraphs are correctly recognized.
+# although quadrigraphs are correctly recognized.  More precisely,
+# you may redefine m4_qlen to recognize whatever escape sequences that
+# you will post-process.
 #
 # Typical outputs are:
 #
@@ -2311,20 +2313,29 @@ dnl finally, clean up the local variables
 #  ## MESSAGE ##
 #  ## ------- ##
 # using FRAME-CHARACTER in the border.
+#
+# Quadrigraphs are correctly recognized.  More precisely, you may
+# redefine m4_qlen to recognize whatever escape sequences that you
+# will post-process.
 m4_define([m4_text_box],
 [m4_pushdef([m4_Border],
            m4_translit(m4_format([%*s], m4_qlen(m4_expand([$1])), []),
                        [ ], m4_default_quoted([$2], [-])))dnl
-@%:@@%:@ m4_Border @%:@@%:@
-@%:@@%:@ $1 @%:@@%:@
-@%:@@%:@ m4_Border @%:@@%:@_m4_popdef([m4_Border])dnl
-])
+[##] m4_Border [##]
+[##] $1 [##]
+[##] m4_Border [##]_m4_popdef([m4_Border])])
 
 
 # m4_qlen(STRING)
 # ---------------
 # Expands to the length of STRING after autom4te converts all quadrigraphs.
 #
+# If you use some other means of post-processing m4 output rather than
+# autom4te, then you may redefine this macro to recognize whatever
+# escape sequences your post-processor will handle.  For that matter,
+# m4_define([m4_qlen], m4_defn([m4_len])) is sufficient if you don't
+# do any post-processing.
+#
 # Avoid bpatsubsts for the common case of no quadrigraphs.  Cache
 # results, as configure scripts tend to ask about lengths of common
 # strings like `/*' and `*/' rather frequently.  Minimize the number
@@ -2340,15 +2351,6 @@ m4_if(m4_index([$1], [@]), [-1], [m4_len([$1])],
                           [\3]))]))_m4_defn([m4_qlen-$1])])
 
 
-# m4_qdelta(STRING)
-# -----------------
-# Expands to the net change in the length of STRING from autom4te converting the
-# quadrigraphs in STRING.  This number is always negative or zero.
-m4_define([m4_qdelta],
-[m4_eval(m4_qlen([$1]) - m4_len([$1]))])
-
-
-
 ## ----------------------- ##
 ## 13. Number processing.  ##
 ## ----------------------- ##