emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lispintro/texinfo.tex


From: Robert J. Chassell
Subject: [Emacs-diffs] Changes to emacs/lispintro/texinfo.tex
Date: Wed, 16 Jul 2003 15:00:30 -0400

Index: emacs/lispintro/texinfo.tex
diff -c emacs/lispintro/texinfo.tex:1.3 emacs/lispintro/texinfo.tex:1.4
*** emacs/lispintro/texinfo.tex:1.3     Tue Feb  4 09:44:45 2003
--- emacs/lispintro/texinfo.tex Wed Jul 16 15:00:28 2003
***************
*** 3,12 ****
  % Load plain if necessary, i.e., if running under initex.
  \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
  %
! \def\texinfoversion{2002-06-07.15}
  %
! % Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
! %               2000, 01, 02 Free Software Foundation, Inc.
  %
  % 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
--- 3,12 ----
  % Load plain if necessary, i.e., if running under initex.
  \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
  %
! \def\texinfoversion{2003-07-16.18}
  %
! % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
! % 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
  % modify it under the terms of the GNU General Public License as
***************
*** 29,47 ****
  %
  % Please try the latest version of texinfo.tex before submitting bug
  % reports; you can get the latest version from:
! %   ftp://ftp.gnu.org/gnu/texinfo.tex
  %     (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
- %   ftp://texinfo.org/texinfo/texinfo.tex
  %   ftp://tug.org/tex/texinfo.tex
  %     (and all CTAN mirrors, see http://www.ctan.org),
  %   and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
  %
  % The texinfo.tex in any given Texinfo distribution could well be out
  % of date, so if that's what you're using, please check.
  %
- % Texinfo has a small home page at http://texinfo.org/ and also
- % http://www.gnu.org/software/texinfo.
- %
  % Send bug reports to address@hidden  Please include including a
  % complete document in each bug report with which we can reproduce the
  % problem.  Patches are, of course, greatly appreciated.
--- 29,45 ----
  %
  % Please try the latest version of texinfo.tex before submitting bug
  % reports; you can get the latest version from:
! %   ftp://ftp.gnu.org/gnu/texinfo/texinfo.tex
  %     (and all GNU mirrors, see http://www.gnu.org/order/ftp.html)
  %   ftp://tug.org/tex/texinfo.tex
  %     (and all CTAN mirrors, see http://www.ctan.org),
  %   and /home/gd/gnu/doc/texinfo.tex on the GNU machines.
  %
+ % The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+ %
  % The texinfo.tex in any given Texinfo distribution could well be out
  % of date, so if that's what you're using, please check.
  %
  % Send bug reports to address@hidden  Please include including a
  % complete document in each bug report with which we can reproduce the
  % problem.  Patches are, of course, greatly appreciated.
***************
*** 58,65 ****
  % Sometimes one run after texindex suffices, and sometimes you need more
  % than two; texi2dvi does it as many times as necessary.
  %
! % It is possible to adapt texinfo.tex for other languages.  You can get
! % the existing language-specific files from the full Texinfo distribution.
  
  \message{Loading texinfo [version \texinfoversion]:}
  
--- 56,64 ----
  % Sometimes one run after texindex suffices, and sometimes you need more
  % than two; texi2dvi does it as many times as necessary.
  %
! % It is possible to adapt texinfo.tex for other languages, to some
! % extent.  You can get the existing language-specific files from the
! % full Texinfo distribution.
  
  \message{Loading texinfo [version \texinfoversion]:}
  
***************
*** 69,75 ****
  \everyjob{\message{[Texinfo version \texinfoversion]}%
    \catcode`+=\active \catcode`\_=\active}
  
! % Save some parts of plain tex whose names we will redefine.
  \let\ptexb=\b
  \let\ptexbullet=\bullet
  \let\ptexc=\c
--- 68,81 ----
  \everyjob{\message{[Texinfo version \texinfoversion]}%
    \catcode`+=\active \catcode`\_=\active}
  
! \message{Basics,}
! \chardef\other=12
! 
! % We never want plain's \outer definition of \+ in Texinfo.
! % For @tex, we can use \tabalign.
! \let\+ = \relax
! 
! % Save some plain tex macros whose names we will redefine.
  \let\ptexb=\b
  \let\ptexbullet=\bullet
  \let\ptexc=\c
***************
*** 79,97 ****
  \let\ptexend=\end
  \let\ptexequiv=\equiv
  \let\ptexexclam=\!
  \let\ptexi=\i
  \let\ptexlbrace=\{
  \let\ptexrbrace=\}
  \let\ptexstar=\*
  \let\ptext=\t
  
- % We never want plain's outer \+ definition in Texinfo.
- % For @tex, we can use \tabalign.
- \let\+ = \relax
- 
- \message{Basics,}
- \chardef\other=12
- 
  % If this character appears in an error message or help string, it
  % starts a new line in the output.
  \newlinechar = `^^J
--- 85,102 ----
  \let\ptexend=\end
  \let\ptexequiv=\equiv
  \let\ptexexclam=\!
+ \let\ptexgtr=>
+ \let\ptexhat=^
  \let\ptexi=\i
+ \let\ptexindent=\indent
  \let\ptexlbrace=\{
+ \let\ptexless=<
+ \let\ptexplus=+
  \let\ptexrbrace=\}
+ \let\ptexslash=\/
  \let\ptexstar=\*
  \let\ptext=\t
  
  % If this character appears in an error message or help string, it
  % starts a new line in the output.
  \newlinechar = `^^J
***************
*** 138,177 ****
  \ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{Function}\fi
  \ifx\putwordDeftypefun\undefined\gdef\putwordDeftypefun{Function}\fi
  
  % Ignore a token.
  %
  \def\gobble#1{}
  
  \hyphenation{ap-pen-dix}
- \hyphenation{mini-buf-fer mini-buf-fers}
  \hyphenation{eshell}
  \hyphenation{white-space}
  
  % Margin to add to right of even pages, to left of odd pages.
! \newdimen \bindingoffset
! \newdimen \normaloffset
  \newdimen\pagewidth \newdimen\pageheight
  
  % Sometimes it is convenient to have everything in the transcript file
  % and nothing on the terminal.  We don't just call \tracingall here,
! % since that produces some useless output on the terminal.
  %
  \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
! \ifx\eTeXversion\undefined
! \def\loggingall{\tracingcommands2 \tracingstats2
!    \tracingpages1 \tracingoutput1 \tracinglostchars1
!    \tracingmacros2 \tracingparagraphs1 \tracingrestores1
!    \showboxbreadth\maxdimen\showboxdepth\maxdimen
! }%
! \else
! \def\loggingall{\tracingcommands3 \tracingstats2
!    \tracingpages1 \tracingoutput1 \tracinglostchars1
!    \tracingmacros2 \tracingparagraphs1 \tracingrestores1
!    \tracingscantokens1 \tracingassigns1 \tracingifs1
!    \tracinggroups1 \tracingnesting2
!    \showboxbreadth\maxdimen\showboxdepth\maxdimen
  }%
- \fi
  
  % add check for \lastpenalty to plain's definitions.  If the last thing
  % we did was a \nobreak, we don't want to insert more space.
--- 143,207 ----
  \ifx\putwordDeffunc\undefined   \gdef\putwordDeffunc{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.
  %
  \def\gobble#1{}
  
+ % True if #1 is the empty string, i.e., called like `\ifempty{}'.
+ %
+ \def\ifempty#1{\ifemptyx #1\emptymarkA\emptymarkB}%
+ \def\ifemptyx#1#2\emptymarkB{\ifx #1\emptymarkA}%
+ 
+ % Hyphenation fixes.
  \hyphenation{ap-pen-dix}
  \hyphenation{eshell}
+ \hyphenation{mini-buf-fer mini-buf-fers}
+ \hyphenation{time-stamp}
  \hyphenation{white-space}
  
  % Margin to add to right of even pages, to left of odd pages.
! \newdimen\bindingoffset
! \newdimen\normaloffset
  \newdimen\pagewidth \newdimen\pageheight
  
  % Sometimes it is convenient to have everything in the transcript file
  % and nothing on the terminal.  We don't just call \tracingall here,
! % since that produces some useless output on the terminal.  We also make
! % some effort to order the tracing commands to reduce output in the log
! % file; cf. trace.sty in LaTeX.
  %
  \def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}%
! \def\loggingall{%
!   \tracingstats2
!   \tracingpages1
!   \tracinglostchars2  % 2 gives us more in etex
!   \tracingparagraphs1
!   \tracingoutput1
!   \tracingmacros2
!   \tracingrestores1
!   \showboxbreadth\maxdimen \showboxdepth\maxdimen
!   \ifx\eTeXversion\undefined\else % etex gives us more logging
!     \tracingscantokens1
!     \tracingifs1
!     \tracinggroups1
!     \tracingnesting2
!     \tracingassigns1
!   \fi
!   \tracingcommands3  % 3 gives us more in etex
!   \errorcontextlines\maxdimen
  }%
  
  % add check for \lastpenalty to plain's definitions.  If the last thing
  % we did was a \nobreak, we don't want to insert more space.
***************
*** 276,282 ****
        \egroup % \vbox from first cropmarks clause
        \fi
      }% end of \shipout\vbox
!   }% end of group with \turnoffactive
    \advancepageno
    \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  }
--- 306,312 ----
        \egroup % \vbox from first cropmarks clause
        \fi
      }% end of \shipout\vbox
!   }% end of group with \normalturnoffactive
    \advancepageno
    \ifnum\outputpenalty>-20000 \else\dosupereject\fi
  }
***************
*** 436,452 ****
  }
  
  
- % Single-spacing is done by various environments (specifically, in
- % \nonfillstart and \quotations).
- \newskip\singlespaceskip \singlespaceskip = 12.5pt
- \def\singlespace{%
-   % Why was this kern here?  It messes up equalizing space above and below
-   % environments.  --karl, 6may93
-   %{\advance \baselineskip by -\singlespaceskip
-   %\kern \baselineskip}%
-   \setleading\singlespaceskip
- }
- 
  %% Simple single-character @ commands
  
  % @@ prints an @
--- 466,471 ----
***************
*** 466,481 ****
  \let\{=\mylbrace
  \let\}=\myrbrace
  \begingroup
!   % Definitions to produce actual \{ & \} command in an index.
!   \catcode`\{ = 12 \catcode`\} = 12
    \catcode`\[ = 1 \catcode`\] = 2
!   \catcode`\@ = 0 \catcode`\\ = 12
!   @address@hidden
!   @address@hidden
! @endgroup
  
  % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
! % Others are defined by plain TeX: @` @' @" @^ @~ @= @v @H.
  \let\, = \c
  \let\dotaccent = \.
  \def\ringaccent#1{{\accent23 #1}}
--- 485,503 ----
  \let\{=\mylbrace
  \let\}=\myrbrace
  \begingroup
!   % Definitions to produce \{ and \} commands for indices,
!   % and @{ and @} for the aux file.
!   \catcode`\{ = \other \catcode`\} = \other
    \catcode`\[ = 1 \catcode`\] = 2
!   \catcode`\! = 0 \catcode`\\ = \other
!   !gdef!lbracecmd[\{]%
!   !gdef!rbracecmd[\}]%
!   address@hidden
!   address@hidden
! !endgroup
  
  % Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
! % Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
  \let\, = \c
  \let\dotaccent = \.
  \def\ringaccent#1{{\accent23 #1}}
***************
*** 484,490 ****
  \let\udotaccent = \d
  
  % Other special characters: @questiondown @exclamdown
! % Plain TeX defines: @AA @AE @O @OE @L (and lowercase versions) @ss.
  \def\questiondown{?`}
  \def\exclamdown{!`}
  
--- 506,512 ----
  \let\udotaccent = \d
  
  % Other special characters: @questiondown @exclamdown
! % Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
  \def\questiondown{?`}
  \def\exclamdown{!`}
  
***************
*** 517,522 ****
--- 539,547 ----
  % @* forces a line break.
  \def\*{\hfil\break\hbox{}\ignorespaces}
  
+ % @/ allows a line break.
+ \let\/=\allowbreak
+ 
  % @. is an end-of-sentence period.
  \def\.{.\spacefactor=3000 }
  
***************
*** 539,544 ****
--- 564,579 ----
  % therefore, no glue is inserted, and the space between the headline and
  % 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
    \ifnum\catcode13=\active \else
      \errhelp = \groupinvalidhelp
***************
*** 552,561 ****
    % above.  But it's pretty close.
    \def\Egroup{%
      \egroup           % End the \vtop.
      \endgroup         % End the \group.
    }%
    %
!   \vtop\bgroup
      % 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.
      % Otherwise, the interline space between the last line of the group
--- 587,608 ----
    % above.  But it's pretty close.
    \def\Egroup{%
      \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.
    }%
    %
!   \setbox\groupbox = \vtop\bgroup
      % 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.
      % Otherwise, the interline space between the last line of the group
***************
*** 680,687 ****
    \spacefactor=3000
  }
  
! 
! % @page    forces the start of a new page
  %
  \def\page{\par\vfill\supereject}
  
--- 727,733 ----
    \spacefactor=3000
  }
  
! % @page forces the start of a new page.
  %
  \def\page{\par\vfill\supereject}
  
***************
*** 753,782 ****
  % @include file    insert text of that file as input.
  % Allow normal characters that  we make active in the argument (a file name).
  \def\include{\begingroup
!   \catcode`\\=12
!   \catcode`~=12
!   \catcode`^=12
!   \catcode`_=12
!   \catcode`|=12
!   \catcode`<=12
!   \catcode`>=12
!   \catcode`+=12
    \parsearg\includezzz}
  % Restore active chars for included file.
  \def\includezzz#1{\endgroup\begingroup
    % Read the included file in a group so nested @include's work.
    \def\thisfile{#1}%
    \input\thisfile
  \endgroup}
  
  \def\thisfile{}
  
! % @center line   outputs that line, centered
! 
! \def\center{\parsearg\centerzzz}
! \def\centerzzz #1{{\advance\hsize by -\leftskip
! \advance\hsize by -\rightskip
! \centerline{#1}}}
  
  % @sp n   outputs n lines of vertical space
  
--- 799,834 ----
  % @include file    insert text of that file as input.
  % Allow normal characters that  we make active in the argument (a file name).
  \def\include{\begingroup
!   \catcode`\\=\other
!   \catcode`~=\other
!   \catcode`^=\other
!   \catcode`_=\other
!   \catcode`|=\other
!   \catcode`<=\other
!   \catcode`>=\other
!   \catcode`+=\other
    \parsearg\includezzz}
  % Restore active chars for included file.
  \def\includezzz#1{\endgroup\begingroup
    % Read the included file in a group so nested @include's work.
    \def\thisfile{#1}%
+   \let\value=\expandablevalue
    \input\thisfile
  \endgroup}
  
  \def\thisfile{}
  
! % @center line
! % outputs that line, centered.
! %
! \def\center{\parsearg\docenter}
! \def\docenter#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
  
***************
*** 796,802 ****
  
  % @paragraphindent NCHARS
  % We'll use ems for NCHARS, close enough.
! % We cannot implement @paragraphindent asis, though.
  %
  \def\asisword{asis} % no translation, these are keywords
  \def\noneword{none}
--- 848,855 ----
  
  % @paragraphindent NCHARS
  % We'll use ems for NCHARS, close enough.
! % 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\noneword{none}
***************
*** 832,837 ****
--- 885,937 ----
    \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.
  %
  \def\asis#1{#1}
***************
*** 841,851 ****
  % to set catcodes according to plain TeX first, to allow for subscripts,
  % superscripts, special math chars, etc.
  %
- % @math does not do math typesetting in section titles, index
- % entries, and other such contexts where the catcodes are set before
- % @math gets a chance to work.  This could perhaps be fixed, but for now
- % at least we can have real math in the main text, where it's needed most.
- %
  \let\implicitmath = $%$ font-lock fix
  %
  % One complication: _ usually means subscripts, but it could also mean
--- 941,946 ----
***************
*** 853,861 ****
  % _ within @math be active (mathcode "8000), and distinguish by seeing
  % if the current family is \slfam, which is what @var uses.
  %
! {\catcode95 = \active  % 95 = _
  \gdef\mathunderscore{%
!   \catcode95=\active
    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
  }}
  %
--- 948,956 ----
  % _ within @math be active (mathcode "8000), and distinguish by seeing
  % if the current family is \slfam, which is what @var uses.
  %
! {\catcode\underChar = \active
  \gdef\mathunderscore{%
!   \catcode\underChar=\active
    \def_{\ifnum\fam=\slfam \_\else\sb\fi}%
  }}
  %
***************
*** 871,879 ****
--- 966,992 ----
    \tex
    \mathcode`\_="8000 \mathunderscore
    \let\\ = \mathbackslash
+   \mathactive
    \implicitmath\finishmath}
  \def\finishmath#1{#1\implicitmath\Etex}
  
+ % Some active characters (such as <) are spaced differently in math.
+ % We have to reset their definitions in case the @math was an
+ % argument to a command which set the catcodes (such as @item or @section).
+ %
+ {
+   \catcode`^ = \active
+   \catcode`< = \active
+   \catcode`> = \active
+   \catcode`+ = \active
+   \gdef\mathactive{%
+     \let^ = \ptexhat
+     \let< = \ptexless
+     \let> = \ptexgtr
+     \let+ = \ptexplus
+   }
+ }
+ 
  % @bullet and @minus need the same treatment as @math, just above.
  \def\bullet{\implicitmath\ptexbullet\implicitmath}
  \def\minus{\implicitmath-\implicitmath}
***************
*** 965,971 ****
        \ifx\empty\imagewidth\else width \imagewidth \fi
        \ifx\empty\imageheight\else height \imageheight \fi
        \ifnum\pdftexversion<13
!        #1.pdf%
         \else
           {#1.pdf}%
         \fi
--- 1078,1084 ----
        \ifx\empty\imagewidth\else width \imagewidth \fi
        \ifx\empty\imageheight\else height \imageheight \fi
        \ifnum\pdftexversion<13
!          #1.pdf%
         \else
           {#1.pdf}%
         \fi
***************
*** 987,1026 ****
      \openin 1 \jobname.toc
      \ifeof 1\else\begingroup
        \closein 1
-       \indexnofonts
-       \def\tt{}
-       \let\_ = \normalunderscore
        % Thanh's hack / proper braces in bookmarks
        \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
        \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
        %
        \def\chapentry ##1##2##3{}
-       \let\appendixentry = \chapentry
-       \def\unnumbchapentry ##1##2{}
        \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
-       \def\unnumbsecentry ##1##2##3{\advancenumber{chap##2}}
        \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
-       \def\unnumbsubsecentry ##1##2##3##4{\advancenumber{sec##2.##3}}
        \def\subsubsecentry 
##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
!       \def\unnumbsubsubsecentry 
##1##2##3##4##5{\advancenumber{subsec##2.##3.##4}}
        \input \jobname.toc
        \def\chapentry ##1##2##3{%
          \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
-       \let\appendixentry = \chapentry
-       \def\unnumbchapentry ##1##2{%
-         \pdfoutline goto name{\pdfmkpgn{##2}}{##1}}
        \def\secentry ##1##2##3##4{%
          \pdfoutline goto 
name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
-       \def\unnumbsecentry ##1##2##3{%
-         \pdfoutline goto name{\pdfmkpgn{##3}}{##1}}
        \def\subsecentry ##1##2##3##4##5{%
          \pdfoutline goto 
name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
-       \def\unnumbsubsecentry ##1##2##3##4{%
-         \pdfoutline goto name{\pdfmkpgn{##4}}{##1}}
        \def\subsubsecentry ##1##2##3##4##5##6{%
          \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
!       \def\unnumbsubsubsecentry ##1##2##3##4##5{%
!         \pdfoutline goto name{\pdfmkpgn{##5}}{##1}}
        \input \jobname.toc
      \endgroup\fi
    }}
--- 1100,1138 ----
      \openin 1 \jobname.toc
      \ifeof 1\else\begingroup
        \closein 1
        % Thanh's hack / proper braces in bookmarks
        \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
        \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
        %
        \def\chapentry ##1##2##3{}
        \def\secentry ##1##2##3##4{\advancenumber{chap##2}}
        \def\subsecentry ##1##2##3##4##5{\advancenumber{sec##2.##3}}
        \def\subsubsecentry 
##1##2##3##4##5##6{\advancenumber{subsec##2.##3.##4}}
!       \let\appendixentry = \chapentry
!       \let\unnumbchapentry = \chapentry
!       \let\unnumbsecentry = \secentry
!       \let\unnumbsubsecentry = \subsecentry
!       \let\unnumbsubsubsecentry = \subsubsecentry
        \input \jobname.toc
        \def\chapentry ##1##2##3{%
          \pdfoutline goto name{\pdfmkpgn{##3}}count-\expnumber{chap##2}{##1}}
        \def\secentry ##1##2##3##4{%
          \pdfoutline goto 
name{\pdfmkpgn{##4}}count-\expnumber{sec##2.##3}{##1}}
        \def\subsecentry ##1##2##3##4##5{%
          \pdfoutline goto 
name{\pdfmkpgn{##5}}count-\expnumber{subsec##2.##3.##4}{##1}}
        \def\subsubsecentry ##1##2##3##4##5##6{%
          \pdfoutline goto name{\pdfmkpgn{##6}}{##1}}
!       \let\appendixentry = \chapentry
!       \let\unnumbchapentry = \chapentry
!       \let\unnumbsecentry = \secentry
!       \let\unnumbsubsecentry = \subsecentry
!       \let\unnumbsubsubsecentry = \subsubsecentry
!       %
!       % Make special characters normal for writing to the pdf file.
!       %
!       \indexnofonts
!       \let\tt=\relax
!       \turnoffactive
        \input \jobname.toc
      \endgroup\fi
    }}
***************
*** 1170,1187 ****
  \newcount\mainmagstep
  \ifx\bigger\relax
    % not really supported.
!   \let\mainmagstep=\magstep1
    \setfont\textrm\rmshape{12}{1000}
    \setfont\texttt\ttshape{12}{1000}
  \else
! %  \mainmagstep=\magstephalf
!   \mainmagstep=\magstep1
    \setfont\textrm\rmshape{10}{\mainmagstep}
    \setfont\texttt\ttshape{10}{\mainmagstep}
  \fi
! % Instead of cmb10, you many want to use cmbx10.
  % cmbx10 is a prettier font on its own, but cmb10
! % looks better when embedded in a line with cmr10.
  \setfont\textbf\bfshape{10}{\mainmagstep}
  \setfont\textit\itshape{10}{\mainmagstep}
  \setfont\textsl\slshape{10}{\mainmagstep}
--- 1282,1299 ----
  \newcount\mainmagstep
  \ifx\bigger\relax
    % not really supported.
!   \mainmagstep=\magstep1
    \setfont\textrm\rmshape{12}{1000}
    \setfont\texttt\ttshape{12}{1000}
  \else
!   \mainmagstep=\magstephalf
    \setfont\textrm\rmshape{10}{\mainmagstep}
    \setfont\texttt\ttshape{10}{\mainmagstep}
  \fi
! % Instead of cmb10, you may want to use cmbx10.
  % cmbx10 is a prettier font on its own, but cmb10
! % looks better when embedded in a line with cmr10
! % (in Bob's opinion).
  \setfont\textbf\bfshape{10}{\mainmagstep}
  \setfont\textit\itshape{10}{\mainmagstep}
  \setfont\textsl\slshape{10}{\mainmagstep}
***************
*** 1232,1237 ****
--- 1344,1350 ----
  \font\titlei=cmmi12 scaled \magstep3
  \font\titlesy=cmsy10 scaled \magstep4
  \def\authorrm{\secrm}
+ \def\authortt{\sectt}
  
  % Chapter (and unnumbered) fonts (17.28pt).
  \setfont\chaprm\rmbshape{12}{\magstep2}
***************
*** 1329,1335 ****
    \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
    \let\tenttsl=\smallerttsl
    \resetmathfonts \setleading{9.5pt}}
! \let\smallexamplefonts = \smallerfonts
  
  % Set up the default fonts, so we can use them for creating boxes.
  %
--- 1442,1466 ----
    \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy
    \let\tenttsl=\smallerttsl
    \resetmathfonts \setleading{9.5pt}}
! 
! % 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.
  %
***************
*** 1346,1360 ****
  \setfont\shortcontrm\rmshape{12}{1000}
  \setfont\shortcontbf\bxshape{12}{1000}
  \setfont\shortcontsl\slshape{12}{1000}
  
  %% Add scribe-like font environments, plus @l for inline lisp (usually sans
  %% serif) and @ii for TeX italic
  
  % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
  % 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\smartslanted#1{{\sl #1}\futurelet\next\smartitalicx}
! \def\smartitalic#1{{\it #1}\futurelet\next\smartitalicx}
  
  \let\i=\smartitalic
  \let\var=\smartslanted
--- 1477,1493 ----
  \setfont\shortcontrm\rmshape{12}{1000}
  \setfont\shortcontbf\bxshape{12}{1000}
  \setfont\shortcontsl\slshape{12}{1000}
+ \setfont\shortconttt\ttshape{12}{1000}
  
  %% Add scribe-like font environments, plus @l for inline lisp (usually sans
  %% serif) and @ii for TeX italic
  
  % \smartitalic{ARG} outputs arg in italics, followed by an italic correction
  % unless the following character is such as not to need one.
! \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\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx}
  
  \let\i=\smartitalic
  \let\var=\smartslanted
***************
*** 1372,1377 ****
--- 1505,1521 ----
  \def\nohyphenation{\hyphenchar\font = -1  \aftergroup\restorehyphenation}
  \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.
+ %
+ address@hidden
+   \def\frenchspacing{%
+     \sfcode\dotChar  address@hidden address@hidden address@hidden
+     address@hidden \sfcode\semiChar address@hidden \sfcode\commaChar 
address@hidden
+   }
+ address@hidden
+ 
  \def\t#1{%
    {\tt \rawbackslash \frenchspacing #1}%
    \null
***************
*** 1471,1485 ****
      \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
    \else\ifx\arg\wordcode
      \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
    \fi\fi\fi
  }
  \def\worddistinct{distinct}
  \def\wordexample{example}
  \def\wordcode{code}
  
! % Default is kbdinputdistinct.  (Too much of a hassle to call the macro,
! % the catcodes are wrong for parsearg to work.)
! \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}
  
  \def\xkey{\key}
  \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
--- 1615,1631 ----
      \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}%
    \else\ifx\arg\wordcode
      \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}%
+   \else
+     \errhelp = \EMsimple
+     \errmessage{Unknown @kbdinputstyle option `\arg'}%
    \fi\fi\fi
  }
  \def\worddistinct{distinct}
  \def\wordexample{example}
  \def\wordcode{code}
  
! % Default is `distinct.'
! \kbdinputstyle distinct
  
  \def\xkey{\key}
  \def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}%
***************
*** 1567,1572 ****
--- 1713,1728 ----
  % @pounds{} is a sterling sign.
  \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,}
  
***************
*** 1593,1599 ****
     \let\subtitlerm=\tenrm
     \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
     %
!    \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines}%
     %
     % Leave some space at the very top of the page.
     \vglue\titlepagetopglue
--- 1749,1756 ----
     \let\subtitlerm=\tenrm
     \def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines}%
     %
!    \def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines
!                    \let\tt=\authortt}%
     %
     % Leave some space at the very top of the page.
     \vglue\titlepagetopglue
***************
*** 1874,1883 ****
      % \parskip glue -- logically it's part of the @item we just started.
      \nobreak \vskip-\parskip
      %
!     % Stop a page break at the \parskip glue coming up.  Unfortunately
      % we can't prevent a possible page break at the following
!     % \baselineskip glue.
!     \nobreak
      \endgroup
      \itemxneedsnegativevskipfalse
    \else
--- 2031,2048 ----
      % \parskip glue -- logically it's part of the @item we just started.
      \nobreak \vskip-\parskip
      %
!     % Stop a page break at the \parskip glue coming up.  (Unfortunately
      % we can't prevent a possible page break at the following
!     % \baselineskip glue.)  However, if what follows is an environment
!     % such as @example, there will be no \parskip glue; then
!     % the negative vskip we just would cause the example and the item to
!     % crash together.  So we use this bizarre value of 10001 as a signal
!     % to \aboveenvbreak to insert \parskip glue after all.
!     % (Possibly there are other commands that could be followed by
!     % @example which need the same treatment, but not section titles; or
!     % maybe section titles are the only special case and they should be
!     % penalty 10001...)
!     \penalty 10001
      \endgroup
      \itemxneedsnegativevskipfalse
    \else
***************
*** 1970,1992 ****
    \itemizey {#1}{\Eitemize}
  }
  
! \def\itemizey #1#2{%
! \aboveenvbreak %
! \itemmax=\itemindent %
! \advance \itemmax by -\itemmargin %
! \advance \leftskip by \itemindent %
! \exdentamount=\itemindent
! \parindent = 0pt %
! \parskip = \smallskipamount %
! \ifdim \parskip=0pt \parskip=2pt \fi%
! \def#2{\endgraf\afterenvbreak\endgroup}%
! \def\itemcontents{#1}%
! \let\item=\itemizeitem}
! 
! % Set sfcode to normal for the chars that usually have another value.
! % 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
  % TOKENS, and \rest to be the remainder.
--- 2135,2155 ----
    \itemizey {#1}{\Eitemize}
  }
  
! \def\itemizey#1#2{%
!   \aboveenvbreak
!   \itemmax=\itemindent
!   \advance\itemmax by -\itemmargin
!   \advance\leftskip by \itemindent
!   \exdentamount=\itemindent
!   \parindent=0pt
!   \parskip=\smallskipamount
!   \ifdim\parskip=0pt \parskip=2pt \fi
!   \def#2{\endgraf\afterenvbreak\endgroup}%
!   \def\itemcontents{#1}%
!   % @itemize with no arg is equivalent to @itemize @bullet.
!   \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi
!   \let\item=\itemizeitem
! }
  
  % \splitoff TOKENS\endmark defines \first to be the first token in
  % TOKENS, and \rest to be the remainder.
***************
*** 2209,2216 ****
           \let\go\pickupwholefraction
        \else
           \global\advance\colcount by 1
!          \setbox0=\hbox{#1\unskip }% Add a normal word space as a separator;
!                             % typically that is always in the input, anyway.
           \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
        \fi
      \fi
--- 2372,2379 ----
           \let\go\pickupwholefraction
        \else
           \global\advance\colcount by 1
!          \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a
!                    % separator; typically that is always in the input, anyway.
           \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}%
        \fi
      \fi
***************
*** 2225,2242 ****
    \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, address@hidden, 20apr99.
- \def\tab{&}
- 
  % @multitable ... @end multitable definitions:
  %
  \def\multitable{\parsearg\dotable}
  \def\dotable#1{\bgroup
    \vskip\parskip
!   \let\item\crcr
    \tolerance=9500
    \hbadness=9500
    \setmultitablespacing
--- 2388,2405 ----
    \go
  }
  
  % @multitable ... @end multitable definitions:
  %
  \def\multitable{\parsearg\dotable}
  \def\dotable#1{\bgroup
    \vskip\parskip
!   \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,
!   % address@hidden, 20apr99.
!   \let\tab=&%
!   \let\startfootins=\startsavedfootnote
    \tolerance=9500
    \hbadness=9500
    \setmultitablespacing
***************
*** 2244,2250 ****
    \parindent=\multitableparindent
    \overfullrule=0pt
    \global\colcount=0
!   \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
    %
    % To parse everything between @multitable and @item:
    \setuptable#1 \endsetuptable
--- 2407,2417 ----
    \parindent=\multitableparindent
    \overfullrule=0pt
    \global\colcount=0
!   \def\Emultitable{%
!     \global\setpercentfalse
!     \crcrwithfootnotes\crcr
!     \egroup\egroup
!   }%
    %
    % To parse everything between @multitable and @item:
    \setuptable#1 \endsetuptable
***************
*** 2333,2338 ****
--- 2500,2524 ----
                                        %% than skip between lines in the table.
  \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,}
  % Prevent errors for section commands.
***************
*** 2368,2432 ****
  % and so want to turn off most commands, in case they are used
  % incorrectly.
  %
  \def\ignoremorecommands{%
    \let\defcodeindex = \relax
!   \let\defcv = \relax
!   \let\deffn = \relax
!   \let\deffnx = \relax
    \let\defindex = \relax
!   \let\defivar = \relax
!   \let\defmac = \relax
!   \let\defmethod = \relax
!   \let\defop = \relax
!   \let\defopt = \relax
!   \let\defspec = \relax
!   \let\deftp = \relax
!   \let\deftypefn = \relax
!   \let\deftypefun = \relax
!   \let\deftypeivar = \relax
!   \let\deftypeop = \relax
!   \let\deftypevar = \relax
!   \let\deftypevr = \relax
!   \let\defun = \relax
!   \let\defvar = \relax
!   \let\defvr = \relax
!   \let\ref = \relax
!   \let\xref = \relax
!   \let\printindex = \relax
!   \let\pxref = \relax
!   \let\settitle = \relax
!   \let\setchapternewpage = \relax
!   \let\setchapterstyle = \relax
!   \let\everyheading = \relax
    \let\evenheading = \relax
-   \let\oddheading = \relax
    \let\everyfooting = \relax
!   \let\evenfooting = \relax
!   \let\oddfooting = \relax
    \let\headings = \relax
    \let\include = \relax
    \let\lowersections = \relax
!   \let\down = \relax
    \let\raisesections = \relax
!   \let\up = \relax
    \let\set = \relax
!   \let\clear = \relax
!   \let\item = \relax
  }
  
! % Ignore @ignore, @ifhtml, @ifinfo, @ifplaintext, @ifnottex, @html, @menu,
! % @direntry, and @documentdescription.
  %
! \def\ignore{\doignore{ignore}}
  \def\ifhtml{\doignore{ifhtml}}
  \def\ifinfo{\doignore{ifinfo}}
  \def\ifplaintext{\doignore{ifplaintext}}
! \def\ifnottex{\doignore{ifnottex}}
! \def\html{\doignore{html}}
  \def\menu{\doignore{menu}}
! \def\direntry{\doignore{direntry}}
! \def\documentdescription{\doignore{documentdescription}}
! \def\documentdescriptionword{documentdescription}
  
  % @dircategory CATEGORY  -- specify a category of the dir file
  % which this file should belong to.  Ignore this in TeX.
--- 2554,2670 ----
  % and so want to turn off most commands, in case they are used
  % 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{%
    \let\defcodeindex = \relax
!   \let\defcv = \empty
!   \let\defcvx = \empty
!   \let\Edefcv = \empty
!   \let\deffn = \empty
!   \let\deffnx = \empty
!   \let\Edeffn = \empty
    \let\defindex = \relax
!   \let\defivar = \empty
!   \let\defivarx = \empty
!   \let\Edefivar = \empty
!   \let\defmac = \empty
!   \let\defmacx = \empty
!   \let\Edefmac = \empty
!   \let\defmethod = \empty
!   \let\defmethodx = \empty
!   \let\Edefmethod = \empty
!   \let\defop = \empty
!   \let\defopx = \empty
!   \let\Edefop = \empty
!   \let\defopt = \empty
!   \let\defoptx = \empty
!   \let\Edefopt = \empty
!   \let\defspec = \empty
!   \let\defspecx = \empty
!   \let\Edefspec = \empty
!   \let\deftp = \empty
!   \let\deftpx = \empty
!   \let\Edeftp = \empty
!   \let\deftypefn = \empty
!   \let\deftypefnx = \empty
!   \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\everyfooting = \relax
!   \let\everyheading = \relax
    \let\headings = \relax
    \let\include = \relax
+   \let\item = \relax
    \let\lowersections = \relax
!   \let\oddfooting = \relax
!   \let\oddheading = \relax
!   \let\printindex = \relax
!   \let\pxref = \relax
    \let\raisesections = \relax
!   \let\ref = \relax
    \let\set = \relax
!   \let\setchapternewpage = \relax
!   \let\setchapterstyle = \relax
!   \let\settitle = \relax
!   \let\up = \relax
!   \let\verbatiminclude = \relax
!   \let\xref = \relax
  }
  
! % Ignore @ignore, @ifhtml, @ifinfo, and the like.
  %
! \def\direntry{\doignore{direntry}}
! \def\documentdescriptionword{documentdescription}
! \def\documentdescription{\doignore{documentdescription}}
! \def\html{\doignore{html}}
  \def\ifhtml{\doignore{ifhtml}}
  \def\ifinfo{\doignore{ifinfo}}
+ \def\ifnottex{\nestedignore{ifnottex}}
  \def\ifplaintext{\doignore{ifplaintext}}
! \def\ifxml{\doignore{ifxml}}
! \def\ignore{\doignore{ignore}}
  \def\menu{\doignore{menu}}
! \def\xml{\doignore{xml}}
  
  % @dircategory CATEGORY  -- specify a category of the dir file
  % which this file should belong to.  Ignore this in TeX.
***************
*** 2444,2450 ****
    address@hidden #1{\enddoignore}%
    %
    % Make sure that spaces turn into tokens that match what \doignoretext 
wants.
!   \catcode32 = 10
    %
    % Ignore braces, too, so mismatched braces don't cause trouble.
    \catcode`\{ = 9
--- 2682,2688 ----
    address@hidden #1{\enddoignore}%
    %
    % Make sure that spaces turn into tokens that match what \doignoretext 
wants.
!   \catcode\spaceChar = 10
    %
    % Ignore braces, too, so mismatched braces don't cause trouble.
    \catcode`\{ = 9
***************
*** 2486,2492 ****
      \immediate\write16{If you are running another version of TeX, relax.}
      \immediate\write16{If you are running Unix TeX 3.0, kill this TeX 
process.}
      \immediate\write16{  Then upgrade your TeX installation if you can.}
!     \immediate\write16{  (See ftp://ftp.gnu.org/pub/gnu/TeX.README.)}
      \immediate\write16{If you are stuck with version 3.0, run the}
      \immediate\write16{  script ``tex3patch'' from the Texinfo distribution}
      \immediate\write16{  to use a workaround.}
--- 2724,2730 ----
      \immediate\write16{If you are running another version of TeX, relax.}
      \immediate\write16{If you are running Unix TeX 3.0, kill this TeX 
process.}
      \immediate\write16{  Then upgrade your TeX installation if you can.}
!     \immediate\write16{  (See ftp://ftp.gnu.org/non-gnu/TeX.README.)}
      \immediate\write16{If you are stuck with version 3.0, run the}
      \immediate\write16{  script ``tex3patch'' from the Texinfo distribution}
      \immediate\write16{  to use a workaround.}
***************
*** 2508,2515 ****
    % We must actually expand the ignored text to look for the @end
    % command, so that nested ignore constructs work.  Thus, we put the
    % text into a \vbox and then do nothing with the result.  To minimize
!   % the change of memory overflow, we follow the approach outlined on
!   % page 401 of the TeXbook: make the current font be a dummy font.
    %
    \setbox0 = \vbox\bgroup
      % Don't complain about control sequences we have declared \outer.
--- 2746,2753 ----
    % We must actually expand the ignored text to look for the @end
    % command, so that nested ignore constructs work.  Thus, we put the
    % text into a \vbox and then do nothing with the result.  To minimize
!   % the chance of memory overflow, we follow the approach outlined on
!   % page 401 of the TeXbook.
    %
    \setbox0 = \vbox\bgroup
      % Don't complain about control sequences we have declared \outer.
***************
*** 2530,2537 ****
      %
      % Set the current font to be \nullfont, a TeX primitive, and define
      % all the font commands to also use \nullfont.  We don't use
!     % dummy.tfm, as suggested in the TeXbook, because not all sites
!     % might have that installed.  Therefore, math mode will still
      % produce output, but that should be an extremely small amount of
      % stuff compared to the main input.
      %
--- 2768,2775 ----
      %
      % Set the current font to be \nullfont, a TeX primitive, and define
      % all the font commands to also use \nullfont.  We don't use
!     % dummy.tfm, as suggested in the TeXbook, because some sites
!     % might not have that installed.  Therefore, math mode will still
      % produce output, but that should be an extremely small amount of
      % stuff compared to the main input.
      %
***************
*** 2560,2566 ****
      % Do minimal line-breaking.
      \pretolerance = 10000
      %
!     % Do not execute instructions in @tex
      \def\tex{\doignore{tex}}%
      % Do not execute macro definitions.
      % `c' is a comment character, so the word `macro' will get cut off.
--- 2798,2804 ----
      % Do minimal line-breaking.
      \pretolerance = 10000
      %
!     % Do not execute instructions in @tex.
      \def\tex{\doignore{tex}}%
      % Do not execute macro definitions.
      % `c' is a comment character, so the word `macro' will get cut off.
***************
*** 2605,2611 ****
    % we're called from @code, as @address@hidden  So \let any
    % such active characters to their normal equivalents.
    \gdef\value{\begingroup
!     \catcode`\-=12 \catcode`\_=12
      \indexbreaks \let_\normalunderscore
      \valuexxx}
  }
--- 2843,2849 ----
    % we're called from @code, as @address@hidden  So \let any
    % such active characters to their normal equivalents.
    \gdef\value{\begingroup
!     \catcode`\-=\other \catcode`\_=\other
      \indexbreaks \let_\normalunderscore
      \valuexxx}
  }
***************
*** 2614,2628 ****
  % 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
  % 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
! % winds up in the index file.  This means that if the variable's value
! % contains other Texinfo commands, it's almost certain it will fail
! % (although perhaps we could fix that with sufficient work to do a
! % one-level expansion on the result, instead of complete).
  %
  \def\expandablevalue#1{%
    \expandafter\ifx\csname SET#1\endcsname\relax
      {[No value for ``#1'']}%
    \else
      \csname SET#1\endcsname
    \fi
--- 2852,2868 ----
  % 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
  % whose names contain - or _ still won't work, but we can't do anything
! % about that.  The command has to be fully expandable (if the variable
! % is set), since the result winds up in the index file.  This means that
! % if the variable's value contains other Texinfo commands, it's almost
! % certain it will fail (although perhaps we could fix that with
! % sufficient work to do a one-level expansion on the result, instead of
! % complete).
  %
  \def\expandablevalue#1{%
    \expandafter\ifx\csname SET#1\endcsname\relax
      {[No value for ``#1'']}%
+     \message{Variable `#1', used in @value, is not set.}%
    \else
      \csname SET#1\endcsname
    \fi
***************
*** 2631,2643 ****
  % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  % with @set.
  %
! \def\ifset{\parsearg\ifsetxxx}
! \def\ifsetxxx #1{%
    \expandafter\ifx\csname SET#1\endcsname\relax
!     \expandafter\ifsetfail
    \else
!     \expandafter\ifsetsucceed
    \fi
  }
  \def\ifsetsucceed{\conditionalsucceed{ifset}}
  \def\ifsetfail{\nestedignore{ifset}}
--- 2871,2884 ----
  % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
  % with @set.
  %
! \def\ifset{\parsearg\doifset}
! \def\doifset#1{%
    \expandafter\ifx\csname SET#1\endcsname\relax
!     \let\next=\ifsetfail
    \else
!     \let\next=\ifsetsucceed
    \fi
+   \next
  }
  \def\ifsetsucceed{\conditionalsucceed{ifset}}
  \def\ifsetfail{\nestedignore{ifset}}
***************
*** 2646,2658 ****
  % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
  % defined with @set, or has been undefined with @clear.
  %
! \def\ifclear{\parsearg\ifclearxxx}
! \def\ifclearxxx #1{%
    \expandafter\ifx\csname SET#1\endcsname\relax
!     \expandafter\ifclearsucceed
    \else
!     \expandafter\ifclearfail
    \fi
  }
  \def\ifclearsucceed{\conditionalsucceed{ifclear}}
  \def\ifclearfail{\nestedignore{ifclear}}
--- 2887,2900 ----
  % @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been
  % defined with @set, or has been undefined with @clear.
  %
! \def\ifclear{\parsearg\doifclear}
! \def\doifclear#1{%
    \expandafter\ifx\csname SET#1\endcsname\relax
!     \let\next=\ifclearsucceed
    \else
!     \let\next=\ifclearfail
    \fi
+   \next
  }
  \def\ifclearsucceed{\conditionalsucceed{ifclear}}
  \def\ifclearfail{\nestedignore{ifclear}}
***************
*** 2671,2698 ****
  \defineunmatchedend{ifnotinfo}
  \defineunmatchedend{ifnotplaintext}
  
! % We can't just want to start a group at @iftex (etc.) and end it at
! % @end iftex, since then @set commands inside the conditional have no
! % effect (they'd get reverted at the end of the group).  So we must
! % 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{%
!   \edef\temp{%
!     % Remember the current value of \E#1.
!     \let\nece{prevE#1} = \nece{E#1}%
!     %
!     % At the address@hidden #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.
  \let\definfoenclose=\comment
--- 2913,2925 ----
  \defineunmatchedend{ifnotinfo}
  \defineunmatchedend{ifnotplaintext}
  
! % True conditional.  Since \set globally defines its variables, we can
! % just start and end a group (to keep the @end definition undefined at
! % the outer level).
  %
! \def\conditionalsucceed#1{\begingroup
!   \expandafter\def\csname E#1\endcsname{\endgroup}%
! }
  
  % @defininfoenclose.
  \let\definfoenclose=\comment
***************
*** 2785,2888 ****
  \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  
! % Take care of texinfo commands likely to appear in an index entry.
! % (Must be a way to avoid doing expansion at all, and thus not have to
! % laboriously list every single command here.)
  %
  \def\indexdummies{%
! \def\ { }%
! address@hidden@}% change to @@ when we switch to @ as escape char in aux 
files.
! % Need these in case \tex is in effect and \{ is a \delimiter again.
! % But can't use \lbracecmd and \rbracecmd because texindex assumes
! % braces and backslashes are used only as delimiters.
! \let\{ = \mylbrace
! \let\} = \myrbrace
! \def\_{{\realbackslash _}}%
! \normalturnoffactive
! %
! % Take care of the plain tex accent commands.
! \def\,##1{\realbackslash ,{##1}}%
! \def\"{\realbackslash "}%
! \def\`{\realbackslash `}%
! \def\'{\realbackslash '}%
! \def\^{\realbackslash ^}%
! \def\~{\realbackslash ~}%
! \def\={\realbackslash =}%
! \def\b{\realbackslash b}%
! \def\c{\realbackslash c}%
! \def\d{\realbackslash d}%
! \def\u{\realbackslash u}%
! \def\v{\realbackslash v}%
! \def\H{\realbackslash H}%
! \def\dotless##1{\realbackslash dotless {##1}}%
! % Take care of the plain tex special European modified letters.
! \def\AA{\realbackslash AA}%
! \def\AE{\realbackslash AE}%
! \def\L{\realbackslash L}%
! \def\OE{\realbackslash OE}%
! \def\O{\realbackslash O}%
! \def\aa{\realbackslash aa}%
! \def\ae{\realbackslash ae}%
! \def\l{\realbackslash l}%
! \def\oe{\realbackslash oe}%
! \def\o{\realbackslash o}%
! \def\ss{\realbackslash ss}%
! %
! % Although these internals commands shouldn't show up, sometimes they do.
! \def\bf{\realbackslash bf }%
! \def\gtr{\realbackslash gtr}%
! \def\hat{\realbackslash hat}%
! \def\less{\realbackslash less}%
! %\def\rm{\realbackslash rm }%
! \def\sf{\realbackslash sf}%
! \def\sl{\realbackslash sl }%
! \def\tclose##1{\realbackslash tclose {##1}}%
! \def\tt{\realbackslash tt}%
! %
! \def\b##1{\realbackslash b {##1}}%
! \def\i##1{\realbackslash i {##1}}%
! \def\sc##1{\realbackslash sc {##1}}%
! \def\t##1{\realbackslash t {##1}}%
! \def\r##1{\realbackslash r {##1}}%
! %
! \def\TeX{\realbackslash TeX}%
! \def\acronym##1{\realbackslash acronym {##1}}%
! \def\cite##1{\realbackslash cite {##1}}%
! \def\code##1{\realbackslash code {##1}}%
! \def\command##1{\realbackslash command {##1}}%
! \def\dfn##1{\realbackslash dfn {##1}}%
! \def\dots{\realbackslash dots }%
! \def\emph##1{\realbackslash emph {##1}}%
! \def\env##1{\realbackslash env {##1}}%
! \def\file##1{\realbackslash file {##1}}%
! \def\kbd##1{\realbackslash kbd {##1}}%
! \def\key##1{\realbackslash key {##1}}%
! \def\math##1{\realbackslash math {##1}}%
! \def\option##1{\realbackslash option {##1}}%
! \def\samp##1{\realbackslash samp {##1}}%
! \def\strong##1{\realbackslash strong {##1}}%
! \def\uref##1{\realbackslash uref {##1}}%
! \def\url##1{\realbackslash url {##1}}%
! \def\var##1{\realbackslash var {##1}}%
! \def\w{\realbackslash w }%
! %
! % These math commands don't seem likely to be used in index entries.
! \def\copyright{\realbackslash copyright}%
! \def\equiv{\realbackslash equiv}%
! \def\error{\realbackslash error}%
! \def\expansion{\realbackslash expansion}%
! \def\point{\realbackslash point}%
! \def\print{\realbackslash print}%
! \def\result{\realbackslash 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
! %
! \unsepspaces
! % Turn off macro expansion
! \turnoffmacros
  }
  
  % If an index command is used in an @example environment, any spaces
--- 3012,3177 ----
  \def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer}
  \def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}}
  
! % Take care of Texinfo commands that can appear in an index entry.
! % Since there are some commands we want to expand, and others we don't,
! % we have to laboriously prevent expansion for those that we don't.
  %
  \def\indexdummies{%
!   address@hidden@}% change to @@ when we switch to @ as escape char in index 
files.
!   \def\ {\realbackslash\space }%
!   % Need these in case \tex is in effect and \{ is a \delimiter again.
!   % But can't use \lbracecmd and \rbracecmd because texindex assumes
!   % braces and backslashes are used only as delimiters.
!   \let\{ = \mylbrace
!   \let\} = \myrbrace
!   %
!   % \definedummyword defines \#1 as \realbackslash #1\space, thus
!   % effectively preventing its expansion.  This is used only for control
!   % words, not control letters, because the \space would be incorrect
!   % for control characters, but is needed to separate the control word
!   % from whatever follows.
!   %
!   % For control letters, we have \definedummyletter, which omits the
!   % space.
!   %
!   % These can be used both for control words that take an argument and
!   % those that do not.  If it is followed by {arg} in the input, then
!   % that will dutifully get written to the index (or wherever).
!   %
!   \def\definedummyword##1{%
!     \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}%
!   }%
!   \def\definedummyletter##1{%
!     \expandafter\def\csname ##1\endcsname{\realbackslash ##1}%
!   }%
!   %
!   % Do the redefinitions.
!   \commondummies
! }
! 
! % For the aux file, @ is the escape character.  So we want to redefine
! % everything using @ instead of \realbackslash.  When everything uses
! % @, this will be simpler.
! %
! \def\atdummies{%
!   address@hidden@@}%
!   \def\ {@ }%
!   \let\{ = \lbraceatcmd
!   \let\} = \rbraceatcmd
!   %
!   % (See comments in \indexdummies.)
!   \def\definedummyword##1{%
!     \expandafter\def\csname address@hidden
!   }%
!   \def\definedummyletter##1{%
!     \expandafter\def\csname address@hidden
!   }%
!   %
!   % Do the redefinitions.
!   \commondummies
! }
! 
! % Called from \indexdummies and \atdummies.  \definedummyword and
! % \definedummyletter must be defined first.
! %
! \def\commondummies{%
!   %
!   \normalturnoffactive
!   %
!   % Control letters and accents.
!   \definedummyletter{_}%
!   \definedummyletter{,}%
!   \definedummyletter{"}%
!   \definedummyletter{`}%
!   \definedummyletter{'}%
!   \definedummyletter{^}%
!   \definedummyletter{~}%
!   \definedummyletter{=}%
!   \definedummyword{u}%
!   \definedummyword{v}%
!   \definedummyword{H}%
!   \definedummyword{dotaccent}%
!   \definedummyword{ringaccent}%
!   \definedummyword{tieaccent}%
!   \definedummyword{ubaraccent}%
!   \definedummyword{udotaccent}%
!   \definedummyword{dotless}%
!   %
!   % Other non-English letters.
!   \definedummyword{AA}%
!   \definedummyword{AE}%
!   \definedummyword{L}%
!   \definedummyword{OE}%
!   \definedummyword{O}%
!   \definedummyword{aa}%
!   \definedummyword{ae}%
!   \definedummyword{l}%
!   \definedummyword{oe}%
!   \definedummyword{o}%
!   \definedummyword{ss}%
!   %
!   % 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
***************
*** 2891,2973 ****
  {\obeyspaces
   \gdef\unsepspaces{\obeyspaces\let =\space}}
  
! % \indexnofonts no-ops all font-change commands.
! % This is used when outputting the strings to sort the index by.
! \def\indexdummyfont#1{#1}
  \def\indexdummytex{TeX}
  \def\indexdummydots{...}
! 
  \def\indexnofonts{%
! address@hidden@}%
! % how to handle braces?
! \def\_{\normalunderscore}%
! %
! \let\,=\indexdummyfont
! \let\"=\indexdummyfont
! \let\`=\indexdummyfont
! \let\'=\indexdummyfont
! \let\^=\indexdummyfont
! \let\~=\indexdummyfont
! \let\==\indexdummyfont
! \let\b=\indexdummyfont
! \let\c=\indexdummyfont
! \let\d=\indexdummyfont
! \let\u=\indexdummyfont
! \let\v=\indexdummyfont
! \let\H=\indexdummyfont
! \let\dotless=\indexdummyfont
! % Take care of the plain tex special European modified letters.
! \def\AA{AA}%
! \def\AE{AE}%
! \def\L{L}%
! \def\OE{OE}%
! \def\O{O}%
! \def\aa{aa}%
! \def\ae{ae}%
! \def\l{l}%
! \def\oe{oe}%
! \def\o{o}%
! \def\ss{ss}%
! %
! % Don't no-op \tt, since it isn't a user-level command
! % and is used in the definitions of the active chars like <, >, |, etc.
! % Likewise with the other plain tex font commands.
! %\let\tt=\indexdummyfont
! %
! \let\b=\indexdummyfont
! \let\i=\indexdummyfont
! \let\r=\indexdummyfont
! \let\sc=\indexdummyfont
! \let\t=\indexdummyfont
! %
! \let\TeX=\indexdummytex
! \let\acronym=\indexdummyfont
! \let\cite=\indexdummyfont
! \let\code=\indexdummyfont
! \let\command=\indexdummyfont
! \let\dfn=\indexdummyfont
! \let\dots=\indexdummydots
! \let\emph=\indexdummyfont
! \let\env=\indexdummyfont
! \let\file=\indexdummyfont
! \let\kbd=\indexdummyfont
! \let\key=\indexdummyfont
! \let\math=\indexdummyfont
! \let\option=\indexdummyfont
! \let\samp=\indexdummyfont
! \let\strong=\indexdummyfont
! \let\uref=\indexdummyfont
! \let\url=\indexdummyfont
! \let\var=\indexdummyfont
! \let\w=\indexdummyfont
! }
! 
! % To define \realbackslash, we must make \ not be an escape.
! % We must first make another character (@) an escape
! % so we do not become unable to do a definition.
! 
! address@hidden \catcode`\\=\other
!  @address@hidden
  
  \let\indexbackslash=0  %overridden during \printindex.
  \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
--- 3180,3265 ----
  {\obeyspaces
   \gdef\unsepspaces{\obeyspaces\let =\space}}
  
! 
! % \indexnofonts is used when outputting the strings to sort the index
! % by, and when constructing control sequence names.  It eliminates all
! % control sequences and just writes whatever the best ASCII sort string
! % would be for a given command (usually its argument).
! %
  \def\indexdummytex{TeX}
  \def\indexdummydots{...}
! %
  \def\indexnofonts{%
!   \def\ { }%
!   address@hidden@}%
!   % how to handle braces?
!   \def\_{\normalunderscore}%
!   %
!   \let\,=\asis
!   \let\"=\asis
!   \let\`=\asis
!   \let\'=\asis
!   \let\^=\asis
!   \let\~=\asis
!   \let\==\asis
!   \let\u=\asis
!   \let\v=\asis
!   \let\H=\asis
!   \let\dotaccent=\asis
!   \let\ringaccent=\asis
!   \let\tieaccent=\asis
!   \let\ubaraccent=\asis
!   \let\udotaccent=\asis
!   \let\dotless=\asis
!   %
!   % Other non-English letters.
!   \def\AA{AA}%
!   \def\AE{AE}%
!   \def\L{L}%
!   \def\OE{OE}%
!   \def\O{O}%
!   \def\aa{aa}%
!   \def\ae{ae}%
!   \def\l{l}%
!   \def\oe{oe}%
!   \def\o{o}%
!   \def\ss{ss}%
!   \def\exclamdown{!}%
!   \def\questiondown{?}%
!   %
!   % Don't no-op \tt, since it isn't a user-level command
!   % and is used in the definitions of the active chars like <, >, |, etc.
!   % Likewise with the other plain tex font commands.
!   %\let\tt=\asis
!   %
!   % Texinfo font commands.
!   \let\b=\asis
!   \let\i=\asis
!   \let\r=\asis
!   \let\sc=\asis
!   \let\t=\asis
!   %
!   \let\TeX=\indexdummytex
!   \let\acronym=\asis
!   \let\cite=\asis
!   \let\code=\asis
!   \let\command=\asis
!   \let\dfn=\asis
!   \let\dots=\indexdummydots
!   \let\emph=\asis
!   \let\env=\asis
!   \let\file=\asis
!   \let\kbd=\asis
!   \let\key=\asis
!   \let\math=\asis
!   \let\option=\asis
!   \let\samp=\asis
!   \let\strong=\asis
!   \let\uref=\asis
!   \let\url=\asis
!   \let\var=\asis
!   \let\w=\asis
! }
  
  \let\indexbackslash=0  %overridden during \printindex.
  \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
***************
*** 2999,3026 ****
          \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined 
now
          % so it will be output as is; and it will print as backslash.
          %
!         \def\thirdarg{#3}%
!         %
!         % 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}%
          %
!         % If the third (subentry) arg is present, add it to the index
!         % line to write.
          \ifx\thirdarg\emptymacro \else
!           \toks0 = \expandafter{\the\toks0{#3}}%
          \fi
          %
          % Set up the complete index entry, with both the sort key and
          % the original text, including any font commands.  We write
          % three arguments to \entry to the .?? file (four in the
--- 3291,3314 ----
          \def\rawbackslashxx{\indexbackslash}% \indexbackslash isn't defined 
now
          % so it will be output as is; and it will print as backslash.
          %
!         % The main index entry text.
          \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
!            % line to write.
!           \toks0 = \expandafter{\the\toks0 \space #3}%
          \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
          % the original text, including any font commands.  We write
          % three arguments to \entry to the .?? file (four in the
***************
*** 3051,3062 ****
          \iflinks
            \ifvmode
              \skip0 = \lastskip
!             \ifdim\lastskip = 0pt \else \nobreak\vskip-\lastskip \fi
            \fi
            %
            \temp % do the write
            %
-           %
            \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
          \fi
        }%
--- 3339,3349 ----
          \iflinks
            \ifvmode
              \skip0 = \lastskip
!             \ifdim\lastskip = 0pt \else \nobreak\vskip-\skip0 \fi
            \fi
            %
            \temp % do the write
            %
            \ifvmode \ifdim\skip0 = 0pt \else \nobreak\vskip\skip0 \fi \fi
          \fi
        }%
***************
*** 3106,3111 ****
--- 3393,3399 ----
    %
    \smallfonts \rm
    \tolerance = 9500
+   \everypar = {}% don't want the \kern\-parindent from indentation 
suppression.
    \indexbreaks
    %
    % See if the index file exists and is nonempty.
***************
*** 3487,3492 ****
--- 3775,3781 ----
      \numberedsubsubseczzz{#2}
    \fi
  \fi
+ \suppressfirstparagraphindent
  }
  
  % like \numhead, but chooses appendix heading levels
***************
*** 3506,3511 ****
--- 3795,3801 ----
      \appendixsubsubseczzz{#2}
    \fi
  \fi
+ \suppressfirstparagraphindent
  }
  
  % like \numhead, but chooses numberless heading levels
***************
*** 3525,3530 ****
--- 3815,3821 ----
      \unnumberedsubsubseczzz{#2}
    \fi
  \fi
+ \suppressfirstparagraphindent
  }
  
  % @chapter, @appendix, @unnumbered.
***************
*** 3532,3573 ****
  \outer\def\chapter{\parsearg\chapteryyy}
  \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
  \def\chapterzzz #1{%
! \secno=0 \subsecno=0 \subsubsecno=0
! \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
! \chapmacro {#1}{\the\chapno}%
! \gdef\thissection{#1}%
! \gdef\thischaptername{#1}%
! % We don't substitute the actual chapter name into \thischapter
! % because we don't want its macros evaluated now.
! \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash chapentry{\the\toks0}%
!                                   {\the\chapno}}}%
! \temp
! \donoderef
! \global\let\section = \numberedsec
! \global\let\subsection = \numberedsubsec
! \global\let\subsubsection = \numberedsubsubsec
! }
  
  \outer\def\appendix{\parsearg\appendixyyy}
  \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
  \def\appendixzzz #1{%
! \secno=0 \subsecno=0 \subsubsecno=0
! \global\advance \appendixno by 1
! \message{\putwordAppendix\space \appendixletter}%
! \chapmacro {#1}{\putwordAppendix{} \appendixletter}%
! \gdef\thissection{#1}%
! \gdef\thischaptername{#1}%
! \xdef\thischapter{\putwordAppendix{} \appendixletter: 
\noexpand\thischaptername}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash appendixentry{\the\toks0}%
!                        {\appendixletter}}}%
! \temp
! \appendixnoderef
! \global\let\section = \appendixsec
! \global\let\subsection = \appendixsubsec
! \global\let\subsubsection = \appendixsubsubsec
  }
  
  % @centerchap is like @unnumbered, but the heading is centered.
--- 3823,3863 ----
  \outer\def\chapter{\parsearg\chapteryyy}
  \def\chapteryyy #1{\numhead0{#1}} % normally numhead0 calls chapterzzz
  \def\chapterzzz #1{%
!   \secno=0 \subsecno=0 \subsubsecno=0
!   \global\advance \chapno by 1 \message{\putwordChapter\space \the\chapno}%
!   \chapmacro {#1}{\the\chapno}%
!   \gdef\thissection{#1}%
!   \gdef\thischaptername{#1}%
!   % We don't substitute the actual chapter name into \thischapter
!   % because we don't want its macros evaluated now.
!   \xdef\thischapter{\putwordChapter{} \the\chapno: \noexpand\thischaptername}%
!   \writetocentry{chap}{#1}{{\the\chapno}}
!   \donoderef
!   \global\let\section = \numberedsec
!   \global\let\subsection = \numberedsubsec
!   \global\let\subsubsection = \numberedsubsubsec
! }
! 
! % we use \chapno to avoid indenting back
! \def\appendixbox#1{%
!   \setbox0 = \hbox{\putwordAppendix{} \the\chapno}%
!   \hbox to \wd0{#1\hss}}
  
  \outer\def\appendix{\parsearg\appendixyyy}
  \def\appendixyyy #1{\apphead0{#1}} % normally apphead0 calls appendixzzz
  \def\appendixzzz #1{%
!   \secno=0 \subsecno=0 \subsubsecno=0
!   \global\advance \appendixno by 1
!   \message{\putwordAppendix\space \appendixletter}%
!   \chapmacro {#1}{\appendixbox{\putwordAppendix{} \appendixletter}}%
!   \gdef\thissection{#1}%
!   \gdef\thischaptername{#1}%
!   \xdef\thischapter{\putwordAppendix{} \appendixletter: 
\noexpand\thischaptername}%
!   \writetocentry{appendix}{#1}{{\appendixletter}}
!   \appendixnoderef
!   \global\let\section = \appendixsec
!   \global\let\subsection = \appendixsubsec
!   \global\let\subsubsection = \appendixsubsubsec
  }
  
  % @centerchap is like @unnumbered, but the heading is centered.
***************
*** 3580,3729 ****
  \outer\def\unnumbered{\parsearg\unnumberedyyy}
  \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
  \def\unnumberedzzz #1{%
! \secno=0 \subsecno=0 \subsubsecno=0
! %
! % This used to be simply \message{#1}, but TeX fully expands the
! % argument to \message.  Therefore, if #1 contained @-commands, TeX
! % expanded them.  For example, in address@hidden The @cite{Book}', TeX
! % expanded @cite (which turns out to cause errors because \cite is meant
! % to be executed, not expanded).
! %
! % Anyway, we don't want the fully-expanded definition of @cite to appear
! % as a result of the \message, we just want address@hidden' itself.  We use
! % \the<toks register> to achieve this: TeX expands \the<toks> only once,
! % simply yielding the contents of <toks register>.  (We also do this for
! % the toc entries.)
! \toks0 = {#1}\message{(\the\toks0)}%
! %
! \unnumbchapmacro {#1}%
! \gdef\thischapter{#1}\gdef\thissection{#1}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash 
unnumbchapentry{\the\toks0}}}%
! \temp
! \unnumbnoderef
! \global\let\section = \unnumberedsec
! \global\let\subsection = \unnumberedsubsec
! \global\let\subsubsection = \unnumberedsubsubsec
  }
  
  % Sections.
  \outer\def\numberedsec{\parsearg\secyyy}
  \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
  \def\seczzz #1{%
! \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
! \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
!                                   {\the\chapno}{\the\secno}}}%
! \temp
! \donoderef
! \nobreak
  }
  
  \outer\def\appendixsection{\parsearg\appendixsecyyy}
  \outer\def\appendixsec{\parsearg\appendixsecyyy}
  \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
  \def\appendixsectionzzz #1{%
! \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
! \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash secentry{\the\toks0}%
!                                   {\appendixletter}{\the\secno}}}%
! \temp
! \appendixnoderef
! \nobreak
  }
  
  \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
  \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
  \def\unnumberedseczzz #1{%
! \plainsecheading {#1}\gdef\thissection{#1}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsecentry%
!   {\the\toks0}{\the\chapno}}}%
! \temp
! \unnumbnoderef
! \nobreak
  }
  
  % Subsections.
  \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
  \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
  \def\numberedsubseczzz #1{%
! \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
! \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
!                                     
{\the\chapno}{\the\secno}{\the\subsecno}}}%
! \temp
! \donoderef
! \nobreak
  }
  
  \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
  \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
  \def\appendixsubseczzz #1{%
! \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
! \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash subsecentry{\the\toks0}%
!                                 
{\appendixletter}{\the\secno}{\the\subsecno}}}%
! \temp
! \appendixnoderef
! \nobreak
  }
  
  \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
  \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls 
unnumberedsubseczzz
  \def\unnumberedsubseczzz #1{%
! \plainsubsecheading {#1}\gdef\thissection{#1}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsecentry%
!   {\the\toks0}{\the\chapno}{\the\secno}}}%
! \temp
! \unnumbnoderef
! \nobreak
  }
  
  % Subsubsections.
  \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
  \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
  \def\numberedsubsubseczzz #1{%
! \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
! \subsubsecheading {#1}
!   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
!   {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
! \temp
! \donoderef
! \nobreak
  }
  
  \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
  \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
  \def\appendixsubsubseczzz #1{%
! \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
! \subsubsecheading {#1}
!   {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash subsubsecentry{\the\toks0}%
!   {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}}%
! \temp
! \appendixnoderef
! \nobreak
  }
  
  \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
  \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally 
unnumberedsubsubseczzz
  \def\unnumberedsubsubseczzz #1{%
! \plainsubsubsecheading {#1}\gdef\thissection{#1}%
! \toks0 = {#1}%
! \edef\temp{\noexpand\writetocentry{\realbackslash unnumbsubsubsecentry%
!   {\the\toks0}{\the\chapno}{\the\secno}{\the\subsecno}}}%
! \temp
! \unnumbnoderef
! \nobreak
  }
  
  % These are variants which are not "outer", so they can appear in @ifinfo.
--- 3870,3990 ----
  \outer\def\unnumbered{\parsearg\unnumberedyyy}
  \def\unnumberedyyy #1{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz
  \def\unnumberedzzz #1{%
!   \secno=0 \subsecno=0 \subsubsecno=0
!   %
!   % This used to be simply \message{#1}, but TeX fully expands the
!   % argument to \message.  Therefore, if #1 contained @-commands, TeX
!   % expanded them.  For example, in address@hidden The @cite{Book}', TeX
!   % expanded @cite (which turns out to cause errors because \cite is meant
!   % to be executed, not expanded).
!   %
!   % Anyway, we don't want the fully-expanded definition of @cite to appear
!   % as a result of the \message, we just want address@hidden' itself.  We use
!   % \the<toks register> to achieve this: TeX expands \the<toks> only once,
!   % simply yielding the contents of <toks register>.  (We also do this for
!   % the toc entries.)
!   \toks0 = {#1}\message{(\the\toks0)}%
!   %
!   \unnumbchapmacro {#1}%
!   \gdef\thischapter{#1}\gdef\thissection{#1}%
!   \writetocentry{unnumbchap}{#1}{{\the\chapno}}
!   \unnumbnoderef
!   \global\let\section = \unnumberedsec
!   \global\let\subsection = \unnumberedsubsec
!   \global\let\subsubsection = \unnumberedsubsubsec
  }
  
  % Sections.
  \outer\def\numberedsec{\parsearg\secyyy}
  \def\secyyy #1{\numhead1{#1}} % normally calls seczzz
  \def\seczzz #1{%
!   \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
!   \gdef\thissection{#1}\secheading {#1}{\the\chapno}{\the\secno}%
!   \writetocentry{sec}{#1}{{\the\chapno}{\the\secno}}
!   \donoderef
!   \nobreak
  }
  
  \outer\def\appendixsection{\parsearg\appendixsecyyy}
  \outer\def\appendixsec{\parsearg\appendixsecyyy}
  \def\appendixsecyyy #1{\apphead1{#1}} % normally calls appendixsectionzzz
  \def\appendixsectionzzz #1{%
!   \subsecno=0 \subsubsecno=0 \global\advance \secno by 1 %
!   \gdef\thissection{#1}\secheading {#1}{\appendixletter}{\the\secno}%
!   \writetocentry{sec}{#1}{{\appendixletter}{\the\secno}}
!   \appendixnoderef
!   \nobreak
  }
  
  \outer\def\unnumberedsec{\parsearg\unnumberedsecyyy}
  \def\unnumberedsecyyy #1{\unnmhead1{#1}} % normally calls unnumberedseczzz
  \def\unnumberedseczzz #1{%
!   \plainsecheading {#1}\gdef\thissection{#1}%
!   \writetocentry{unnumbsec}{#1}{{\the\chapno}{\the\secno}}
!   \unnumbnoderef
!   \nobreak
  }
  
  % Subsections.
  \outer\def\numberedsubsec{\parsearg\numberedsubsecyyy}
  \def\numberedsubsecyyy #1{\numhead2{#1}} % normally calls numberedsubseczzz
  \def\numberedsubseczzz #1{%
!   \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
!   \subsecheading {#1}{\the\chapno}{\the\secno}{\the\subsecno}%
!   \writetocentry{subsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
!   \donoderef
!   \nobreak
  }
  
  \outer\def\appendixsubsec{\parsearg\appendixsubsecyyy}
  \def\appendixsubsecyyy #1{\apphead2{#1}} % normally calls appendixsubseczzz
  \def\appendixsubseczzz #1{%
!   \gdef\thissection{#1}\subsubsecno=0 \global\advance \subsecno by 1 %
!   \subsecheading {#1}{\appendixletter}{\the\secno}{\the\subsecno}%
!   \writetocentry{subsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}}
!   \appendixnoderef
!   \nobreak
  }
  
  \outer\def\unnumberedsubsec{\parsearg\unnumberedsubsecyyy}
  \def\unnumberedsubsecyyy #1{\unnmhead2{#1}} %normally calls 
unnumberedsubseczzz
  \def\unnumberedsubseczzz #1{%
!   \plainsubsecheading {#1}\gdef\thissection{#1}%
!   \writetocentry{unnumbsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}}
!   \unnumbnoderef
!   \nobreak
  }
  
  % Subsubsections.
  \outer\def\numberedsubsubsec{\parsearg\numberedsubsubsecyyy}
  \def\numberedsubsubsecyyy #1{\numhead3{#1}} % normally numberedsubsubseczzz
  \def\numberedsubsubseczzz #1{%
!   \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
!   \subsubsecheading {#1}
!     {\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
!   
\writetocentry{subsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
!   \donoderef
!   \nobreak
  }
  
  \outer\def\appendixsubsubsec{\parsearg\appendixsubsubsecyyy}
  \def\appendixsubsubsecyyy #1{\apphead3{#1}} % normally appendixsubsubseczzz
  \def\appendixsubsubseczzz #1{%
!   \gdef\thissection{#1}\global\advance \subsubsecno by 1 %
!   \subsubsecheading {#1}
!     {\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}%
!   
\writetocentry{subsubsec}{#1}{{\appendixletter}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
!   \appendixnoderef
!   \nobreak
  }
  
  \outer\def\unnumberedsubsubsec{\parsearg\unnumberedsubsubsecyyy}
  \def\unnumberedsubsubsecyyy #1{\unnmhead3{#1}} %normally 
unnumberedsubsubseczzz
  \def\unnumberedsubsubseczzz #1{%
!   \plainsubsubsecheading {#1}\gdef\thissection{#1}%
!   
\writetocentry{unnumbsubsubsec}{#1}{{\the\chapno}{\the\secno}{\the\subsecno}{\the\subsubsecno}}
!   \unnumbnoderef
!   \nobreak
  }
  
  % These are variants which are not "outer", so they can appear in @ifinfo.
***************
*** 3764,3779 ****
  
  \def\majorheading{\parsearg\majorheadingzzz}
  \def\majorheadingzzz #1{%
! {\advance\chapheadingskip by 10pt \chapbreak }%
! {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
!                   \parindent=0pt\raggedright
!                   \rm #1\hfill}}\bigskip \par\penalty 200}
  
  \def\chapheading{\parsearg\chapheadingzzz}
  \def\chapheadingzzz #1{\chapbreak %
! {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
!                   \parindent=0pt\raggedright
!                   \rm #1\hfill}}\bigskip \par\penalty 200}
  
  % @heading, @subheading, @subsubheading.
  \def\heading{\parsearg\plainsecheading}
--- 4025,4040 ----
  
  \def\majorheading{\parsearg\majorheadingzzz}
  \def\majorheadingzzz #1{%
!   {\advance\chapheadingskip by 10pt \chapbreak }%
!   {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
!                     \parindent=0pt\raggedright
!                     \rm #1\hfill}}\bigskip \par\penalty 200}
  
  \def\chapheading{\parsearg\chapheadingzzz}
  \def\chapheadingzzz #1{\chapbreak %
!   {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000
!                     \parindent=0pt\raggedright
!                     \rm #1\hfill}}\bigskip \par\penalty 200}
  
  % @heading, @subheading, @subsubheading.
  \def\heading{\parsearg\plainsecheading}
***************
*** 3919,3925 ****
            \hangindent = \wd0 % zero if no section number
            \unhbox0 #3}%
    }%
!   \ifdim\parskip<10pt \nobreak\kern10pt\nobreak\kern-\parskip\fi \nobreak
  }
  
  
--- 4180,4195 ----
            \hangindent = \wd0 % zero if no section number
            \unhbox0 #3}%
    }%
!   % Add extra space after the heading -- either a line space or a
!   % paragraph space, whichever is more.  (Some people like to set
!   % \parskip to large values for some reason.)  Don't allow stretch, though.
!   \nobreak
!   \ifdim\parskip>\normalbaselineskip
!     \kern\parskip
!   \else
!     \kern\normalbaselineskip
!   \fi
!   \nobreak
  }
  
  
***************
*** 3931,3946 ****
  % 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.
  %
! % We open the .toc file here instead of at @setfilename or any other
! % fixed time so that @contents can be put in the document anywhere.
  %
  \newif\iftocfileopened
! \def\writetocentry#1{%
    \iftocfileopened\else
      \immediate\openout\tocfile = \jobname.toc
      \global\tocfileopenedtrue
    \fi
!   \iflinks \write\tocfile{#1{\folio}}\fi
    %
    % 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
--- 4201,4222 ----
  % 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.
  %
! % Usage: \writetocentry{chap}{The Name of The Game}{{\the\chapno}}
! % 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
! \def\writetocentry#1#2#3{%
    \iftocfileopened\else
      \immediate\openout\tocfile = \jobname.toc
      \global\tocfileopenedtrue
    \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
    % will be the target of the links in the table of contents.  We can't
***************
*** 3979,3985 ****
        \advance\hsize by -\contentsrightmargin % Don't use the full line 
length.
        %
        % Roman numerals for page numbers.
!       \ifnum \pageno>0 \pageno = \lastnegativepageno \fi
  }
  
  
--- 4255,4261 ----
        \advance\hsize by -\contentsrightmargin % Don't use the full line 
length.
        %
        % Roman numerals for page numbers.
!       \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
  }
  
  
***************
*** 3996,4002 ****
       \pdfmakeoutlines
     \endgroup
     \lastnegativepageno = \pageno
!    \pageno = \savepageno
  }
  
  % And just the chapters.
--- 4272,4278 ----
       \pdfmakeoutlines
     \endgroup
     \lastnegativepageno = \pageno
!    \global\pageno = \savepageno
  }
  
  % And just the chapters.
***************
*** 4008,4023 ****
        \let\unnumbchapentry = \shortunnumberedentry
        % We want a true roman here for the page numbers.
        \secfonts
!       \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
        \rm
        \hyphenpenalty = 10000
        \advance\baselineskip by 1pt % Open it up a little.
        \def\secentry ##1##2##3##4{}
-       \def\unnumbsecentry ##1##2##3{}
        \def\subsecentry ##1##2##3##4##5{}
-       \def\unnumbsubsecentry ##1##2##3##4{}
        \def\subsubsecentry ##1##2##3##4##5##6{}
!       \def\unnumbsubsubsecentry ##1##2##3##4##5{}
        \openin 1 \jobname.toc
        \ifeof 1 \else
          \closein 1
--- 4284,4300 ----
        \let\unnumbchapentry = \shortunnumberedentry
        % We want a true roman here for the page numbers.
        \secfonts
!       \let\rm=\shortcontrm \let\bf=\shortcontbf
!       \let\sl=\shortcontsl \let\tt=\shortconttt
        \rm
        \hyphenpenalty = 10000
        \advance\baselineskip by 1pt % Open it up a little.
        \def\secentry ##1##2##3##4{}
        \def\subsecentry ##1##2##3##4##5{}
        \def\subsubsecentry ##1##2##3##4##5##6{}
!       \let\unnumbsecentry = \secentry
!       \let\unnumbsubsecentry = \subsecentry
!       \let\unnumbsubsubsecentry = \subsubsecentry
        \openin 1 \jobname.toc
        \ifeof 1 \else
          \closein 1
***************
*** 4027,4033 ****
       \contentsalignmacro % in case @setchapternewpage odd is in effect
     \endgroup
     \lastnegativepageno = \pageno
!    \pageno = \savepageno
  }
  \let\shortcontents = \summarycontents
  
--- 4304,4310 ----
       \contentsalignmacro % in case @setchapternewpage odd is in effect
     \endgroup
     \lastnegativepageno = \pageno
!    \global\pageno = \savepageno
  }
  \let\shortcontents = \summarycontents
  
***************
*** 4050,4056 ****
  }
  
  % Appendices, in the main contents.
! \def\appendixentry#1#2#3{\dochapentry{\putwordAppendix{} #2\labelspace#1}{#3}}
  %
  % Appendices, in the short toc.
  \let\shortappendixentry = \shortchapentry
--- 4327,4334 ----
  }
  
  % Appendices, in the main contents.
! \def\appendixentry#1#2#3{%
!   \dochapentry{\appendixbox{\putwordAppendix{} #2}\labelspace#1}{#3}}
  %
  % Appendices, in the short toc.
  \let\shortappendixentry = \shortchapentry
***************
*** 4074,4094 ****
  }
  
  % Unnumbered chapters.
! \def\unnumbchapentry#1#2{\dochapentry{#1}{#2}}
! \def\shortunnumberedentry#1#2{\tocentry{#1}{\doshortpageno\bgroup#2\egroup}}
  
  % Sections.
  \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
! \def\unnumbsecentry#1#2#3{\dosecentry{#1}{#3}}
  
  % Subsections.
  \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
! \def\unnumbsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}}
  
  % And subsubsections.
  \def\subsubsecentry#1#2#3#4#5#6{%
    \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
! \def\unnumbsubsubsecentry#1#2#3#4#5{\dosubsubsecentry{#1}{#5}}
  
  % This parameter controls the indentation of the various levels.
  \newdimen\tocindent \tocindent = 3pc
--- 4352,4372 ----
  }
  
  % Unnumbered chapters.
! \def\unnumbchapentry#1#2#3{\dochapentry{#1}{#3}}
! \def\shortunnumberedentry#1#2#3{\tocentry{#1}{\doshortpageno\bgroup#3\egroup}}
  
  % Sections.
  \def\secentry#1#2#3#4{\dosecentry{#2.#3\labelspace#1}{#4}}
! \def\unnumbsecentry#1#2#3#4{\dosecentry{#1}{#4}}
  
  % Subsections.
  \def\subsecentry#1#2#3#4#5{\dosubsecentry{#2.#3.#4\labelspace#1}{#5}}
! \def\unnumbsubsecentry#1#2#3#4#5{\dosubsecentry{#1}{#5}}
  
  % And subsubsections.
  \def\subsubsecentry#1#2#3#4#5#6{%
    \dosubsubsecentry{#2.#3.#4.#5\labelspace#1}{#6}}
! \def\unnumbsubsubsecentry#1#2#3#4#5#6{\dosubsubsecentry{#1}{#6}}
  
  % This parameter controls the indentation of the various levels.
  \newdimen\tocindent \tocindent = 3pc
***************
*** 4190,4203 ****
  \def\tex{\begingroup
    \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
    \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
!   \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
    \catcode `\%=14
!   \catcode 43=12 % plus
!   \catcode`\"=12
!   \catcode`\==12
!   \catcode`\|=12
!   \catcode`\<=12
!   \catcode`\>=12
    \escapechar=`\\
    %
    \let\b=\ptexb
--- 4468,4481 ----
  \def\tex{\begingroup
    \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
    \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
!   \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
    \catcode `\%=14
!   \catcode `\+=\other
!   \catcode `\"=\other
!   \catcode `\==\other
!   \catcode `\|=\other
!   \catcode `\<=\other
!   \catcode `\>=\other
    \escapechar=`\\
    %
    \let\b=\ptexb
***************
*** 4209,4217 ****
--- 4487,4497 ----
    \let\equiv=\ptexequiv
    \let\!=\ptexexclam
    \let\i=\ptexi
+   \let\indent=\ptexindent
    \let\{=\ptexlbrace
    \let\+=\tabalign
    \let\}=\ptexrbrace
+   \let\/=\ptexslash
    \let\*=\ptexstar
    \let\t=\ptext
    %
***************
*** 4251,4265 ****
  % Make spacing and below environment symmetrical.  We use \parskip here
  % to help in doing that, since in @example-like environments \parskip
  % is reset to zero; thus the \afterenvbreak inserts no space -- but the
! % start of the next paragraph will insert \parskip
  %
  \def\aboveenvbreak{{%
!   \ifnum\lastpenalty < 10000
      \advance\envskipamount by \parskip
      \endgraf
      \ifdim\lastskip<\envskipamount
        \removelastskip
!       \penalty-50
        \vskip\envskipamount
      \fi
    \fi
--- 4531,4548 ----
  % Make spacing and below environment symmetrical.  We use \parskip here
  % to help in doing that, since in @example-like environments \parskip
  % is reset to zero; thus the \afterenvbreak inserts no space -- but the
! % start of the next paragraph will insert \parskip.
  %
  \def\aboveenvbreak{{%
!   % =10000 instead of <10000 because of a special case in \itemzzz, q.v.
!   \ifnum \lastpenalty=10000 \else
      \advance\envskipamount by \parskip
      \endgraf
      \ifdim\lastskip<\envskipamount
        \removelastskip
!       % it's not a good place to break if the last penalty was \nobreak
!       % or better ...
!       \ifnum\lastpenalty>10000 \else \penalty-50 \fi
        \vskip\envskipamount
      \fi
    \fi
***************
*** 4291,4297 ****
  %
  \newskip\lskip\newskip\rskip
  
! \long\def\cartouche{%
  \begingroup
          \lskip=\leftskip \rskip=\rightskip
          \leftskip=0pt\rightskip=0pt %we want these *outside*.
--- 4574,4581 ----
  %
  \newskip\lskip\newskip\rskip
  
! \def\cartouche{%
! \par  % can't be in the midst of a paragraph.
  \begingroup
          \lskip=\leftskip \rskip=\rightskip
          \leftskip=0pt\rightskip=0pt %we want these *outside*.
***************
*** 4338,4344 ****
    \inENV % This group ends at the end of the body
    \hfuzz = 12pt % Don't be fussy
    \sepspaces % Make spaces be word-separators rather than space tokens.
-   \singlespace
    \let\par = \lisppar % don't ignore blank lines
    \obeylines % each line of input is a line of output
    \parskip = 0pt
--- 4622,4627 ----
***************
*** 4377,4403 ****
  % @example: Same as @lisp.
  \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
  
! % @small... is usually equivalent to the non-small (@smallbook
! % 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 address@hidden
! \def\smalllispx{\begingroup
    \def\Esmalllisp{\nonfillfinish\endgroup}%
    \def\Esmallexample{\nonfillfinish\endgroup}%
    \smallexamplefonts
    \lisp
  }
  
  % @display: same as @lisp except keep current font.
  %
--- 4660,4675 ----
  % @example: Same as @lisp.
  \def\example{\begingroup \def\Eexample{\nonfillfinish\endgroup}\lisp}
  
! % @smallexample and @smalllisp: use smaller fonts.
  % Originally contributed by address@hidden
! \def\smalllisp{\begingroup
    \def\Esmalllisp{\nonfillfinish\endgroup}%
    \def\Esmallexample{\nonfillfinish\endgroup}%
    \smallexamplefonts
    \lisp
  }
+ \let\smallexample = \smalllisp
+ 
  
  % @display: same as @lisp except keep current font.
  %
***************
*** 4407,4415 ****
    \gobble
  }
  %
! % @smalldisplay (when @smallbook): @display plus smaller fonts.
  %
! \def\smalldisplayx{\begingroup
    \def\Esmalldisplay{\nonfillfinish\endgroup}%
    \smallexamplefonts \rm
    \display
--- 4679,4687 ----
    \gobble
  }
  %
! % @smalldisplay: @display plus smaller fonts.
  %
! \def\smalldisplay{\begingroup
    \def\Esmalldisplay{\nonfillfinish\endgroup}%
    \smallexamplefonts \rm
    \display
***************
*** 4424,4432 ****
    \gobble
  }
  %
! % @smallformat (when @smallbook): @format plus smaller fonts.
  %
! \def\smallformatx{\begingroup
    \def\Esmallformat{\nonfillfinish\endgroup}%
    \smallexamplefonts \rm
    \format
--- 4696,4704 ----
    \gobble
  }
  %
! % @smallformat: @format plus smaller fonts.
  %
! \def\smallformat{\begingroup
    \def\Esmallformat{\nonfillfinish\endgroup}%
    \smallexamplefonts \rm
    \format
***************
*** 4453,4459 ****
  \def\quotation{%
    \begingroup\inENV %This group ends at the end of the @quotation body
    {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip
-   \singlespace
    \parindent=0pt
    % We have retained a nonzero parskip for the environment, since we're
    % doing normal filling. So to avoid extra space below the environment...
--- 4725,4730 ----
***************
*** 4476,4485 ****
  %
  % [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
  %
! % [Knuth] p. 344; only we need to do '@' too
  \def\dospecials{%
!   \do\ address@hidden&%
!   \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~}
  %
  % [Knuth] p. 380
  \def\uncatcodespecials{%
--- 4747,4760 ----
  %
  % [Knuth]: Donald Ervin Knuth, 1996.  The TeXbook.
  %
! % [Knuth] p.344; only we need to do the other characters Texinfo sets
! % active too.  Otherwise, they get lost as the first character on a
! % verbatim line.
  \def\dospecials{%
!   \do\ \do\\\do\{\do\}\do\$\do\&%
!   \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~%
!   \do\<\do\>\do\|address@hidden"%
! }
  %
  % [Knuth] p. 380
  \def\uncatcodespecials{%
***************
*** 4566,4572 ****
  %
  % For Texinfo it's a lot easier than for LaTeX,
  % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
! % we need not redefine '\', '{' and '}'
  %
  % Inspired by LaTeX's verbatim command set [latex.ltx]
  %% Include LaTeX hack for completeness -- never know
--- 4841,4847 ----
  %
  % For Texinfo it's a lot easier than for LaTeX,
  % because texinfo's \verbatim doesn't stop at '\end{verbatim}':
! % we need not redefine '\', '{' and '}'.
  %
  % Inspired by LaTeX's verbatim command set [latex.ltx]
  %% Include LaTeX hack for completeness -- never know
***************
*** 4576,4584 ****
  %% \catcode`\\=12|gdef|address@hidden verbatim[
  %% #1|endgroup|def|Everbatim[]|end[verbatim]]
  %% |endgroup
  \begingroup
    \catcode`\ =\active
!   address@hidden verbatim{#1\end{verbatim}}
  \endgroup
  %
  \def\verbatim{%
--- 4851,4864 ----
  %% \catcode`\\=12|gdef|address@hidden verbatim[
  %% #1|endgroup|def|Everbatim[]|end[verbatim]]
  %% |endgroup
+ %
  \begingroup
    \catcode`\ =\active
!   \obeylines %
!   % ignore everything up to the first ^^M, that's the newline at the end
!   % of the @verbatim input line itself.  Otherwise we get an extra blank
!   % line in the output.
!   address@hidden verbatim{#2\end{verbatim}}%
  \endgroup
  %
  \def\verbatim{%
***************
*** 4594,4607 ****
  % Allow normal characters that we make active in the argument (a file name).
  \def\verbatiminclude{%
    \begingroup
!     \catcode`\\=12
!     \catcode`~=12
!     \catcode`^=12
!     \catcode`_=12
!     \catcode`|=12
!     \catcode`<=12
!     \catcode`>=12
!     \catcode`+=12
      \parsearg\doverbatiminclude
  }
  \def\setupverbatiminclude{%
--- 4874,4887 ----
  % Allow normal characters that we make active in the argument (a file name).
  \def\verbatiminclude{%
    \begingroup
!     \catcode`\\=\other
!     \catcode`~=\other
!     \catcode`^=\other
!     \catcode`_=\other
!     \catcode`|=\other
!     \catcode`<=\other
!     \catcode`>=\other
!     \catcode`+=\other
      \parsearg\doverbatiminclude
  }
  \def\setupverbatiminclude{%
***************
*** 4615,4658 ****
       % Restore active chars for included file.
    \endgroup
    \begingroup
!   \def\thisfile{#1}%
!   \expandafter\expandafter\setupverbatiminclude\input\thisfile
!   \endgroup\nonfillfinish\endgroup
  }
  
  % @copying ... @end copying.
! % Save the text away for @insertcopying later.
  %
! \newbox\copyingbox
  %
  \def\copying{\begingroup
    \parindent = 0pt  % looks wrong on title page
!   \def\Ecopying{\egroup\endgroup}%
!   \global\setbox\copyingbox = \vbox\bgroup
  }
  
- % @insertcopying.
- %
- \def\insertcopying{\unvcopy\copyingbox}
- 
- 
  \message{defuns,}
  % @defun etc.
  
  % Allow user to change definition object font (\df) internally
! \def\setdeffont #1 {\csname DEF#1\endcsname}
  
  \newskip\defbodyindent \defbodyindent=.4in
  \newskip\defargsindent \defargsindent=50pt
- \newskip\deftypemargin \deftypemargin=12pt
  \newskip\deflastargmargin \deflastargmargin=18pt
  
  \newcount\parencount
! % define \functionparens, which makes ( and ) and & do special things.
! % \functionparens affects the group it is contained in.
  \def\activeparens{%
! \catcode`\(=\active \catcode`\)=\active \catcode`\&=\active
! \catcode`\[=\active \catcode`\]=\active}
  
  % Make control sequences which act like normal parenthesis chars.
  \let\lparen = ( \let\rparen = )
--- 4895,4996 ----
       % Restore active chars for included file.
    \endgroup
    \begingroup
!     \let\value=\expandablevalue
!     \def\thisfile{#1}%
!     \expandafter\expandafter\setupverbatiminclude\input\thisfile
!   \endgroup
!   \nonfillfinish
!   \endgroup
  }
  
  % @copying ... @end copying.
! % Save the text away for @insertcopying later.  Many commands won't be
! % allowed in this context, but that's ok.
  %
! % We save the uninterpreted tokens, rather than creating a box.
! % Saving the text in a box would be much easier, but then all the
! % typesetting commands (@smallbook, font changes, etc.) have to be done
! % beforehand -- and a) we want @copying to be done first in the source
! % file; b) letting users define the frontmatter in as flexible order as
! % possible is very desirable.
  %
  \def\copying{\begingroup
+   % Define a command to swallow text until we reach address@hidden copying'.
+   % \ is the escape char in this texinfo.tex file, so it is the
+   % delimiter for the command; @ will be the escape char when we read
+   % it, but that doesn't matter.
+   \long\def\docopying##1\end copying{\gdef\copyingtext{##1}\enddocopying}%
+   %
+   % We must preserve ^^M's in the input file; see \insertcopying below.
+   \catcode`\^^M = \active
+   \docopying
+ }
+ 
+ % What we do to finish off the copying text.
+ %
+ \def\enddocopying{\endgroup\ignorespaces}
+ 
+ % @insertcopying.  Here we must play games with ^^M's.  On the one hand,
+ % we need them to delimit commands such as address@hidden quotation', so they
+ % must be active.  On the other hand, we certainly don't want every
+ % end-of-line to be a \par, as would happen with the normal active
+ % definition of ^^M.  On the third hand, two ^^M's in a row should still
+ % generate a \par.
+ %
+ % Our approach is to make ^^M insert a space and a penalty1 normally;
+ % then it can also check if \lastpenalty=1.  If it does, then manually
+ % do \par.
+ %
+ % This messes up the normal definitions of @c[omment], so we redefine
+ % it.  Similarly for @ignore.  (These commands are used in the gcc
+ % manual for man page generation.)
+ %
+ % Seems pretty fragile, most line-oriented commands will presumably
+ % fail, but for the limited use of getting the copying text (which
+ % should be quite simple) inserted, we can hope it's ok.
+ %
+ {\catcode`\^^M=\active %
+ \gdef\insertcopying{\begingroup %
    \parindent = 0pt  % looks wrong on title page
!   \def^^M{%
!     \ifnum \lastpenalty=1 %
!       \par %
!     \else %
!       \space \penalty 1 %
!     \fi %
!   }%
!   %
!   % Fix @c[omment] for catcode 13 ^^M's.
!   \def\c##1^^M{\ignorespaces}%
!   \let\comment = \c %
!   %
!   % Don't bother jumping through all the hoops that \doignore does, it
!   % would be very hard since the catcodes are already set.
!   \long\def\ignore##1\end ignore{\ignorespaces}%
!   %
!   \copyingtext %
! \endgroup}%
  }
  
  \message{defuns,}
  % @defun etc.
  
  % Allow user to change definition object font (\df) internally
! \def\setdeffont#1 {\csname DEF#1\endcsname}
  
  \newskip\defbodyindent \defbodyindent=.4in
  \newskip\defargsindent \defargsindent=50pt
  \newskip\deflastargmargin \deflastargmargin=18pt
  
  \newcount\parencount
! 
! % We want ()&[] to print specially on the defun line.
! %
  \def\activeparens{%
!   \catcode`\(=\active \catcode`\)=\active
!   \catcode`\&=\active
!   \catcode`\[=\active \catcode`\]=\active
! }
  
  % Make control sequences which act like normal parenthesis chars.
  \let\lparen = ( \let\rparen = )
***************
*** 4699,4786 ****
  
  % Active &'s sneak into the index arguments, so make sure it's defined.
  {
!   \catcode`& = 13
    \global\let& = \ampnr
  }
  
! % First, defname, which formats the header line itself.
! % #1 should be the function name.
! % #2 should be the type of definition, such as "Function".
! 
! \def\defname #1#2{%
! % Get the values of \leftskip and \rightskip as they were
! % outside the @def...
! \dimen2=\leftskip
! \advance\dimen2 by -\defbodyindent
! \noindent
! \setbox0=\hbox{\hskip \deflastargmargin{\rm #2}\hskip \deftypemargin}%
! \dimen0=\hsize \advance \dimen0 by -\wd0 % compute size for first line
! \dimen1=\hsize \advance \dimen1 by -\defargsindent %size for continuations
! \parshape 2 0in \dimen0 \defargsindent \dimen1
! % Now output arg 2 ("Function" or some such)
! % ending at \deftypemargin from the right margin,
! % but stuck inside a box of width 0 so it does not interfere with linebreaking
! {% Adjust \hsize to exclude the ambient margins,
! % so that \rightline will obey them.
! \advance \hsize by -\dimen2
! \rlap{\rightline{{\rm #2}\hskip -1.25pc }}}%
! % Make all lines underfull and no complaints:
! \tolerance=10000 \hbadness=10000
! \advance\leftskip by -\defbodyindent
! \exdentamount=\defbodyindent
! {\df #1}\enskip        % Generate function name
! }
! 
! % Actually process the body of a definition
! % #1 should be the terminating control sequence, such as \Edefun.
! % #2 should be the "another name" control sequence, such as \defunx.
! % #3 should be the control sequence that actually processes the header,
! %    such as \defunheader.
! 
! \def\defparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
! \medbreak %
! % Define the end token that this defining construct specifies
! % so that it will exit this group.
! \def#1{\endgraf\endgroup\medbreak}%
! \def#2{\begingroup\obeylines\activeparens\spacesplit#3}%
! \parindent=0in
! \advance\leftskip by \defbodyindent
! \exdentamount=\defbodyindent
! \begingroup %
! \catcode 61=\active % 61 is `='
! \obeylines\activeparens\spacesplit#3}
  
  % #1 is the \E... control sequence to end the definition (which we define).
! % #2 is the \...x control sequence for consecutive fns (which we define).
! % #3 is the control sequence to call to resume processing.
  % #4, delimited by the space, is the class name.
  %
! \def\defmethparsebody#1#2#3#4 {\begingroup\inENV %
! \medbreak %
! % Define the end token that this defining construct specifies
! % so that it will exit this group.
! \def#1{\endgraf\endgroup\medbreak}%
! \def#2##1 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}}}%
! \parindent=0in
! \advance\leftskip by \defbodyindent
! \exdentamount=\defbodyindent
! \begingroup\obeylines\activeparens\spacesplit{#3{#4}}}
  
  % Used for @deftypemethod and @deftypeivar.
! % #1 is the \E... control sequence to end the definition (which we define).
! % #2 is the \...x control sequence for consecutive fns (which we define).
! % #3 is the control sequence to call to resume processing.
  % #4, delimited by a space, is the class name.
  % #5 is the method's return type.
  %
! \def\deftypemethparsebody#1#2#3#4 #5 {\begingroup\inENV
!   \medbreak
!   \def#1{\endgraf\endgroup\medbreak}%
!   \def#2##1 ##2 {\begingroup\obeylines\activeparens\spacesplit{#3{##1}{##2}}}%
!   \parindent=0in
!   \advance\leftskip by \defbodyindent
!   \exdentamount=\defbodyindent
!   \begingroup\obeylines\activeparens\spacesplit{#3{#4}{#5}}}
  
  % Used for @deftypeop.  The change from \deftypemethparsebody is an
  % extra argument at the beginning which is the `category', instead of it
--- 5037,5160 ----
  
  % Active &'s sneak into the index arguments, so make sure it's defined.
  {
!   \catcode`& = \active
    \global\let& = \ampnr
  }
  
! % \defname, which formats the name of the @def (not the args).
! % #1 is the function name.
! % #2 is the type of definition, such as "Function".
! %
! \def\defname#1#2{%
!   % How we'll output the type name.  Putting it in brackets helps
!   % distinguish it from the body text that may end up on the next line
!   % just below it.
!   \ifempty{#2}%
!     \def\defnametype{}%
!   \else
!     \def\defnametype{[\rm #2]}%
!   \fi
!   %
!   % Get the values of \leftskip and \rightskip as they were outside the 
@def...
!   \dimen2=\leftskip
!   \advance\dimen2 by -\defbodyindent
!   %
!   % Figure out values for the paragraph shape.
!   \setbox0=\hbox{\hskip \deflastargmargin{\defnametype}}%
!   \dimen0=\hsize \advance \dimen0 by -\wd0  % compute size for first line
!   \dimen1=\hsize \advance \dimen1 by -\defargsindent  % size for continuations
!   \parshape 2 0in \dimen0 \defargsindent \dimen1
!   %
!   % Output arg 2 ("Function" or some such) but stuck inside a box of
!   % width 0 so it does not interfere with linebreaking.
!   \noindent
!   %
!   {% Adjust \hsize to exclude the ambient margins,
!    % so that \rightline will obey them.
!    \advance \hsize by -\dimen2
!    \dimen3 = 0pt  % was -1.25pc
!    \rlap{\rightline{\defnametype\kern\dimen3}}%
!   }%
!   %
!   % Allow all lines to be underfull without complaint:
!   \tolerance=10000 \hbadness=10000
!   \advance\leftskip by -\defbodyindent
!   \exdentamount=\defbodyindent
!   {\df #1}\enskip        % output function name
!   % \defunargs will be called next to output the arguments, if any.
! }
  
+ % Common pieces to start any @def...
  % #1 is the \E... control sequence to end the definition (which we define).
! % #2 is the \...x control sequence (which our caller defines).
! % #3 is the control sequence to process the header, such as \defunheader.
! %
! \def\parsebodycommon#1#2#3{%
!   \begingroup\inENV
!   % 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
!   % header.  But if there's nothing but headers, we want to allow a
!   % break after all.  Check for penalty 10002 (inserted by
!   % \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
!   %
!   % Define the \E... end token that this defining construct specifies
!   % so that it will exit this group.
!   \def#1{\endgraf\endgroup\medbreak}%
!   %
!   \parindent=0in
!   \advance\leftskip by \defbodyindent
!   \exdentamount=\defbodyindent
! }
! 
! % Common part of the \...x definitions.
! %
! \def\defxbodycommon{%
!   % As with \parsebodycommon above, allow line break if we have multiple
!   % x headers in a row.  It's not a great place, though.
!   \ifnum\lastpenalty=10000 \penalty1000 \fi
!   %
!   \begingroup\obeylines
! }
! 
! % Process body of @defun, @deffn, @defmac, etc.
! %
! \def\defparsebody#1#2#3{%
!   \parsebodycommon{#1}{#2}{#3}%
!   \def#2{\defxbodycommon \activeparens \spacesplit#3}%
!   \catcode\equalChar=\active
!   \begingroup\obeylines\activeparens
!   \spacesplit#3%
! }
! 
! % #1, #2, #3 are the common arguments (see \parsebodycommon above).
  % #4, delimited by the space, is the class name.
  %
! \def\defmethparsebody#1#2#3#4 {%
!   \parsebodycommon{#1}{#2}{#3}%
!   \def#2##1 {\defxbodycommon \activeparens \spacesplit{#3{##1}}}%
!   \begingroup\obeylines\activeparens
!   % The \empty here prevents misinterpretation of a construct such as
!   %   @deffn {whatever} {Enharmonic comma}
!   % See comments at \deftpparsebody, although in our case we don't have
!   % to remove the \empty afterwards, since it is empty.
!   \spacesplit{#3{#4}}\empty
! }
  
  % Used for @deftypemethod and @deftypeivar.
! % #1, #2, #3 are the common arguments (see \defparsebody).
  % #4, delimited by a space, is the class name.
  % #5 is the method's return type.
  %
! \def\deftypemethparsebody#1#2#3#4 #5 {%
!   \parsebodycommon{#1}{#2}{#3}%
!   \def#2##1 ##2 {\defxbodycommon \activeparens \spacesplit{#3{##1}{##2}}}%
!   \begingroup\obeylines\activeparens
!   \spacesplit{#3{#4}{#5}}%
! }
  
  % Used for @deftypeop.  The change from \deftypemethparsebody is an
  % extra argument at the beginning which is the `category', instead of it
***************
*** 4789,4852 ****
  % input at hand.  Thus also need a control sequence (passed as #5) for
  % the \E... definition to assign the category name to.
  %
! \def\deftypeopparsebody#1#2#3#4#5 #6 {\begingroup\inENV
!   \medbreak
!   \def#1{\endgraf\endgroup\medbreak}%
!   \def#2##1 ##2 ##3 {%
!     \def#4{##1}%
!     \begingroup\obeylines\activeparens\spacesplit{#3{##2}{##3}}}%
!   \parindent=0in
!   \advance\leftskip by \defbodyindent
!   \exdentamount=\defbodyindent
!   \begingroup\obeylines\activeparens\spacesplit{#3{#5}{#6}}}
  
! \def\defopparsebody #1#2#3#4#5 {\begingroup\inENV %
! \medbreak %
! % Define the end token that this defining construct specifies
! % so that it will exit this group.
! \def#1{\endgraf\endgroup\medbreak}%
! \def#2##1 ##2 {\def#4{##1}%
! \begingroup\obeylines\activeparens\spacesplit{#3{##2}}}%
! \parindent=0in
! \advance\leftskip by \defbodyindent
! \exdentamount=\defbodyindent
! \begingroup\obeylines\activeparens\spacesplit{#3{#5}}}
  
  % These parsing functions are similar to the preceding ones
  % except that they do not make parens into active characters.
  % These are used for "variables" since they have no arguments.
- 
- \def\defvarparsebody #1#2#3{\begingroup\inENV% Environment for definitionbody
- \medbreak %
- % Define the end token that this defining construct specifies
- % so that it will exit this group.
- \def#1{\endgraf\endgroup\medbreak}%
- \def#2{\begingroup\obeylines\spacesplit#3}%
- \parindent=0in
- \advance\leftskip by \defbodyindent
- \exdentamount=\defbodyindent
- \begingroup %
- \catcode 61=\active %
- \obeylines\spacesplit#3}
- 
- % This is used for \def{tp,vr}parsebody.  It could probably be used for
- % some of the others, too, with some judicious conditionals.
  %
! \def\parsebodycommon#1#2#3{%
!   \begingroup\inENV %
!   \medbreak %
!   % Define the end token that this defining construct specifies
!   % so that it will exit this group.
!   \def#1{\endgraf\endgroup\medbreak}%
!   \def#2##1 {\begingroup\obeylines\spacesplit{#3{##1}}}%
!   \parindent=0in
!   \advance\leftskip by \defbodyindent
!   \exdentamount=\defbodyindent
    \begingroup\obeylines
  }
  
  \def\defvrparsebody#1#2#3#4 {%
    \parsebodycommon{#1}{#2}{#3}%
    \spacesplit{#3{#4}}%
  }
  
--- 5163,5210 ----
  % input at hand.  Thus also need a control sequence (passed as #5) for
  % the \E... definition to assign the category name to.
  %
! \def\deftypeopparsebody#1#2#3#4#5 #6 {%
!   \parsebodycommon{#1}{#2}{#3}%
!   \def#2##1 ##2 ##3 {\def#4{##1}%
!     \defxbodycommon \activeparens \spacesplit{#3{##2}{##3}}}%
!   \begingroup\obeylines\activeparens
!   \spacesplit{#3{#5}{#6}}%
! }
  
! % For @defop.
! \def\defopparsebody #1#2#3#4#5 {%
!   \parsebodycommon{#1}{#2}{#3}%
!   \def#2##1 ##2 {\def#4{##1}%
!     \defxbodycommon \activeparens \spacesplit{#3{##2}}}%
!   \begingroup\obeylines\activeparens
!   \spacesplit{#3{#5}}%
! }
  
  % These parsing functions are similar to the preceding ones
  % except that they do not make parens into active characters.
  % These are used for "variables" since they have no arguments.
  %
! \def\defvarparsebody #1#2#3{%
!   \parsebodycommon{#1}{#2}{#3}%
!   \def#2{\defxbodycommon \spacesplit#3}%
!   \catcode\equalChar=\active
    \begingroup\obeylines
+   \spacesplit#3%
+ }
+ 
+ % @defopvar.
+ \def\defopvarparsebody #1#2#3#4#5 {%
+   \parsebodycommon{#1}{#2}{#3}%
+   \def#2##1 ##2 {\def#4{##1}%
+     \defxbodycommon \spacesplit{#3{##2}}}%
+   \begingroup\obeylines
+   \spacesplit{#3{#5}}%
  }
  
  \def\defvrparsebody#1#2#3#4 {%
    \parsebodycommon{#1}{#2}{#3}%
+   \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
+   \begingroup\obeylines
    \spacesplit{#3{#4}}%
  }
  
***************
*** 4861,4866 ****
--- 5219,5226 ----
  %
  \def\deftpparsebody #1#2#3#4 {%
    \parsebodycommon{#1}{#2}{#3}%
+   \def#2##1 {\defxbodycommon \spacesplit{#3{##1}}}%
+   \begingroup\obeylines
    \spacesplit{\parsetpheaderline{#3{#4}}}\empty
  }
  
***************
*** 4877,4914 ****
    #1{\removeemptybraces#2\relax}{#3}%
  }%
  
! \def\defopvarparsebody #1#2#3#4#5 {\begingroup\inENV %
! \medbreak %
! % Define the end token that this defining construct specifies
! % so that it will exit this group.
! \def#1{\endgraf\endgroup\medbreak}%
! \def#2##1 ##2 {\def#4{##1}%
! \begingroup\obeylines\spacesplit{#3{##2}}}%
! \parindent=0in
! \advance\leftskip by \defbodyindent
! \exdentamount=\defbodyindent
! \begingroup\obeylines\spacesplit{#3{#5}}}
! 
! % Split up #2 at the first space token.
  % call #1 with two arguments:
  %  the first is all of #2 before the space token,
  %  the second is all of #2 after that space token.
  % If #2 contains no space token, all of it is passed as the first arg
  % and the second is passed as empty.
! 
! {\obeylines
! \gdef\spacesplit#1#2^^M{\endgroup\spacesplitfoo{#1}#2 \relax\spacesplitfoo}%
! \long\gdef\spacesplitfoo#1#2 #3#4\spacesplitfoo{%
! \ifx\relax #3%
! #1{#2}{}\else #1{#2}{#3#4}\fi}}
! 
! % So much for the things common to all kinds of definitions.
  
  % Define @defun.
  
! % First, define the processing that is wanted for arguments of \defun
! % Use this to expand the args and terminate the paragraph they make up
  
  \def\defunargs#1{\functionparens \sl
  % Expand, preventing hyphenation at `-' chars.
  % Note that groups don't affect changes in \hyphenchar.
--- 5237,5273 ----
    #1{\removeemptybraces#2\relax}{#3}%
  }%
  
! % Split up #2 (the rest of the input line) at the first space token.
  % call #1 with two arguments:
  %  the first is all of #2 before the space token,
  %  the second is all of #2 after that space token.
  % If #2 contains no space token, all of it is passed as the first arg
  % and the second is passed as empty.
! %
! {\obeylines %
!  \gdef\spacesplit#1#2^^M{\endgroup\spacesplitx{#1}#2 \relax\spacesplitx}%
!  \long\gdef\spacesplitx#1#2 #3#4\spacesplitx{%
!    \ifx\relax #3%
!      #1{#2}{}%
!    \else %
!      #1{#2}{#3#4}%
!    \fi}%
! }
  
  % Define @defun.
  
! % This is called to end the arguments processing for all the @def... commands.
! %
! \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
  % Expand, preventing hyphenation at `-' chars.
  % Note that groups don't affect changes in \hyphenchar.
***************
*** 4917,4925 ****
  #1%
  {\tensl\hyphenchar\font=45}%
  \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
! \interlinepenalty=10000
! \advance\rightskip by 0pt plus 1fil
! \endgraf\nobreak\vskip -\parskip\nobreak
  }
  
  \def\deftypefunargs #1{%
--- 5276,5282 ----
  #1%
  {\tensl\hyphenchar\font=45}%
  \ifnum\parencount=0 \else \errmessage{Unbalanced parentheses in @def}\fi%
!   \defargscommonending
  }
  
  \def\deftypefunargs #1{%
***************
*** 4928,4936 ****
  % Use \boldbraxnoamp, not \functionparens, so that & is not special.
  \boldbraxnoamp
  \tclose{#1}% avoid \code because of side effects on active chars
! \interlinepenalty=10000
! \advance\rightskip by 0pt plus 1fil
! \endgraf\nobreak\vskip -\parskip\nobreak
  }
  
  % Do complete processing of one @defun or @defunx line already parsed.
--- 5285,5291 ----
  % Use \boldbraxnoamp, not \functionparens, so that & is not special.
  \boldbraxnoamp
  \tclose{#1}% avoid \code because of side effects on active chars
!   \defargscommonending
  }
  
  % Do complete processing of one @defun or @defunx line already parsed.
***************
*** 4941,4947 ****
  
  \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
  \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
! \catcode 61=\other % Turn off change made in \defparsebody
  }
  
  % @defun == @deffn Function
--- 5296,5302 ----
  
  \def\deffnheader #1#2#3{\doind {fn}{\code{#2}}%
  \begingroup\defname {#2}{#1}\defunargs{#3}\endgroup %
! \catcode\equalChar=\other % Turn off change made in \defparsebody
  }
  
  % @defun == @deffn Function
***************
*** 4951,4957 ****
  \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  \begingroup\defname {#1}{\putwordDeffunc}%
  \defunargs {#2}\endgroup %
! \catcode 61=\other % Turn off change made in \defparsebody
  }
  
  % @deftypefun int foobar (int @var{foo}, float @var{bar})
--- 5306,5312 ----
  \def\defunheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  \begingroup\defname {#1}{\putwordDeffunc}%
  \defunargs {#2}\endgroup %
! \catcode\equalChar=\other % Turn off change made in \defparsebody
  }
  
  % @deftypefun int foobar (int @var{foo}, float @var{bar})
***************
*** 4965,4971 ****
  \doind {fn}{\code{#2}}% Make entry in function index
  \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
  \deftypefunargs {#3}\endgroup %
! \catcode 61=\other % Turn off change made in \defparsebody
  }
  
  % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
--- 5320,5326 ----
  \doind {fn}{\code{#2}}% Make entry in function index
  \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypefun}%
  \deftypefunargs {#3}\endgroup %
! \catcode\equalChar=\other % Turn off change made in \defparsebody
  }
  
  % @deftypefn {Library Function} int foobar (int @var{foo}, float @var{bar})
***************
*** 4986,4992 ****
  %               at least some C++ text from working
  \defname {\defheaderxcond#2\relax$.$#3}{#1}%
  \deftypefunargs {#4}\endgroup %
! \catcode 61=\other % Turn off change made in \defparsebody
  }
  
  % @defmac == @deffn Macro
--- 5341,5347 ----
  %               at least some C++ text from working
  \defname {\defheaderxcond#2\relax$.$#3}{#1}%
  \deftypefunargs {#4}\endgroup %
! \catcode\equalChar=\other % Turn off change made in \defparsebody
  }
  
  % @defmac == @deffn Macro
***************
*** 4996,5002 ****
  \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  \begingroup\defname {#1}{\putwordDefmac}%
  \defunargs {#2}\endgroup %
! \catcode 61=\other % Turn off change made in \defparsebody
  }
  
  % @defspec == @deffn Special Form
--- 5351,5357 ----
  \def\defmacheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  \begingroup\defname {#1}{\putwordDefmac}%
  \defunargs {#2}\endgroup %
! \catcode\equalChar=\other % Turn off change made in \defparsebody
  }
  
  % @defspec == @deffn Special Form
***************
*** 5006,5012 ****
  \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  \begingroup\defname {#1}{\putwordDefspec}%
  \defunargs {#2}\endgroup %
! \catcode 61=\other % Turn off change made in \defparsebody
  }
  
  % @defop CATEGORY CLASS OPERATION ARG...
--- 5361,5367 ----
  \def\defspecheader #1#2{\doind {fn}{\code{#1}}% Make entry in function index
  \begingroup\defname {#1}{\putwordDefspec}%
  \defunargs {#2}\endgroup %
! \catcode\equalChar=\other % Turn off change made in \defparsebody
  }
  
  % @defop CATEGORY CLASS OPERATION ARG...
***************
*** 5015,5023 ****
  \defopparsebody\Edefop\defopx\defopheader\defoptype}
  %
  \def\defopheader#1#2#3{%
! \dosubind {fn}{\code{#2}}{\putwordon\ #1}% Make entry in function index
! \begingroup\defname {#2}{\defoptype\ \putwordon\ #1}%
! \defunargs {#3}\endgroup %
  }
  
  % @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
--- 5370,5380 ----
  \defopparsebody\Edefop\defopx\defopheader\defoptype}
  %
  \def\defopheader#1#2#3{%
!   \dosubind{fn}{\code{#2}}{\putwordon\ \code{#1}}% function index entry
!   \begingroup
!     \defname{#2}{\defoptype\ \putwordon\ #1}%
!     \defunargs{#3}%
!   \endgroup
  }
  
  % @deftypeop CATEGORY CLASS TYPE OPERATION ARG...
***************
*** 5084,5092 ****
  \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
  
  \def\defcvarheader #1#2#3{%
! \dosubind {vr}{\code{#2}}{\putwordof\ #1}% Make entry in var index
! \begingroup\defname {#2}{\defcvtype\ \putwordof\ #1}%
! \defvarargs {#3}\endgroup %
  }
  
  % @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
--- 5441,5451 ----
  \defopvarparsebody\Edefcv\defcvx\defcvarheader\defcvtype}
  
  \def\defcvarheader #1#2#3{%
!   \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% variable index entry
!   \begingroup
!     \defname{#2}{\defcvtype\ \putwordof\ #1}%
!     \defvarargs{#3}%
!   \endgroup
  }
  
  % @defivar CLASS VARNAME == @defcv {Instance Variable} CLASS VARNAME
***************
*** 5094,5100 ****
  \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
  %
  \def\defivarheader#1#2#3{%
!   \dosubind {vr}{\code{#2}}{\putwordof\ #1}% entry in var index
    \begingroup
      \defname{#2}{\putwordInstanceVariableof\ #1}%
      \defvarargs{#3}%
--- 5453,5459 ----
  \def\defivar{\defvrparsebody\Edefivar\defivarx\defivarheader}
  %
  \def\defivarheader#1#2#3{%
!   \dosubind{vr}{\code{#2}}{\putwordof\ \code{#1}}% entry in var index
    \begingroup
      \defname{#2}{\putwordInstanceVariableof\ #1}%
      \defvarargs{#3}%
***************
*** 5106,5113 ****
  % This is actually simple: just print them in roman.
  % This must expand the args and terminate the paragraph they make up
  \def\defvarargs #1{\normalparens #1%
! \interlinepenalty=10000
! \endgraf\nobreak\vskip -\parskip\nobreak}
  
  % @defvr Counter foo-count
  
--- 5465,5472 ----
  % This is actually simple: just print them in roman.
  % This must expand the args and terminate the paragraph they make up
  \def\defvarargs #1{\normalparens #1%
!   \defargscommonending
! }
  
  % @defvr Counter foo-count
  
***************
*** 5143,5150 ****
  \def\deftypevarheader #1#2{%
  \dovarind#2 \relax% Make entry in variables index
  \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
! \interlinepenalty=10000
! \endgraf\nobreak\vskip -\parskip\nobreak
  \endgroup}
  \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
  
--- 5502,5508 ----
  \def\deftypevarheader #1#2{%
  \dovarind#2 \relax% Make entry in variables index
  \begingroup\defname {\defheaderxcond#1\relax$.$#2}{\putwordDeftypevar}%
!   \defargscommonending
  \endgroup}
  \def\dovarind#1 #2\relax{\doind{vr}{\code{#1}}}
  
***************
*** 5154,5161 ****
  
  \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
  \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
! \interlinepenalty=10000
! \endgraf\nobreak\vskip -\parskip\nobreak
  \endgroup}
  
  % Now define @deftp
--- 5512,5518 ----
  
  \def\deftypevrheader #1#2#3{\dovarind#3 \relax%
  \begingroup\defname {\defheaderxcond#2\relax$.$#3}{#1}
!   \defargscommonending
  \endgroup}
  
  % Now define @deftp
***************
*** 5204,5210 ****
   \def\scanmacro#1{%
     \begingroup \newlinechar`\^^M
     % Undo catcode changes of \startcontents and \doprintindex
!    address@hidden \catcode`\\=12 \escapechar=`\@
     % Append \endinput to make sure that TeX does not see the ending newline.
     \toks0={#1\endinput}%
     \immediate\openout\macscribble=\jobname.tmp
--- 5561,5567 ----
   \def\scanmacro#1{%
     \begingroup \newlinechar`\^^M
     % Undo catcode changes of \startcontents and \doprintindex
!    address@hidden \catcode`\\=\other \escapechar=`\@
     % Append \endinput to make sure that TeX does not see the ending newline.
     \toks0={#1\endinput}%
     \immediate\openout\macscribble=\jobname.tmp
***************
*** 5218,5224 ****
  \def\scanmacro#1{%
  \begingroup \newlinechar`\^^M
  % Undo catcode changes of \startcontents and \doprintindex
! address@hidden \catcode`\\=12 \escapechar=`\@
  \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
  \fi
  
--- 5575,5581 ----
  \def\scanmacro#1{%
  \begingroup \newlinechar`\^^M
  % Undo catcode changes of \startcontents and \doprintindex
! address@hidden \catcode`\\=\other \escapechar=`\@
  \let\xeatspaces\eatspaces\scantokens{#1\endinput}\endgroup}
  \fi
  
***************
*** 5248,5254 ****
  }
  
  % Trim a single trailing ^^M off a string.
! {\catcode`\^^M=12\catcode`\Q=3%
  \gdef\eatcr #1{\eatcra #1Q^^MQ}%
  \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
  \gdef\eatcrb#1Q#2Q{#1}%
--- 5605,5611 ----
  }
  
  % Trim a single trailing ^^M off a string.
! {\catcode`\^^M=\other \catcode`\Q=3%
  \gdef\eatcr #1{\eatcra #1Q^^MQ}%
  \gdef\eatcra#1^^MQ{\eatcrb#1Q}%
  \gdef\eatcrb#1Q#2Q{#1}%
***************
*** 5263,5291 ****
  % body, and then making it the \newlinechar in \scanmacro.
  
  \def\macrobodyctxt{%
!   \catcode`\~=12
!   \catcode`\^=12
!   \catcode`\_=12
!   \catcode`\|=12
!   \catcode`\<=12
!   \catcode`\>=12
!   \catcode`\+=12
!   \catcode`\{=12
!   \catcode`\}=12
!   address@hidden
!   \catcode`\^^M=12
    \usembodybackslash}
  
  \def\macroargctxt{%
!   \catcode`\~=12
!   \catcode`\^=12
!   \catcode`\_=12
!   \catcode`\|=12
!   \catcode`\<=12
!   \catcode`\>=12
!   \catcode`\+=12
!   address@hidden
!   \catcode`\\=12}
  
  % \mbodybackslash is the definition of \ in @macro bodies.
  % It maps \foo\ => \csname macarg.foo\endcsname => #N
--- 5620,5648 ----
  % body, and then making it the \newlinechar in \scanmacro.
  
  \def\macrobodyctxt{%
!   \catcode`\~=\other
!   \catcode`\^=\other
!   \catcode`\_=\other
!   \catcode`\|=\other
!   \catcode`\<=\other
!   \catcode`\>=\other
!   \catcode`\+=\other
!   \catcode`\{=\other
!   \catcode`\}=\other
!   address@hidden
!   \catcode`\^^M=\other
    \usembodybackslash}
  
  \def\macroargctxt{%
!   \catcode`\~=\other
!   \catcode`\^=\other
!   \catcode`\_=\other
!   \catcode`\|=\other
!   \catcode`\<=\other
!   \catcode`\>=\other
!   \catcode`\+=\other
!   address@hidden
!   \catcode`\\=\other}
  
  % \mbodybackslash is the definition of \ in @macro bodies.
  % It maps \foo\ => \csname macarg.foo\endcsname => #N
***************
*** 5326,5357 ****
    \else \expandafter\parsemacbody
    \fi}
  
! \def\unmacro{\parsearg\unmacroxxx}
! \def\unmacroxxx#1{%
    \if1\csname ismacro.#1\endcsname
      \global\cslet{#1}{macsave.#1}%
      \global\expandafter\let \csname ismacro.#1\endcsname=0%
!     % Remove the macro name from \macrolist
      \begingroup
!       \edef\tempa{\expandafter\noexpand\csname#1\endcsname}%
!       \def\do##1{%
!         \def\tempb{##1}%
!         \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
    \else
      \errmessage{Macro #1 not defined}%
    \fi
  }
  
  % This makes use of the obscure feature that if the last token of a
  % <parameter list> is #, then the preceding argument is delimited by
  % an opening brace, and that opening brace is not consumed.
--- 5683,5715 ----
    \else \expandafter\parsemacbody
    \fi}
  
! \def\unmacro{\parsearg\dounmacro}
! \def\dounmacro#1{%
    \if1\csname ismacro.#1\endcsname
      \global\cslet{#1}{macsave.#1}%
      \global\expandafter\let \csname ismacro.#1\endcsname=0%
!     % Remove the macro name from \macrolist:
      \begingroup
!       \expandafter\let\csname#1\endcsname \relax
!       \let\do\unmacrodo
!       \xdef\macrolist{\macrolist}%
      \endgroup
    \else
      \errmessage{Macro #1 not defined}%
    \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
  % <parameter list> is #, then the preceding argument is delimited by
  % an opening brace, and that opening brace is not consumed.
***************
*** 5499,5506 ****
  
  % @node's job is to define \lastnode.
  \def\node{\ENVcheck\parsearg\nodezzz}
! \def\nodezzz#1{\nodexxx [#1,]}
! \def\nodexxx[#1,#2]{\gdef\lastnode{#1}}
  \let\nwnode=\node
  \let\lastnode=\relax
  
--- 5857,5864 ----
  
  % @node's job is to define \lastnode.
  \def\node{\ENVcheck\parsearg\nodezzz}
! \def\nodezzz#1{\nodexxx #1,\finishnodeparse}
! \def\nodexxx#1,#2\finishnodeparse{\gdef\lastnode{#1}}
  \let\nwnode=\node
  \let\lastnode=\relax
  
***************
*** 5534,5548 ****
  \gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
  \gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
  
! % \setref{NAME}{SNT} defines a cross-reference point NAME, namely
! % NAME-title, NAME-pg, and NAME-SNT.  Called from \foonoderef.  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.
  %
  \def\setref#1#2{{%
!   \indexdummies
    \pdfmkdest{#1}%
    \dosetq{#1-title}{Ytitle}%
    \dosetq{#1-pg}{Ypagenumber}%
    \dosetq{#1-snt}{#2}%
--- 5892,5914 ----
  \gdef\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi}
  \gdef\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces}
  
! % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
! % anchor), namely NAME-title (the corresponding @chapter/etc. name),
! % NAME-pg (the page number), and NAME-snt (section number and type).
! % Called from \foonoderef.
! %
! % 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{{%
!   \atdummies
    \pdfmkdest{#1}%
+   %
+   \turnoffactive
    \dosetq{#1-title}{Ytitle}%
    \dosetq{#1-pg}{Ypagenumber}%
    \dosetq{#1-snt}{#2}%
***************
*** 5594,5600 ****
    \ifpdf
      \leavevmode
      \getfilename{#4}%
!     {\normalturnoffactive
       \ifnum\filenamelength>0
         \startlink attr{/Border [0 0 0]}%
           goto file{\the\filename.pdf} name{#1}%
--- 5960,5966 ----
    \ifpdf
      \leavevmode
      \getfilename{#4}%
!     {\turnoffactive \otherbackslash
       \ifnum\filenamelength>0
         \startlink attr{/Border [0 0 0]}%
           goto file{\the\filename.pdf} name{#1}%
***************
*** 5614,5695 ****
      % into the usual \leavevmode...\vrule stuff for purposes of
      % printing. So we \turnoffactive for the \refx-snt, back on for the
      % printing, back off for the \refx-pg.
!     {\normalturnoffactive
       % Only output a following space if the -snt ref is nonempty; for
       % @unnumbered and @anchor, it won't be.
       \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
       \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
      }%
!     % [mynode],
!     [\printednodename],\space
!     % page 3
!     \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
    \fi
    \endlink
  \endgroup}
  
! % \dosetq is the interface for calls from other macros
  
! % Use \normalturnoffactive so that punctuation chars such as underscore
! % and backslash work in node names.  (\turnoffactive doesn't do \.)
  \def\dosetq#1#2{%
    {\let\folio=0%
-    \normalturnoffactive
     \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
!    \iflinks
!      \next
!    \fi
    }%
  }
  
! % \internalsetq {foo}{page} expands into
! % CHARACTERS 'xrdef {foo}{...expansion of \Ypage...}
! % When the aux file is read, ' is the escape character
! 
! \def\internalsetq #1#2{'xrdef {#1}{\csname #2\endcsname}}
! 
! % Things to be expanded by \internalsetq
  
  \def\Ypagenumber{\folio}
- 
  \def\Ytitle{\thissection}
- 
  \def\Ynothing{}
- 
  \def\Ysectionnumberandtype{%
! \ifnum\secno=0 \putwordChapter\xreftie\the\chapno %
! \else \ifnum \subsecno=0 \putwordSection\xreftie\the\chapno.\the\secno %
! \else \ifnum \subsubsecno=0 %
! \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno %
! \else %
! \putwordSection\xreftie\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno %
! \fi \fi \fi }
  
  \def\Yappendixletterandtype{%
! \ifnum\secno=0 \putwordAppendix\xreftie'char\the\appendixno{}%
! \else \ifnum \subsecno=0 
\putwordSection\xreftie'char\the\appendixno.\the\secno %
! \else \ifnum \subsubsecno=0 %
! \putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno %
! \else %
! 
\putwordSection\xreftie'char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno
 %
! \fi \fi \fi }
! 
! \gdef\xreftie{'tie}
  
  % 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.
  %
  \ifx\inputlineno\thisisundefined
!   \let\linenumber = \empty % Non-3.0.
  \else
    \def\linenumber{\the\inputlineno:\space}
  \fi
  
  % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  % If its value is nonempty, SUFFIX is output afterward.
! 
  \def\refx#1#2{%
!   \expandafter\ifx\csname X#1\endcsname\relax
      % If not defined, say something at least.
      \angleleft un\-de\-fined\angleright
      \iflinks
--- 5980,6073 ----
      % into the usual \leavevmode...\vrule stuff for purposes of
      % printing. So we \turnoffactive for the \refx-snt, back on for the
      % printing, back off for the \refx-pg.
!     {\turnoffactive \otherbackslash
       % Only output a following space if the -snt ref is nonempty; for
       % @unnumbered and @anchor, it won't be.
       \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
       \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
      }%
!     % output the `[mynode]' via a macro.
!     \xrefprintnodename\printednodename
!     %
!     % But we always want a comma and a space:
!     ,\space
!     %
!     % output the `page 3'.
!     \turnoffactive \otherbackslash \putwordpage\tie\refx{#1-pg}{}%
    \fi
    \endlink
  \endgroup}
  
! % 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]}
  
! % \dosetq is called from \setref to do the actual \write (\iflinks).
! %
  \def\dosetq#1#2{%
    {\let\folio=0%
     \edef\next{\write\auxfile{\internalsetq{#1}{#2}}}%
!    \iflinks \next \fi
    }%
  }
  
! % \internalsetq{foo}{page} expands into
! %   CHARACTERS @xrdef{foo}{...expansion of \page...}
! address@hidden #2\endcsname}}
  
+ % Things to be expanded by \internalsetq.
+ %
  \def\Ypagenumber{\folio}
  \def\Ytitle{\thissection}
  \def\Ynothing{}
  \def\Ysectionnumberandtype{%
!   \ifnum\secno=0
!     address@hidden \the\chapno
!   \else \ifnum\subsecno=0
!     address@hidden \the\chapno.\the\secno
!   \else \ifnum\subsubsecno=0
!     address@hidden \the\chapno.\the\secno.\the\subsecno
!   \else
!     address@hidden \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno
!   \fi\fi\fi
! }
  
  \def\Yappendixletterandtype{%
!   \ifnum\secno=0
!      address@hidden @char\the\appendixno{}%
!   \else \ifnum\subsecno=0
!      address@hidden @char\the\appendixno.\the\secno
!   \else \ifnum\subsubsecno=0
!     address@hidden @char\the\appendixno.\the\secno.\the\subsecno
!   \else
!     address@hidden
!       @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
  % messages, but if we're using an old version of TeX, don't do anything.
  %
  \ifx\inputlineno\thisisundefined
!   \let\linenumber = \empty % Pre-3.0.
  \else
    \def\linenumber{\the\inputlineno:\space}
  \fi
  
  % Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME.
  % If its value is nonempty, SUFFIX is output afterward.
! %
  \def\refx#1#2{%
!   {%
!     \indexnofonts
!     \otherbackslash
!     \expandafter\global\expandafter\let\expandafter\thisrefX
!       \csname X#1\endcsname
!   }%
!   \ifx\thisrefX\relax
      % If not defined, say something at least.
      \angleleft un\-de\-fined\angleright
      \iflinks
***************
*** 5704,5722 ****
      \fi
    \else
      % It's defined, so just use it.
!     \csname X#1\endcsname
    \fi
    #2% Output the suffix in any case.
  }
  
  % This is the macro invoked by entries in the aux file.
  %
! \def\xrdef#1{\begingroup
!   % 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.
  \def\readauxfile{\begingroup
--- 6082,6095 ----
      \fi
    \else
      % It's defined, so just use it.
!     \thisrefX
    \fi
    #2% Output the suffix in any case.
  }
  
  % This is the macro invoked by entries in the aux file.
  %
! \def\xrdef#1{\expandafter\gdef\csname X#1\endcsname}
  
  % Read the last existing aux file, if any.  No error if none exists.
  \def\readauxfile{\begingroup
***************
*** 5747,5755 ****
    \catcode`\^^]=\other
    \catcode`\^^^=\other
    \catcode`\^^_=\other
!   address@hidden
!   \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
    % supported in the main text, it doesn't seem desirable.  Furthermore,
    % that is not enough: for node names that actually contain a ^
--- 6120,6126 ----
    \catcode`\^^]=\other
    \catcode`\^^^=\other
    \catcode`\^^_=\other
!   % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
    % in xref tags, i.e., node names.  But since ^^e4 notation isn't
    % supported in the main text, it doesn't seem desirable.  Furthermore,
    % that is not enough: for node names that actually contain a ^
***************
*** 5762,5767 ****
--- 6133,6141 ----
    % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
    % and then to call \auxhat in \setq.
    %
+   \catcode`\^=\other
+   %
+   % Special characters.  Should be turned off anyway, but...
    \catcode`\~=\other
    \catcode`\[=\other
    \catcode`\]=\other
***************
*** 5773,5779 ****
--- 6147,6155 ----
    \catcode`\$=\other
    \catcode`\#=\other
    \catcode`\&=\other
+   \catcode`\%=\other
    \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
+   %
    % Make the characters 128-255 be printing characters
    {%
      \count 1=128
***************
*** 5783,5799 ****
        \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
    % entries which were dumped with control sequences in their names.
!   % For example, 'xrdef {$\leq $-fun}{page ...} made by @defun ^^
    % 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.
    \catcode`\{=1
    \catcode`\}=2
!   \catcode`\%=\other
!   \catcode`\'=0
!   \catcode`\\=\other
    %
    \openin 1 \jobname.aux
    \ifeof 1 \else
--- 6159,6176 ----
        \ifnum \count 1<256 \loop \fi
      }%
    }%
!   %
    % Turn off \ as an escape so we do not lose on
    % entries which were dumped with control sequences in their names.
!   % For example, @xrdef{$\leq $-fun}{page ...} made by @defun ^^
    % 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.
+   \catcode`\\=\other
+   %
+   % @ is our escape character in .aux files.
    \catcode`\{=1
    \catcode`\}=2
!   address@hidden
    %
    \openin 1 \jobname.aux
    \ifeof 1 \else
***************
*** 5827,5844 ****
  %
  % Auto-number footnotes.  Otherwise like plain.
  \gdef\footnote{%
    \global\advance\footnoteno by address@hidden
    \edef\thisfootno{$^{\the\footnoteno}$}%
    %
    % In case the footnote comes at the end of a sentence, preserve the
    % extra spacing after we do the footnote number.
    address@hidden
!   address@hidden/\fi
    %
    % Remove inadvertent blank space before typesetting the footnote number.
    \unskip
    address@hidden
!   \footnotezzz
  }%
  
  % Don't bother with the trickery in plain.tex to not require the
--- 6204,6222 ----
  %
  % Auto-number footnotes.  Otherwise like plain.
  \gdef\footnote{%
+   \let\indent=\ptexindent
    \global\advance\footnoteno by address@hidden
    \edef\thisfootno{$^{\the\footnoteno}$}%
    %
    % In case the footnote comes at the end of a sentence, preserve the
    % extra spacing after we do the footnote number.
    address@hidden
!   address@hidden
    %
    % Remove inadvertent blank space before typesetting the footnote number.
    \unskip
    address@hidden
!   \dofootnote
  }%
  
  % Don't bother with the trickery in plain.tex to not require the
***************
*** 5848,5857 ****
  % \parseargline fail inside footnotes because the tokens are fixed when
  % the footnote is read.  --karl, 16nov96.
  %
! \long\gdef\footnotezzz{\insert\footins\bgroup
    % We want to typeset this text as a normal paragraph, even if the
    % footnote reference occurs in (for example) a display environment.
    % So reset some parameters.
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\ht\strutbox % top baseline for broken footnotes
    \splitmaxdepth\dp\strutbox
--- 6226,6242 ----
  % \parseargline fail inside footnotes because the tokens are fixed when
  % the footnote is read.  --karl, 16nov96.
  %
! % 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
    % footnote reference occurs in (for example) a display environment.
    % So reset some parameters.
+   \hsize=\pagewidth
    \interlinepenalty\interfootnotelinepenalty
    \splittopskip\ht\strutbox % top baseline for broken footnotes
    \splitmaxdepth\dp\strutbox
***************
*** 5881,5892 ****
    \footstrut
    address@hidden
  }
- address@hidden \let\next\f@@t
-   address@hidden \next}
- \def\f@@address@hidden
- address@hidden@foot}
- address@hidden
- 
  }%end \catcode address@hidden
  
  % @| inserts a changebar to the left of the current line.  It should
--- 6266,6271 ----
***************
*** 5933,5940 ****
  \openin 1 = epsf.tex
  \ifeof 1 \else
    \closein 1
!   % Do not bother showing banner with post-v2.7 epsf.tex (available in
!   % doc/epsf.tex until it shows up on ctan).
    \def\epsfannounce{\toks0 = }%
    \input epsf.tex
  \fi
--- 6312,6319 ----
  \openin 1 = epsf.tex
  \ifeof 1 \else
    \closein 1
!   % Do not bother showing banner with epsf.tex v2.7k (available in
!   % doc/epsf.tex and on ctan).
    \def\epsfannounce{\toks0 = }%
    \input epsf.tex
  \fi
***************
*** 6059,6069 ****
  }
  
  % Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
! % 4) hoffset; 5) binding offset; 6) topskip.  We also call
! % \setleading{\textleading}, so the caller should define \textleading.
! % The caller should also set \parskip.
  %
! \def\internalpagesizes#1#2#3#4#5#6{%
    \voffset = #3\relax
    \topskip = #6\relax
    \splittopskip = \topskip
--- 6438,6450 ----
  }
  
  % Parameters in order: 1) textheight; 2) textwidth; 3) voffset;
! % 4) hoffset; 5) binding offset; 6) topskip; 7) physical page height; 8)
! % physical page width.
! %
! % We also call \setleading{\textleading}, so the caller should define
! % \textleading.  The caller should also set \parskip.
  %
! \def\internalpagesizes#1#2#3#4#5#6#7#8{%
    \voffset = #3\relax
    \topskip = #6\relax
    \splittopskip = \topskip
***************
*** 6082,6109 ****
    \normaloffset = #4\relax
    \bindingoffset = #5\relax
    %
    \setleading{\textleading}
    %
    \parindent = \defaultparindent
    \setemergencystretch
  }
  
- % Use `small' versions.
- %
- \def\smallenvironments{%
-   \let\smalldisplay = \smalldisplayx
-   \let\smallexample = \smalllispx
-   \let\smallformat = \smallformatx
-   \let\smalllisp = \smalllispx
- }
- 
  % @letterpaper (the default).
  \def\letterpaper{{\globaldefs = 1
    \parskip = 3pt plus 2pt minus 1pt
    \textleading = 13.2pt
    %
    % If page is nothing but text, make it come out even.
!   
\internalpagesizes{46\baselineskip}{6in}{\voffset}{.25in}{\bindingoffset}{36pt}%
  }}
  
  % Use @smallbook to reset parameters for 7x9.5 (or so) format.
--- 6463,6489 ----
    \normaloffset = #4\relax
    \bindingoffset = #5\relax
    %
+   \ifpdf
+     \pdfpageheight #7\relax
+     \pdfpagewidth #8\relax
+   \fi
+   %
    \setleading{\textleading}
    %
    \parindent = \defaultparindent
    \setemergencystretch
  }
  
  % @letterpaper (the default).
  \def\letterpaper{{\globaldefs = 1
    \parskip = 3pt plus 2pt minus 1pt
    \textleading = 13.2pt
    %
    % If page is nothing but text, make it come out even.
!   \internalpagesizes{46\baselineskip}{6in}%
!                     {\voffset}{.25in}%
!                     {\bindingoffset}{36pt}%
!                     {11in}{8.5in}%
  }}
  
  % Use @smallbook to reset parameters for 7x9.5 (or so) format.
***************
*** 6111,6136 ****
    \parskip = 2pt plus 1pt
    \textleading = 12pt
    %
!   \internalpagesizes{7.5in}{5.in}{\voffset}{.25in}{\bindingoffset}{16pt}%
    %
    \lispnarrowing = 0.3in
    \tolerance = 700
    \hfuzz = 1pt
    \contentsrightmargin = 0pt
-   \deftypemargin = 0pt
    \defbodyindent = .5cm
-   \smallenvironments
  }}
  
  % Use @afourpaper to print on European A4 paper.
  \def\afourpaper{{\globaldefs = 1
    \parskip = 3pt plus 2pt minus 1pt
!   \textleading = 12pt
    %
!   
\internalpagesizes{53\baselineskip}{160mm}{\voffset}{4mm}{\bindingoffset}{44pt}%
    %
    \tolerance = 700
    \hfuzz = 1pt
  }}
  
  % Use @afivepaper to print on European A5 paper.
--- 6491,6532 ----
    \parskip = 2pt plus 1pt
    \textleading = 12pt
    %
!   \internalpagesizes{7.5in}{5in}%
!                     {\voffset}{.25in}%
!                     {\bindingoffset}{16pt}%
!                     {9.25in}{7in}%
    %
    \lispnarrowing = 0.3in
    \tolerance = 700
    \hfuzz = 1pt
    \contentsrightmargin = 0pt
    \defbodyindent = .5cm
  }}
  
  % Use @afourpaper to print on European A4 paper.
  \def\afourpaper{{\globaldefs = 1
    \parskip = 3pt plus 2pt minus 1pt
!   \textleading = 13.2pt
    %
!   % Double-side printing via postscript on Laserjet 4050
!   % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm.
!   % To change the settings for a different printer or situation, adjust
!   % \normaloffset until the front-side and back-side texts align.  Then
!   % do the same for \bindingoffset.  You can set these for testing in
!   % your texinfo source file like this:
!   % @tex
!   % \global\normaloffset = -6mm
!   % \global\bindingoffset = 10mm
!   % @end tex
!   \internalpagesizes{51\baselineskip}{160mm}
!                     {\voffset}{\hoffset}%
!                     {\bindingoffset}{44pt}%
!                     {297mm}{210mm}%
    %
    \tolerance = 700
    \hfuzz = 1pt
+   \contentsrightmargin = 0pt
+   \defbodyindent = 5mm
  }}
  
  % Use @afivepaper to print on European A5 paper.
***************
*** 6140,6176 ****
    \parskip = 2pt plus 1pt minus 0.1pt
    \textleading = 12.5pt
    %
!   \internalpagesizes{166mm}{120mm}{\voffset}{-8mm}{\bindingoffset}{8pt}%
    %
    \lispnarrowing = 0.2in
    \tolerance = 800
    \hfuzz = 1.2pt
!   \contentsrightmargin = 0mm
!   \deftypemargin = 0pt
    \defbodyindent = 2mm
    \tableindent = 12mm
-   %
-   \smallenvironments
  }}
  
! % A specific text layout, 24x15cm overall, intended for A4 paper.  Top margin
! % 29mm, hence bottom margin 28mm, nominal side margin 3cm.
  \def\afourlatex{{\globaldefs = 1
-   \textleading = 13.6pt
-   %
    \afourpaper
!   \internalpagesizes{237mm}{150mm}{3.6mm}{3.6mm}{3mm}{7mm}%
    %
!   % Must explicitly reset to 0 because we call \afourpaper, apparently,
!   % although this does not entirely make sense.
    \globaldefs = 0
  }}
  
! % Use @afourwide to print on European A4 paper in wide format.
! \def\afourwide{%
    \afourpaper
!   
\internalpagesizes{6.5in}{9.5in}{\hoffset}{\normaloffset}{\bindingoffset}{7mm}%
! }
  
  % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
  % Perhaps we should allow setting the margins, \topskip, \parskip,
--- 6536,6575 ----
    \parskip = 2pt plus 1pt minus 0.1pt
    \textleading = 12.5pt
    %
!   \internalpagesizes{160mm}{120mm}%
!                     {\voffset}{\hoffset}%
!                     {\bindingoffset}{8pt}%
!                     {210mm}{148mm}%
    %
    \lispnarrowing = 0.2in
    \tolerance = 800
    \hfuzz = 1.2pt
!   \contentsrightmargin = 0pt
    \defbodyindent = 2mm
    \tableindent = 12mm
  }}
  
! % A specific text layout, 24x15cm overall, intended for A4 paper.
  \def\afourlatex{{\globaldefs = 1
    \afourpaper
!   \internalpagesizes{237mm}{150mm}%
!                     {\voffset}{4.6mm}%
!                     {\bindingoffset}{7mm}%
!                     {297mm}{210mm}%
    %
!   % Must explicitly reset to 0 because we call \afourpaper.
    \globaldefs = 0
  }}
  
! % Use @afourwide to print on A4 paper in landscape format.
! \def\afourwide{{\globaldefs = 1
    \afourpaper
!   \internalpagesizes{241mm}{165mm}%
!                     {\voffset}{-2.95mm}%
!                     {\bindingoffset}{7mm}%
!                     {297mm}{210mm}%
!   \globaldefs = 0
! }}
  
  % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
  % Perhaps we should allow setting the margins, \topskip, \parskip,
***************
*** 6185,6191 ****
    \parskip = 3pt plus 2pt minus 1pt
    \setleading{\textleading}%
    %
!   
\internalpagesizes{#1}{\hsize}{\voffset}{\normaloffset}{\bindingoffset}{44pt}%
  }}
  
  % Set default to letter.
--- 6584,6599 ----
    \parskip = 3pt plus 2pt minus 1pt
    \setleading{\textleading}%
    %
!   \dimen0 = #1
!   \advance\dimen0 by \voffset
!   %
!   \dimen2 = \hsize
!   \advance\dimen2 by \normaloffset
!   %
!   \internalpagesizes{#1}{\hsize}%
!                     {\voffset}{\normaloffset}%
!                     {\bindingoffset}{44pt}%
!                     {\dimen0}{\dimen2}%
  }}
  
  % Set default to letter.
***************
*** 6249,6255 ****
  \catcode`\_=\active
  \def_{\ifusingtt\normalunderscore\_}
  % Subroutine for the previous macro.
! \def\_{\leavevmode \kern.06em \vbox{\hrule width.3em height.1ex}}
  
  \catcode`\|=\active
  \def|{{\tt\char124}}
--- 6657,6663 ----
  \catcode`\_=\active
  \def_{\ifusingtt\normalunderscore\_}
  % Subroutine for the previous macro.
! \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em }
  
  \catcode`\|=\active
  \def|{{\tt\char124}}
***************
*** 6263,6270 ****
  \def+{{\tt \char 43}}
  \catcode`\$=\active
  \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.
  {\catcode`\==\active
--- 6671,6676 ----
***************
*** 6281,6324 ****
  
  address@hidden
  
! % \rawbackslashxx output one backslash character in current font
  \global\chardef\rawbackslashxx=`\\
- %{\catcode`\\=\other
- address@hidden@rawbackslashxx{\}}
  
! % \rawbackslash redefines \ as input to do \rawbackslashxx.
  {\catcode`\\=\active
! @address@hidden@address@hidden }}
  
  % \normalbackslash outputs one backslash in fixed width font.
  \def\normalbackslash{{\tt\rawbackslashxx}}
  
- % \catcode 17=0   % Define control-q
  \catcode`\\=\active
  
  % Used sometimes to turn off (effectively) the active characters
  % even after parsing them.
! @address@hidden@let"address@hidden
! @address@hidden
! @address@hidden
! @address@hidden
! @address@hidden
! @let|address@hidden
! @let<address@hidden
! @let>address@hidden
! @address@hidden
! @address@hidden font-lock fix
! 
! @address@hidden@let"address@hidden
! @address@hidden
! @address@hidden
! @address@hidden
! @address@hidden
! @let|address@hidden
! @let<address@hidden
! @let>address@hidden
! @address@hidden
! @address@hidden font-lock fix
  
  % Make _ and + \other characters, temporarily.
  % This is canceled by @fixbackslash.
--- 6687,6732 ----
  
  address@hidden
  
! % \rawbackslashxx outputs one backslash character in current font,
! % as in \char`\\.
  \global\chardef\rawbackslashxx=`\\
  
! % \rawbackslash defines an active \ to do \rawbackslashxx.
! % \otherbackslash defines an active \ to be a literal `\' character with
! % catcode other.
  {\catcode`\\=\active
!  @address@hidden@address@hidden
!  @address@hidden@address@hidden
! }
! 
! % \realbackslash is an actual character `\' with catcode other.
! {\catcode`\\=\other @address@hidden
  
  % \normalbackslash outputs one backslash in fixed width font.
  \def\normalbackslash{{\tt\rawbackslashxx}}
  
  \catcode`\\=\active
  
  % Used sometimes to turn off (effectively) the active characters
  % even after parsing them.
! @address@hidden
!   @let"address@hidden
!   @address@hidden
!   @address@hidden
!   @address@hidden
!   @address@hidden
!   @let|address@hidden
!   @let<address@hidden
!   @let>address@hidden
!   @address@hidden
!   @address@hidden %$ font-lock fix
! }
! 
! % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
! % the literal character `\'.  (Thus, \ is not expandable when this is in
! % effect.)
! %
! @address@hidden@turnoffactive @address@hidden
  
  % Make _ and + \other characters, temporarily.
  % This is canceled by @fixbackslash.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]