[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: document some m4 text processing macros
From: |
Ralf Wildenhues |
Subject: |
Re: document some m4 text processing macros |
Date: |
Wed, 22 Feb 2006 21:18:40 +0100 |
User-agent: |
Mutt/1.5.9i |
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 <address@hidden> 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 @@
address@hidden Text processing Macros
address@hidden Text processing Macros
+
+The following macros may be used to manipulate strings in M4.
+They are not intended for casual use.
+
address@hidden m4_re_escape (@var{string})
address@hidden
+Backslash-escape all characters in @var{string} that are active in
+regexps.
address@hidden defmac
+
address@hidden m4_tolower (@var{string})
address@hidden m4_toupper (@var{string})
address@hidden
address@hidden
+Return @var{string} with letters converted to upper or lower case,
+respectively.
address@hidden defmac
+
address@hidden m4_split (@var{string}, @ovar{regexp})
address@hidden
+Split @var{string} into an M4 list of elements quoted by @samp{[} and
address@hidden, 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.
address@hidden defmac
+
address@hidden m4_normalize (@var{string})
address@hidden
+Remove leading and trailing spaces and tabs, sequences of
+backslash-then-newline, and replace multiple spaces and tabs with a
+single space.
address@hidden defmac
+
address@hidden m4_append (@var{macro-name}, @var{string}, @ovar{separator})
address@hidden m4_append_uniq (@var{macro-name}, @var{string}, @ovar{separator})
address@hidden
address@hidden
+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
address@hidden to grow strings without duplicating substrings.
address@hidden defmac
+
+
+
@node Forbidden Patterns
@subsection Forbidden Patterns
@cindex Forbidden patterns