Hi Paul,
Thanks for the review, and sorry for the broken patch. :-/
* Paul Eggert wrote on Wed, Feb 22, 2006 at 07:10:09AM CET:
> Ralf Wildenhues <[EMAIL PROTECTED]> writes:
> >
> > +Grow strings (without duplicating substrings).
>
> This doesn't make it clear that m4_append grows, and m4_append_uniq
> grows without duplicating substrings.
Agreed. I have applied the patch as below, which is hopefully better.
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.953
diff -u -r1.953 autoconf.texi
--- doc/autoconf.texi 21 Feb 2006 09:30:01 -0000 1.953
+++ doc/autoconf.texi 22 Feb 2006 20:14:37 -0000
@@ -439,6 +439,7 @@
* 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
@@ -8784,6 +8785,7 @@
* 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
@@ -8979,6 +8981,54 @@
[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]
+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. @code{m4_append} can be used to grow strings, and
[EMAIL PROTECTED] to grow strings without duplicating substrings.
[EMAIL PROTECTED] defmac
+
+
+
@node Forbidden Patterns
@subsection Forbidden Patterns
@cindex Forbidden patterns