autoconf-patches
[Top][All Lists]
Advanced

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

Re: FYI: optional features and AC_ARG_WITH


From: Stepan Kasal
Subject: Re: FYI: optional features and AC_ARG_WITH
Date: Fri, 22 Apr 2005 08:39:51 +0200
User-agent: Mutt/1.4.1i

Hello,

On Tue, Apr 19, 2005 at 09:34:08AM -0700, Paul Eggert wrote:
> Why not just leave things be?  The formatting problem is a minor one,
> and doesn't hurt anything.  It even has a small positive role, as it
> serves as a reminder to fix AS_HELP_STRING.

OK, so the first occurence, woth [default=check] is left there.
The other two are removed.

Below is the patch as I commited it.

Stepan

2005-04-22  Stepan Kasal  <address@hidden>

        * 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.

Index: doc/autoconf.texi
===================================================================
RCS file: /cvsroot/autoconf/autoconf/doc/autoconf.texi,v
retrieving revision 1.887
diff -u -r1.887 autoconf.texi
--- doc/autoconf.texi   14 Apr 2005 14:56:55 -0000      1.887
+++ doc/autoconf.texi   22 Apr 2005 06:34:15 -0000
@@ -13347,7 +13347,7 @@
 @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)
 
@@ -13369,7 +13369,7 @@
 @example
 AC_ARG_WITH(readline,
   [AS_HELP_STRING(--without-readline,
-    [disable support for readline @@<:@@default=enabled@@:>@@])],
+    [disable support for readline])],
   [],
   with_readline=yes)
 
Index: lib/m4sugar/m4sh.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sh.m4,v
retrieving revision 1.137
diff -u -r1.137 m4sh.m4
--- lib/m4sugar/m4sh.m4 23 Feb 2005 19:26:35 -0000      1.137
+++ lib/m4sugar/m4sh.m4 22 Apr 2005 06:34:15 -0000
@@ -1058,6 +1058,18 @@
 #  | 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],
Index: lib/m4sugar/m4sugar.m4
===================================================================
RCS file: /cvsroot/autoconf/autoconf/lib/m4sugar/m4sugar.m4,v
retrieving revision 2.84
diff -u -r2.84 m4sugar.m4
--- lib/m4sugar/m4sugar.m4      19 Apr 2005 06:20:38 -0000      2.84
+++ lib/m4sugar/m4sugar.m4      22 Apr 2005 06:34:15 -0000
@@ -1416,10 +1416,7 @@
 #    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
@@ -1511,10 +1508,10 @@
 # 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:
 #
@@ -1541,12 +1538,15 @@
 # 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




reply via email to

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