texinfo-commits
[Top][All Lists]
Advanced

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

[6556] Invoking Macros


From: Gavin D. Smith
Subject: [6556] Invoking Macros
Date: Wed, 19 Aug 2015 18:04:56 +0000

Revision: 6556
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6556
Author:   gavin
Date:     2015-08-19 18:04:55 +0000 (Wed, 19 Aug 2015)
Log Message:
-----------
Invoking Macros

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/texinfo.texi

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-08-19 15:27:09 UTC (rev 6555)
+++ trunk/ChangeLog     2015-08-19 18:04:55 UTC (rev 6556)
@@ -1,5 +1,12 @@
 2015-08-19  Gavin Smith  <address@hidden>
 
+       * doc/texinfo.texi (Invoking Macros):  Remove duplicate material 
+       about commas in the argument to a one-arg macro.  Mention that \ 
+       escapes aren't used for whole-line arguments.  Mention that \{ 
+       and \} don't work in TeX.
+
+2015-08-19  Gavin Smith  <address@hidden>
+
        * doc/texinfo.texi (Macro Details): Remove two obsolete caveats.
 
 2015-08-19  Gavin Smith  <address@hidden>

Modified: trunk/doc/texinfo.texi
===================================================================
--- trunk/doc/texinfo.texi      2015-08-19 15:27:09 UTC (rev 6555)
+++ trunk/doc/texinfo.texi      2015-08-19 18:04:55 UTC (rev 6556)
@@ -14281,7 +14281,7 @@
 @end display
 
 @cindex Comma, in macro arguments
-Passing macro arguments containing commas requires special care, since
+Passing macro arguments containing commas requires care, since
 commas also separate the arguments.  To include a comma character in
 an argument, the most reliable method is to use the @code{@@address@hidden@}}
 command.  For @code{makeinfo}, you can also prepend a backslash
@@ -14346,29 +14346,26 @@
 to be treated as a part of an argument.
 @end enumerate
 
address@hidden Braces, in macro arguments
 @cindex Backslash, in macro arguments
-In addition to the comma, characters that need to be quoted in macro
-arguments are curly braces and backslash.  For example:
address@hidden Braces, in macro arguments
+The backslash itself can be quoted in macro arguments with another
+backslash.  For example:
 
 @example
-@@@var{macname} @address@hidden@}\,@}
+@@@var{macname} @address@hidden
 @end example
 
 @noindent
-will pass the (almost certainly error-producing) argument
address@hidden@address@hidden,} to @var{macname}.
+will pass the argument @samp{\bleh} to @var{macname}.
 
-Unfortunately, this has not been reliably implemented in @TeX{}.  When
-macros are used in the argument to other commands, for example, errors
-or incorrect output (the @samp{\} ``escape'' being included literally)
-are likely to result.
address@hidden also recognizes @address@hidden and @address@hidden sequences
+for curly braces, but these are not recognized by the implementation in
address@hidden  There should, however, rarely be a need for these, as they are
+only needed when a macro argument contains unbalanced braces.
 
-If a macro is defined to take exactly one argument, it can (but need
-not) be invoked without any braces; then the entire rest of the line
-after the macro name is used as the argument.  (Braces around the
-argument(s) are required in all other cases, i.e., if the macro takes
-either zero or more than one argument.)  For example:
+If a macro is defined to take exactly one argument, it can be
+invoked without any braces, taking all of the line after the macro name
+as the argument.  For example:
 
 @example
 @@macro bar @address@hidden
@@ -14383,23 +14380,10 @@
 Twice: aah & aah.
 @end display
 
-Likewise, if a macro is defined to take exactly one argument, and is
-invoked with braces, the braced text is passed as the argument, also
-regardless of commas.  For example:
address@hidden
+In these arguments, there is no escaping of special characters, so each
address@hidden stands for itself.
 
address@hidden
-@@macro bar @address@hidden
-Twice: \p\ & \p\.
-@@end macro
-@@address@hidden,address@hidden
address@hidden example
-
address@hidden produces:
-
address@hidden
-Twice: a,b & a,b.
address@hidden display
-
 If a macro is defined to take more than one argument, but is called
 with only one (in braces), the remaining arguments are set to the
 empty string, and no error is given.  For example:




reply via email to

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