bug-autoconf
[Top][All Lists]
Advanced

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

Re: AM_GNU_GETTEXT working with autoconf 2.50, yet again


From: Paul Eggert
Subject: Re: AM_GNU_GETTEXT working with autoconf 2.50, yet again
Date: Fri, 15 Jun 2001 16:23:12 -0700 (PDT)

> From: Bruno Haible <address@hidden>
> Date: Thu, 14 Jun 2001 19:54:25 +0200 (CEST)
> 
> >     * configure.in: Do not use changequote.
> >     * m4/gettext.m4: Do not use changequote.
> 
> This is a regression. You are replacing a reliable method, changequote,
> by a less reliable one, namely duplicating random occurrences of brackets.
> This is unreliable, as we have seen recently with the fileutils regex.m4
> macro, which uses unbalanced brackets. With changequote no problems. Without
> changequote, bugs.

Actually, I've run into problems with changequote as well.

Why not use the new quadrigraph feature, introduced in autoconf 2.50?
It should be more reliable than either changequote or double-quoting,
and it should work with unbalanced brackets.  It was introduced
precisely to address this kind of problem.

Hmm, I think I can see one reason why: quadrigraphs are not
documented.  Here is a patch to autoconf to fix this problem.

2001-06-15  Paul Eggert  <address@hidden>

        * NEWS, doc/autoconf.texi: Document quadrigraphs.

===================================================================
RCS file: NEWS,v
retrieving revision 2.50
retrieving revision 2.50.0.1
diff -pu -r2.50 -r2.50.0.1
--- NEWS        2001/05/21 07:34:02     2.50
+++ NEWS        2001/06/15 23:16:52     2.50.0.1
@@ -1,3 +1,11 @@
+** Improved documentation
+
+Quadrigraphs are documented.  This feature was present in autoconf
+2.50 but was not documented.  For example, `@<:@' is translated to `['
+just before output.  This is useful when writing strings that contain
+unbalanced quotes, or other hard-to-quote constructs.
+
+
 * Major changes in Autoconf 2.50                       -*- outline -*-
 
 ** Lots of bug fixes
===================================================================
RCS file: doc/autoconf.texi,v
retrieving revision 2.50.0.3
retrieving revision 2.50.0.4
diff -pu -r2.50.0.3 -r2.50.0.4
--- doc/autoconf.texi   2001/06/13 15:35:25     2.50.0.3
+++ doc/autoconf.texi   2001/06/15 23:12:33     2.50.0.4
@@ -310,6 +310,7 @@ Quoting
 * Active Characters::           Characters that change the behavior of m4
 * One Macro Call::              Quotation and one macro call
 * Quotation and Nested Macros::  Macros calling macros
+* Quadrigraphs::                Another way to escape special characters
 * Quotation Rule Of Thumb::     One parenthesis, one quote
 
 Dependencies Between Macros
@@ -7460,6 +7461,7 @@ former helps one to follow the latter.
 * Active Characters::           Characters that change the behavior of m4
 * One Macro Call::              Quotation and one macro call
 * Quotation and Nested Macros::  Macros calling macros
+* Quadrigraphs::                Another way to escape special characters
 * Quotation Rule Of Thumb::     One parenthesis, one quote
 @end menu
 
@@ -7590,7 +7592,7 @@ With this in mind, we can explore the ca
 address@hidden
 
 
address@hidden Quotation and Nested Macros, Quotation Rule Of Thumb, One Macro 
Call, Quoting
address@hidden Quotation and Nested Macros, Quadrigraphs, One Macro Call, 
Quoting
 @subsection Quotation and Nested Macros
 
 The examples below use the following macros:
@@ -7719,7 +7721,41 @@ they are given to the macro, often not i
 Also, because @code{qar} behaves differently from the other macros,
 it's an exception that should be avoided in Autoconf.
 
address@hidden Quotation Rule Of Thumb,  , Quotation and Nested Macros, Quoting
address@hidden Quadrigraphs, Quotation Rule Of Thumb, Quotation and Nested 
Macros, Quoting
address@hidden Quadrigraphs
address@hidden quadrigraphs
address@hidden @samp{@@<:@@}
address@hidden @samp{@@:>@@}
address@hidden @samp{@@S|@@}
address@hidden @samp{@@%:@@}
+
+When writing an autoconf macro you may occasionally need to generate
+special characters that are difficult to express with the standard
+autoconf quoting rules.  For example, you may need to output the regular
+expression @samp{[^[]}, which matches any character other than @samp{[}.
+This expression contains unbalanced brackets so it cannot be put easily
+into an M4 macro.
+
+You can work around this problem by using one of the following
address@hidden:
+
address@hidden @samp
address@hidden @@<:@@
address@hidden
address@hidden @@:>@@
address@hidden
address@hidden @@S|@@
address@hidden
address@hidden @@%:@@
address@hidden
address@hidden table
+
+Quadrigraphs are replaced at a late stage of the translation process,
+after @command{m4} is run, so they do not get in the way of M4 quoting.
+For example, the string @samp{[^@@<:@@]}, if properly quoted, will
+appear as @samp{[^[]} in the @code{configure} script.
+
address@hidden Quotation Rule Of Thumb,  , Quadrigraphs, Quoting
 @subsection Quotation Rule Of Thumb
 
 To conclude, the quotation rule of thumb is:
@@ -7795,7 +7831,8 @@ extern char *tzname[]; /* RS6000 and oth
                [ac_cv_var_tzname=no])
 @end example
 
address@hidden FIXME: Quadrigraphs and hopeless cases.
+See @xref{Quadrigraphs}, for what to do if you run into a hopeless case
+where quoting does not suffice.
 
 When you create a @code{configure} script using newly written macros,
 examine it carefully to check whether you need to add more quotes in



reply via email to

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