(\readauxfile): Leave \catcode`\^ as other;

* texinfo.tex (\readauxfile): Leave \catcode`\^ as other;  
otherwise, node names containing ^, such as in info/info.texi,  
cause an error when run through TeX. 
(\setq): Do not call \auxhat. 
(\auxhat): Definition no longer needed. 
Reported by Howard Gayle <howard@hal.com>.
This commit is contained in:
Karl Berry 1996-11-09 18:44:09 +00:00
parent d780e42f3c
commit 4dbca03b64

View File

@ -1,5 +1,5 @@
%% TeX macros to handle Texinfo files. %% TeX macros to handle Texinfo files.
%% $Id: texinfo.tex,v 2.187 1996/11/05 19:52:23 karl Exp $ %% $Id: texinfo.tex,v 2.188 1996/11/09 18:44:09 karl Exp $
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, % Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
% 94, 95, 1996 Free Software Foundation, Inc. % 94, 95, 1996 Free Software Foundation, Inc.
@ -36,7 +36,7 @@
% This automatically updates the version number based on RCS. % This automatically updates the version number based on RCS.
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
\deftexinfoversion$Revision: 2.187 $ \deftexinfoversion$Revision: 2.188 $
\message{Loading texinfo package [Version \texinfoversion]:} \message{Loading texinfo package [Version \texinfoversion]:}
% If in a .fmt file, print the version number % If in a .fmt file, print the version number
@ -4163,7 +4163,7 @@ width0pt\relax} \fi
% Use \turnoffactive so that punctuation chars such as underscore % Use \turnoffactive so that punctuation chars such as underscore
% work in node names. % work in node names.
\def\dosetq #1#2{{\let\folio=0 \turnoffactive \auxhat% \def\dosetq #1#2{{\let\folio=0 \turnoffactive
\edef\next{\write\auxfile{\internalsetq {#1}{#2}}}% \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
\next}} \next}}
@ -4232,84 +4232,101 @@ width0pt\relax} \fi
#2% Output the suffix in any case. #2% Output the suffix in any case.
} }
% Read the last existing aux file, if any. No error if none exists.
% This is the macro invoked by entries in the aux file. % This is the macro invoked by entries in the aux file.
\def\xrdef #1#2{ \def\xrdef #1#2{{%
{\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}} \catcode`\'=\other
\expandafter\gdef\csname X#1\endcsname{#2}%
}}
\def\readauxfile{% % Read the last existing aux file, if any. No error if none exists.
\begingroup \def\readauxfile{\begingroup
\catcode `\^^@=\other \catcode`\^^@=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode `\^^C=\other \catcode`\^^C=\other
\catcode `\^^D=\other \catcode`\^^D=\other
\catcode `\^^E=\other \catcode`\^^E=\other
\catcode `\^^F=\other \catcode`\^^F=\other
\catcode `\^^G=\other \catcode`\^^G=\other
\catcode `\^^H=\other \catcode`\^^H=\other
\catcode `\ =\other \catcode`\ =\other
\catcode `\^^L=\other \catcode`\^^L=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode `\=\other \catcode`\=\other
\catcode 26=\other \catcode26=\other
\catcode `\^^[=\other \catcode`\^^[=\other
\catcode `\^^\=\other \catcode`\^^\=\other
\catcode `\^^]=\other \catcode`\^^]=\other
\catcode `\^^^=\other \catcode`\^^^=\other
\catcode `\^^_=\other \catcode`\^^_=\other
\catcode `\@=\other \catcode`\@=\other
\catcode `\^=\other \catcode`\^=\other
\catcode `\~=\other % It was suggested to define this as 7, which would allow ^^e4 etc.
\catcode `\[=\other % in xref tags, i.e., node names. But since ^^e4 notation isn't
\catcode `\]=\other % supported in the main text, it doesn't seem desirable. Furthermore,
\catcode`\"=\other % that is not enough: for node names that actually contain a ^
\catcode`\_=\other % character, we would end up writing a line like this: 'xrdef {'hat
\catcode`\|=\other % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
\catcode`\<=\other % argument, and \hat is not an expandable control sequence. It could
\catcode`\>=\other % all be worked out, but why? Either we support ^^ or we don't.
\catcode `\$=\other %
\catcode `\#=\other % The other change necessary for this was to define \auxhat:
\catcode `\&=\other % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
% `\+ does not work, so use 43. % and then to call \auxhat in \setq.
\catcode 43=\other %
% Make the characters 128-255 be printing characters \catcode`\~=\other
{% \catcode`\[=\other
\catcode`\]=\other
\catcode`\"=\other
\catcode`\_=\other
\catcode`\|=\other
\catcode`\<=\other
\catcode`\>=\other
\catcode`\$=\other
\catcode`\#=\other
\catcode`\&=\other
% `\+ does not work, so use 43.
\catcode43=\other
% Make the characters 128-255 be printing characters
{%
\count 1=128 \count 1=128
\def\loop{% \def\loop{%
\catcode\count 1=\other \catcode\count 1=\other
\advance\count 1 by 1 \advance\count 1 by 1
\ifnum \count 1<256 \loop \fi \ifnum \count 1<256 \loop \fi
}% }%
}% }%
% the aux file uses ' as the escape. % The aux file uses ' as the escape (for now).
% Turn off \ as an escape so we do not lose on % Turn off \ as an escape so we do not lose on
% entries which were dumped with control sequences in their names. % entries which were dumped with control sequences in their names.
% For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^ % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
% Reference to such entries still does not work the way one would wish, % Reference to such entries still does not work the way one would wish,
% but at least they do not bomb out when the aux file is read in. % but at least they do not bomb out when the aux file is read in.
\catcode `\{=1 \catcode `\}=2 \catcode`\{=1
\catcode `\%=\other \catcode`\}=2
\catcode `\'=0 \catcode`\%=\other
\catcode`\^=7 % to make ^^e4 etc usable in xref tags \catcode`\'=0
\catcode `\\=\other \catcode`\\=\other
\openin 1 \jobname.aux %
\ifeof 1 \else \closein 1 \input \jobname.aux \global\havexrefstrue \openin 1 \jobname.aux
\global\warnedobstrue \ifeof 1 \else
\fi \closein 1
% Open the new aux file. Tex will close it automatically at exit. \input \jobname.aux
\openout \auxfile=\jobname.aux \global\havexrefstrue
\global\warnedobstrue
\fi
% Open the new aux file. TeX will close it automatically at exit.
\openout\auxfile=\jobname.aux
\endgroup} \endgroup}
@ -4605,7 +4622,6 @@ width0pt\relax} \fi
\def~{{\tt \char '176}} \def~{{\tt \char '176}}
\chardef\hat=`\^ \chardef\hat=`\^
\catcode`\^=\active \catcode`\^=\active
\def\auxhat{\def^{'hat}}
\def^{{\tt \hat}} \def^{{\tt \hat}}
\catcode`\_=\active \catcode`\_=\active