Commit adc4adcd by Gerald Pfeifer

ggc-page.c (extra_order_size_table): Insns have 9 slots.

	* ggc-page.c (extra_order_size_table): Insns have 9 slots. Regs
	don't have 2.

	* ggc-page.c (struct globals): Add new fields to keep track of the
	total allocated memory and overhead.
	(ggc_print_statistics): Print them.
	(ggc_alloc): Keep track of the total allocated memory and the
	overhead.

	* tree.c (dump_tree_statistics): Increase spacing.
	(enum tree_node_kind): Move to ...
	* tree.h (enum tree_node_kind): ... here.
	(tree_node_counts, tree_node_sizes): Declare.

	* doc/include/texinfo.tex: Upgrade to texinfo 4.6.

From-SVN: r69330
parent 3ad249b9
2003-07-14 Dan Nicolaescu <dann@ics.uci.edu>
* ggc-page.c (extra_order_size_table): Insns have 9 slots. Regs
don't have 2.
2003-07-14 Dan Nicolaescu <dann@ics.uci.edu>
* ggc-page.c (struct globals): Add new fields to keep track of the
total allocated memory and overhead.
(ggc_print_statistics): Print them.
(ggc_alloc): Keep track of the total allocated memory and the
overhead.
* tree.c (dump_tree_statistics): Increase spacing.
(enum tree_node_kind): Move to ...
* tree.h (enum tree_node_kind): ... here.
(tree_node_counts, tree_node_sizes): Declare.
2003-07-14 James A. Morrison <ja2morri@student.math.uwaterloo.ca>
* doc/include/texinfo.tex: Upgrade to texinfo 4.6.
2003-07-14 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> 2003-07-14 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
PR optimization/11440 PR optimization/11440
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
% Load plain if necessary, i.e., if running under initex. % Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
% %
\def\texinfoversion{2002-12-26.16} \def\texinfoversion{2003-05-04.08}
% %
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
% %
% This texinfo.tex file is free software; you can redistribute it and/or % This texinfo.tex file is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License as % modify it under the terms of the GNU General Public License as
...@@ -56,8 +56,9 @@ ...@@ -56,8 +56,9 @@
% Sometimes one run after texindex suffices, and sometimes you need more % Sometimes one run after texindex suffices, and sometimes you need more
% than two; texi2dvi does it as many times as necessary. % than two; texi2dvi does it as many times as necessary.
% %
% It is possible to adapt texinfo.tex for other languages. You can get % It is possible to adapt texinfo.tex for other languages, to some
% the existing language-specific files from the full Texinfo distribution. % extent. You can get the existing language-specific files from the
% full Texinfo distribution.
\message{Loading texinfo [version \texinfoversion]:} \message{Loading texinfo [version \texinfoversion]:}
...@@ -70,11 +71,11 @@ ...@@ -70,11 +71,11 @@
\message{Basics,} \message{Basics,}
\chardef\other=12 \chardef\other=12
% We never want plain's outer \+ definition in Texinfo. % We never want plain's \outer definition of \+ in Texinfo.
% For @tex, we can use \tabalign. % For @tex, we can use \tabalign.
\let\+ = \relax \let\+ = \relax
% Save some parts of plain tex whose names we will redefine. % Save some plain tex macros whose names we will redefine.
\let\ptexb=\b \let\ptexb=\b
\let\ptexbullet=\bullet \let\ptexbullet=\bullet
\let\ptexc=\c \let\ptexc=\c
...@@ -87,10 +88,12 @@ ...@@ -87,10 +88,12 @@
\let\ptexgtr=> \let\ptexgtr=>
\let\ptexhat=^ \let\ptexhat=^
\let\ptexi=\i \let\ptexi=\i
\let\ptexindent=\indent
\let\ptexlbrace=\{ \let\ptexlbrace=\{
\let\ptexless=< \let\ptexless=<
\let\ptexplus=+ \let\ptexplus=+
\let\ptexrbrace=\} \let\ptexrbrace=\}
\let\ptexslash=\/
\let\ptexstar=\* \let\ptexstar=\*
\let\ptext=\t \let\ptext=\t
...@@ -140,6 +143,18 @@ ...@@ -140,6 +143,18 @@
\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi
\ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
% In some macros, we cannot use the `\? notation---the left quote is
% in some cases the escape char.
\chardef\colonChar = `\:
\chardef\commaChar = `\,
\chardef\dotChar = `\.
\chardef\equalChar = `\=
\chardef\exclamChar= `\!
\chardef\questChar = `\?
\chardef\semiChar = `\;
\chardef\spaceChar = `\ %
\chardef\underChar = `\_
% Ignore a token. % Ignore a token.
% %
\def\gobble#1{} \def\gobble#1{}
...@@ -151,8 +166,9 @@ ...@@ -151,8 +166,9 @@
% Hyphenation fixes. % Hyphenation fixes.
\hyphenation{ap-pen-dix} \hyphenation{ap-pen-dix}
\hyphenation{mini-buf-fer mini-buf-fers}
\hyphenation{eshell} \hyphenation{eshell}
\hyphenation{mini-buf-fer mini-buf-fers}
\hyphenation{time-stamp}
\hyphenation{white-space} \hyphenation{white-space}
% Margin to add to right of even pages, to left of odd pages. % Margin to add to right of even pages, to left of odd pages.
...@@ -290,7 +306,7 @@ ...@@ -290,7 +306,7 @@
\egroup % \vbox from first cropmarks clause \egroup % \vbox from first cropmarks clause
\fi \fi
}% end of \shipout\vbox }% end of \shipout\vbox
}% end of group with \turnoffactive }% end of group with \normalturnoffactive
\advancepageno \advancepageno
\ifnum\outputpenalty>-20000 \else\dosupereject\fi \ifnum\outputpenalty>-20000 \else\dosupereject\fi
} }
...@@ -469,16 +485,19 @@ ...@@ -469,16 +485,19 @@
\let\{=\mylbrace \let\{=\mylbrace
\let\}=\myrbrace \let\}=\myrbrace
\begingroup \begingroup
% Definitions to produce actual \{ & \} command in an index. % Definitions to produce \{ and \} commands for indices,
\catcode`\{ = 12 \catcode`\} = 12 % and @{ and @} for the aux file.
\catcode`\{ = \other \catcode`\} = \other
\catcode`\[ = 1 \catcode`\] = 2 \catcode`\[ = 1 \catcode`\] = 2
\catcode`\@ = 0 \catcode`\\ = 12 \catcode`\! = 0 \catcode`\\ = \other
@gdef@lbracecmd[\{]% !gdef!lbracecmd[\{]%
@gdef@rbracecmd[\}]% !gdef!rbracecmd[\}]%
@endgroup !gdef!lbraceatcmd[@{]%
!gdef!rbraceatcmd[@}]%
!endgroup
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
% Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H. % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
\let\, = \c \let\, = \c
\let\dotaccent = \. \let\dotaccent = \.
\def\ringaccent#1{{\accent23 #1}} \def\ringaccent#1{{\accent23 #1}}
...@@ -487,7 +506,7 @@ ...@@ -487,7 +506,7 @@
\let\udotaccent = \d \let\udotaccent = \d
% Other special characters: @questiondown @exclamdown % Other special characters: @questiondown @exclamdown
% Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss. % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
\def\questiondown{?`} \def\questiondown{?`}
\def\exclamdown{!`} \def\exclamdown{!`}
...@@ -520,6 +539,9 @@ ...@@ -520,6 +539,9 @@
% @* forces a line break. % @* forces a line break.
\def\*{\hfil\break\hbox{}\ignorespaces} \def\*{\hfil\break\hbox{}\ignorespaces}
% @/ allows a line break.
\let\/=\allowbreak
% @. is an end-of-sentence period. % @. is an end-of-sentence period.
\def\.{.\spacefactor=3000 } \def\.{.\spacefactor=3000 }
...@@ -542,6 +564,16 @@ ...@@ -542,6 +564,16 @@
% therefore, no glue is inserted, and the space between the headline and % therefore, no glue is inserted, and the space between the headline and
% the text is small, which looks bad. % the text is small, which looks bad.
% %
% Another complication is that the group might be very large. This can
% cause the glue on the previous page to be unduly stretched, because it
% does not have much material. In this case, it's better to add an
% explicit \vfill so that the extra space is at the bottom. The
% threshold for doing this is if the group is more than \vfilllimit
% percent of a page (\vfilllimit can be changed inside of @tex).
%
\newbox\groupbox
\def\vfilllimit{0.7}
%
\def\group{\begingroup \def\group{\begingroup
\ifnum\catcode13=\active \else \ifnum\catcode13=\active \else
\errhelp = \groupinvalidhelp \errhelp = \groupinvalidhelp
...@@ -555,10 +587,22 @@ ...@@ -555,10 +587,22 @@
% above. But it's pretty close. % above. But it's pretty close.
\def\Egroup{% \def\Egroup{%
\egroup % End the \vtop. \egroup % End the \vtop.
% \dimen0 is the vertical size of the group's box.
\dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
% \dimen2 is how much space is left on the page (more or less).
\dimen2 = \pageheight \advance\dimen2 by -\pagetotal
% if the group doesn't fit on the current page, and it's a big big
% group, force a page break.
\ifdim \dimen0 > \dimen2
\ifdim \pagetotal < \vfilllimit\pageheight
\page
\fi
\fi
\copy\groupbox
\endgroup % End the \group. \endgroup % End the \group.
}% }%
% %
\vtop\bgroup \setbox\groupbox = \vtop\bgroup
% We have to put a strut on the last line in case the @group is in % We have to put a strut on the last line in case the @group is in
% the midst of an example, rather than completely enclosing it. % the midst of an example, rather than completely enclosing it.
% Otherwise, the interline space between the last line of the group % Otherwise, the interline space between the last line of the group
...@@ -683,8 +727,7 @@ where each line of input produces a line of output.} ...@@ -683,8 +727,7 @@ where each line of input produces a line of output.}
\spacefactor=3000 \spacefactor=3000
} }
% @page forces the start of a new page.
% @page forces the start of a new page
% %
\def\page{\par\vfill\supereject} \def\page{\par\vfill\supereject}
...@@ -756,30 +799,36 @@ where each line of input produces a line of output.} ...@@ -756,30 +799,36 @@ where each line of input produces a line of output.}
% @include file insert text of that file as input. % @include file insert text of that file as input.
% Allow normal characters that we make active in the argument (a file name). % Allow normal characters that we make active in the argument (a file name).
\def\include{\begingroup \def\include{\begingroup
\catcode`\\=12 \catcode`\\=\other
\catcode`~=12 \catcode`~=\other
\catcode`^=12 \catcode`^=\other
\catcode`_=12 \catcode`_=\other
\catcode`|=12 \catcode`|=\other
\catcode`<=12 \catcode`<=\other
\catcode`>=12 \catcode`>=\other
\catcode`+=12 \catcode`+=\other
\parsearg\includezzz} \parsearg\includezzz}
% Restore active chars for included file. % Restore active chars for included file.
\def\includezzz#1{\endgroup\begingroup \def\includezzz#1{\endgroup\begingroup
% Read the included file in a group so nested @include's work. % Read the included file in a group so nested @include's work.
\def\thisfile{#1}% \def\thisfile{#1}%
\let\value=\expandablevalue
\input\thisfile \input\thisfile
\endgroup} \endgroup}
\def\thisfile{} \def\thisfile{}
% @center line outputs that line, centered % @center line
% outputs that line, centered.
\def\center{\parsearg\centerzzz} %
\def\centerzzz #1{{\advance\hsize by -\leftskip \def\center{\parsearg\docenter}
\advance\hsize by -\rightskip \def\docenter#1{{%
\centerline{#1}}} \ifhmode \hfil\break \fi
\advance\hsize by -\leftskip
\advance\hsize by -\rightskip
\line{\hfil \ignorespaces#1\unskip \hfil}%
\ifhmode \break \fi
}}
% @sp n outputs n lines of vertical space % @sp n outputs n lines of vertical space
...@@ -799,7 +848,8 @@ where each line of input produces a line of output.} ...@@ -799,7 +848,8 @@ where each line of input produces a line of output.}
% @paragraphindent NCHARS % @paragraphindent NCHARS
% We'll use ems for NCHARS, close enough. % We'll use ems for NCHARS, close enough.
% We cannot implement @paragraphindent asis, though. % NCHARS can also be the word `asis' or `none'.
% We cannot feasibly implement @paragraphindent asis, though.
% %
\def\asisword{asis} % no translation, these are keywords \def\asisword{asis} % no translation, these are keywords
\def\noneword{none} \def\noneword{none}
...@@ -835,6 +885,53 @@ where each line of input produces a line of output.} ...@@ -835,6 +885,53 @@ where each line of input produces a line of output.}
\fi \fi
} }
% @firstparagraphindent WORD
% If WORD is `none', then suppress indentation of the first paragraph
% after a section heading. If WORD is `insert', then do indentat such
% paragraphs.
%
% The paragraph indentation is suppressed or not by calling
% \suppressfirstparagraphindent, which the sectioning commands do. We
% switch the definition of this back and forth according to WORD. By
% default, we suppress indentation.
%
\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent}
\newdimen\currentparindent
%
\def\insertword{insert}
%
\def\firstparagraphindent{\parsearg\dofirstparagraphindent}
\def\dofirstparagraphindent#1{%
\def\temp{#1}%
\ifx\temp\noneword
\let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
\else\ifx\temp\insertword
\let\suppressfirstparagraphindent = \relax
\else
\errhelp = \EMsimple
\errmessage{Unknown @firstparagraphindent option `\temp'}%
\fi\fi
}
% Here is how we actually suppress indentation. Redefine \everypar to
% \kern backwards by \parindent, and then reset itself to empty.
%
% We also make \indent itself not actually do anything until the next
% paragraph.
%
\gdef\dosuppressfirstparagraphindent{%
\gdef\indent{%
\global\let\indent=\ptexindent
\global\everypar = {}%
}%
\global\everypar = {%
\kern-\parindent
\global\let\indent=\ptexindent
\global\everypar = {}%
}%
}%
% @asis just yields its argument. Used with @table, for example. % @asis just yields its argument. Used with @table, for example.
% %
\def\asis#1{#1} \def\asis#1{#1}
...@@ -851,9 +948,9 @@ where each line of input produces a line of output.} ...@@ -851,9 +948,9 @@ where each line of input produces a line of output.}
% _ within @math be active (mathcode "8000), and distinguish by seeing % _ within @math be active (mathcode "8000), and distinguish by seeing
% if the current family is \slfam, which is what @var uses. % if the current family is \slfam, which is what @var uses.
% %
{\catcode95 = \active % 95 = _ {\catcode\underChar = \active
\gdef\mathunderscore{% \gdef\mathunderscore{%
\catcode95=\active \catcode\underChar=\active
\def_{\ifnum\fam=\slfam \_\else\sb\fi}% \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
}} }}
% %
...@@ -1193,9 +1290,10 @@ where each line of input produces a line of output.} ...@@ -1193,9 +1290,10 @@ where each line of input produces a line of output.}
\setfont\textrm\rmshape{10}{\mainmagstep} \setfont\textrm\rmshape{10}{\mainmagstep}
\setfont\texttt\ttshape{10}{\mainmagstep} \setfont\texttt\ttshape{10}{\mainmagstep}
\fi \fi
% Instead of cmb10, you many want to use cmbx10. % Instead of cmb10, you may want to use cmbx10.
% cmbx10 is a prettier font on its own, but cmb10 % cmbx10 is a prettier font on its own, but cmb10
% looks better when embedded in a line with cmr10. % looks better when embedded in a line with cmr10
% (in Bob's opinion).
\setfont\textbf\bfshape{10}{\mainmagstep} \setfont\textbf\bfshape{10}{\mainmagstep}
\setfont\textit\itshape{10}{\mainmagstep} \setfont\textit\itshape{10}{\mainmagstep}
\setfont\textsl\slshape{10}{\mainmagstep} \setfont\textsl\slshape{10}{\mainmagstep}
...@@ -1344,7 +1442,25 @@ where each line of input produces a line of output.} ...@@ -1344,7 +1442,25 @@ where each line of input produces a line of output.}
\let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
\let\tenttsl=\smallerttsl \let\tenttsl=\smallerttsl
\resetmathfonts \setleading{9.5pt}} \resetmathfonts \setleading{9.5pt}}
\let\smallexamplefonts = \smallerfonts
% Set the fonts to use with the @small... environments.
\let\smallexamplefonts = \smallfonts
% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample
% can fit this many characters:
% 8.5x11=86 smallbook=72 a4=90 a5=69
% If we use \smallerfonts (8pt), then we can fit this many characters:
% 8.5x11=90+ smallbook=80 a4=90+ a5=77
% For me, subjectively, the few extra characters that fit aren't worth
% the additional smallness of 8pt. So I'm making the default 9pt.
%
% By the way, for comparison, here's what fits with @example (10pt):
% 8.5x11=71 smallbook=60 a4=75 a5=58
%
% I wish we used A4 paper on this side of the Atlantic.
%
% --karl, 24jan03.
% Set up the default fonts, so we can use them for creating boxes. % Set up the default fonts, so we can use them for creating boxes.
% %
...@@ -1368,7 +1484,8 @@ where each line of input produces a line of output.} ...@@ -1368,7 +1484,8 @@ where each line of input produces a line of output.}
% \smartitalic{ARG} outputs arg in italics, followed by an italic correction % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
% unless the following character is such as not to need one. % unless the following character is such as not to need one.
\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else\/\fi\fi\fi} \def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else
\ptexslash\fi\fi\fi}
\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} \def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx}
\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} \def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
...@@ -1388,6 +1505,17 @@ where each line of input produces a line of output.} ...@@ -1388,6 +1505,17 @@ where each line of input produces a line of output.}
\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} \def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation}
\def\restorehyphenation{\hyphenchar\font = `- } \def\restorehyphenation{\hyphenchar\font = `- }
% Set sfcode to normal for the chars that usually have another value.
% Can't use plain's \frenchspacing because it uses the `\x notation, and
% sometimes \x has an active definition that messes things up.
%
\catcode`@=11
\def\frenchspacing{%
\sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m
\sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m
}
\catcode`@=\other
\def\t#1{% \def\t#1{%
{\tt \rawbackslash \frenchspacing #1}% {\tt \rawbackslash \frenchspacing #1}%
\null \null
...@@ -1487,15 +1615,17 @@ where each line of input produces a line of output.} ...@@ -1487,15 +1615,17 @@ where each line of input produces a line of output.}
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
\else\ifx\arg\wordcode \else\ifx\arg\wordcode
\gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
\else
\errhelp = \EMsimple
\errmessage{Unknown @kbdinputstyle option `\arg'}%
\fi\fi\fi \fi\fi\fi
} }
\def\worddistinct{distinct} \def\worddistinct{distinct}
\def\wordexample{example} \def\wordexample{example}
\def\wordcode{code} \def\wordcode{code}
% Default is kbdinputdistinct. (Too much of a hassle to call the macro, % Default is `distinct.'
% the catcodes are wrong for parsearg to work.) \kbdinputstyle distinct
\gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
\def\xkey{\key} \def\xkey{\key}
\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
...@@ -1583,6 +1713,16 @@ where each line of input produces a line of output.} ...@@ -1583,6 +1713,16 @@ where each line of input produces a line of output.}
% @pounds{} is a sterling sign. % @pounds{} is a sterling sign.
\def\pounds{{\it\$}} \def\pounds{{\it\$}}
% @registeredsymbol - R in a circle. For now, only works in text size;
% we'd have to redo the font mechanism to change the \scriptstyle and
% \scriptscriptstyle font sizes to make it look right in headings.
% Adapted from the plain.tex definition of \copyright.
%
\def\registeredsymbol{%
$^{{\ooalign{\hfil\raise.07ex\hbox{$\scriptstyle\rm R$}\hfil\crcr\Orb}}%
}$%
}
\message{page headings,} \message{page headings,}
...@@ -1995,23 +2135,21 @@ where each line of input produces a line of output.} ...@@ -1995,23 +2135,21 @@ where each line of input produces a line of output.}
\itemizey {#1}{\Eitemize} \itemizey {#1}{\Eitemize}
} }
\def\itemizey #1#2{% \def\itemizey#1#2{%
\aboveenvbreak % \aboveenvbreak
\itemmax=\itemindent % \itemmax=\itemindent
\advance \itemmax by -\itemmargin % \advance\itemmax by -\itemmargin
\advance \leftskip by \itemindent % \advance\leftskip by \itemindent
\exdentamount=\itemindent \exdentamount=\itemindent
\parindent = 0pt % \parindent=0pt
\parskip = \smallskipamount % \parskip=\smallskipamount
\ifdim \parskip=0pt \parskip=2pt \fi% \ifdim\parskip=0pt \parskip=2pt \fi
\def#2{\endgraf\afterenvbreak\endgroup}% \def#2{\endgraf\afterenvbreak\endgroup}%
\def\itemcontents{#1}% \def\itemcontents{#1}%
\let\item=\itemizeitem} % @itemize with no arg is equivalent to @itemize @bullet.
\ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
% Set sfcode to normal for the chars that usually have another value. \let\item=\itemizeitem
% These are `.?!:;,' }
\def\frenchspacing{\sfcode46=1000 \sfcode63=1000 \sfcode33=1000
\sfcode58=1000 \sfcode59=1000 \sfcode44=1000 }
% \splitoff TOKENS\endmark defines \first to be the first token in % \splitoff TOKENS\endmark defines \first to be the first token in
% TOKENS, and \rest to be the remainder. % TOKENS, and \rest to be the remainder.
...@@ -2234,8 +2372,8 @@ where each line of input produces a line of output.} ...@@ -2234,8 +2372,8 @@ where each line of input produces a line of output.}
\let\go\pickupwholefraction \let\go\pickupwholefraction
\else \else
\global\advance\colcount by 1 \global\advance\colcount by 1
\setbox0=\hbox{#1\unskip }% Add a normal word space as a separator; \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
% typically that is always in the input, anyway. % separator; typically that is always in the input, anyway.
\expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
\fi \fi
\fi \fi
...@@ -2250,18 +2388,18 @@ where each line of input produces a line of output.} ...@@ -2250,18 +2388,18 @@ where each line of input produces a line of output.}
\go \go
} }
% This used to have \hskip1sp. But then the space in a template line is
% not enough. That is bad. So let's go back to just & until we
% encounter the problem it was intended to solve again.
% --karl, nathan@acm.org, 20apr99.
\def\tab{&}
% @multitable ... @end multitable definitions: % @multitable ... @end multitable definitions:
% %
\def\multitable{\parsearg\dotable} \def\multitable{\parsearg\dotable}
\def\dotable#1{\bgroup \def\dotable#1{\bgroup
\vskip\parskip \vskip\parskip
\let\item\crcr \let\item=\crcrwithfootnotes
% A \tab used to include \hskip1sp. But then the space in a template
% line is not enough. That is bad. So let's go back to just & until
% we encounter the problem it was intended to solve again. --karl,
% nathan@acm.org, 20apr99.
\let\tab=&%
\let\startfootins=\startsavedfootnote
\tolerance=9500 \tolerance=9500
\hbadness=9500 \hbadness=9500
\setmultitablespacing \setmultitablespacing
...@@ -2269,7 +2407,11 @@ where each line of input produces a line of output.} ...@@ -2269,7 +2407,11 @@ where each line of input produces a line of output.}
\parindent=\multitableparindent \parindent=\multitableparindent
\overfullrule=0pt \overfullrule=0pt
\global\colcount=0 \global\colcount=0
\def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}% \def\Emultitable{%
\global\setpercentfalse
\crcrwithfootnotes\crcr
\egroup\egroup
}%
% %
% To parse everything between @multitable and @item: % To parse everything between @multitable and @item:
\setuptable#1 \endsetuptable \setuptable#1 \endsetuptable
...@@ -2358,6 +2500,25 @@ width0pt\relax} \fi ...@@ -2358,6 +2500,25 @@ width0pt\relax} \fi
%% than skip between lines in the table. %% than skip between lines in the table.
\fi} \fi}
% In case a @footnote appears inside an alignment, save the footnote
% text to a box and make the \insert when a row of the table is
% finished. Otherwise, the insertion is lost, it never migrates to the
% main vertical list. --kasal, 22jan03.
%
\newbox\savedfootnotes
%
% \dotable \let's \startfootins to this, so that \dofootnote will call
% it instead of starting the insertion right away.
\def\startsavedfootnote{%
\global\setbox\savedfootnotes = \vbox\bgroup
\unvbox\savedfootnotes
}
\def\crcrwithfootnotes{%
\crcr
\ifvoid\savedfootnotes \else
\noalign{\insert\footins{\box\savedfootnotes}}%
\fi
}
\message{conditionals,} \message{conditionals,}
% Prevent errors for section commands. % Prevent errors for section commands.
...@@ -2393,50 +2554,101 @@ width0pt\relax} \fi ...@@ -2393,50 +2554,101 @@ width0pt\relax} \fi
% and so want to turn off most commands, in case they are used % and so want to turn off most commands, in case they are used
% incorrectly. % incorrectly.
% %
% We use \empty instead of \relax for the @def... commands, so that \end
% doesn't throw an error. For instance:
% @ignore
% @deffn ...
% @end deffn
% @end ignore
%
% The @end deffn is going to get expanded, because we're trying to allow
% nested conditionals. But we don't want to expand the actual @deffn,
% since it might be syntactically correct and intended to be ignored.
% Since \end checks for \relax, using \empty does not cause an error.
%
\def\ignoremorecommands{% \def\ignoremorecommands{%
\let\defcodeindex = \relax \let\defcodeindex = \relax
\let\defcv = \relax \let\defcv = \empty
\let\deffn = \relax \let\defcvx = \empty
\let\deffnx = \relax \let\Edefcv = \empty
\let\deffn = \empty
\let\deffnx = \empty
\let\Edeffn = \empty
\let\defindex = \relax \let\defindex = \relax
\let\defivar = \relax \let\defivar = \empty
\let\defmac = \relax \let\defivarx = \empty
\let\defmethod = \relax \let\Edefivar = \empty
\let\defop = \relax \let\defmac = \empty
\let\defopt = \relax \let\defmacx = \empty
\let\defspec = \relax \let\Edefmac = \empty
\let\deftp = \relax \let\defmethod = \empty
\let\deftypefn = \relax \let\defmethodx = \empty
\let\deftypefun = \relax \let\Edefmethod = \empty
\let\deftypeivar = \relax \let\defop = \empty
\let\deftypeop = \relax \let\defopx = \empty
\let\deftypevar = \relax \let\Edefop = \empty
\let\deftypevr = \relax \let\defopt = \empty
\let\defun = \relax \let\defoptx = \empty
\let\defvar = \relax \let\Edefopt = \empty
\let\defvr = \relax \let\defspec = \empty
\let\ref = \relax \let\defspecx = \empty
\let\xref = \relax \let\Edefspec = \empty
\let\printindex = \relax \let\deftp = \empty
\let\pxref = \relax \let\deftpx = \empty
\let\settitle = \relax \let\Edeftp = \empty
\let\setchapternewpage = \relax \let\deftypefn = \empty
\let\setchapterstyle = \relax \let\deftypefnx = \empty
\let\everyheading = \relax \let\Edeftypefn = \empty
\let\deftypefun = \empty
\let\deftypefunx = \empty
\let\Edeftypefun = \empty
\let\deftypeivar = \empty
\let\deftypeivarx = \empty
\let\Edeftypeivar = \empty
\let\deftypemethod = \empty
\let\deftypemethodx = \empty
\let\Edeftypemethod = \empty
\let\deftypeop = \empty
\let\deftypeopx = \empty
\let\Edeftypeop = \empty
\let\deftypevar = \empty
\let\deftypevarx = \empty
\let\Edeftypevar = \empty
\let\deftypevr = \empty
\let\deftypevrx = \empty
\let\Edeftypevr = \empty
\let\defun = \empty
\let\defunx = \empty
\let\Edefun = \empty
\let\defvar = \empty
\let\defvarx = \empty
\let\Edefvar = \empty
\let\defvr = \empty
\let\defvrx = \empty
\let\Edefvr = \empty
\let\clear = \relax
\let\down = \relax
\let\evenfooting = \relax
\let\evenheading = \relax \let\evenheading = \relax
\let\oddheading = \relax
\let\everyfooting = \relax \let\everyfooting = \relax
\let\evenfooting = \relax \let\everyheading = \relax
\let\oddfooting = \relax
\let\headings = \relax \let\headings = \relax
\let\include = \relax \let\include = \relax
\let\item = \relax
\let\lowersections = \relax \let\lowersections = \relax
\let\down = \relax \let\oddfooting = \relax
\let\oddheading = \relax
\let\printindex = \relax
\let\pxref = \relax
\let\raisesections = \relax \let\raisesections = \relax
\let\up = \relax \let\ref = \relax
\let\set = \relax \let\set = \relax
\let\clear = \relax \let\setchapternewpage = \relax
\let\item = \relax \let\setchapterstyle = \relax
\let\settitle = \relax
\let\up = \relax
\let\verbatiminclude = \relax
\let\xref = \relax
} }
% Ignore @ignore, @ifhtml, @ifinfo, and the like. % Ignore @ignore, @ifhtml, @ifinfo, and the like.
...@@ -2470,7 +2682,7 @@ width0pt\relax} \fi ...@@ -2470,7 +2682,7 @@ width0pt\relax} \fi
\long\def\doignoretext##1@end #1{\enddoignore}% \long\def\doignoretext##1@end #1{\enddoignore}%
% %
% Make sure that spaces turn into tokens that match what \doignoretext wants. % Make sure that spaces turn into tokens that match what \doignoretext wants.
\catcode32 = 10 \catcode\spaceChar = 10
% %
% Ignore braces, too, so mismatched braces don't cause trouble. % Ignore braces, too, so mismatched braces don't cause trouble.
\catcode`\{ = 9 \catcode`\{ = 9
...@@ -2535,7 +2747,7 @@ width0pt\relax} \fi ...@@ -2535,7 +2747,7 @@ width0pt\relax} \fi
% command, so that nested ignore constructs work. Thus, we put the % command, so that nested ignore constructs work. Thus, we put the
% text into a \vbox and then do nothing with the result. To minimize % text into a \vbox and then do nothing with the result. To minimize
% the chance of memory overflow, we follow the approach outlined on % the chance of memory overflow, we follow the approach outlined on
% page 401 of the TeXbook: make the current font be a dummy font. % page 401 of the TeXbook.
% %
\setbox0 = \vbox\bgroup \setbox0 = \vbox\bgroup
% Don't complain about control sequences we have declared \outer. % Don't complain about control sequences we have declared \outer.
...@@ -2556,8 +2768,8 @@ width0pt\relax} \fi ...@@ -2556,8 +2768,8 @@ width0pt\relax} \fi
% %
% Set the current font to be \nullfont, a TeX primitive, and define % Set the current font to be \nullfont, a TeX primitive, and define
% all the font commands to also use \nullfont. We don't use % all the font commands to also use \nullfont. We don't use
% dummy.tfm, as suggested in the TeXbook, because not all sites % dummy.tfm, as suggested in the TeXbook, because some sites
% might have that installed. Therefore, math mode will still % might not have that installed. Therefore, math mode will still
% produce output, but that should be an extremely small amount of % produce output, but that should be an extremely small amount of
% stuff compared to the main input. % stuff compared to the main input.
% %
...@@ -2631,7 +2843,7 @@ width0pt\relax} \fi ...@@ -2631,7 +2843,7 @@ width0pt\relax} \fi
% we're called from @code, as @code{@value{foo-bar_}}. So \let any % we're called from @code, as @code{@value{foo-bar_}}. So \let any
% such active characters to their normal equivalents. % such active characters to their normal equivalents.
\gdef\value{\begingroup \gdef\value{\begingroup
\catcode`\-=12 \catcode`\_=12 \catcode`\-=\other \catcode`\_=\other
\indexbreaks \let_\normalunderscore \indexbreaks \let_\normalunderscore
\valuexxx} \valuexxx}
} }
...@@ -2640,15 +2852,17 @@ width0pt\relax} \fi ...@@ -2640,15 +2852,17 @@ width0pt\relax} \fi
% We have this subroutine so that we can handle at least some @value's % We have this subroutine so that we can handle at least some @value's
% properly in indexes (we \let\value to this in \indexdummies). Ones % properly in indexes (we \let\value to this in \indexdummies). Ones
% whose names contain - or _ still won't work, but we can't do anything % whose names contain - or _ still won't work, but we can't do anything
% about that. The command has to be fully expandable, since the result % about that. The command has to be fully expandable (if the variable
% winds up in the index file. This means that if the variable's value % is set), since the result winds up in the index file. This means that
% contains other Texinfo commands, it's almost certain it will fail % if the variable's value contains other Texinfo commands, it's almost
% (although perhaps we could fix that with sufficient work to do a % certain it will fail (although perhaps we could fix that with
% one-level expansion on the result, instead of complete). % sufficient work to do a one-level expansion on the result, instead of
% complete).
% %
\def\expandablevalue#1{% \def\expandablevalue#1{%
\expandafter\ifx\csname SET#1\endcsname\relax \expandafter\ifx\csname SET#1\endcsname\relax
{[No value for ``#1'']}% {[No value for ``#1'']}%
\message{Variable `#1', used in @value, is not set.}%
\else \else
\csname SET#1\endcsname \csname SET#1\endcsname
\fi \fi
...@@ -2657,13 +2871,14 @@ width0pt\relax} \fi ...@@ -2657,13 +2871,14 @@ width0pt\relax} \fi
% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
% with @set. % with @set.
% %
\def\ifset{\parsearg\ifsetxxx} \def\ifset{\parsearg\doifset}
\def\ifsetxxx #1{% \def\doifset#1{%
\expandafter\ifx\csname SET#1\endcsname\relax \expandafter\ifx\csname SET#1\endcsname\relax
\expandafter\ifsetfail \let\next=\ifsetfail
\else \else
\expandafter\ifsetsucceed \let\next=\ifsetsucceed
\fi \fi
\next
} }
\def\ifsetsucceed{\conditionalsucceed{ifset}} \def\ifsetsucceed{\conditionalsucceed{ifset}}
\def\ifsetfail{\nestedignore{ifset}} \def\ifsetfail{\nestedignore{ifset}}
...@@ -2672,13 +2887,14 @@ width0pt\relax} \fi ...@@ -2672,13 +2887,14 @@ width0pt\relax} \fi
% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
% defined with @set, or has been undefined with @clear. % defined with @set, or has been undefined with @clear.
% %
\def\ifclear{\parsearg\ifclearxxx} \def\ifclear{\parsearg\doifclear}
\def\ifclearxxx #1{% \def\doifclear#1{%
\expandafter\ifx\csname SET#1\endcsname\relax \expandafter\ifx\csname SET#1\endcsname\relax
\expandafter\ifclearsucceed \let\next=\ifclearsucceed
\else \else
\expandafter\ifclearfail \let\next=\ifclearfail
\fi \fi
\next
} }
\def\ifclearsucceed{\conditionalsucceed{ifclear}} \def\ifclearsucceed{\conditionalsucceed{ifclear}}
\def\ifclearfail{\nestedignore{ifclear}} \def\ifclearfail{\nestedignore{ifclear}}
...@@ -2697,29 +2913,14 @@ width0pt\relax} \fi ...@@ -2697,29 +2913,14 @@ width0pt\relax} \fi
\defineunmatchedend{ifnotinfo} \defineunmatchedend{ifnotinfo}
\defineunmatchedend{ifnotplaintext} \defineunmatchedend{ifnotplaintext}
% We can't just want to start a group at @iftex (etc.) and end it at % True conditional. Since \set globally defines its variables, we can
% @end iftex, since then @set commands inside the conditional have no % just start and end a group (to keep the @end definition undefined at
% effect (they'd get reverted at the end of the group). So we must % the outer level).
% define \Eiftex to redefine itself to be its previous value. (We can't
% just define it to fail again with an ``unmatched end'' error, since
% the @ifset might be nested.)
% %
\def\conditionalsucceed#1{% \def\conditionalsucceed#1{\begingroup
\edef\temp{% \expandafter\def\csname E#1\endcsname{\endgroup}%
% Remember the current value of \E#1.
\let\nece{prevE#1} = \nece{E#1}%
%
% At the `@end #1', redefine \E#1 to be its previous value.
\def\nece{E#1}{\let\nece{E#1} = \nece{prevE#1}}%
}%
\temp
} }
% We need to expand lots of \csname's, but we don't want to expand the
% control sequences after we've constructed them.
%
\def\nece#1{\expandafter\noexpand\csname#1\endcsname}
% @defininfoenclose. % @defininfoenclose.
\let\definfoenclose=\comment \let\definfoenclose=\comment
...@@ -2811,104 +3012,166 @@ width0pt\relax} \fi ...@@ -2811,104 +3012,166 @@ width0pt\relax} \fi
\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
% Take care of texinfo commands likely to appear in an index entry. % Take care of Texinfo commands that can appear in an index entry.
% (Must be a way to avoid doing expansion at all, and thus not have to % Since there are some commands we want to expand, and others we don't,
% laboriously list every single command here.) % we have to laboriously prevent expansion for those that we don't.
% %
\def\indexdummies{% \def\indexdummies{%
\def\ { }% \def\@{@}% change to @@ when we switch to @ as escape char in index files.
\def\@{@}% change to @@ when we switch to @ as escape char in aux files. \def\ {\realbackslash\space }%
% Need these in case \tex is in effect and \{ is a \delimiter again. % Need these in case \tex is in effect and \{ is a \delimiter again.
% But can't use \lbracecmd and \rbracecmd because texindex assumes % But can't use \lbracecmd and \rbracecmd because texindex assumes
% braces and backslashes are used only as delimiters. % braces and backslashes are used only as delimiters.
\let\{ = \mylbrace \let\{ = \mylbrace
\let\} = \myrbrace \let\} = \myrbrace
\def\_{{\realbackslash _}}% %
\normalturnoffactive % \definedummyword defines \#1 as \realbackslash #1\space, thus
% % effectively preventing its expansion. This is used only for control
% Take care of the plain tex accent commands. % words, not control letters, because the \space would be incorrect
\def\,##1{\realbackslash ,{##1}}% % for control characters, but is needed to separate the control word
\def\"{\realbackslash "}% % from whatever follows.
\def\`{\realbackslash `}% %
\def\'{\realbackslash '}% % For control letters, we have \definedummyletter, which omits the
\def\^{\realbackslash ^}% % space.
\def\~{\realbackslash ~}% %
\def\={\realbackslash =}% % These can be used both for control words that take an argument and
\def\b{\realbackslash b}% % those that do not. If it is followed by {arg} in the input, then
\def\c{\realbackslash c}% % that will dutifully get written to the index (or wherever).
\def\d{\realbackslash d}% %
\def\u{\realbackslash u}% \def\definedummyword##1{%
\def\v{\realbackslash v}% \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}%
\def\H{\realbackslash H}% }%
\def\dotless##1{\realbackslash dotless {##1}}% \def\definedummyletter##1{%
% Take care of the plain tex special European modified letters. \expandafter\def\csname ##1\endcsname{\realbackslash ##1}%
\def\AA{\realbackslash AA}% }%
\def\AE{\realbackslash AE}% %
\def\L{\realbackslash L}% % Do the redefinitions.
\def\OE{\realbackslash OE}% \commondummies
\def\O{\realbackslash O}% }
\def\aa{\realbackslash aa}%
\def\ae{\realbackslash ae}% % For the aux file, @ is the escape character. So we want to redefine
\def\l{\realbackslash l}% % everything using @ instead of \realbackslash. When everything uses
\def\oe{\realbackslash oe}% % @, this will be simpler.
\def\o{\realbackslash o}% %
\def\ss{\realbackslash ss}% \def\atdummies{%
% \def\@{@@}%
% Although these internals commands shouldn't show up, sometimes they do. \def\ {@ }%
\def\bf{\realbackslash bf }% \let\{ = \lbraceatcmd
\def\gtr{\realbackslash gtr}% \let\} = \rbraceatcmd
\def\hat{\realbackslash hat}% %
\def\less{\realbackslash less}% % (See comments in \indexdummies.)
%\def\rm{\realbackslash rm }% \def\definedummyword##1{%
\def\sf{\realbackslash sf}% \expandafter\def\csname ##1\endcsname{@##1\space}%
\def\sl{\realbackslash sl }% }%
\def\tclose##1{\realbackslash tclose {##1}}% \def\definedummyletter##1{%
\def\tt{\realbackslash tt}% \expandafter\def\csname ##1\endcsname{@##1}%
% }%
\def\b##1{\realbackslash b {##1}}% %
\def\i##1{\realbackslash i {##1}}% % Do the redefinitions.
\def\sc##1{\realbackslash sc {##1}}% \commondummies
\def\t##1{\realbackslash t {##1}}% }
\def\r##1{\realbackslash r {##1}}%
% % Called from \indexdummies and \atdummies. \definedummyword and
\def\TeX{\realbackslash TeX}% % \definedummyletter must be defined first.
\def\acronym##1{\realbackslash acronym {##1}}% %
\def\cite##1{\realbackslash cite {##1}}% \def\commondummies{%
\def\code##1{\realbackslash code {##1}}% %
\def\command##1{\realbackslash command {##1}}% \normalturnoffactive
\def\dfn##1{\realbackslash dfn {##1}}% %
\def\dots{\realbackslash dots }% % Control letters and accents.
\def\emph##1{\realbackslash emph {##1}}% \definedummyletter{_}%
\def\env##1{\realbackslash env {##1}}% \definedummyletter{,}%
\def\file##1{\realbackslash file {##1}}% \definedummyletter{"}%
\def\kbd##1{\realbackslash kbd {##1}}% \definedummyletter{`}%
\def\key##1{\realbackslash key {##1}}% \definedummyletter{'}%
\def\math##1{\realbackslash math {##1}}% \definedummyletter{^}%
\def\option##1{\realbackslash option {##1}}% \definedummyletter{~}%
\def\samp##1{\realbackslash samp {##1}}% \definedummyletter{=}%
\def\strong##1{\realbackslash strong {##1}}% \definedummyword{u}%
\def\uref##1{\realbackslash uref {##1}}% \definedummyword{v}%
\def\url##1{\realbackslash url {##1}}% \definedummyword{H}%
\def\var##1{\realbackslash var {##1}}% \definedummyword{dotaccent}%
\def\w{\realbackslash w }% \definedummyword{ringaccent}%
% \definedummyword{tieaccent}%
% These math commands don't seem likely to be used in index entries. \definedummyword{ubaraccent}%
\def\copyright{\realbackslash copyright}% \definedummyword{udotaccent}%
\def\equiv{\realbackslash equiv}% \definedummyword{dotless}%
\def\error{\realbackslash error}% %
\def\expansion{\realbackslash expansion}% % Other non-English letters.
\def\point{\realbackslash point}% \definedummyword{AA}%
\def\print{\realbackslash print}% \definedummyword{AE}%
\def\result{\realbackslash result}% \definedummyword{L}%
% \definedummyword{OE}%
% Handle some cases of @value -- where the variable name does not \definedummyword{O}%
% contain - or _, and the value does not contain any \definedummyword{aa}%
% (non-fully-expandable) commands. \definedummyword{ae}%
\let\value = \expandablevalue \definedummyword{l}%
% \definedummyword{oe}%
\unsepspaces \definedummyword{o}%
% Turn off macro expansion \definedummyword{ss}%
\turnoffmacros %
% Although these internal commands shouldn't show up, sometimes they do.
\definedummyword{bf}%
\definedummyword{gtr}%
\definedummyword{hat}%
\definedummyword{less}%
\definedummyword{sf}%
\definedummyword{sl}%
\definedummyword{tclose}%
\definedummyword{tt}%
%
% Texinfo font commands.
\definedummyword{b}%
\definedummyword{i}%
\definedummyword{r}%
\definedummyword{sc}%
\definedummyword{t}%
%
\definedummyword{TeX}%
\definedummyword{acronym}%
\definedummyword{cite}%
\definedummyword{code}%
\definedummyword{command}%
\definedummyword{dfn}%
\definedummyword{dots}%
\definedummyword{emph}%
\definedummyword{env}%
\definedummyword{file}%
\definedummyword{kbd}%
\definedummyword{key}%
\definedummyword{math}%
\definedummyword{option}%
\definedummyword{samp}%
\definedummyword{strong}%
\definedummyword{uref}%
\definedummyword{url}%
\definedummyword{var}%
\definedummyword{w}%
%
% Assorted special characters.
\definedummyword{bullet}%
\definedummyword{copyright}%
\definedummyword{dots}%
\definedummyword{enddots}%
\definedummyword{equiv}%
\definedummyword{error}%
\definedummyword{expansion}%
\definedummyword{minus}%
\definedummyword{pounds}%
\definedummyword{point}%
\definedummyword{print}%
\definedummyword{result}%
%
% Handle some cases of @value -- where the variable name does not
% contain - or _, and the value does not contain any
% (non-fully-expandable) commands.
\let\value = \expandablevalue
%
% Normal spaces, not active ones.
\unsepspaces
%
% No macro expansion.
\turnoffmacros
} }
% If an index command is used in an @example environment, any spaces % If an index command is used in an @example environment, any spaces
...@@ -2917,83 +3180,86 @@ width0pt\relax} \fi ...@@ -2917,83 +3180,86 @@ width0pt\relax} \fi
{\obeyspaces {\obeyspaces
\gdef\unsepspaces{\obeyspaces\let =\space}} \gdef\unsepspaces{\obeyspaces\let =\space}}
% \indexnofonts no-ops all font-change commands.
% This is used when outputting the strings to sort the index by. % \indexnofonts is used when outputting the strings to sort the index
\def\indexdummyfont#1{#1} % by, and when constructing control sequence names. It eliminates all
% control sequences and just writes whatever the best ASCII sort string
% would be for a given command (usually its argument).
%
\def\indexdummytex{TeX} \def\indexdummytex{TeX}
\def\indexdummydots{...} \def\indexdummydots{...}
%
\def\indexnofonts{% \def\indexnofonts{%
\def\@{@}% \def\ { }%
% how to handle braces? \def\@{@}%
\def\_{\normalunderscore}% % how to handle braces?
% \def\_{\normalunderscore}%
\let\,=\indexdummyfont %
\let\"=\indexdummyfont \let\,=\asis
\let\`=\indexdummyfont \let\"=\asis
\let\'=\indexdummyfont \let\`=\asis
\let\^=\indexdummyfont \let\'=\asis
\let\~=\indexdummyfont \let\^=\asis
\let\==\indexdummyfont \let\~=\asis
\let\b=\indexdummyfont \let\==\asis
\let\c=\indexdummyfont \let\u=\asis
\let\d=\indexdummyfont \let\v=\asis
\let\u=\indexdummyfont \let\H=\asis
\let\v=\indexdummyfont \let\dotaccent=\asis
\let\H=\indexdummyfont \let\ringaccent=\asis
\let\dotless=\indexdummyfont \let\tieaccent=\asis
% Take care of the plain tex special European modified letters. \let\ubaraccent=\asis
\def\AA{AA}% \let\udotaccent=\asis
\def\AE{AE}% \let\dotless=\asis
\def\L{L}% %
\def\OE{OE}% % Other non-English letters.
\def\O{O}% \def\AA{AA}%
\def\aa{aa}% \def\AE{AE}%
\def\ae{ae}% \def\L{L}%
\def\l{l}% \def\OE{OE}%
\def\oe{oe}% \def\O{O}%
\def\o{o}% \def\aa{aa}%
\def\ss{ss}% \def\ae{ae}%
% \def\l{l}%
% Don't no-op \tt, since it isn't a user-level command \def\oe{oe}%
% and is used in the definitions of the active chars like <, >, |, etc. \def\o{o}%
% Likewise with the other plain tex font commands. \def\ss{ss}%
%\let\tt=\indexdummyfont \def\exclamdown{!}%
% \def\questiondown{?}%
\let\b=\indexdummyfont %
\let\i=\indexdummyfont % Don't no-op \tt, since it isn't a user-level command
\let\r=\indexdummyfont % and is used in the definitions of the active chars like <, >, |, etc.
\let\sc=\indexdummyfont % Likewise with the other plain tex font commands.
\let\t=\indexdummyfont %\let\tt=\asis
% %
\let\TeX=\indexdummytex % Texinfo font commands.
\let\acronym=\indexdummyfont \let\b=\asis
\let\cite=\indexdummyfont \let\i=\asis
\let\code=\indexdummyfont \let\r=\asis
\let\command=\indexdummyfont \let\sc=\asis
\let\dfn=\indexdummyfont \let\t=\asis
\let\dots=\indexdummydots %
\let\emph=\indexdummyfont \let\TeX=\indexdummytex
\let\env=\indexdummyfont \let\acronym=\asis
\let\file=\indexdummyfont \let\cite=\asis
\let\kbd=\indexdummyfont \let\code=\asis
\let\key=\indexdummyfont \let\command=\asis
\let\math=\indexdummyfont \let\dfn=\asis
\let\option=\indexdummyfont \let\dots=\indexdummydots
\let\samp=\indexdummyfont \let\emph=\asis
\let\strong=\indexdummyfont \let\env=\asis
\let\uref=\indexdummyfont \let\file=\asis
\let\url=\indexdummyfont \let\kbd=\asis
\let\var=\indexdummyfont \let\key=\asis
\let\w=\indexdummyfont \let\math=\asis
} \let\option=\asis
\let\samp=\asis
% To define \realbackslash, we must make \ not be an escape. \let\strong=\asis
% We must first make another character (@) an escape \let\uref=\asis
% so we do not become unable to do a definition. \let\url=\asis
\let\var=\asis
{\catcode`\@=0 \catcode`\\=\other \let\w=\asis
@gdef@realbackslash{\}} }
\let\indexbackslash=0 %overridden during \printindex. \let\indexbackslash=0 %overridden during \printindex.
\let\SETmarginindex=\relax % put index entries in margin (undocumented)? \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
...@@ -3025,28 +3291,24 @@ width0pt\relax} \fi ...@@ -3025,28 +3291,24 @@ width0pt\relax} \fi
\def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined now
% so it will be output as is; and it will print as backslash. % so it will be output as is; and it will print as backslash.
% %
\def\thirdarg{#3}% % The main index entry text.
%
% If third arg is present, precede it with space in sort key.
\ifx\thirdarg\emptymacro
\let\subentry = \empty
\else
\def\subentry{ #3}%
\fi
%
% First process the index entry with all font commands turned
% off to get the string to sort by.
{\indexnofonts \xdef\indexsorttmp{#2\subentry}}%
%
% Now the real index entry with the fonts.
\toks0 = {#2}% \toks0 = {#2}%
% %
% If third arg is present, precede it with space in sort key.
\def\thirdarg{#3}%
\ifx\thirdarg\emptymacro \else
% If the third (subentry) arg is present, add it to the index % If the third (subentry) arg is present, add it to the index
% line to write. % line to write.
\ifx\thirdarg\emptymacro \else \toks0 = \expandafter{\the\toks0 \space #3}%
\toks0 = \expandafter{\the\toks0{#3}}%
\fi \fi
% %
% Process the index entry with all font commands turned off, to
% get the string to sort by.
{\indexnofonts
\edef\temp{\the\toks0}% need full expansion
\xdef\indexsorttmp{\temp}%
}%
%
% Set up the complete index entry, with both the sort key and % Set up the complete index entry, with both the sort key and
% the original text, including any font commands. We write % the original text, including any font commands. We write
% three arguments to \entry to the .?? file (four in the % three arguments to \entry to the .?? file (four in the
...@@ -3077,12 +3339,11 @@ width0pt\relax} \fi ...@@ -3077,12 +3339,11 @@ width0pt\relax} \fi
\iflinks \iflinks
\ifvmode \ifvmode
\skip0 = \lastskip \skip0 = \lastskip
\ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi
\fi \fi
% %
\temp % do the write \temp % do the write
% %
%
\ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
\fi \fi
}% }%
...@@ -3132,6 +3393,7 @@ width0pt\relax} \fi ...@@ -3132,6 +3393,7 @@ width0pt\relax} \fi
% %
\smallfonts \rm \smallfonts \rm
\tolerance = 9500 \tolerance = 9500
\everypar = {}% don't want the \kern\-parindent from indentation suppression.
\indexbreaks \indexbreaks
% %
% See if the index file exists and is nonempty. % See if the index file exists and is nonempty.
...@@ -3513,6 +3775,7 @@ width0pt\relax} \fi ...@@ -3513,6 +3775,7 @@ width0pt\relax} \fi
\numberedsubsubseczzz{#2} \numberedsubsubseczzz{#2}
\fi \fi
\fi \fi
\suppressfirstparagraphindent
} }
% like \numhead, but chooses appendix heading levels % like \numhead, but chooses appendix heading levels
...@@ -3532,6 +3795,7 @@ width0pt\relax} \fi ...@@ -3532,6 +3795,7 @@ width0pt\relax} \fi
\appendixsubsubseczzz{#2} \appendixsubsubseczzz{#2}
\fi \fi
\fi \fi
\suppressfirstparagraphindent
} }
% like \numhead, but chooses numberless heading levels % like \numhead, but chooses numberless heading levels
...@@ -3551,6 +3815,7 @@ width0pt\relax} \fi ...@@ -3551,6 +3815,7 @@ width0pt\relax} \fi
\unnumberedsubsubseczzz{#2} \unnumberedsubsubseczzz{#2}
\fi \fi
\fi \fi
\suppressfirstparagraphindent
} }
% @chapter, @appendix, @unnumbered. % @chapter, @appendix, @unnumbered.
...@@ -3558,22 +3823,19 @@ width0pt\relax} \fi ...@@ -3558,22 +3823,19 @@ width0pt\relax} \fi
\outer\def\chapter{\parsearg\chapteryyy} \outer\def\chapter{\parsearg\chapteryyy}
\def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
\def\chapterzzz #1{% \def\chapterzzz #1{%
\secno=0 \subsecno=0 \subsubsecno=0 \secno=0 \subsecno=0 \subsubsecno=0
\global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}% \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
\chapmacro {#1}{\the\chapno}% \chapmacro {#1}{\the\chapno}%
\gdef\thissection{#1}% \gdef\thissection{#1}%
\gdef\thischaptername{#1}% \gdef\thischaptername{#1}%
% We don't substitute the actual chapter name into \thischapter % We don't substitute the actual chapter name into \thischapter
% because we don't want its macros evaluated now. % because we don't want its macros evaluated now.
\xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}% \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
\toks0 = {#1}% \writetocentry{chap}{#1}{{\the\chapno}}
\edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}% \donoderef
{\the\chapno}}}% \global\let\section = \numberedsec
\temp \global\let\subsection = \numberedsubsec
\donoderef \global\let\subsubsection = \numberedsubsubsec
\global\let\section = \numberedsec
\global\let\subsection = \numberedsubsec
\global\let\subsubsection = \numberedsubsubsec
} }
% we use \chapno to avoid indenting back % we use \chapno to avoid indenting back
...@@ -3584,21 +3846,18 @@ width0pt\relax} \fi ...@@ -3584,21 +3846,18 @@ width0pt\relax} \fi
\outer\def\appendix{\parsearg\appendixyyy} \outer\def\appendix{\parsearg\appendixyyy}
\def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
\def\appendixzzz #1{% \def\appendixzzz #1{%
\secno=0 \subsecno=0 \subsubsecno=0 \secno=0 \subsecno=0 \subsubsecno=0
\global\advance \appendixno by 1 \global\advance \appendixno by 1
\message{\putwordAppendix\space \appendixletter}% \message{\putwordAppendix\space \appendixletter}%
\chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}% \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}%
\gdef\thissection{#1}% \gdef\thissection{#1}%
\gdef\thischaptername{#1}% \gdef\thischaptername{#1}%
\xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}% \xdef\thischapter{\putwordAppendix{} \appendixletter: \noexpand\thischaptername}%
\toks0 = {#1}% \writetocentry{appendix}{#1}{{\appendixletter}}
\edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}% \appendixnoderef
{\appendixletter}}}% \global\let\section = \appendixsec
\temp \global\let\subsection = \appendixsubsec
\appendixnoderef \global\let\subsubsection = \appendixsubsubsec
\global\let\section = \appendixsec
\global\let\subsection = \appendixsubsec
\global\let\subsubsection = \appendixsubsubsec
} }
% @centerchap is like @unnumbered, but the heading is centered. % @centerchap is like @unnumbered, but the heading is centered.
...@@ -3611,150 +3870,121 @@ width0pt\relax} \fi ...@@ -3611,150 +3870,121 @@ width0pt\relax} \fi
\outer\def\unnumbered{\parsearg\unnumberedyyy} \outer\def\unnumbered{\parsearg\unnumberedyyy}
\def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
\def\unnumberedzzz #1{% \def\unnumberedzzz #1{%
\secno=0 \subsecno=0 \subsubsecno=0 \secno=0 \subsecno=0 \subsubsecno=0
% %
% This used to be simply \message{#1}, but TeX fully expands the % This used to be simply \message{#1}, but TeX fully expands the
% argument to \message. Therefore, if #1 contained @-commands, TeX % argument to \message. Therefore, if #1 contained @-commands, TeX
% expanded them. For example, in `@unnumbered The @cite{Book}', TeX % expanded them. For example, in `@unnumbered The @cite{Book}', TeX
% expanded @cite (which turns out to cause errors because \cite is meant % expanded @cite (which turns out to cause errors because \cite is meant
% to be executed, not expanded). % to be executed, not expanded).
% %
% Anyway, we don't want the fully-expanded definition of @cite to appear % Anyway, we don't want the fully-expanded definition of @cite to appear
% as a result of the \message, we just want `@cite' itself. We use % as a result of the \message, we just want `@cite' itself. We use
% \the<toks register> to achieve this: TeX expands \the<toks> only once, % \the<toks register> to achieve this: TeX expands \the<toks> only once,
% simply yielding the contents of <toks register>. (We also do this for % simply yielding the contents of <toks register>. (We also do this for
% the toc entries.) % the toc entries.)
\toks0 = {#1}\message{(\the\toks0)}% \toks0 = {#1}\message{(\the\toks0)}%
% %
\unnumbchapmacro {#1}% \unnumbchapmacro {#1}%
\gdef\thischapter{#1}\gdef\thissection{#1}% \gdef\thischapter{#1}\gdef\thissection{#1}%
\toks0 = {#1}% \writetocentry{unnumbchap}{#1}{{\the\chapno}}
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbchapentry{\the\toks0}{\the\chapno}}}% \unnumbnoderef
\temp \global\let\section = \unnumberedsec
\unnumbnoderef \global\let\subsection = \unnumberedsubsec
\global\let\section = \unnumberedsec \global\let\subsubsection = \unnumberedsubsubsec
\global\let\subsection = \unnumberedsubsec
\global\let\subsubsection = \unnumberedsubsubsec
} }
% Sections. % Sections.
\outer\def\numberedsec{\parsearg\secyyy} \outer\def\numberedsec{\parsearg\secyyy}
\def\secyyy #1{\numhead1{#1}} % normally calls seczzz \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
\def\seczzz #1{% \def\seczzz #1{%
\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
\gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}% \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
\toks0 = {#1}% \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}}
\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% \donoderef
{\the\chapno}{\the\secno}}}% \nobreak
\temp
\donoderef
\nobreak
} }
\outer\def\appendixsection{\parsearg\appendixsecyyy} \outer\def\appendixsection{\parsearg\appendixsecyyy}
\outer\def\appendixsec{\parsearg\appendixsecyyy} \outer\def\appendixsec{\parsearg\appendixsecyyy}
\def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
\def\appendixsectionzzz #1{% \def\appendixsectionzzz #1{%
\subsecno=0 \subsubsecno=0 \global\advance \secno by 1 % \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
\gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}% \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
\toks0 = {#1}% \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}}
\edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}% \appendixnoderef
{\appendixletter}{\the\secno}}}% \nobreak
\temp
\appendixnoderef
\nobreak
} }
\outer\def\unnumberedsec{\parsearg\unnumberedsecyyy} \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
\def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
\def\unnumberedseczzz #1{% \def\unnumberedseczzz #1{%
\plainsecheading {#1}\gdef\thissection{#1}% \plainsecheading {#1}\gdef\thissection{#1}%
\toks0 = {#1}% \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}}
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry% \unnumbnoderef
{\the\toks0}{\the\chapno}{\the\secno}}}% \nobreak
\temp
\unnumbnoderef
\nobreak
} }
% Subsections. % Subsections.
\outer\def\numberedsubsec{\parsearg\numberedsubsecyyy} \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
\def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
\def\numberedsubseczzz #1{% \def\numberedsubseczzz #1{%
\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
\subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}% \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
\toks0 = {#1}% \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% \donoderef
{\the\chapno}{\the\secno}{\the\subsecno}}}% \nobreak
\temp
\donoderef
\nobreak
} }
\outer\def\appendixsubsec{\parsearg\appendixsubsecyyy} \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
\def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
\def\appendixsubseczzz #1{% \def\appendixsubseczzz #1{%
\gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 % \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
\subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}% \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
\toks0 = {#1}% \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}}
\edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}% \appendixnoderef
{\appendixletter}{\the\secno}{\the\subsecno}}}% \nobreak
\temp
\appendixnoderef
\nobreak
} }
\outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy} \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
\def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls unnumberedsubseczzz
\def\unnumberedsubseczzz #1{% \def\unnumberedsubseczzz #1{%
\plainsubsecheading {#1}\gdef\thissection{#1}% \plainsubsecheading {#1}\gdef\thissection{#1}%
\toks0 = {#1}% \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry% \unnumbnoderef
{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}% \nobreak
\temp
\unnumbnoderef
\nobreak
} }
% Subsubsections. % Subsubsections.
\outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy} \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
\def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
\def\numberedsubsubseczzz #1{% \def\numberedsubsubseczzz #1{%
\gdef\thissection{#1}\global\advance \subsubsecno by 1 % \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
\subsubsecheading {#1} \subsubsecheading {#1}
{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}% {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
\toks0 = {#1}% \writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% \donoderef
{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% \nobreak
\temp
\donoderef
\nobreak
} }
\outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy} \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
\def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
\def\appendixsubsubseczzz #1{% \def\appendixsubsubseczzz #1{%
\gdef\thissection{#1}\global\advance \subsubsecno by 1 % \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
\subsubsecheading {#1} \subsubsecheading {#1}
{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}% {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
\toks0 = {#1}% \writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
\edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}% \appendixnoderef
{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% \nobreak
\temp
\appendixnoderef
\nobreak
} }
\outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy} \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
\def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally unnumberedsubsubseczzz
\def\unnumberedsubsubseczzz #1{% \def\unnumberedsubsubseczzz #1{%
\plainsubsubsecheading {#1}\gdef\thissection{#1}% \plainsubsubsecheading {#1}\gdef\thissection{#1}%
\toks0 = {#1}% \writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
\edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry% \unnumbnoderef
{\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}% \nobreak
\temp
\unnumbnoderef
\nobreak
} }
% These are variants which are not "outer", so they can appear in @ifinfo. % These are variants which are not "outer", so they can appear in @ifinfo.
...@@ -3795,14 +4025,14 @@ width0pt\relax} \fi ...@@ -3795,14 +4025,14 @@ width0pt\relax} \fi
\def\majorheading{\parsearg\majorheadingzzz} \def\majorheading{\parsearg\majorheadingzzz}
\def\majorheadingzzz #1{% \def\majorheadingzzz #1{%
{\advance\chapheadingskip by 10pt \chapbreak }% {\advance\chapheadingskip by 10pt \chapbreak }%
{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright \parindent=0pt\raggedright
\rm #1\hfill}}\bigskip \par\penalty 200} \rm #1\hfill}}\bigskip \par\penalty 200}
\def\chapheading{\parsearg\chapheadingzzz} \def\chapheading{\parsearg\chapheadingzzz}
\def\chapheadingzzz #1{\chapbreak % \def\chapheadingzzz #1{\chapbreak %
{\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
\parindent=0pt\raggedright \parindent=0pt\raggedright
\rm #1\hfill}}\bigskip \par\penalty 200} \rm #1\hfill}}\bigskip \par\penalty 200}
...@@ -3952,7 +4182,7 @@ width0pt\relax} \fi ...@@ -3952,7 +4182,7 @@ width0pt\relax} \fi
}% }%
% Add extra space after the heading -- either a line space or a % Add extra space after the heading -- either a line space or a
% paragraph space, whichever is more. (Some people like to set % paragraph space, whichever is more. (Some people like to set
% \parskip to large values for some reason.) % \parskip to large values for some reason.) Don't allow stretch, though.
\nobreak \nobreak
\ifdim\parskip>\normalbaselineskip \ifdim\parskip>\normalbaselineskip
\kern\parskip \kern\parskip
...@@ -3971,16 +4201,22 @@ width0pt\relax} \fi ...@@ -3971,16 +4201,22 @@ width0pt\relax} \fi
% Called from @chapter, etc. We supply {\folio} at the end of the % Called from @chapter, etc. We supply {\folio} at the end of the
% argument, which will end up as the last argument to the \...entry macro. % argument, which will end up as the last argument to the \...entry macro.
% %
% We open the .toc file here instead of at @setfilename or any other % Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}}
% fixed time so that @contents can be put in the document anywhere. % We open the .toc file for writing here instead of at @setfilename (or
% any other fixed time) so that @contents can be anywhere in the document.
% %
\newif\iftocfileopened \newif\iftocfileopened
\def\writetocentry#1{% \def\writetocentry#1#2#3{%
\iftocfileopened\else \iftocfileopened\else
\immediate\openout\tocfile = \jobname.toc \immediate\openout\tocfile = \jobname.toc
\global\tocfileopenedtrue \global\tocfileopenedtrue
\fi \fi
\iflinks \write\tocfile{#1{\folio}}\fi %
\iflinks
\toks0 = {#2}%
\edef\temp{\write\tocfile{\realbackslash #1entry{\the\toks0}#3{\folio}}}%
\temp
\fi
% %
% Tell \shipout to create a page destination if we're doing pdf, which % Tell \shipout to create a page destination if we're doing pdf, which
% will be the target of the links in the table of contents. We can't % will be the target of the links in the table of contents. We can't
...@@ -4019,7 +4255,7 @@ width0pt\relax} \fi ...@@ -4019,7 +4255,7 @@ width0pt\relax} \fi
\advance\hsize by -\contentsrightmargin % Don't use the full line length. \advance\hsize by -\contentsrightmargin % Don't use the full line length.
% %
% Roman numerals for page numbers. % Roman numerals for page numbers.
\ifnum \pageno>0 \pageno = \lastnegativepageno \fi \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
} }
...@@ -4036,7 +4272,7 @@ width0pt\relax} \fi ...@@ -4036,7 +4272,7 @@ width0pt\relax} \fi
\pdfmakeoutlines \pdfmakeoutlines
\endgroup \endgroup
\lastnegativepageno = \pageno \lastnegativepageno = \pageno
\pageno = \savepageno \global\pageno = \savepageno
} }
% And just the chapters. % And just the chapters.
...@@ -4068,7 +4304,7 @@ width0pt\relax} \fi ...@@ -4068,7 +4304,7 @@ width0pt\relax} \fi
\contentsalignmacro % in case @setchapternewpage odd is in effect \contentsalignmacro % in case @setchapternewpage odd is in effect
\endgroup \endgroup
\lastnegativepageno = \pageno \lastnegativepageno = \pageno
\pageno = \savepageno \global\pageno = \savepageno
} }
\let\shortcontents = \summarycontents \let\shortcontents = \summarycontents
...@@ -4232,14 +4468,14 @@ width0pt\relax} \fi ...@@ -4232,14 +4468,14 @@ width0pt\relax} \fi
\def\tex{\begingroup \def\tex{\begingroup
\catcode `\\=0 \catcode `\{=1 \catcode `\}=2 \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
\catcode `\$=3 \catcode `\&=4 \catcode `\#=6 \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
\catcode `\%=14 \catcode `\%=14
\catcode 43=12 % plus \catcode `\+=\other
\catcode`\"=12 \catcode `\"=\other
\catcode`\==12 \catcode `\==\other
\catcode`\|=12 \catcode `\|=\other
\catcode`\<=12 \catcode `\<=\other
\catcode`\>=12 \catcode `\>=\other
\escapechar=`\\ \escapechar=`\\
% %
\let\b=\ptexb \let\b=\ptexb
...@@ -4251,9 +4487,11 @@ width0pt\relax} \fi ...@@ -4251,9 +4487,11 @@ width0pt\relax} \fi
\let\equiv=\ptexequiv \let\equiv=\ptexequiv
\let\!=\ptexexclam \let\!=\ptexexclam
\let\i=\ptexi \let\i=\ptexi
\let\indent=\ptexindent
\let\{=\ptexlbrace \let\{=\ptexlbrace
\let\+=\tabalign \let\+=\tabalign
\let\}=\ptexrbrace \let\}=\ptexrbrace
\let\/=\ptexslash
\let\*=\ptexstar \let\*=\ptexstar
\let\t=\ptext \let\t=\ptext
% %
...@@ -4336,7 +4574,8 @@ width0pt\relax} \fi ...@@ -4336,7 +4574,8 @@ width0pt\relax} \fi
% %
\newskip\lskip\newskip\rskip \newskip\lskip\newskip\rskip
\long\def\cartouche{% \def\cartouche{%
\par % can't be in the midst of a paragraph.
\begingroup \begingroup
\lskip=\leftskip \rskip=\rightskip \lskip=\leftskip \rskip=\rightskip
\leftskip=0pt\rightskip=0pt %we want these *outside*. \leftskip=0pt\rightskip=0pt %we want these *outside*.
...@@ -4421,27 +4660,16 @@ width0pt\relax} \fi ...@@ -4421,27 +4660,16 @@ width0pt\relax} \fi
% @example: Same as @lisp. % @example: Same as @lisp.
\def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp} \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
% @small... is usually equivalent to the non-small (@smallbook % @smallexample and @smalllisp: use smaller fonts.
% redefines). We must call \example (or whatever) last in the
% definition, since it reads the return following the @example (or
% whatever) command.
%
% This actually allows (for example) @end display inside an
% @smalldisplay. Too bad, but makeinfo will catch the error anyway.
%
\def\smalldisplay{\begingroup\def\Esmalldisplay{\nonfillfinish\endgroup}\display}
\def\smallexample{\begingroup\def\Esmallexample{\nonfillfinish\endgroup}\lisp}
\def\smallformat{\begingroup\def\Esmallformat{\nonfillfinish\endgroup}\format}
\def\smalllisp{\begingroup\def\Esmalllisp{\nonfillfinish\endgroup}\lisp}
% Real @smallexample and @smalllisp (when @smallbook): use smaller fonts.
% Originally contributed by Pavel@xerox. % Originally contributed by Pavel@xerox.
\def\smalllispx{\begingroup \def\smalllisp{\begingroup
\def\Esmalllisp{\nonfillfinish\endgroup}% \def\Esmalllisp{\nonfillfinish\endgroup}%
\def\Esmallexample{\nonfillfinish\endgroup}% \def\Esmallexample{\nonfillfinish\endgroup}%
\smallexamplefonts \smallexamplefonts
\lisp \lisp
} }
\let\smallexample = \smalllisp
% @display: same as @lisp except keep current font. % @display: same as @lisp except keep current font.
% %
...@@ -4451,9 +4679,9 @@ width0pt\relax} \fi ...@@ -4451,9 +4679,9 @@ width0pt\relax} \fi
\gobble \gobble
} }
% %
% @smalldisplay (when @smallbook): @display plus smaller fonts. % @smalldisplay: @display plus smaller fonts.
% %
\def\smalldisplayx{\begingroup \def\smalldisplay{\begingroup
\def\Esmalldisplay{\nonfillfinish\endgroup}% \def\Esmalldisplay{\nonfillfinish\endgroup}%
\smallexamplefonts \rm \smallexamplefonts \rm
\display \display
...@@ -4468,9 +4696,9 @@ width0pt\relax} \fi ...@@ -4468,9 +4696,9 @@ width0pt\relax} \fi
\gobble \gobble
} }
% %
% @smallformat (when @smallbook): @format plus smaller fonts. % @smallformat: @format plus smaller fonts.
% %
\def\smallformatx{\begingroup \def\smallformat{\begingroup
\def\Esmallformat{\nonfillfinish\endgroup}% \def\Esmallformat{\nonfillfinish\endgroup}%
\smallexamplefonts \rm \smallexamplefonts \rm
\format \format
...@@ -4646,14 +4874,14 @@ width0pt\relax} \fi ...@@ -4646,14 +4874,14 @@ width0pt\relax} \fi
% Allow normal characters that we make active in the argument (a file name). % Allow normal characters that we make active in the argument (a file name).
\def\verbatiminclude{% \def\verbatiminclude{%
\begingroup \begingroup
\catcode`\\=12 \catcode`\\=\other
\catcode`~=12 \catcode`~=\other
\catcode`^=12 \catcode`^=\other
\catcode`_=12 \catcode`_=\other
\catcode`|=12 \catcode`|=\other
\catcode`<=12 \catcode`<=\other
\catcode`>=12 \catcode`>=\other
\catcode`+=12 \catcode`+=\other
\parsearg\doverbatiminclude \parsearg\doverbatiminclude
} }
\def\setupverbatiminclude{% \def\setupverbatiminclude{%
...@@ -4667,9 +4895,12 @@ width0pt\relax} \fi ...@@ -4667,9 +4895,12 @@ width0pt\relax} \fi
% Restore active chars for included file. % Restore active chars for included file.
\endgroup \endgroup
\begingroup \begingroup
\let\value=\expandablevalue
\def\thisfile{#1}% \def\thisfile{#1}%
\expandafter\expandafter\setupverbatiminclude\input\thisfile \expandafter\expandafter\setupverbatiminclude\input\thisfile
\endgroup\nonfillfinish\endgroup \endgroup
\nonfillfinish
\endgroup
} }
% @copying ... @end copying. % @copying ... @end copying.
...@@ -4806,7 +5037,7 @@ width0pt\relax} \fi ...@@ -4806,7 +5037,7 @@ width0pt\relax} \fi
% Active &'s sneak into the index arguments, so make sure it's defined. % Active &'s sneak into the index arguments, so make sure it's defined.
{ {
\catcode`& = 13 \catcode`& = \active
\global\let& = \ampnr \global\let& = \ampnr
} }
...@@ -4863,8 +5094,11 @@ width0pt\relax} \fi ...@@ -4863,8 +5094,11 @@ width0pt\relax} \fi
% If there are two @def commands in a row, we'll have a \nobreak, % If there are two @def commands in a row, we'll have a \nobreak,
% which is there to keep the function description together with its % which is there to keep the function description together with its
% header. But if there's nothing but headers, we want to allow a % header. But if there's nothing but headers, we want to allow a
% break after all. % break after all. Check for penalty 10002 (inserted by
\ifnum\lastpenalty=10000 \penalty0 \fi % \defargscommonending) instead of 10000, since the sectioning
% commands insert a \penalty10000, and we don't want to allow a break
% between a section heading and a defun.
\ifnum\lastpenalty=10002 \penalty0 \fi
\medbreak \medbreak
% %
% Define the \E... end token that this defining construct specifies % Define the \E... end token that this defining construct specifies
...@@ -4891,7 +5125,7 @@ width0pt\relax} \fi ...@@ -4891,7 +5125,7 @@ width0pt\relax} \fi
\def\defparsebody#1#2#3{% \def\defparsebody#1#2#3{%
\parsebodycommon{#1}{#2}{#3}% \parsebodycommon{#1}{#2}{#3}%
\def#2{\defxbodycommon \activeparens \spacesplit#3}% \def#2{\defxbodycommon \activeparens \spacesplit#3}%
\catcode61=\active % 61 is `=' \catcode\equalChar=\active
\begingroup\obeylines\activeparens \begingroup\obeylines\activeparens
\spacesplit#3% \spacesplit#3%
} }
...@@ -4953,7 +5187,7 @@ width0pt\relax} \fi ...@@ -4953,7 +5187,7 @@ width0pt\relax} \fi
\def\defvarparsebody #1#2#3{% \def\defvarparsebody #1#2#3{%
\parsebodycommon{#1}{#2}{#3}% \parsebodycommon{#1}{#2}{#3}%
\def#2{\defxbodycommon \spacesplit#3}% \def#2{\defxbodycommon \spacesplit#3}%
\catcode61=\active % \catcode\equalChar=\active
\begingroup\obeylines \begingroup\obeylines
\spacesplit#3% \spacesplit#3%
} }
...@@ -5022,9 +5256,18 @@ width0pt\relax} \fi ...@@ -5022,9 +5256,18 @@ width0pt\relax} \fi
% Define @defun. % Define @defun.
% First, define the processing that is wanted for arguments of \defun % This is called to end the arguments processing for all the @def... commands.
% Use this to expand the args and terminate the paragraph they make up %
\def\defargscommonending{%
\interlinepenalty = 10000
\advance\rightskip by 0pt plus 1fil
\endgraf
\nobreak\vskip -\parskip
\penalty 10002 % signal to \parsebodycommon.
}
% This expands the args and terminates the paragraph they comprise.
%
\def\defunargs#1{\functionparens \sl \def\defunargs#1{\functionparens \sl
% Expand, preventing hyphenation at `-' chars. % Expand, preventing hyphenation at `-' chars.
% Note that groups don't affect changes in \hyphenchar. % Note that groups don't affect changes in \hyphenchar.
...@@ -5033,9 +5276,7 @@ width0pt\relax} \fi ...@@ -5033,9 +5276,7 @@ width0pt\relax} \fi
#1% #1%
{\tensl\hyphenchar\font=45}% {\tensl\hyphenchar\font=45}%
\ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi% \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
\interlinepenalty=10000 \defargscommonending
\advance\rightskip by 0pt plus 1fil
\endgraf\nobreak\vskip -\parskip\nobreak
} }
\def\deftypefunargs #1{% \def\deftypefunargs #1{%
...@@ -5044,9 +5285,7 @@ width0pt\relax} \fi ...@@ -5044,9 +5285,7 @@ width0pt\relax} \fi
% Use \boldbraxnoamp, not \functionparens, so that & is not special. % Use \boldbraxnoamp, not \functionparens, so that & is not special.
\boldbraxnoamp \boldbraxnoamp
\tclose{#1}% avoid \code because of side effects on active chars \tclose{#1}% avoid \code because of side effects on active chars
\interlinepenalty=10000 \defargscommonending
\advance\rightskip by 0pt plus 1fil
\endgraf\nobreak\vskip -\parskip\nobreak
} }
% Do complete processing of one @defun or @defunx line already parsed. % Do complete processing of one @defun or @defunx line already parsed.
...@@ -5057,7 +5296,7 @@ width0pt\relax} \fi ...@@ -5057,7 +5296,7 @@ width0pt\relax} \fi
\def\deffnheader #1#2#3{\doind {fn}{\code{#2}}% \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
\begingroup\defname {#2}{#1}\defunargs{#3}\endgroup % \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody \catcode\equalChar=\other % Turn off change made in \defparsebody
} }
% @defun == @deffn Function % @defun == @deffn Function
...@@ -5067,7 +5306,7 @@ width0pt\relax} \fi ...@@ -5067,7 +5306,7 @@ width0pt\relax} \fi
\def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{\putwordDeffunc}% \begingroup\defname {#1}{\putwordDeffunc}%
\defunargs {#2}\endgroup % \defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody \catcode\equalChar=\other % Turn off change made in \defparsebody
} }
% @deftypefun int foobar (int @var{foo}, float @var{bar}) % @deftypefun int foobar (int @var{foo}, float @var{bar})
...@@ -5081,7 +5320,7 @@ width0pt\relax} \fi ...@@ -5081,7 +5320,7 @@ width0pt\relax} \fi
\doind {fn}{\code{#2}}% Make entry in function index \doind {fn}{\code{#2}}% Make entry in function index
\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}% \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
\deftypefunargs {#3}\endgroup % \deftypefunargs {#3}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody \catcode\equalChar=\other % Turn off change made in \defparsebody
} }
% @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar}) % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
...@@ -5102,7 +5341,7 @@ width0pt\relax} \fi ...@@ -5102,7 +5341,7 @@ width0pt\relax} \fi
% at least some C++ text from working % at least some C++ text from working
\defname {\defheaderxcond#2\relax$.$#3}{#1}% \defname {\defheaderxcond#2\relax$.$#3}{#1}%
\deftypefunargs {#4}\endgroup % \deftypefunargs {#4}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody \catcode\equalChar=\other % Turn off change made in \defparsebody
} }
% @defmac == @deffn Macro % @defmac == @deffn Macro
...@@ -5112,7 +5351,7 @@ width0pt\relax} \fi ...@@ -5112,7 +5351,7 @@ width0pt\relax} \fi
\def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{\putwordDefmac}% \begingroup\defname {#1}{\putwordDefmac}%
\defunargs {#2}\endgroup % \defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody \catcode\equalChar=\other % Turn off change made in \defparsebody
} }
% @defspec == @deffn Special Form % @defspec == @deffn Special Form
...@@ -5122,7 +5361,7 @@ width0pt\relax} \fi ...@@ -5122,7 +5361,7 @@ width0pt\relax} \fi
\def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
\begingroup\defname {#1}{\putwordDefspec}% \begingroup\defname {#1}{\putwordDefspec}%
\defunargs {#2}\endgroup % \defunargs {#2}\endgroup %
\catcode 61=\other % Turn off change made in \defparsebody \catcode\equalChar=\other % Turn off change made in \defparsebody
} }
% @defop CATEGORY CLASS OPERATION ARG... % @defop CATEGORY CLASS OPERATION ARG...
...@@ -5131,9 +5370,11 @@ width0pt\relax} \fi ...@@ -5131,9 +5370,11 @@ width0pt\relax} \fi
\defopparsebody\Edefop\defopx\defopheader\defoptype} \defopparsebody\Edefop\defopx\defopheader\defoptype}
% %
\def\defopheader#1#2#3{% \def\defopheader#1#2#3{%
\dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry
\begingroup\defname {#2}{\defoptype\ \putwordon\ #1}% \begingroup
\defunargs {#3}\endgroup % \defname{#2}{\defoptype\ \putwordon\ #1}%
\defunargs{#3}%
\endgroup
} }
% @deftypeop CATEGORY CLASS TYPE OPERATION ARG... % @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
...@@ -5200,9 +5441,11 @@ width0pt\relax} \fi ...@@ -5200,9 +5441,11 @@ width0pt\relax} \fi
\defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype} \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
\def\defcvarheader #1#2#3{% \def\defcvarheader #1#2#3{%
\dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry
\begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}% \begingroup
\defvarargs {#3}\endgroup % \defname{#2}{\defcvtype\ \putwordof\ #1}%
\defvarargs{#3}%
\endgroup
} }
% @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME % @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
...@@ -5210,7 +5453,7 @@ width0pt\relax} \fi ...@@ -5210,7 +5453,7 @@ width0pt\relax} \fi
\def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader} \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
% %
\def\defivarheader#1#2#3{% \def\defivarheader#1#2#3{%
\dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index
\begingroup \begingroup
\defname{#2}{\putwordInstanceVariableof\ #1}% \defname{#2}{\putwordInstanceVariableof\ #1}%
\defvarargs{#3}% \defvarargs{#3}%
...@@ -5222,8 +5465,8 @@ width0pt\relax} \fi ...@@ -5222,8 +5465,8 @@ width0pt\relax} \fi
% This is actually simple: just print them in roman. % This is actually simple: just print them in roman.
% This must expand the args and terminate the paragraph they make up % This must expand the args and terminate the paragraph they make up
\def\defvarargs #1{\normalparens #1% \def\defvarargs #1{\normalparens #1%
\interlinepenalty=10000 \defargscommonending
\endgraf\nobreak\vskip -\parskip\nobreak} }
% @defvr Counter foo-count % @defvr Counter foo-count
...@@ -5259,8 +5502,7 @@ width0pt\relax} \fi ...@@ -5259,8 +5502,7 @@ width0pt\relax} \fi
\def\deftypevarheader #1#2{% \def\deftypevarheader #1#2{%
\dovarind#2 \relax% Make entry in variables index \dovarind#2 \relax% Make entry in variables index
\begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}% \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
\interlinepenalty=10000 \defargscommonending
\endgraf\nobreak\vskip -\parskip\nobreak
\endgroup} \endgroup}
\def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}} \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
...@@ -5270,8 +5512,7 @@ width0pt\relax} \fi ...@@ -5270,8 +5512,7 @@ width0pt\relax} \fi
\def\deftypevrheader #1#2#3{\dovarind#3 \relax% \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
\begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1} \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
\interlinepenalty=10000 \defargscommonending
\endgraf\nobreak\vskip -\parskip\nobreak
\endgroup} \endgroup}
% Now define @deftp % Now define @deftp
...@@ -5320,7 +5561,7 @@ width0pt\relax} \fi ...@@ -5320,7 +5561,7 @@ width0pt\relax} \fi
\def\scanmacro#1{% \def\scanmacro#1{%
\begingroup \newlinechar`\^^M \begingroup \newlinechar`\^^M
% Undo catcode changes of \startcontents and \doprintindex % Undo catcode changes of \startcontents and \doprintindex
\catcode`\@=0 \catcode`\\=12 \escapechar=`\@ \catcode`\@=0 \catcode`\\=\other \escapechar=`\@
% Append \endinput to make sure that TeX does not see the ending newline. % Append \endinput to make sure that TeX does not see the ending newline.
\toks0={#1\endinput}% \toks0={#1\endinput}%
\immediate\openout\macscribble=\jobname.tmp \immediate\openout\macscribble=\jobname.tmp
...@@ -5334,7 +5575,7 @@ width0pt\relax} \fi ...@@ -5334,7 +5575,7 @@ width0pt\relax} \fi
\def\scanmacro#1{% \def\scanmacro#1{%
\begingroup \newlinechar`\^^M \begingroup \newlinechar`\^^M
% Undo catcode changes of \startcontents and \doprintindex % Undo catcode changes of \startcontents and \doprintindex
\catcode`\@=0 \catcode`\\=12 \escapechar=`\@ \catcode`\@=0 \catcode`\\=\other \escapechar=`\@
\let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup} \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
\fi \fi
...@@ -5364,7 +5605,7 @@ width0pt\relax} \fi ...@@ -5364,7 +5605,7 @@ width0pt\relax} \fi
} }
% Trim a single trailing ^^M off a string. % Trim a single trailing ^^M off a string.
{\catcode`\^^M=12\catcode`\Q=3% {\catcode`\^^M=\other \catcode`\Q=3%
\gdef\eatcr #1{\eatcra #1Q^^MQ}% \gdef\eatcr #1{\eatcra #1Q^^MQ}%
\gdef\eatcra#1^^MQ{\eatcrb#1Q}% \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
\gdef\eatcrb#1Q#2Q{#1}% \gdef\eatcrb#1Q#2Q{#1}%
...@@ -5379,29 +5620,29 @@ width0pt\relax} \fi ...@@ -5379,29 +5620,29 @@ width0pt\relax} \fi
% body, and then making it the \newlinechar in \scanmacro. % body, and then making it the \newlinechar in \scanmacro.
\def\macrobodyctxt{% \def\macrobodyctxt{%
\catcode`\~=12 \catcode`\~=\other
\catcode`\^=12 \catcode`\^=\other
\catcode`\_=12 \catcode`\_=\other
\catcode`\|=12 \catcode`\|=\other
\catcode`\<=12 \catcode`\<=\other
\catcode`\>=12 \catcode`\>=\other
\catcode`\+=12 \catcode`\+=\other
\catcode`\{=12 \catcode`\{=\other
\catcode`\}=12 \catcode`\}=\other
\catcode`\@=12 \catcode`\@=\other
\catcode`\^^M=12 \catcode`\^^M=\other
\usembodybackslash} \usembodybackslash}
\def\macroargctxt{% \def\macroargctxt{%
\catcode`\~=12 \catcode`\~=\other
\catcode`\^=12 \catcode`\^=\other
\catcode`\_=12 \catcode`\_=\other
\catcode`\|=12 \catcode`\|=\other
\catcode`\<=12 \catcode`\<=\other
\catcode`\>=12 \catcode`\>=\other
\catcode`\+=12 \catcode`\+=\other
\catcode`\@=12 \catcode`\@=\other
\catcode`\\=12} \catcode`\\=\other}
% \mbodybackslash is the definition of \ in @macro bodies. % \mbodybackslash is the definition of \ in @macro bodies.
% It maps \foo\ => \csname macarg.foo\endcsname => #N % It maps \foo\ => \csname macarg.foo\endcsname => #N
...@@ -5442,32 +5683,33 @@ width0pt\relax} \fi ...@@ -5442,32 +5683,33 @@ width0pt\relax} \fi
\else \expandafter\parsemacbody \else \expandafter\parsemacbody
\fi} \fi}
\def\unmacro{\parsearg\unmacroxxx} \def\unmacro{\parsearg\dounmacro}
\def\unmacroxxx#1{% \def\dounmacro#1{%
\if1\csname ismacro.#1\endcsname \if1\csname ismacro.#1\endcsname
\global\cslet{#1}{macsave.#1}% \global\cslet{#1}{macsave.#1}%
\global\expandafter\let \csname ismacro.#1\endcsname=0% \global\expandafter\let \csname ismacro.#1\endcsname=0%
% Remove the macro name from \macrolist % Remove the macro name from \macrolist:
\begingroup \begingroup
\edef\tempa{\expandafter\noexpand\csname#1\endcsname}% \expandafter\let\csname#1\endcsname \relax
\def\do##1{% \let\do\unmacrodo
\def\tempb{##1}% \xdef\macrolist{\macrolist}%
\ifx\tempa\tempb
% remove this
\else
\toks0 = \expandafter{\newmacrolist\do}%
\edef\newmacrolist{\the\toks0\expandafter\noexpand\tempa}%
\fi}%
\def\newmacrolist{}%
% Execute macro list to define \newmacrolist
\macrolist
\global\let\macrolist\newmacrolist
\endgroup \endgroup
\else \else
\errmessage{Macro #1 not defined}% \errmessage{Macro #1 not defined}%
\fi \fi
} }
% Called by \do from \dounmacro on each macro. The idea is to omit any
% macro definitions that have been changed to \relax.
%
\def\unmacrodo#1{%
\ifx#1\relax
% remove this
\else
\noexpand\do \noexpand #1%
\fi
}
% This makes use of the obscure feature that if the last token of a % This makes use of the obscure feature that if the last token of a
% <parameter list> is #, then the preceding argument is delimited by % <parameter list> is #, then the preceding argument is delimited by
% an opening brace, and that opening brace is not consumed. % an opening brace, and that opening brace is not consumed.
...@@ -5615,8 +5857,8 @@ width0pt\relax} \fi ...@@ -5615,8 +5857,8 @@ width0pt\relax} \fi
% @node's job is to define \lastnode. % @node's job is to define \lastnode.
\def\node{\ENVcheck\parsearg\nodezzz} \def\node{\ENVcheck\parsearg\nodezzz}
\def\nodezzz#1{\nodexxx [#1,]} \def\nodezzz#1{\nodexxx #1,\finishnodeparse}
\def\nodexxx[#1,#2]{\gdef\lastnode{#1}} \def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}}
\let\nwnode=\node \let\nwnode=\node
\let\lastnode=\relax \let\lastnode=\relax
...@@ -5650,15 +5892,23 @@ width0pt\relax} \fi ...@@ -5650,15 +5892,23 @@ width0pt\relax} \fi
\gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} \gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
\gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} \gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
% \setref{NAME}{SNT} defines a cross-reference point NAME, namely % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
% NAME-title, NAME-pg, and NAME-SNT. Called from \foonoderef. We have % anchor), namely NAME-title (the corresponding @chapter/etc. name),
% to set \indexdummies so commands such as @code in a section title % NAME-pg (the page number), and NAME-snt (section number and type).
% aren't expanded. It would be nicer not to expand the titles in the % Called from \foonoderef.
% first place, but there's so many layers that that is hard to do. %
% We have to set \indexdummies so commands such as @code in a section
% title aren't expanded. It would be nicer not to expand the titles in
% the first place, but there's so many layers that that is hard to do.
%
% Likewise, use \turnoffactive so that punctuation chars such as underscore
% and backslash work in node names.
% %
\def\setref#1#2{{% \def\setref#1#2{{%
\indexdummies \atdummies
\pdfmkdest{#1}% \pdfmkdest{#1}%
%
\turnoffactive
\dosetq{#1-title}{Ytitle}% \dosetq{#1-title}{Ytitle}%
\dosetq{#1-pg}{Ypagenumber}% \dosetq{#1-pg}{Ypagenumber}%
\dosetq{#1-snt}{#2}% \dosetq{#1-snt}{#2}%
...@@ -5710,7 +5960,7 @@ width0pt\relax} \fi ...@@ -5710,7 +5960,7 @@ width0pt\relax} \fi
\ifpdf \ifpdf
\leavevmode \leavevmode
\getfilename{#4}% \getfilename{#4}%
{\normalturnoffactive {\turnoffactive \otherbackslash
\ifnum\filenamelength>0 \ifnum\filenamelength>0
\startlink attr{/Border [0 0 0]}% \startlink attr{/Border [0 0 0]}%
goto file{\the\filename.pdf} name{#1}% goto file{\the\filename.pdf} name{#1}%
...@@ -5730,82 +5980,94 @@ width0pt\relax} \fi ...@@ -5730,82 +5980,94 @@ width0pt\relax} \fi
% into the usual \leavevmode...\vrule stuff for purposes of % into the usual \leavevmode...\vrule stuff for purposes of
% printing. So we \turnoffactive for the \refx-snt, back on for the % printing. So we \turnoffactive for the \refx-snt, back on for the
% printing, back off for the \refx-pg. % printing, back off for the \refx-pg.
{\normalturnoffactive {\turnoffactive \otherbackslash
% Only output a following space if the -snt ref is nonempty; for % Only output a following space if the -snt ref is nonempty; for
% @unnumbered and @anchor, it won't be. % @unnumbered and @anchor, it won't be.
\setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
\ifdim \wd2 > 0pt \refx{#1-snt}\space\fi \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
}% }%
% [mynode], % output the `[mynode]' via a macro.
[\printednodename],\space \xrefprintnodename\printednodename
% page 3 %
\turnoffactive \putwordpage\tie\refx{#1-pg}{}% % But we always want a comma and a space:
,\space
%
% output the `page 3'.
\turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%
\fi \fi
\endlink \endlink
\endgroup} \endgroup}
% \dosetq is the interface for calls from other macros % This macro is called from \xrefX for the `[nodename]' part of xref
% output. It's a separate macro only so it can be changed more easily,
% since not square brackets don't work in some documents. Particularly
% one that Bob is working on :).
%
\def\xrefprintnodename#1{[#1]}
% Use \normalturnoffactive so that punctuation chars such as underscore % \dosetq is called from \setref to do the actual \write (\iflinks).
% and backslash work in node names. (\turnoffactive doesn't do \.) %
\def\dosetq#1#2{% \def\dosetq#1#2{%
{\let\folio=0% {\let\folio=0%
\normalturnoffactive
\edef\next{\write\auxfile{\internalsetq{#1}{#2}}}% \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
\iflinks \iflinks \next \fi
\next
\fi
}% }%
} }
% \internalsetq {foo}{page} expands into % \internalsetq{foo}{page} expands into
% CHARACTERS 'xrdef {foo}{...expansion of \Ypage...} % CHARACTERS @xrdef{foo}{...expansion of \page...}
% When the aux file is read, ' is the escape character \def\internalsetq#1#2{@xrdef{#1}{\csname #2\endcsname}}
\def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
% Things to be expanded by \internalsetq
% Things to be expanded by \internalsetq.
%
\def\Ypagenumber{\folio} \def\Ypagenumber{\folio}
\def\Ytitle{\thissection} \def\Ytitle{\thissection}
\def\Ynothing{} \def\Ynothing{}
\def\Ysectionnumberandtype{% \def\Ysectionnumberandtype{%
\ifnum\secno=0 \putwordChapter\xreftie\the\chapno % \ifnum\secno=0
\else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno % \putwordChapter@tie \the\chapno
\else \ifnum \subsubsecno=0 % \else \ifnum\subsecno=0
\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno % \putwordSection@tie \the\chapno.\the\secno
\else % \else \ifnum\subsubsecno=0
\putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno % \putwordSection@tie \the\chapno.\the\secno.\the\subsecno
\fi \fi \fi } \else
\putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
\fi\fi\fi
}
\def\Yappendixletterandtype{% \def\Yappendixletterandtype{%
\ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}% \ifnum\secno=0
\else \ifnum \subsecno=0 \putwordSection\xreftie'char\the\appendixno.\the\secno % \putwordAppendix@tie @char\the\appendixno{}%
\else \ifnum \subsubsecno=0 % \else \ifnum\subsecno=0
\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno % \putwordSection@tie @char\the\appendixno.\the\secno
\else % \else \ifnum\subsubsecno=0
\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno % \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno
\fi \fi \fi } \else
\putwordSection@tie
\gdef\xreftie{'tie} @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
\fi\fi\fi
}
% Use TeX 3.0's \inputlineno to get the line number, for better error % Use TeX 3.0's \inputlineno to get the line number, for better error
% messages, but if we're using an old version of TeX, don't do anything. % messages, but if we're using an old version of TeX, don't do anything.
% %
\ifx\inputlineno\thisisundefined \ifx\inputlineno\thisisundefined
\let\linenumber = \empty % Non-3.0. \let\linenumber = \empty % Pre-3.0.
\else \else
\def\linenumber{\the\inputlineno:\space} \def\linenumber{\the\inputlineno:\space}
\fi \fi
% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
% If its value is nonempty, SUFFIX is output afterward. % If its value is nonempty, SUFFIX is output afterward.
%
\def\refx#1#2{% \def\refx#1#2{%
\expandafter\ifx\csname X#1\endcsname\relax {%
\indexnofonts
\otherbackslash
\expandafter\global\expandafter\let\expandafter\thisrefX
\csname X#1\endcsname
}%
\ifx\thisrefX\relax
% If not defined, say something at least. % If not defined, say something at least.
\angleleft un\-de\-fined\angleright \angleleft un\-de\-fined\angleright
\iflinks \iflinks
...@@ -5820,19 +6082,14 @@ width0pt\relax} \fi ...@@ -5820,19 +6082,14 @@ width0pt\relax} \fi
\fi \fi
\else \else
% It's defined, so just use it. % It's defined, so just use it.
\csname X#1\endcsname \thisrefX
\fi \fi
#2% Output the suffix in any case. #2% Output the suffix in any case.
} }
% 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{\begingroup \def\xrdef#1{\expandafter\gdef\csname X#1\endcsname}
% Reenable \ as an escape while reading the second argument.
\catcode`\\ = 0
\afterassignment\endgroup
\expandafter\gdef\csname X#1\endcsname
}
% Read the last existing aux file, if any. No error if none exists. % Read the last existing aux file, if any. No error if none exists.
\def\readauxfile{\begingroup \def\readauxfile{\begingroup
...@@ -5863,9 +6120,7 @@ width0pt\relax} \fi ...@@ -5863,9 +6120,7 @@ width0pt\relax} \fi
\catcode`\^^]=\other \catcode`\^^]=\other
\catcode`\^^^=\other \catcode`\^^^=\other
\catcode`\^^_=\other \catcode`\^^_=\other
\catcode`\@=\other % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
\catcode`\^=\other
% It was suggested to define this as 7, which would allow ^^e4 etc.
% in xref tags, i.e., node names. But since ^^e4 notation isn't % in xref tags, i.e., node names. But since ^^e4 notation isn't
% supported in the main text, it doesn't seem desirable. Furthermore, % supported in the main text, it doesn't seem desirable. Furthermore,
% that is not enough: for node names that actually contain a ^ % that is not enough: for node names that actually contain a ^
...@@ -5878,6 +6133,9 @@ width0pt\relax} \fi ...@@ -5878,6 +6133,9 @@ width0pt\relax} \fi
% \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
% and then to call \auxhat in \setq. % and then to call \auxhat in \setq.
% %
\catcode`\^=\other
%
% Special characters. Should be turned off anyway, but...
\catcode`\~=\other \catcode`\~=\other
\catcode`\[=\other \catcode`\[=\other
\catcode`\]=\other \catcode`\]=\other
...@@ -5889,7 +6147,9 @@ width0pt\relax} \fi ...@@ -5889,7 +6147,9 @@ width0pt\relax} \fi
\catcode`\$=\other \catcode`\$=\other
\catcode`\#=\other \catcode`\#=\other
\catcode`\&=\other \catcode`\&=\other
\catcode`\%=\other
\catcode`+=\other % avoid \+ for paranoia even though we've turned it off \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
%
% Make the characters 128-255 be printing characters % Make the characters 128-255 be printing characters
{% {%
\count 1=128 \count 1=128
...@@ -5899,17 +6159,18 @@ width0pt\relax} \fi ...@@ -5899,17 +6159,18 @@ width0pt\relax} \fi
\ifnum \count 1<256 \loop \fi \ifnum \count 1<256 \loop \fi
}% }%
}% }%
% 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`\\=\other
%
% @ is our escape character in .aux files.
\catcode`\{=1 \catcode`\{=1
\catcode`\}=2 \catcode`\}=2
\catcode`\%=\other \catcode`\@=0
\catcode`\'=0
\catcode`\\=\other
% %
\openin 1 \jobname.aux \openin 1 \jobname.aux
\ifeof 1 \else \ifeof 1 \else
...@@ -5943,18 +6204,19 @@ width0pt\relax} \fi ...@@ -5943,18 +6204,19 @@ width0pt\relax} \fi
% %
% Auto-number footnotes. Otherwise like plain. % Auto-number footnotes. Otherwise like plain.
\gdef\footnote{% \gdef\footnote{%
\let\indent=\ptexindent
\global\advance\footnoteno by \@ne \global\advance\footnoteno by \@ne
\edef\thisfootno{$^{\the\footnoteno}$}% \edef\thisfootno{$^{\the\footnoteno}$}%
% %
% In case the footnote comes at the end of a sentence, preserve the % In case the footnote comes at the end of a sentence, preserve the
% extra spacing after we do the footnote number. % extra spacing after we do the footnote number.
\let\@sf\empty \let\@sf\empty
\ifhmode\edef\@sf{\spacefactor\the\spacefactor}\/\fi \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi
% %
% Remove inadvertent blank space before typesetting the footnote number. % Remove inadvertent blank space before typesetting the footnote number.
\unskip \unskip
\thisfootno\@sf \thisfootno\@sf
\footnotezzz \dofootnote
}% }%
% Don't bother with the trickery in plain.tex to not require the % Don't bother with the trickery in plain.tex to not require the
...@@ -5964,10 +6226,17 @@ width0pt\relax} \fi ...@@ -5964,10 +6226,17 @@ width0pt\relax} \fi
% \parseargline fail inside footnotes because the tokens are fixed when % \parseargline fail inside footnotes because the tokens are fixed when
% the footnote is read. --karl, 16nov96. % the footnote is read. --karl, 16nov96.
% %
\long\gdef\footnotezzz{\insert\footins\bgroup % The start of the footnote looks usually like this:
\gdef\startfootins{\insert\footins\bgroup}
%
% ... but this macro is redefined inside @multitable.
%
\gdef\dofootnote{%
\startfootins
% We want to typeset this text as a normal paragraph, even if the % We want to typeset this text as a normal paragraph, even if the
% footnote reference occurs in (for example) a display environment. % footnote reference occurs in (for example) a display environment.
% So reset some parameters. % So reset some parameters.
\hsize=\pagewidth
\interlinepenalty\interfootnotelinepenalty \interlinepenalty\interfootnotelinepenalty
\splittopskip\ht\strutbox % top baseline for broken footnotes \splittopskip\ht\strutbox % top baseline for broken footnotes
\splitmaxdepth\dp\strutbox \splitmaxdepth\dp\strutbox
...@@ -5997,12 +6266,6 @@ width0pt\relax} \fi ...@@ -5997,12 +6266,6 @@ width0pt\relax} \fi
\footstrut \footstrut
\futurelet\next\fo@t \futurelet\next\fo@t
} }
\def\fo@t{\ifcat\bgroup\noexpand\next \let\next\f@@t
\else\let\next\f@t\fi \next}
\def\f@@t{\bgroup\aftergroup\@foot\let\next}
\def\f@t#1{#1\@foot}
\def\@foot{\strut\par\egroup}
}%end \catcode `\@=11 }%end \catcode `\@=11
% @| inserts a changebar to the left of the current line. It should % @| inserts a changebar to the left of the current line. It should
...@@ -6049,8 +6312,8 @@ width0pt\relax} \fi ...@@ -6049,8 +6312,8 @@ width0pt\relax} \fi
\openin 1 = epsf.tex \openin 1 = epsf.tex
\ifeof 1 \else \ifeof 1 \else
\closein 1 \closein 1
% Do not bother showing banner with post-v2.7 epsf.tex (available in % Do not bother showing banner with epsf.tex v2.7k (available in
% doc/epsf.tex until it shows up on ctan). % doc/epsf.tex and on ctan).
\def\epsfannounce{\toks0 = }% \def\epsfannounce{\toks0 = }%
\input epsf.tex \input epsf.tex
\fi \fi
...@@ -6211,15 +6474,6 @@ should work if nowhere else does.} ...@@ -6211,15 +6474,6 @@ should work if nowhere else does.}
\setemergencystretch \setemergencystretch
} }
% Use `small' versions.
%
\def\smallenvironments{%
\let\smalldisplay = \smalldisplayx
\let\smallexample = \smalllispx
\let\smallformat = \smallformatx
\let\smalllisp = \smalllispx
}
% @letterpaper (the default). % @letterpaper (the default).
\def\letterpaper{{\globaldefs = 1 \def\letterpaper{{\globaldefs = 1
\parskip = 3pt plus 2pt minus 1pt \parskip = 3pt plus 2pt minus 1pt
...@@ -6247,7 +6501,6 @@ should work if nowhere else does.} ...@@ -6247,7 +6501,6 @@ should work if nowhere else does.}
\hfuzz = 1pt \hfuzz = 1pt
\contentsrightmargin = 0pt \contentsrightmargin = 0pt
\defbodyindent = .5cm \defbodyindent = .5cm
\smallenvironments
}} }}
% Use @afourpaper to print on European A4 paper. % Use @afourpaper to print on European A4 paper.
...@@ -6294,8 +6547,6 @@ should work if nowhere else does.} ...@@ -6294,8 +6547,6 @@ should work if nowhere else does.}
\contentsrightmargin = 0pt \contentsrightmargin = 0pt
\defbodyindent = 2mm \defbodyindent = 2mm
\tableindent = 12mm \tableindent = 12mm
%
\smallenvironments
}} }}
% A specific text layout, 24x15cm overall, intended for A4 paper. % A specific text layout, 24x15cm overall, intended for A4 paper.
...@@ -6406,7 +6657,7 @@ should work if nowhere else does.} ...@@ -6406,7 +6657,7 @@ should work if nowhere else does.}
\catcode`\_=\active \catcode`\_=\active
\def_{\ifusingtt\normalunderscore\_} \def_{\ifusingtt\normalunderscore\_}
% Subroutine for the previous macro. % Subroutine for the previous macro.
\def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}} \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
\catcode`\|=\active \catcode`\|=\active
\def|{{\tt\char124}} \def|{{\tt\char124}}
...@@ -6420,8 +6671,6 @@ should work if nowhere else does.} ...@@ -6420,8 +6671,6 @@ should work if nowhere else does.}
\def+{{\tt \char 43}} \def+{{\tt \char 43}}
\catcode`\$=\active \catcode`\$=\active
\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix \def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix
%\catcode 27=\active
%\def^^[{$\diamondsuit$}
% Set up an active definition for =, but don't enable it most of the time. % Set up an active definition for =, but don't enable it most of the time.
{\catcode`\==\active {\catcode`\==\active
...@@ -6438,35 +6687,45 @@ should work if nowhere else does.} ...@@ -6438,35 +6687,45 @@ should work if nowhere else does.}
\catcode`\@=0 \catcode`\@=0
% \rawbackslashxx output one backslash character in current font % \rawbackslashxx outputs one backslash character in current font,
% as in \char`\\.
\global\chardef\rawbackslashxx=`\\ \global\chardef\rawbackslashxx=`\\
%{\catcode`\\=\other
%@gdef@rawbackslashxx{\}}
% \rawbackslash redefines \ as input to do \rawbackslashxx. % \rawbackslash defines an active \ to do \rawbackslashxx.
% \otherbackslash defines an active \ to be a literal `\' character with
% catcode other.
{\catcode`\\=\active {\catcode`\\=\active
@gdef@rawbackslash{@let\=@rawbackslashxx }} @gdef@rawbackslash{@let\=@rawbackslashxx}
@gdef@otherbackslash{@let\=@realbackslash}
}
% \realbackslash is an actual character `\' with catcode other.
{\catcode`\\=\other @gdef@realbackslash{\}}
% \normalbackslash outputs one backslash in fixed width font. % \normalbackslash outputs one backslash in fixed width font.
\def\normalbackslash{{\tt\rawbackslashxx}} \def\normalbackslash{{\tt\rawbackslashxx}}
% \catcode 17=0 % Define control-q
\catcode`\\=\active \catcode`\\=\active
% Used sometimes to turn off (effectively) the active characters % Used sometimes to turn off (effectively) the active characters
% even after parsing them. % even after parsing them.
@def@turnoffactive{@let"=@normaldoublequote @def@turnoffactive{%
@let\=@realbackslash @let"=@normaldoublequote
@let~=@normaltilde @let\=@realbackslash
@let^=@normalcaret @let~=@normaltilde
@let_=@normalunderscore @let^=@normalcaret
@let|=@normalverticalbar @let_=@normalunderscore
@let<=@normalless @let|=@normalverticalbar
@let>=@normalgreater @let<=@normalless
@let+=@normalplus @let>=@normalgreater
@let$=@normaldollar}%$ font-lock fix @let+=@normalplus
@let$=@normaldollar %$ font-lock fix
% Same as @turnoffactive except for \. }
% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
% the literal character `\'. (Thus, \ is not expandable when this is in
% effect.)
%
@def@normalturnoffactive{@turnoffactive @let\=@normalbackslash} @def@normalturnoffactive{@turnoffactive @let\=@normalbackslash}
% Make _ and + \other characters, temporarily. % Make _ and + \other characters, temporarily.
......
...@@ -184,8 +184,8 @@ static const size_t extra_order_size_table[] = { ...@@ -184,8 +184,8 @@ static const size_t extra_order_size_table[] = {
sizeof (struct tree_decl), sizeof (struct tree_decl),
sizeof (struct tree_list), sizeof (struct tree_list),
TREE_EXP_SIZE (2), TREE_EXP_SIZE (2),
RTL_SIZE (2), /* REG, MEM, PLUS, etc. */ RTL_SIZE (2), /* MEM, PLUS, etc. */
RTL_SIZE (10), /* INSN, CALL_INSN, JUMP_INSN */ RTL_SIZE (9), /* INSN, CALL_INSN, JUMP_INSN */
}; };
/* The total number of orders. */ /* The total number of orders. */
...@@ -400,6 +400,31 @@ static struct globals ...@@ -400,6 +400,31 @@ static struct globals
better runtime data access pattern. */ better runtime data access pattern. */
unsigned long **save_in_use; unsigned long **save_in_use;
#ifdef GATHER_STATISTICS
struct
{
/* Total memory allocated with ggc_alloc */
unsigned long long total_allocated;
/* Total overhead for memory to be allocated with ggc_alloc */
unsigned long long total_overhead;
/* Total allocations and overhead for sizes less than 32, 64 and 128.
These sizes are interesting because they are typical cache line
sizes. */
unsigned long long total_allocated_under32;
unsigned long long total_overhead_under32;
unsigned long long total_allocated_under64;
unsigned long long total_overhead_under64;
unsigned long long total_allocated_under128;
unsigned long long total_overhead_under128;
/* The overhead for each of the allocation orders. */
unsigned long long total_overhead_per_order[NUM_ORDERS];
} stats;
#endif
} G; } G;
/* The size in bytes required to maintain a bitmap for the objects /* The size in bytes required to maintain a bitmap for the objects
...@@ -1123,6 +1148,30 @@ ggc_alloc (size_t size) ...@@ -1123,6 +1148,30 @@ ggc_alloc (size_t size)
information is used in deciding when to collect. */ information is used in deciding when to collect. */
G.allocated += OBJECT_SIZE (order); G.allocated += OBJECT_SIZE (order);
#ifdef GATHER_STATISTICS
{
G.stats.total_overhead += OBJECT_SIZE (order) - size;
G.stats.total_overhead_per_order[order] += OBJECT_SIZE (order) - size;
G.stats.total_allocated += OBJECT_SIZE(order);
if (size <= 32){
G.stats.total_overhead_under32 += OBJECT_SIZE (order) - size;
G.stats.total_allocated_under32 += OBJECT_SIZE(order);
}
if (size <= 64){
G.stats.total_overhead_under64 += OBJECT_SIZE (order) - size;
G.stats.total_allocated_under64 += OBJECT_SIZE(order);
}
if (size <= 128){
G.stats.total_overhead_under128 += OBJECT_SIZE (order) - size;
G.stats.total_allocated_under128 += OBJECT_SIZE(order);
}
}
#endif
if (GGC_DEBUG_LEVEL >= 3) if (GGC_DEBUG_LEVEL >= 3)
fprintf (G.debug_file, fprintf (G.debug_file,
"Allocating object, requested size=%lu, actual=%lu at %p on %p\n", "Allocating object, requested size=%lu, actual=%lu at %p on %p\n",
...@@ -1761,7 +1810,7 @@ ggc_print_statistics (void) ...@@ -1761,7 +1810,7 @@ ggc_print_statistics (void)
/* Collect some information about the various sizes of /* Collect some information about the various sizes of
allocation. */ allocation. */
fprintf (stderr, "\n%-5s %10s %10s %10s\n", fprintf (stderr, "%-5s %10s %10s %10s\n",
"Size", "Allocated", "Used", "Overhead"); "Size", "Allocated", "Used", "Overhead");
for (i = 0; i < NUM_ORDERS; ++i) for (i = 0; i < NUM_ORDERS; ++i)
{ {
...@@ -1799,6 +1848,33 @@ ggc_print_statistics (void) ...@@ -1799,6 +1848,33 @@ ggc_print_statistics (void)
SCALE (G.bytes_mapped), LABEL (G.bytes_mapped), SCALE (G.bytes_mapped), LABEL (G.bytes_mapped),
SCALE (G.allocated), LABEL(G.allocated), SCALE (G.allocated), LABEL(G.allocated),
SCALE (total_overhead), LABEL (total_overhead)); SCALE (total_overhead), LABEL (total_overhead));
#ifdef GATHER_STATISTICS
{
fprintf (stderr, "Total Overhead: %10lld\n",
G.stats.total_overhead);
fprintf (stderr, "Total Allocated: %10lld\n",
G.stats.total_allocated);
fprintf (stderr, "Total Overhead under 32B: %10lld\n",
G.stats.total_overhead_under32);
fprintf (stderr, "Total Allocated under 32B: %10lld\n",
G.stats.total_allocated_under32);
fprintf (stderr, "Total Overhead under 64B: %10lld\n",
G.stats.total_overhead_under64);
fprintf (stderr, "Total Allocated under 64B: %10lld\n",
G.stats.total_allocated_under64);
fprintf (stderr, "Total Overhead under 128B: %10lld\n",
G.stats.total_overhead_under128);
fprintf (stderr, "Total Allocated under 128B: %10lld\n",
G.stats.total_allocated_under128);
for (i = 0; i < NUM_ORDERS; i++)
if (G.stats.total_overhead_per_order[i])
fprintf (stderr, "Total Overhead page size %7d: %10lld\n",
OBJECT_SIZE (i), G.stats.total_overhead_per_order[i]);
}
#endif
} }
struct ggc_pch_data struct ggc_pch_data
......
...@@ -51,28 +51,11 @@ extern int _obstack_allocated_p (struct obstack *h, void *obj); ...@@ -51,28 +51,11 @@ extern int _obstack_allocated_p (struct obstack *h, void *obj);
#ifdef GATHER_STATISTICS #ifdef GATHER_STATISTICS
/* Statistics-gathering stuff. */ /* Statistics-gathering stuff. */
typedef enum
{
d_kind,
t_kind,
b_kind,
s_kind,
r_kind,
e_kind,
c_kind,
id_kind,
perm_list_kind,
temp_list_kind,
vec_kind,
x_kind,
lang_decl,
lang_type,
all_kinds
} tree_node_kind;
int tree_node_counts[(int) all_kinds]; int tree_node_counts[(int) all_kinds];
int tree_node_sizes[(int) all_kinds]; int tree_node_sizes[(int) all_kinds];
/* Keep in sync with tree.h:enum tree_node_kind. */
static const char * const tree_node_kind_names[] = { static const char * const tree_node_kind_names[] = {
"decls", "decls",
"types", "types",
...@@ -4447,18 +4430,18 @@ dump_tree_statistics (void) ...@@ -4447,18 +4430,18 @@ dump_tree_statistics (void)
fprintf (stderr, "\n??? tree nodes created\n\n"); fprintf (stderr, "\n??? tree nodes created\n\n");
#ifdef GATHER_STATISTICS #ifdef GATHER_STATISTICS
fprintf (stderr, "Kind Nodes Bytes\n"); fprintf (stderr, "Kind Nodes Bytes\n");
fprintf (stderr, "-------------------------------------\n"); fprintf (stderr, "---------------------------------------\n");
total_nodes = total_bytes = 0; total_nodes = total_bytes = 0;
for (i = 0; i < (int) all_kinds; i++) for (i = 0; i < (int) all_kinds; i++)
{ {
fprintf (stderr, "%-20s %6d %9d\n", tree_node_kind_names[i], fprintf (stderr, "%-20s %7d %10d\n", tree_node_kind_names[i],
tree_node_counts[i], tree_node_sizes[i]); tree_node_counts[i], tree_node_sizes[i]);
total_nodes += tree_node_counts[i]; total_nodes += tree_node_counts[i];
total_bytes += tree_node_sizes[i]; total_bytes += tree_node_sizes[i];
} }
fprintf (stderr, "-------------------------------------\n"); fprintf (stderr, "---------------------------------------\n");
fprintf (stderr, "%-20s %6d %9d\n", "Total", total_nodes, total_bytes); fprintf (stderr, "%-20s %7d %10d\n", "Total", total_nodes, total_bytes);
fprintf (stderr, "-------------------------------------\n"); fprintf (stderr, "---------------------------------------\n");
#else #else
fprintf (stderr, "(No per-node statistics)\n"); fprintf (stderr, "(No per-node statistics)\n");
#endif #endif
......
...@@ -3017,4 +3017,28 @@ extern void fancy_abort (const char *, int, const char *) ...@@ -3017,4 +3017,28 @@ extern void fancy_abort (const char *, int, const char *)
ATTRIBUTE_NORETURN; ATTRIBUTE_NORETURN;
#define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__) #define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__)
/* Enum and arrays used for tree allocation stats.
Keep in sync with tree.c:tree_node_kind_names. */
typedef enum
{
d_kind,
t_kind,
b_kind,
s_kind,
r_kind,
e_kind,
c_kind,
id_kind,
perm_list_kind,
temp_list_kind,
vec_kind,
x_kind,
lang_decl,
lang_type,
all_kinds
} tree_node_kind;
extern int tree_node_counts[];
extern int tree_node_sizes[];
#endif /* GCC_TREE_H */ #endif /* GCC_TREE_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment