doc: Improve documentation for macro support.
authorBen Pfaff <blp@cs.stanford.edu>
Thu, 25 Aug 2022 21:00:56 +0000 (14:00 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Thu, 25 Aug 2022 21:00:56 +0000 (14:00 -0700)
doc/flow-control.texi

index 72d7a052cd4379bb9fb475c76530b669fcef1f9b..2082e338037d40df5330ea00a5a6b1d84ffbc4d9 100644 (file)
@@ -411,6 +411,10 @@ These rules apply to macro calls, not to uses within a macro body of
 macro functions, macro arguments, and macro variables created by
 @code{!DO} or @code{!LET}, which are always expanded.
 
+@code{SET MEXPAND} may appear within the body of a macro, but it will
+not affect expansion of the macro that it appears in.  Use
+@code{!OFFEXPAND} and @code{!ONEXPAND} instead.
+
 @node Macro Functions
 @subsection Macro Functions
 
@@ -804,10 +808,6 @@ a macro that calls itself.
 MITERATE (@pxref{SET MITERATE}) limits the number of iterations in a
 @code{!DO} construct.  The default is 1000.
 
-PRESERVE...RESTORE
-
-SET MEXPAND, etc. doesn't work inside macro bodies.
-
 @node Macro Notes
 @subsection Additional Notes
 
@@ -816,9 +816,9 @@ SET MEXPAND, etc. doesn't work inside macro bodies.
 If the body of macro A includes a call to macro B, the call can use
 macro arguments (including @code{!*}) and macro variables as part of
 arguments to B.  For @code{!TOKENS} arguments, the argument or
-variable name counts as one token regardless of the number that
-expands into, for @code{!CHAREND} and @code{!ENCLOSE} arguments the
-delimiters come only from the call, not the expansions, and
+variable name counts as one token regardless of the number that it
+expands into; for @code{!CHAREND} and @code{!ENCLOSE} arguments, the
+delimiters come only from the call, not the expansions; and
 @code{!CMDEND} ends at the calling command, not any end of command
 within an argument or variable.