[gnu.emacs] Undumpable texinfo macros.

seindal@UUNET.UU.NET (Rene' Seindal) (06/21/89)

I have changed the texinfo macros, to make it possible to preload the macros
into TeX.  The diffs are below.  The macros work both as preloaded, and as
usual.  When preloaded, the `\input texinfo' line is no longer necessary,
though it does little harm (you get the text `\input texinfo' in the upper
left corner of the title page).

The changes are relative to texinfo version 1.24 as I found it on
yahi.stanford.edu.  I haven't incremented the version number.

The only functional difference compared to the original version 1.24, is that
this version does not make the toc, aux, and index files, unless they are
actually written to, i.e., if you don't put anything into the keyword index,
no .ky file is generated.  This might be considered a bug or a feature.

Have fun.

Rene' Seindal (seindal@diku.dk).

------------------------------------------------------------------------
*** texinfo.tex	Tue Jun 20 19:12:52 1989
--- /common/lib/tex/macros/texinfo.tex	Sun Jun 18 16:14:29 1989
***************
*** 21,31 ****
  %You are forbidden to forbid anyone else to use, share and improve
  %what you give them.   Help stamp out software-hoarding!
  
- \ifx\texinfoversion\undefined \relax\else\endinput\fi
- 
  \def\texinfoversion{1.24}
- \immediate\write16{}
  \message{Loading texinfo package [Version \texinfoversion]:}
  
  % Save some parts of plain tex whose names we will redefine.
  
--- 21,29 ----
  %You are forbidden to forbid anyone else to use, share and improve
  %what you give them.   Help stamp out software-hoarding!
  
  \def\texinfoversion{1.24}
  \message{Loading texinfo package [Version \texinfoversion]:}
+ \message{}
  
  % Save some parts of plain tex whose names we will redefine.
  
***************
*** 379,396 ****
  \font\secsf=cmss10 scaled \magstep2
  \let\secbf=\secrm
  
! % \font\ssecrm=cmbx10 scaled \magstep1    % This size and font looked bad.
  % \font\ssecit=cmti10 scaled \magstep1    % The letters were too crowded.
  % \font\ssecsl=cmsl10 scaled \magstep1
  % \font\ssectt=cmtt10 scaled \magstep1
  % \font\ssecsf=cmss10 scaled \magstep1
  
! % These fonts was previously loaded at 13pt, which is not a too common size (rs).
! \font\ssecrm=cmb10  scaled \magstep2    % Note the use of cmb rather than cmbx.
! \font\ssecit=cmti10 scaled \magstep2	% Also, the size is a little larger than
! \font\ssecsl=cmsl10 scaled \magstep2	% being scaled magstep1.
! \font\ssectt=cmtt10 scaled \magstep2
! \font\ssecsf=cmss10 scaled \magstep2
  
  \let\ssecbf=\ssecrm
  
--- 377,393 ----
  \font\secsf=cmss10 scaled \magstep2
  \let\secbf=\secrm
  
! % \font\ssecrm=cmbx10 scaled \magstep1    % This size an fontlooked bad.
  % \font\ssecit=cmti10 scaled \magstep1    % The letters were too crowded.
  % \font\ssecsl=cmsl10 scaled \magstep1
  % \font\ssectt=cmtt10 scaled \magstep1
  % \font\ssecsf=cmss10 scaled \magstep1
  
! \font\ssecrm=cmb10 at 13pt	% Note the use of cmb rather than cmbx.
! \font\ssecit=cmti10 at 13pt	% Also, the size is a little larger than
! \font\ssecsl=cmsl10 at 13pt	% being scaled magstep1.
! \font\ssectt=cmtt10 at 13pt
! \font\ssecsf=cmss10 at 13pt
  
  \let\ssecbf=\ssecrm
  
***************
*** 714,725 ****
  
  \def\newindex #1{
  \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
! \expandafter\gdef\csname#1openfile\endcsname{\openout % Open the file
! \csname#1indfile\endcsname \jobname.#1
! %\write16{Opening index file `#1'}%
! \expandafter\gdef\csname#1openfile\endcsname{\relax}}%
  \expandafter\xdef\csname#1index\endcsname{%	% Define \xxxindex
- \expandafter\noexpand\csname#1openfile\endcsname
  \noexpand\doindex {#1}}
  }
  
--- 711,718 ----
  
  \def\newindex #1{
  \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
! \openout \csname#1indfile\endcsname \jobname.#1	% Open the file
  \expandafter\xdef\csname#1index\endcsname{%	% Define \xxxindex
  \noexpand\doindex {#1}}
  }
  
***************
*** 731,742 ****
  
  \def\newcodeindex #1{
  \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
! \expandafter\gdef\csname#1openfile\endcsname{\openout % Open the file
! \csname#1indfile\endcsname \jobname.#1
! %\write16{Opening index file `#1'}%
! \expandafter\gdef\csname#1openfile\endcsname{\relax}}
  \expandafter\xdef\csname#1index\endcsname{%	% Define \xxxindex
- \expandafter\noexpand\csname#1openfile\endcsname
  \noexpand\docodeindex {#1}}
  }
  
--- 724,731 ----
  
  \def\newcodeindex #1{
  \expandafter\newwrite \csname#1indfile\endcsname% Define number for output file
! \openout \csname#1indfile\endcsname \jobname.#1	% Open the file
  \expandafter\xdef\csname#1index\endcsname{%	% Define \xxxindex
  \noexpand\docodeindex {#1}}
  }
  
***************
*** 746,752 ****
  % Do this instead of @defindex foo if you don't want it as a separate index.
  \def\synindex #1 #2 {%
  \expandafter\xdef\csname#1index\endcsname{%	% Define \xxxindex
- \expandafter\noexpand\csname#2openfile\endcsname
  \noexpand\doindex {#2}}%
  }
  
--- 735,740 ----
***************
*** 754,760 ****
  % inside @code.
  \def\syncodeindex #1 #2 {%
  \expandafter\xdef\csname#1index\endcsname{%	% Define \xxxindex
- \expandafter\noexpand\csname#2openfile\endcsname
  \noexpand\docodeindex {#2}}%
  }
  
--- 742,747 ----
***************
*** 971,979 ****
  \def\appendixletter{\char\the\appendixno}
  
  \newwrite \contentsfile
! \def\opentocfile{\openout \contentsfile = \jobname.toc 
! %\write16{Opening table of contents file.}%
! \global\let\opentocfile\relax}
  
  % Each @chapter defines this as the name of the chapter.
  % page headings and footings can use it.  @section does likewise
--- 958,964 ----
  \def\appendixletter{\char\the\appendixno}
  
  \newwrite \contentsfile
! \openout \contentsfile = \jobname.toc
  
  % Each @chapter defines this as the name of the chapter.
  % page headings and footings can use it.  @section does likewise
***************
*** 993,999 ****
  \let\frenchspacing=\relax%
  \edef\temp{{\realbackslash chapentry {#1}{\the\chapno}{\noexpand\folio}}}%
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp  %
  \donoderef %
  }
--- 978,983 ----
***************
*** 1007,1013 ****
  \let\frenchspacing=\relax%
  \edef\temp{{\realbackslash chapentry {#1}{Appendix \appendixletter}{\noexpand\folio}}}%
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp  %
  \unnumbnoderef %
  }
--- 991,996 ----
***************
*** 1021,1027 ****
  \let\frenchspacing=\relax%
  \edef\temp{{\realbackslash unnumbchapentry {#1}{\noexpand\folio}}}%
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp  %
  \unnumbnoderef %
  }
--- 1004,1009 ----
***************
*** 1035,1041 ****
  \edef\temp{{\realbackslash secentry %
  {#1}{\the\chapno}{\the\secno}{\noexpand\folio}}}%
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp %
  \donoderef %
  \penalty 10000 %
--- 1017,1022 ----
***************
*** 1051,1057 ****
  \edef\temp{{\realbackslash secentry %
  {#1}{\appendixletter}{\the\secno}{\noexpand\folio}}}%
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp %
  \unnumbnoderef %
  \penalty 10000 %
--- 1032,1037 ----
***************
*** 1064,1070 ****
  \let\frenchspacing=\relax%
  \edef\temp{{\realbackslash unnumbsecentry{#1}{\noexpand\folio}}}%
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp %
  \unnumbnoderef %
  \penalty 10000 %
--- 1044,1049 ----
***************
*** 1079,1085 ****
  \edef\temp{{\realbackslash subsecentry %
  {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp %
  \donoderef %
  \penalty 10000 %
--- 1058,1063 ----
***************
*** 1094,1100 ****
  \edef\temp{{\realbackslash subsecentry %
  {#1}{\appendixletter}{\the\secno}{\the\subsecno}{\noexpand\folio}}}%
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp %
  \unnumbnoderef %
  \penalty 10000 %
--- 1072,1077 ----
***************
*** 1107,1113 ****
  \let\frenchspacing=\relax%
  \edef\temp{{\realbackslash unnumbsubsecentry{#1}{\noexpand\folio}}}%
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp %
  \unnumbnoderef %
  \penalty 10000 %
--- 1084,1089 ----
***************
*** 1122,1128 ****
  \edef\temp{{\realbackslash subsubsecentry %
  {#1}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%\
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp %
  \donoderef %
  \penalty 10000 %
--- 1098,1103 ----
***************
*** 1137,1143 ****
  \edef\temp{{\realbackslash subsubsecentry{#1}%
  {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}{\noexpand\folio}}}%\
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp %
  \unnumbnoderef %
  \penalty 10000 %
--- 1112,1117 ----
***************
*** 1150,1156 ****
  \let\frenchspacing=\relax%
  \edef\temp{{\realbackslash unnumbsubsubsecentry{#1}{\noexpand\folio}}}%
  \escapechar=`\\%
- \opentocfile
  \write \contentsfile \temp %
  \unnumbnoderef %
  \penalty 10000 %
--- 1124,1129 ----
***************
*** 1840,1846 ****
  
  \def\dosetq #1#2{{\let\folio=0%
  \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
! \openauxfile\next}}
  
  % \internalsetq {foo}{page} expands into CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
  % When the aux file is read, ' is the escape character
--- 1813,1819 ----
  
  \def\dosetq #1#2{{\let\folio=0%
  \edef\next{\write\auxfile{\internalsetq {#1}{#2}}}%
! \next}}
  
  % \internalsetq {foo}{page} expands into CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
  % When the aux file is read, ' is the escape character
***************
*** 1883,1889 ****
  \def\xrdef #1#2{
  {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
  
! \def\readauxfile{\begingroup
  \catcode `\^^@=\other
  \catcode `\=\other
  \catcode `\=\other
--- 1856,1862 ----
  \def\xrdef #1#2{
  {\catcode`\'=\other\expandafter \gdef \csname X#1\endcsname {#2}}}
  
! {
  \catcode `\^^@=\other
  \catcode `\=\other
  \catcode `\=\other
***************
*** 1939,1960 ****
  \catcode `\'=0
  \catcode `\\=\other
  
! \openin 1 \jobname.aux
! \ifeof 1 \else \closein 1 \input \jobname.aux
! \fi
! \endgroup
  }
  
- % read the aux file, in case we are not being preloaded
- \readauxfile
- % make sure the aux file will be read, if we are being preloaded
- \everyjob={\immediate\write16{Texinfo version \texinfoversion.}\readauxfile}
- 
  % Open the new aux file.  Tex will close it automatically at exit.
  
! \def\openauxfile{\global\let\openauxfile\relax
! %\write16{Opening auxiliary file.}%
! \openout \auxfile=\jobname.aux}
  
  % Footnotes.
  
--- 1912,1925 ----
  \catcode `\'=0
  \catcode `\\=\other
  
! 'openin 1 'jobname.aux
! 'ifeof 1 'else 'closein 1 'input 'jobname.aux
! 'fi
  }
  
  % Open the new aux file.  Tex will close it automatically at exit.
  
! \openout \auxfile=\jobname.aux
  
  % Footnotes.