(\doignore): Ignore everything after `c', so @end ifinfo and the like
authorKarl Berry <karl@gnu.org>
Wed, 1 Apr 1998 00:33:30 +0000 (00:33 +0000)
committerKarl Berry <karl@gnu.org>
Wed, 1 Apr 1998 00:33:30 +0000 (00:33 +0000)
can be commented out.
(\macrocsname): New macro.
Reported by: "James A. Lupo" <lupoja@feynman.ml.wpafb.af.mil>

texinfo.tex

index 1701ae10e813cc2ad61cac211be0ab68b207d7f2..56167d61b80d100e2e4e0c087b5d668c4dc0a677 100644 (file)
 %
 % Please try the latest version of texinfo.tex before submitting bug
 % reports; you can get the latest version from:
-% ftp://ftp.cs.umb.edu/pub/tex/texinfo.tex
 % /home/gd/gnu/doc/texinfo.tex on the GNU machines.
+% ftp://tug.org/tex/texinfo.tex
+% ftp://ctan.org/macros/texinfo/texinfo.tex
+% (and all CTAN mirrors, finger info@ctan.org for a list).
 % 
 % Send bug reports to bug-texinfo@gnu.org.
 % Please include a precise test case in each bug report,
@@ -772,6 +774,7 @@ where each line of input produces a line of output.}
 % Also ignore @macro ... @end macro.  The user must run texi2dvi,
 % which runs makeinfo to do macro expansion.  Ignore @unmacro, too.
 \def\macro{\doignore{macro}}
+\def\macrocsname{macro}
 \let\unmacro = \comment
 
 
@@ -786,7 +789,9 @@ where each line of input produces a line of output.}
   \ignoresections
   %
   % Define a command to swallow text until we reach `@end #1'.
-  \long\def\doignoretext##1\end #1{\enddoignore}%
+  % This @ is a catcode 12 token (that is the normal catcode of @ in
+  % this texinfo.tex file).  We change the catcode of @ below to match.
+  \long\def\doignoretext##1@end #1{\enddoignore}%
   %
   % Make sure that spaces turn into tokens that match what \doignoretext wants.
   \catcode32 = 10
@@ -795,6 +800,22 @@ where each line of input produces a line of output.}
   \catcode`\{ = 9
   \catcode`\} = 9
   %
+  % We must not have @c interpreted as a control sequence.
+  \catcode`\@ = 12
+  %
+  % Make the letter c a comment character so that the rest of the line
+  % will be ignored. This way, the document can have (for example)
+  %   @c @end ifinfo
+  % and the @end ifinfo will be properly ignored.
+  % (We've just changed @ to catcode 12.)
+  % 
+  % But we can't do this if #1 is `macro', since that actually contains a c.
+  % Happily, none of the other conditionals have the letter `c' in their names!
+  \def\temp{#1}%
+  \ifx\temp\macrocsname \else
+    \catcode`\c = 14
+  \fi
+  %
   % And now expand that command.
   \doignoretext
 }