+2005-04-22 Stepan Kasal <kasal@ucw.cz>
+
+ * doc/autoconf.texi (External Software): Quadrigraphs are not
+ processed correctly in AS_HELP_STRING; avoid this in the examples.
+ * lib/m4sugar/m4sh.m4 (AS_HELP_STRING): Add a FIXME about quadrigraphs.
+ * lib/m4sugar/m4sugar.m4 (m4_text_wrap): Likewise; and rephrase the
+ comment and reduce m4_default([foo], []) to [foo].
+ (m4_strip): Update the explanation.
+
2005-04-19 Paul Eggert <eggert@cs.ucla.edu>
* lib/autoconf/general.m4 (_AC_INIT_PREPARE, _AC_RUN_IFELSE):
@example
AC_ARG_WITH(readline,
[AS_HELP_STRING(--with-readline,
- [enable experimental support for readline @@<:@@default=disabled@@:>@@])],
+ [enable experimental support for readline])],
[],
with_readline=no)
@example
AC_ARG_WITH(readline,
[AS_HELP_STRING(--without-readline,
- [disable support for readline @@<:@@default=enabled@@:>@@])],
+ [disable support for readline])],
[],
with_readline=yes)
# | column 2 |
# column 0 column 26
#
+#
+# FIXME: Handle quadrigraphs in LHS correctly.
+# another one:
+# FIXME: the m4_text_wrap interface design seems to be wrong. I see two ways:
+# 1) m4_text_wrap could pad the FIRST_PREFIX to the length of PREFIX; then
+# there would be no need to handle quadrigraphs in AS_HELP_STRING.
+# 2) The special case when FIRST_PREFIX is longer than PREFIX could be moved
+# from m4_text_wrap here; then one could call
+# m4_text_wrap(TEXT, [], [ ])
+# to get an indented paragraph.
+# My first impression is that 2) is better. --kasal 19apr05
+#
m4_define([AS_HELP_STRING],
[m4_pushdef([AS_Prefix], m4_default([$3], [ ]))dnl
m4_pushdef([AS_Prefix_Format],
# m4_strip([ active active ])end
# => active activeend
#
-# This macro is fun! Because we want to preserve active symbols, STRING
-# must be quoted for each evaluation, which explains there are 4 levels
-# of brackets around $1 (don't forget that the result must be quoted
-# too, hence one more quoting than applications).
+# Because we want to preserve active symbols, STRING must be double-quoted.
#
# Then notice the 2 last patterns: they are in charge of removing the
# leading/trailing spaces. Why not just `[^ ]'? Because they are
# m4_text_wrap(STRING, [PREFIX], [FIRST-PREFIX], [WIDTH])
# -------------------------------------------------------
# Expands into STRING wrapped to hold in WIDTH columns (default = 79).
-# If prefix is set, each line is prefixed with it. If FIRST-PREFIX is
-# specified, then the first line is prefixed with it. As a special
-# case, if the length of the first prefix is greater than that of
-# PREFIX, then FIRST-PREFIX will be left alone on the first line.
+# If PREFIX is given, each line is prefixed with it. If FIRST-PREFIX is
+# specified, then the first line is prefixed with it. As a special case,
+# if the length of FIRST-PREFIX is greater than that of PREFIX, then
+# FIRST-PREFIX will be left alone on the first line.
#
# Typical outputs are:
#
# we really want to bother with people trying each single corner
# of a software?
#
+# more important:
+# FIXME: handle quadrigraphs correctly, both in TEXT and in FIRST_PREFIX.
+#
# This macro does not leave a trailing space behind the last word,
# what complicates it a bit. The algorithm is stupid simple: all the
# words are preceded by m4_Separator which is defined to empty for the
# first word, and then ` ' (single space) for all the others.
m4_define([m4_text_wrap],
-[m4_pushdef([m4_Prefix], m4_default([$2], []))dnl
+[m4_pushdef([m4_Prefix], [$2])dnl
m4_pushdef([m4_Prefix1], m4_default([$3], [m4_Prefix]))dnl
m4_pushdef([m4_Width], m4_default([$4], 79))dnl
m4_pushdef([m4_Cursor], m4_len(m4_Prefix1))dnl