autoconf-patches
[Top][All Lists]
Advanced

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

document some m4 text processing macros


From: Ralf Wildenhues
Subject: document some m4 text processing macros
Date: Tue, 21 Feb 2006 18:57:15 +0100
User-agent: Mutt/1.5.9i

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 @@
 
 
 
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
+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.  
address@hidden defmac
+
+
+
 @node Forbidden Patterns
 @subsection Forbidden Patterns
 @cindex Forbidden patterns




reply via email to

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