texinfo-commits
[Top][All Lists]
Advanced

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

[6540] preserve multiple spaces in a macro body


From: Gavin D. Smith
Subject: [6540] preserve multiple spaces in a macro body
Date: Mon, 17 Aug 2015 13:01:27 +0000

Revision: 6540
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=6540
Author:   gavin
Date:     2015-08-17 13:01:26 +0000 (Mon, 17 Aug 2015)
Log Message:
-----------
preserve multiple spaces in a macro body

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

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2015-08-17 09:30:34 UTC (rev 6539)
+++ trunk/ChangeLog     2015-08-17 13:01:26 UTC (rev 6540)
@@ -1,5 +1,15 @@
 2015-08-17  Gavin Smith  <address@hidden>
 
+       * doc/texinfo.tex (\macrobodyctxt): Make catcode of space 
+       \other, so they are preserved when expanded in a context like 
+       @example.
+       (\parsemacbody, \parsermacbody): Terminate macro body at line 
+       with space with catcode \other.
+       (\macroargctxt, \defmacro): Update comments.
+       * doc/texinfo-tex-test.texi: Add example.
+
+2015-08-17  Gavin Smith  <address@hidden>
+
        * doc/texinfo-tex-test.texi: Add example with macro invocation 
        nested inside an argument.
 

Modified: trunk/doc/texinfo-tex-test.texi
===================================================================
--- trunk/doc/texinfo-tex-test.texi     2015-08-17 09:30:34 UTC (rev 6539)
+++ trunk/doc/texinfo-tex-test.texi     2015-08-17 13:01:26 UTC (rev 6540)
@@ -21,7 +21,8 @@
 
 @contents
 
address@hidden Backslashes in macro arguments
address@hidden Macros
address@hidden Backslashes in macro arguments
 
 @macro Mac{x}
 A\x\A
@@ -95,4 +96,19 @@
 
 test @,c for c cedilla
 
address@hidden Spaces in macro bodies
+
+Distance between the two x's should be the same
+
address@hidden Mac
address@hidden
+x  x
address@hidden example
address@hidden macro
address@hidden
+x  x
address@hidden example
address@hidden
+
+
 @bye

Modified: trunk/doc/texinfo.tex
===================================================================
--- trunk/doc/texinfo.tex       2015-08-17 09:30:34 UTC (rev 6539)
+++ trunk/doc/texinfo.tex       2015-08-17 13:01:26 UTC (rev 6540)
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2015-08-17.10}
+\def\texinfoversion{2015-08-17.15}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -7452,13 +7452,17 @@
 
 \def\macrobodyctxt{% used for @macro definitions
   \scanctxt
+  \catcode`\ =\other
   \catcode`\{=\other
   \catcode`\}=\other
   \catcode`\^^M=\other
   \usembodybackslash
 }
 
-\def\macroargctxt{% used when scanning braced macro arguments
+% Used when scanning braced macro arguments.  Note, however, that catcode
+% changes here are ineffectual if the macro invocation was nested inside
+% an argument to another Texinfo command.
+\def\macroargctxt{%
   \scanctxt
   \catcode`\\=\active
 }
@@ -7625,12 +7629,12 @@
 
 % These two commands read recursive and nonrecursive macro bodies.
 % (They're different since rec and nonrec macros end differently.)
-%
+% Set \temp to the body of the macro, and call \defmacro.
 \catcode address@hidden
address@hidden macro%
-{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
address@hidden rmacro%
-{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}%
+{\catcode`\ address@hidden macro{%
+\xdef\temp{\eatcr{#1}}\endgroup\defmacro}}%
+{\catcode`\ address@hidden rmacro{%
+\xdef\temp{\eatcr{#1}}\endgroup\defmacro}}%
 \catcode address@hidden
 
 address@hidden
@@ -7810,8 +7814,9 @@
    \long\def#2{#4}%
 }
 
-% This defines a Texinfo @macro. There are eight cases: recursive and
-% nonrecursive macros of zero, one, up to nine, and many arguments.
+% This defines a Texinfo @macro.  \temp has the body of the macro in it.
+% There are eight cases: recursive and nonrecursive macros of zero, one,
+% up to nine, and many arguments.
 % Much magic with \expandafter here.
 % \xdef is used so that macro definitions will survive the file
 % they're defined in; @include reads the file inside a group.




reply via email to

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