Commit 5b8ff7fb authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz
Browse files

new upstream version

parent 90d139db
......@@ -3,10 +3,11 @@
% Load plain if necessary, i.e., if running under initex.
\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
%
\def\texinfoversion{2003-12-04.17}
\def\texinfoversion{2004-01-05.16}
%
% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 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
......@@ -102,6 +103,15 @@
% starts a new line in the output.
\newlinechar = `^^J
% 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{l.\the\inputlineno:\space}
\fi
% Set up fixed words for English if not already set.
\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi
\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi
......@@ -150,9 +160,12 @@
\chardef\exclamChar= `\!
\chardef\questChar = `\?
\chardef\semiChar = `\;
\chardef\spaceChar = `\ %
\chardef\underChar = `\_
\chardef\spaceChar = `\ %
\chardef\spacecat = 10
\def\spaceisspace{\catcode\spaceChar=\spacecat}
% Ignore a token.
%
\def\gobble#1{}
......@@ -160,19 +173,6 @@
% The following is used inside several \edef's.
\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname}
% Make an outer definition into an inner one (due to Chris Thompson).
% The arguments should be the control sequence to be defined, and the
% new of the \outer control sequence, as characters; the control
% sequence #1 is defined to be just the same as \csname#2\endcsname, but
% not \outer.
%
% For example, \innerdef\innernewcount{newcount} defines \innernewcount
% to be a non-outer version of \newcount.
%
\def\innerdef#1#2{\edef#1{\expandafter\noexpand\csname #2\endcsname}}%
%
\innerdef\innernewcount{newcount}%
% Hyphenation fixes.
\hyphenation{ap-pen-dix}
\hyphenation{eshell}
......@@ -244,7 +244,7 @@
\tracingassigns1
\fi
\tracingcommands3 % 3 gives us more in etex
\errorcontextlines\maxdimen
\errorcontextlines16
}%
% add check for \lastpenalty to plain's definitions. If the last thing
......@@ -388,7 +388,7 @@
\def\next{#2}%
\begingroup
\obeylines
\catcode`\ =10
\spaceisspace
#1%
\parseargline\empty% Insert the \empty token, see \finishparsearg below.
}
......@@ -402,21 +402,43 @@
% First remove any @comment, then any @c comment.
\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
\def\argremovec#1\c#2\ArgTerm{\argremovespace#1$ $\ArgTerm}
% \argremovec might leave us with trailing space, though; e.g.,
\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
% Each occurence of `\^^M' or `<space>\^^M' is replaced by a single space.
%
% \argremovec might leave us with trailing space, e.g.,
% @end itemize @c foo
% Note that the argument cannot contain the TeX $, as its catcode is
% changed to \other when Texinfo source is read.
\def\argremovespace#1 $#2\ArgTerm{\finishparsearg#1$\ArgTerm}
% This space token undergoes the same procedure and is eventually removed
% by \finishparsearg.
%
\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M}
\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M}
\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{%
\def\temp{#3}%
\ifx\temp\empty
% We cannot use \next here, as it holds the macro to run;
% thus we reuse \temp.
\let\temp\finishparsearg
\else
\let\temp\argcheckspaces
\fi
% Put the space token in:
\temp#1 #3\ArgTerm
}
% If a _delimited_ argument is enclosed in braces, they get stripped; so
% to get _exactly_ the rest of the line, we had to prevent such situation.
% We prepended an \empty token at the very beginning and we expand it
% We prepended an \empty token at the very beginning and we expand it now,
% just before passing the control to \next.
% (But first, we have to spend the remaining $ or two.)
\def\finishparsearg#1$#2\ArgTerm{\expandafter\next\expandafter{#1}}
% (Similarily, we have to think about #3 of \argcheckspacesY above: it is
% either the null string, or it ends with \^^M---thus there is no danger
% that a pair of braces would be stripped.
%
% But first, we have to remove the trailing space token.
%
\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}}
% \defparsearg\foo{...}
% \parseargdef\foo{...}
% is roughly equivalent to
% \def\foo{\parsearg\Xfoo}
% \def\Xfoo#1{...}
......@@ -424,10 +446,10 @@
% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my
% favourite TeX trick. --kasal, 16nov03
\def\defparsearg#1{%
\expandafter \dodefparsearg \csname\string#1\endcsname #1%
\def\parseargdef#1{%
\expandafter \doparseargdef \csname\string#1\endcsname #1%
}
\def\dodefparsearg#1#2{%
\def\doparseargdef#1#2{%
\def#2{\parsearg#1}%
\def#1##1%
}
......@@ -453,46 +475,66 @@
\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next}
% Define the framework for environments in texinfo.tex. It's used like this:
%
% \envdef\foo{...}
% \def\Efoo{...}
%
% It's the responsibility of \envdef to insert \begingroup before the
% actual body; @end closes the group after calling \Efoo. \envdef also
% defines \thisenv, so the current environment is known; @end checks
% whether the environment name matches. The \checkenv macro can also be
% used to check whether the current environment is the one expected.
%
% Non-false conditionals (@iftex, @ifset) don't fit into this, so they
% are not treated as enviroments; they don't open a group. (The
% implementation of @end takes care not to call \endgroup in this
% special case.)
%% These are used to keep @begin/@end levels from running away
%% Call \inENV within environments (after a \begingroup)
\newif\ifENV \ENVfalse \def\inENV{\ifENV\relax\else\ENVtrue\fi}
\def\ENVcheck{%
\ifENV\errmessage{Still within an environment; press RETURN to continue}
\endgroup\fi} % This is not perfect, but it should reduce lossage
% @end foo executes the definition of \Efoo.
%
\defparsearg\end{%
\expandafter\ifx\csname E#1\endcsname\relax
\badenderror{#1}%
% At runtime, environments start with this:
\def\startenvironment#1{\begingroup\def\thisenv{#1}}
% initialize
\let\thisenv\empty
% ... but they get defined via ``\envdef\foo{...}'':
\long\def\envdef#1#2{\def#1{\startenvironment#1#2}}
\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}}
% Check whether we're in the right environment:
\def\checkenv#1{%
\def\temp{#1}%
\ifx\thisenv\temp
\else
% Everything's ok; the right environment has been started.
\csname E#1\endcsname
\badenverr
\fi
}
\def\badenderror#1{%
\expandafter\ifx\csname#1\endcsname\relax
% There's no \foo, i.e., no ``environment'' foo.
% Evironment mismatch, #1 expected:
\def\badenverr{%
\errhelp = \EMsimple
\errmessage{Undefined command `@end #1'}%
\errmessage{This command can appear only \inenvironment\temp,
not \inenvironment\thisenv}%
}
\def\inenvironment#1{%
\ifx#1\empty
out of any environment%
\else
\unmatchedenderror{#1}%
in environment \expandafter\string#1%
\fi
}
% There is an environment #1, but it hasn't been started. Give an error.
%
\def\unmatchedenderror#1{%
\errhelp = \EMsimple
\errmessage{This `@end #1' doesn't have a matching `@#1'}%
}
% Define the control sequence \E#1 to give an unmatched @end error.
% @end foo executes the definition of \Efoo.
% But first, it executes a specialized version of \checkenv
%
\def\defineunmatchedend#1{%
\expandafter\def\csname E#1\endcsname{\unmatchedenderror{#1}}%
\parseargdef\end{%
\if 1\csname iscond.#1\endcsname
\else
% The general wording of \badenverr may not be ideal, but... --kasal, 06nov03
\expandafter\checkenv\csname#1\endcsname
\csname E#1\endcsname
\endgroup
\fi
}
\newhelp\EMsimple{Press RETURN to continue.}
......@@ -528,6 +570,9 @@
!gdef!rbraceatcmd[@}]%
!endgroup
% @comma{} to avoid , parsing problems.
\let\comma = ,
% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent
% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H.
\let\, = \c
......@@ -537,10 +582,12 @@
\let\ubaraccent = \b
\let\udotaccent = \d
% Other special characters: @questiondown @exclamdown
% Other special characters: @questiondown @exclamdown @ordf @ordm
% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss.
\def\questiondown{?`}
\def\exclamdown{!`}
\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}}
\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}}
% Dotless i and dotless j, used for accents.
\def\imacro{i}
......@@ -553,6 +600,25 @@
\fi\fi
}
% The \TeX{} logo, as in plain, but resetting the spacing so that a
% period following counts as ending a sentence. (Idea found in latex.)
%
\def\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\spacefactor=3000 }
% @LaTeX{} logo. Not quite the same results as the definition in
% latex.ltx, since we use a different font for the raised A; it's most
% convenient for us to use an explicitly smaller font, rather than using
% the \scriptstyle font (since we don't reset \scriptstyle and
% \scriptscriptstyle).
%
\def\LaTeX{%
L\kern-.36em
{\setbox0=\hbox{T}%
\vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}%
\kern-.15em
\TeX
}
% Be sure we're in horizontal mode when doing a tie, since we make space
% equivalent to this in @example-like environments. Otherwise, a space
% at the beginning of a line will start with \penalty -- and
......@@ -606,19 +672,32 @@
\newbox\groupbox
\def\vfilllimit{0.7}
%
\def\group{\begingroup
\envdef\group{%
\ifnum\catcode`\^^M=\active \else
\errhelp = \groupinvalidhelp
\errmessage{@group invalid in context where filling is enabled}%
\fi
\startsavinginserts
%
% The \vtop we start below produces a box with normal height and large
% depth; thus, TeX puts \baselineskip glue before it, and (when the
% next line of text is done) \lineskip glue after it. (See p.82 of
% the TeXbook.) Thus, space below is not quite equal to space
% above. But it's pretty close.
\def\Egroup{%
\setbox\groupbox = \vtop\bgroup
% Do @comment since we are called inside an environment such as
% @example, where each end-of-line in the input causes an
% end-of-line in the output. We don't want the end-of-line after
% the `@group' to put extra space in the output. Since @group
% should appear on a line by itself (according to the Texinfo
% manual), we don't worry about eating any user text.
\comment
}
%
% The \vtop produces a box with normal height and large depth; thus, TeX puts
% \baselineskip glue before it, and (when the next line of text is done)
% \lineskip glue after it. Thus, space below is not quite equal to space
% above. But it's pretty close.
\def\Egroup{%
% To get correct interline space between the last line of the group
% and the first line afterwards, we have to propagate \prevdepth.
\endgraf % Not \par, as it may have been set to \lisppar.
\global\dimen1 = \prevdepth
\egroup % End the \vtop.
% \dimen0 is the vertical size of the group's box.
\dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox
......@@ -632,42 +711,8 @@
\fi
\fi
\box\groupbox
\prevdepth = \dimen1
\checkinserts
\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
% and the first line afterwards is too small. But we can't put the
% strut in \Egroup, since there it would be on a line by itself.
% Hence this just inserts a strut at the beginning of each line.
\everypar = {\strut}%
%
% Since we have a strut on every line, we don't need any of TeX's
% normal interline spacing.
\offinterlineskip
%
% OK, but now we have to do something about blank
% lines in the input in @example-like environments, which normally
% just turn into \lisppar, which will insert no space now that we've
% turned off the interline space. Simplest is to make them be an
% empty paragraph.
\ifx\par\lisppar
\edef\par{\leavevmode \par}%
%
% Reset ^^M's definition to new definition of \par.
\obeylines
\fi
%
% Do @comment since we are called inside an environment such as
% @example, where each end-of-line in the input causes an
% end-of-line in the output. We don't want the end-of-line after
% the `@group' to put extra space in the output. Since @group
% should appear on a line by itself (according to the Texinfo
% manual), we don't worry about eating any user text.
\comment
}
%
% TeX puts in an \escapechar (i.e., `@') at the beginning of the help
......@@ -683,7 +728,7 @@ where each line of input produces a line of output.}
\newdimen\mil \mil=0.001in
% Old definition--didn't work.
%\defparsearg\need{\par %
%\parseargdef\need{\par %
%% This method tries to make TeX break the page naturally
%% if the depth of the box does not fit.
%{\baselineskip=0pt%
......@@ -691,7 +736,7 @@ where each line of input produces a line of output.}
%\prevdepth=-1000pt
%}}
\defparsearg\need{%
\parseargdef\need{%
% Ensure vertical mode, so we don't make a big box in the middle of a
% paragraph.
\par
......@@ -730,35 +775,10 @@ where each line of input produces a line of output.}
\fi
}
% @br forces paragraph break
% @br forces paragraph break (and is undocumented).
\let\br = \par
% @dots{} output an ellipsis using the current font.
% We do .5em per period so that it has the same spacing in a typewriter
% font as three actual period characters.
%
\def\dots{%
\leavevmode
\hbox to 1.5em{%
\hskip 0pt plus 0.25fil minus 0.25fil
.\hss.\hss.%
\hskip 0pt plus 0.5fil minus 0.5fil
}%
}
% @enddots{} is an end-of-sentence ellipsis.
%
\def\enddots{%
\leavevmode
\hbox to 2em{%
\hskip 0pt plus 0.25fil minus 0.25fil
.\hss.\hss.\hss.%
\hskip 0pt plus 0.5fil minus 0.5fil
}%
\spacefactor=3000
}
% @page forces the start of a new page.
%
\def\page{\par\vfill\supereject}
......@@ -771,10 +791,10 @@ where each line of input produces a line of output.}
\newskip\exdentamount
% This defn is used inside fill environments such as @defun.
\defparsearg\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break}
% This defn is used inside nofill environments such as @example.
\defparsearg\nofillexdent{{\advance \leftskip by -\exdentamount
\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount
\leftline{\hskip\leftskip{\rm#1}}}}
% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current
......@@ -870,19 +890,28 @@ where each line of input produces a line of output.}
% @center line
% outputs that line, centered.
%
\defparsearg\center{%
\ifhmode \hfil\break \fi
\parseargdef\center{%
\ifhmode
\let\next\centerH
\else
\let\next\centerV
\fi
\next{\hfil \ignorespaces#1\unskip \hfil}%
}
\def\centerH#1{%
{%
\hfil\break
\advance\hsize by -\leftskip
\advance\hsize by -\rightskip
\line{\hfil \ignorespaces#1\unskip \hfil}%
\line{#1}%
\break
}%
\ifhmode \break \fi
}
\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}}
% @sp n outputs n lines of vertical space
\defparsearg\sp{\vskip #1\baselineskip}
\parseargdef\sp{\vskip #1\baselineskip}
% @comment ...line which is ignored...
% @c is the same as @comment
......@@ -903,7 +932,7 @@ where each line of input produces a line of output.}
\def\asisword{asis} % no translation, these are keywords
\def\noneword{none}
%
\defparsearg\paragraphindent{%
\parseargdef\paragraphindent{%
\def\temp{#1}%
\ifx\temp\asisword
\else
......@@ -920,7 +949,7 @@ where each line of input produces a line of output.}
% We'll use ems for NCHARS like @paragraphindent.
% It seems @exampleindent asis isn't necessary, but
% I preserve it to make it similar to @paragraphindent.
\defparsearg\exampleindent{%
\parseargdef\exampleindent{%
\def\temp{#1}%
\ifx\temp\asisword
\else
......@@ -947,7 +976,7 @@ where each line of input produces a line of output.}
%
\def\insertword{insert}
%
\defparsearg\firstparagraphindent{%
\parseargdef\firstparagraphindent{%
\def\temp{#1}%
\ifx\temp\noneword
\let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent
......@@ -1019,7 +1048,7 @@ where each line of input produces a line of output.}
\mathactive
$\finishmath
}
\def\finishmath#1{#1$\Etex}
\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex.
% Some active characters (such as <) are spaced differently in math.
% We have to reset their definitions in case the @math was an argument
......@@ -1042,6 +1071,31 @@ where each line of input produces a line of output.}
\def\bullet{$\ptexbullet$}
\def\minus{$-$}
% @dots{} outputs an ellipsis using the current font.
% We do .5em per period so that it has the same spacing in a typewriter
% font as three actual period characters.
%
\def\dots{%
\leavevmode
\hbox to 1.5em{%
\hskip 0pt plus 0.25fil
.\hfil.\hfil.%
\hskip 0pt plus 0.5fil
}%
}
% @enddots{} is an end-of-sentence ellipsis.
%
\def\enddots{%
\dots
\spacefactor=3000
}
% @comma{} is so commas can be inserted into text without messing up
% Texinfo's parsing.
%
\let\comma = ,
% @refill is a no-op.
\let\refill=\relax
......@@ -1057,7 +1111,9 @@ where each line of input produces a line of output.}
% This makes it possible to make a .fmt file for texinfo.
\def\setfilename{%
\iflinks
\readauxfile
\tryauxfile
% Open the new aux file. TeX will close it automatically at exit.
\immediate\openout\auxfile=\jobname.aux
\fi % \openindices needs to do some work in any case.
\openindices
\fixbackslash % Turn off hack to swallow `\input texinfo'.
......@@ -1065,11 +1121,9 @@ where each line of input produces a line of output.}
%
% If texinfo.cnf is present on the system, read it.
% Useful for site-wide @afourpaper, etc.
% Just to be on the safe side, close the input stream before the \input.
\openin 1 texinfo.cnf
\ifeof1 \let\temp=\relax \else \def\temp{\input texinfo.cnf }\fi
\closein1
\temp
\ifeof 1 \else \input texinfo.cnf \fi
\closein 1
%
\comment % Ignore the actual filename.
}
......@@ -1172,22 +1226,32 @@ where each line of input produces a line of output.}
}
%
\def\pdfmakeoutlines{%
\openin 1 \jobname.toc
\ifeof 1\else\begingroup
\closein 1
\begingroup
% Thanh's hack / proper braces in bookmarks
\edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace
\edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace
%
% Read toc silently, to get counts of subentries for \pdfoutline.
\def\numchapentry##1##2##3##4{\def\thischapnum{##2}}%
\def\numchapentry##1##2##3##4{%
\def\thischapnum{##2}%
\let\thissecnum\empty
\let\thissubsecnum\empty
}%
\def\numsecentry##1##2##3##4{%
\advancenumber{chap\thischapnum}%
\def\thissecnum{##2}%
\advancenumber{chap\thischapnum}}%
\let\thissubsecnum\empty
}%
\def\numsubsecentry##1##2##3##4{%
\advancenumber{sec\thissecnum}%
\def\thissubsecnum{##2}%
\advancenumber{sec\thissecnum}}%
\def\numsubsubsecentry##1##2##3##4{\advancenumber{subsec\thissubsecnum}}%
}%
\def\numsubsubsecentry##1##2##3##4{%
\advancenumber{subsec\thissubsecnum}%
}%
\let\thischapnum\empty
\let\thissecnum\empty
\let\thissubsecnum\empty
%
% use \def rather than \let here because we redefine \chapentry et
% al. a second time, below.
......@@ -1219,7 +1283,7 @@ where each line of input produces a line of output.}
\indexnofonts
\turnoffactive
\input \jobname.toc
\endgroup\fi
\endgroup
}
%
\def\makelinks #1,{%
......@@ -1305,16 +1369,34 @@ where each line of input produces a line of output.}
\message{fonts,}
% Font-change commands.
% Change the current font style to #1, remembering it in \curfontstyle.
% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in
% italics, not bold italics.
%
\def\setfontstyle#1{%
\def\curfontstyle{#1}% not as a control sequence, because we are \edef'd.
\csname ten#1\endcsname % change the current font
}
% Select #1 fonts with the current style.
%
\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname}
\def\rm{\fam=0 \setfontstyle{rm}}
\def\it{\fam=\itfam \setfontstyle{it}}
\def\sl{\fam=\slfam \setfontstyle{sl}}
\def\bf{\fam=\bffam \setfontstyle{bf}}
\def\tt{\fam=\ttfam \setfontstyle{tt}}
% Texinfo sort of supports the sans serif font style, which plain TeX does not.
% So we set up a \sf analogous to plain's \rm, etc.
% So we set up a \sf.
\newfam\sffam
\def\sf{\fam=\sffam \tensf}
\def\sf{\fam=\sffam \setfontstyle{sf}}
\let\li = \sf % Sometimes we call it \li, not \sf.
% We don't need math for this one.
\def\ttsl{\tenttsl}
% We don't need math for this font style.
\def\ttsl{\setfontstyle{ttsl}}
% Default leading.
\newdimen\textleading \textleading = 13.2pt
......@@ -1365,6 +1447,7 @@ where each line of input produces a line of output.}