OK to apply?
m4_bpatsubsts (sic) and m4_text_wrap should probably be documented, too.
Likewise, m4_join and m4_car/m4_cdr would be helpful. I refrained from
documenting those for now because I think these need more investigation
(remembering how bad Libtool's lt_join scaled some time ago). IMHO it's
ok to delay that to after the next release, if you agree.
Cheers,
Ralf
* doc/autoconf.texi (Text processing Macros): New node to
document the m4sugar macros m4_re_escape, m4_tolower,
m4_toupper, m4_split, m4_normalize, m4_append, m4_append_uniq.
Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.950
diff -u -r1.950 autoconf.texi
--- doc/autoconf.texi 20 Feb 2006 08:41:53 -0000 1.950
+++ doc/autoconf.texi 20 Feb 2006 23:39:11 -0000
@@ -437,7 +437,9 @@
Programming in M4sugar
* Redefined M4 Macros:: M4 builtins changed in M4sugar
* Looping constructs:: Iteration in M4
* Evaluation Macros:: More quotation and evaluation control
+* Text processing Macros:: String manipulation in M4
* Forbidden Patterns:: Catching unexpanded macros
Writing Autoconf Macros
@@ -8781,7 +8783,9 @@
@menu
* Redefined M4 Macros:: M4 builtins changed in M4sugar
* Looping constructs:: Iteration in M4
* Evaluation Macros:: More quotation and evaluation control
+* Text processing Macros:: String manipulation in M4
* Forbidden Patterns:: Catching unexpanded macros
@end menu
@@ -8935,6 +8981,53 @@
[EMAIL PROTECTED] Text processing Macros
[EMAIL PROTECTED] Text processing Macros
+
+The following macros may be used to manipulate strings in M4.
+They are not intended for casual use.
+
[EMAIL PROTECTED] m4_re_escape (@var{string})
[EMAIL PROTECTED]
+Backslash-escape all characters in @var{string} that are active in
+regexps.
[EMAIL PROTECTED] defmac
+
[EMAIL PROTECTED] m4_tolower (@var{string})
[EMAIL PROTECTED] m4_toupper (@var{string})
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+Return @var{string} with letters converted to upper or lower case,
+respectively.
[EMAIL PROTECTED] defmac
+
[EMAIL PROTECTED] m4_split (@var{string}, @ovar{regexp})
[EMAIL PROTECTED]
+Split @var{string} into an M4 list of elements quoted by @samp{[} and
[EMAIL PROTECTED], while keeping white space at the beginning and at the end.
+If @var{regexp} is given, use it instead of @samp{[\t ]+} for splitting.
+If @var{string} is empty, the result is an empty list.
[EMAIL PROTECTED] defmac
+
[EMAIL PROTECTED] m4_normalize (@var{string})
[EMAIL PROTECTED]
+Remove leading and trailing spaces and tabs, sequences of
+backslash-then-newline, and replace multiple spaces and tabs with a
+single space.
[EMAIL PROTECTED] defmac
+
[EMAIL PROTECTED] m4_append (@var{macro-name}, @var{string}, @ovar{separator})
[EMAIL PROTECTED] m4_append_uniq (@var{macro-name}, @var{string},
@ovar{separator})
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+Grow strings (without duplicating substrings). Redefine @var{macro-name}
+to its former contents with @var{separator} and @var{string} added at
+the end. If @var{macro-name} was undefined before (but not if it was
+defined but empty), then no @var{separator} is added.
[EMAIL PROTECTED] defmac
+
+
+
@node Forbidden Patterns
@subsection Forbidden Patterns
@cindex Forbidden patterns