changeset 4808:0eb1e054e5e2

update from texinfo
author Karl Berry <karl@freefriends.org>
date Thu, 23 Oct 2003 14:11:57 +0000
parents d76c27f639f9
children cde3aec825b9
files config/texinfo.tex
diffstat 1 files changed, 94 insertions(+), 104 deletions(-) [+]
line wrap: on
line diff
--- a/config/texinfo.tex
+++ b/config/texinfo.tex
@@ -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{2003-10-16.18}
+\def\texinfoversion{2003-10-23.07}
 %
 % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -25,19 +25,18 @@
 %
 % In other words, you are welcome to use, share and improve this program.
 % You are forbidden to forbid anyone else to use, share and improve
-% what you give them.   Help stamp out software-hoarding!
-%
+% what you give them.
+% 
+% Although texinfo.tex is available under the GPL, this does not affect
+% the license status of any Texinfo documents.  We recommend using the
+% GFDL for software manuals.  Please see
+% http://www.gnu.org/philosophy/licenses for more discussion.
+% 
 % Please try the latest version of texinfo.tex before submitting bug
 % reports; you can get the latest version from:
-%   ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex
-%     (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
 %   ftp://tug.org/tex/texinfo.tex
-%     (and all CTAN mirrors, see http://www.ctan.org),
-%   and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
-%
-% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
-%
-% The texinfo.tex in any given Texinfo distribution could well be out
+%     (and all CTAN mirrors, see http://www.ctan.org).
+% The texinfo.tex in any given distribution could well be out
 % of date, so if that's what you're using, please check.
 %
 % Send bug reports to bug-texinfo@gnu.org.  Please include including a
@@ -59,6 +58,9 @@
 % It is possible to adapt texinfo.tex for other languages, to some
 % extent.  You can get the existing language-specific files from the
 % full Texinfo distribution.
+% 
+% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+
 
 \message{Loading texinfo [version \texinfoversion]:}
 
@@ -335,81 +337,82 @@
 % the input line (except we remove a trailing comment).  #1 should be a
 % macro which expects an ordinary undelimited TeX argument.
 %
-\def\parsearg#1{%
-  \let\next = #1%
+\def\parsearg{\parseargusing{}}
+\def\parseargusing#1#2{%
+  \def\next{#2}%
   \begingroup
     \obeylines
-    \futurelet\temp\parseargx
+    #1%
+    \parseargx
 }
 
 % If the next token is an obeyed space (from an @example environment or
 % the like), remove it and recurse.  Otherwise, we're done.
-\def\parseargx{%
-  % \obeyedspace is defined far below, after the definition of \sepspaces.
-  \ifx\obeyedspace\temp
-    \expandafter\parseargdiscardspace
+\def\parseargx{\futurelet\temp\parseargy}
+\def\parseargy{%
+  \expandafter\ifx\obeyedspace\temp
+    \def\temp{\expandafter\parseargx\gobble}
   \else
-    \expandafter\parseargline
+    \def\temp{\parseargline\empty}% Insert the \empty token, see below.
   \fi
-}
-
-% Remove a single space (as the delimiter token to the macro call).
-{\obeyspaces %
- \gdef\parseargdiscardspace {\futurelet\temp\parseargx}}
+  \temp
+}
 
 {\obeylines %
   \gdef\parseargline#1^^M{%
     \endgroup % End of the group started in \parsearg.
-    %
-    % First remove any @c comment, then any @comment.
-    % Result of each macro is put in \toks0.
-    \argremovec #1\c\relax %
-    \expandafter\argremovecomment \the\toks0 \comment\relax %
-    %
-    % Call the caller's macro, saved as \next in \parsearg.
-    \expandafter\next\expandafter{\the\toks0}%
+    \argremovecomment #1\comment\ArgTerm%
   }%
 }
 
-% Since all \c{,omment} does is throw away the argument, we can let TeX
-% do that for us.  The \relax here is matched by the \relax in the call
-% in \parseargline; it could be more or less anything, its purpose is
-% just to delimit the argument to the \c.
-\def\argremovec#1\c#2\relax{\toks0 = {#1}}
-\def\argremovecomment#1\comment#2\relax{\toks0 = {#1}}
-
-% \argremovec{,omment} might leave us with trailing spaces, though; e.g.,
+% First remove any @comment, then any @c comment.
+\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\removeactivespaces#1\ArgTerm}
+% \argremovec might leave us with trailing spaces, though; e.g.,
 %    @end itemize  @c foo
-% will have two active spaces as part of the argument with the
-% `itemize'.  Here we remove all active spaces from #1, and assign the
-% result to \toks0.
-%
-% This loses if there are any *other* active characters besides spaces
-% in the argument -- _ ^ +, for example -- since they get expanded.
-% Fortunately, Texinfo does not define any such commands.  (If it ever
-% does, the catcode of the characters in questionwill have to be changed
-% here.)  But this means we cannot call \removeactivespaces as part of
-% \argremovec{,omment}, since @c uses \parsearg, and thus the argument
-% that \parsearg gets might well have any character at all in it.
-%
-\def\removeactivespaces#1{%
-  \begingroup
-    \ignoreactivespaces
-    \edef\temp{#1}%
-    \global\toks0 = \expandafter{\temp}%
-  \endgroup
-}
-
-% Change the active space to expand to nothing.
-%
-\begingroup
+{\obeyspaces
+  \gdef\removeactivespaces#1\ArgTerm{\removeactivespacesX#1\RemSpac \RemSpac\ArgTerm}
+  \gdef\removeactivespacesX#1 \RemSpac{\removeactivespacesY{#1}}
+}
+\def\removeactivespacesY#1#2\ArgTerm{%
+  \def\temp{#2}%
+  \ifx\temp\empty
+    \let\temp\finishparsearg
+  \else
+    \let\temp\removeactivespaces
+  \fi
+  \temp #1\ArgTerm
+}
+
+% If a _delimited_ argument is enclosed in braces, they get stripped; so
+% to get _exactly_ the rest of the line, we had to prevent such situation.
+% We prepended an \empty token at the very beginning and we expand it
+% just before passing the control to \next.
+% (But first, we have to remove the remaining \RemSpac token.)
+\def\finishparsearg#1\RemSpac\ArgTerm{\expandafter\next\expandafter{#1}}
+
+% Several utility definitions with active space:
+{
   \obeyspaces
-  \gdef\ignoreactivespaces{\obeyspaces\let =\empty}
-\endgroup
+  \gdef\obeyedspace{ }
+
+  % Make each space character in the input produce a normal interword
+  % space in the output.  Don't allow a line break at this space, as this
+  % is used only in environments like @example, where each line of input
+  % should produce a line of output anyway.
+  %
+  \gdef\sepspaces{\obeyspaces\let =\tie}
+
+  % If an index command is used in an @example environment, any spaces
+  % therein should become regular spaces in the raw index file, not the
+  % expansion of \tie (\leavevmode \penalty \@M \ ).
+  \gdef\unsepspaces{\let =\space}
+}
 
 
 \def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
 
+
 %% These are used to keep @begin/@end levels from running away
 %% Call \inENV within environments (after a \begingroup)
 \newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
@@ -431,20 +434,21 @@
 %
 \def\end{\parsearg\endxxx}
 \def\endxxx #1{%
-  \removeactivespaces{#1}%
-  \edef\endthing{\the\toks0}%
-  %
-  \expandafter\ifx\csname E\endthing\endcsname\relax
-    \expandafter\ifx\csname \endthing\endcsname\relax
-      % There's no \foo, i.e., no ``environment'' foo.
-      \errhelp = \EMsimple
-      \errmessage{Undefined command `@end \endthing'}%
-    \else
-      \unmatchedenderror\endthing
-    \fi
+  \expandafter\ifx\csname E#1\endcsname\relax
+    \badenderror{#1}%
   \else
     % Everything's ok; the right environment has been started.
-    \csname E\endthing\endcsname
+    \csname E#1\endcsname
+  \fi
+}
+
+\def\badenderror#1{%
+  \expandafter\ifx\csname#1\endcsname\relax
+    % There's no \foo, i.e., no ``environment'' foo.
+    \errhelp = \EMsimple
+    \errmessage{Undefined command `@end #1'}%
+  \else
+    \unmatchedenderror{#1}%
   \fi
 }
 
@@ -2131,9 +2135,10 @@
 \def\fnitemindex #1{\doind {fn}{\code{#1}}}%
 \def\vritemindex #1{\doind {vr}{\code{#1}}}%
 
-{\obeyspaces %
+{\obeyspaces
 \gdef\tabley#1#2 #3 #4 #5 #6 #7\endtabley{\endgroup%
-\tablez{#1}{#2}{#3}{#4}{#5}{#6}}}
+\tablez{#1}{#2}{#3}{#4}{#5}{#6}}%
+}
 
 \def\tablez #1#2#3#4#5#6{%
 \aboveenvbreak %
@@ -3050,12 +3055,6 @@
   \turnoffmacros
 }
 
-% If an index command is used in an @example environment, any spaces
-% therein should become regular spaces in the raw index file, not the
-% expansion of \tie (\leavevmode \penalty \@M \ ).
-{\obeyspaces
- \gdef\unsepspaces{\obeyspaces\let =\space}}
-
 
 % \indexnofonts is used when outputting the strings to sort the index
 % by, and when constructing control sequence names.  It eliminates all
@@ -4494,19 +4493,6 @@
 % have any width.
 \def\lisppar{\null\endgraf}
 
-% Make each space character in the input produce a normal interword
-% space in the output.  Don't allow a line break at this space, as this
-% is used only in environments like @example, where each line of input
-% should produce a line of output anyway.
-%
-{\obeyspaces %
-\gdef\sepspaces{\obeyspaces\let =\tie}}
-
-% Define \obeyedspace to be our active space, whatever it is.  This is
-% for use in \parsearg.
-{\sepspaces%
-\global\let\obeyedspace= }
-
 % This space is always present above and below environments.
 \newskip\envskipamount \envskipamount = 0pt
 
@@ -4840,7 +4826,7 @@
   % ignore everything up to the first ^^M, that's the newline at the end
   % of the @verbatim input line itself.  Otherwise we get an extra blank
   % line in the output.
-  \gdef\doverbatim#1^^M#2@end verbatim{#2\end{verbatim}}%
+  \gdef\doverbatim#1^^M#2@end verbatim{#2\end verbatim}%
 \endgroup
 %
 \def\verbatim{%
@@ -5819,12 +5805,16 @@
 % @alias.
 % We need some trickery to remove the optional spaces around the equal
 % sign.  Just make them active and then expand them all to nothing.
-\def\alias{\begingroup\obeyspaces\parsearg\aliasxxx}
+\def\alias{\parseargusing\obeyspaces\aliasxxx}
 \def\aliasxxx #1{\aliasyyy#1\relax}
-\def\aliasyyy #1=#2\relax{\ignoreactivespaces
-\edef\next{\global\let\expandafter\noexpand\csname#1\endcsname=%
-           \expandafter\noexpand\csname#2\endcsname}%
-\expandafter\endgroup\next}
+\def\aliasyyy #1=#2\relax{%
+  {%
+    \expandafter\let\obeyedspace=\empty
+    \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}%
+  }%
+  \next
+}
+\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
 
 
 \message{cross references,}