CVSROOT: /sources/m4
Module name: m4
Branch: branch-1_4
Changes by: Eric Blake <ericb> 06/08/12 20:02:30
Index: doc/m4.texinfo
===================================================================
RCS file: /sources/m4/m4/doc/m4.texinfo,v
retrieving revision 1.1.1.1.2.63
retrieving revision 1.1.1.1.2.64
diff -u -b -r1.1.1.1.2.63 -r1.1.1.1.2.64
--- doc/m4.texinfo 9 Aug 2006 12:28:00 -0000 1.1.1.1.2.63
+++ doc/m4.texinfo 12 Aug 2006 20:02:30 -0000 1.1.1.1.2.64
@@ -1231,6 +1231,8 @@
@end example
@xref{Quoting Arguments}, for an explanation of the double quotes.
+(You should try and improve this example so that clients of exch do not
+have to double quote. @pxref{Answers})
@cindex @acronym{GNU} extensions
@acronym{GNU} @code{m4} allows the number following the @samp{$} to
@@ -4707,6 +4709,21 @@
Some of the examples in this manuals are buggy, for demonstration
purposes. Correctly working macros are presented here.
+The @code{exch} macro (@pxref{Arguments}) as presented requires clients
+to double quote their arguments. A nicer definition, which lets
+clients follow the rule of thumb of one level of quoting per level of
+parentheses, involves adding quotes in the definition of @code{exch}, as
+follows:
+
[EMAIL PROTECTED]
+define(`exch', ``$2', `$1'')
[EMAIL PROTECTED]
+define(exch(`expansion text', `macro'))
[EMAIL PROTECTED]
+macro
[EMAIL PROTECTED] text
[EMAIL PROTECTED] example
+
The @code{cleardivert} macro (@pxref{Cleardiv}) cannot, as it stands, be
called without arguments to clear all pending diversions. That is
because using undivert with an empty string for an argument is different