]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
* doc/autoconf.texi (Text processing Macros): New node to
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 22 Feb 2006 20:18:23 +0000 (20:18 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Wed, 22 Feb 2006 20:18:23 +0000 (20:18 +0000)
document the m4sugar macros m4_re_escape, m4_tolower,
m4_toupper, m4_split, m4_normalize, m4_append, m4_append_uniq.

ChangeLog
doc/autoconf.texi

index ee12306e875ea5cffba982a76c596d0baf63d653..fb4d16b129878bbfe0813556696d5a3e9e4d0522 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-02-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       * 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.
+
 2006-02-22  Paul Eggert  <eggert@cs.ucla.edu>
 
        * lib/autoconf/libs.m4 (_AC_PATH_X_DIRECT): Fix typo:
index f7754373e34d686f303b2bd6f5da6411d670d54b..3c44da1c2d73bbff78ad1ef30790285a5c81dce2 100644 (file)
@@ -439,6 +439,7 @@ 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
@@ -8784,6 +8785,7 @@ 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
 @end menu
 
@@ -8979,6 +8981,54 @@ $1 = [a],[b], $@@ = [[a],[b]]
 
 
 
+@node Text processing Macros
+@subsection Text processing Macros
+
+The following macros may be used to manipulate strings in M4.
+They are not intended for casual use.
+
+@defmac m4_re_escape (@var{string})
+@msindex{re_escape}
+Backslash-escape all characters in @var{string} that are active in
+regexps.
+@end defmac
+
+@defmac m4_tolower (@var{string})
+@defmacx m4_toupper (@var{string})
+@msindex{tolower}
+@msindex{toupper}
+Return @var{string} with letters converted to upper or lower case,
+respectively.
+@end defmac
+
+@defmac m4_split (@var{string}, @ovar{regexp})
+@msindex{split}
+Split @var{string} into an M4 list of elements quoted by @samp{[} and
+@samp{]}, 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.
+@end defmac
+
+@defmac m4_normalize (@var{string})
+@msindex{normalize}
+Remove leading and trailing spaces and tabs, sequences of
+backslash-then-newline, and replace multiple spaces and tabs with a
+single space.
+@end defmac
+
+@defmac m4_append (@var{macro-name}, @var{string}, @ovar{separator})
+@defmacx m4_append_uniq (@var{macro-name}, @var{string}, @ovar{separator})
+@msindex{append}
+@msindex{append_uniq}
+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
+@code{m4_append_uniq} to grow strings without duplicating substrings.
+@end defmac
+
+
+
 @node Forbidden Patterns
 @subsection Forbidden Patterns
 @cindex Forbidden patterns