diff build-aux/texinfo.tex @ 18129:d57623645981

update from texinfo
author Karl Berry <karl@freefriends.org>
date Wed, 14 Oct 2015 15:32:04 -0700
parents fe0c1d00c894
children 5a70f6c50ff3
line wrap: on
line diff
--- a/build-aux/texinfo.tex	Tue Oct 13 23:25:18 2015 -0700
+++ b/build-aux/texinfo.tex	Wed Oct 14 15:32:04 2015 -0700
@@ -3,7 +3,7 @@
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2015-10-09.18}
+\def\texinfoversion{2015-10-14.18}
 %
 % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
 % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
@@ -1106,6 +1106,7 @@
 \newtoks\toksC
 \newtoks\toksD
 \newbox\boxA
+\newbox\boxB
 \newcount\countA
 \newif\ifpdf
 \newif\ifpdfmakepagedest
@@ -4605,6 +4606,8 @@
 }
 
 % \commondummiesnofonts: common to \commondummies and \indexnofonts.
+% Define \definedumyletter, \definedummyaccent and \definedummyword before
+% using.
 %
 \def\commondummiesnofonts{%
   % Control letters and accents.
@@ -4700,11 +4703,27 @@
 {
 \catcode`\<=13
 \catcode`\-=13
+\catcode`\`=13
   \gdef\indexnonalnumdisappear{%
-    \backslashdisappear
-    \def-{}%
-    \def<{}%
-    \def\@{}%
+    \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax\else
+      % @set txiindexlquoteignore makes us ignore left quotes in the sort term.
+      % (Introduced for FSFS 2nd ed.)
+      \let`=\empty
+    \fi
+    %
+    \expandafter\ifx\csname SETtxiindexbackslashignore\endcsname\relax\else
+      \backslashdisappear
+    \fi
+    %
+    \expandafter\ifx\csname SETtxiindexhyphenignore\endcsname\relax\else
+      \def-{}%
+    \fi
+    \expandafter\ifx\csname SETtxiindexlessthanignore\endcsname\relax\else
+      \def<{}%
+    \fi
+    \expandafter\ifx\csname SETtxiindexatsignignore\endcsname\relax\else
+      \def\@{}%
+    \fi
   }
 
   \gdef\indexnonalnumreappear{%
@@ -4728,7 +4747,6 @@
   \def\definedummyletter##1{\let##1\empty}%
   % All control words become @asis by default; overrides below.
   \let\definedummyword\definedummyaccent
-  %
   \commondummiesnofonts
   %
   % Don't no-op \tt, since it isn't a user-level command
@@ -4741,8 +4759,6 @@
   \def\_{\normalunderscore}%
   \def\-{}% @- shouldn't affect sorting
   %
-  % Unfortunately, texindex < 6.0 is not prepared to handle braces in the
-  % content at all, so these won't be sorted in ASCII order.
   \def\lbracechar{{\indexlbrace}}%
   \def\rbracechar{{\indexrbrace}}%
   \let\{=\lbracechar
@@ -4805,9 +4821,6 @@
   \def\result{=>}%
   \def\textdegree{o}%
   %
-  \expandafter\ifx\csname SETtxiindexlquoteignore\endcsname\relax
-  \else \indexlquoteignore \fi
-  %
   % We need to get rid of all macros, leaving only the arguments (if present).
   % Of course this is not nearly correct, but it is the best we can do for now.
   % makeinfo does not expand macros in the argument to @deffn, which ends up
@@ -4821,10 +4834,6 @@
   \macrolist
 }
 
-% Undocumented (for FSFS 2nd ed.): @set txiindexlquoteignore makes us
-% ignore left quotes in the sort term.
-{\catcode`\`=\active
- \gdef\indexlquoteignore{\let`=\empty}}
 
 \let\SETmarginindex=\relax % put index entries in margin (undocumented)?
 
@@ -4917,9 +4926,9 @@
   % Get the string to sort by, by processing the index entry with all
   % font commands turned off.
   {\indexnofonts
+   \indexnonalnumdisappear
    \xdef\indexsortkey{}%
    \let\sortas=\indexwritesortas
-   \indexnonalnumdisappear
    \edef\temp{\the\toks0}%
    \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
    \ifx\indexsortkey\empty
@@ -5214,30 +5223,6 @@
     %  How much \indexdotfill is stretched, or how much \parfillskip is shrunk
     %  Number of lines (\linepenalty)
     %  
-    % Do not prefer a separate line ending with a hyphen to fewer lines.
-    \finalhyphendemerits = 0
-    %
-    % Word spacing - no stretch
-    \spaceskip=\fontdimen2\font minus \fontdimen4\font
-    %
-    \linepenalty=1000  % Discourage line breaks.
-    \hyphenpenalty=5000  % Discourage hyphenation.
-    %
-    % Ragged right margin, but not for the last line with the leaders in it.
-    % When an index entry spans lines, this stretch competes with the stretch
-    % in \indexdotfill to determine how the line will be split.
-    \rightskip=\entryrightmargin
-    \advance\rightskip by 0pt plus .6\hsize
-    %
-    % \parfillskip is at the end of the line with the page number
-    \parfillskip=0pt
-    % Cancel the \rightskip stretch
-    \advance \parfillskip by 0pt plus -.6\hsize
-    % Determine how far we can stretch into the margin.
-    % This allows, e.g., "Appendix H  GNU Free Documentation License" to fit
-    % on one line.
-    \advance \parfillskip by 0pt minus .6\entryrightmargin
-    %
     % Swallow the left brace of the text (first parameter):
     \afterassignment\doentry
     \let\temp =
@@ -5245,20 +5230,26 @@
 \def\entrybreak{\unskip\space\ignorespaces}%
 \def\doentry{%
     % Save the text of the entry in a \vtop.
-    \global\setbox\entryindexbox=\vtop\bgroup
+    \global\setbox\boxA=\hbox\bgroup
     \bgroup % Instead of the swallowed brace.
       \noindent
       \aftergroup\finishentry
       % And now comes the text of the entry.
-}
-\def\finishentry#1{%
+      % Not absorbing as a macro argument reduces the chance of problems
+      % with catcodes occurring.
+}
+{\catcode`\@=11
+\gdef\finishentry#1{%
+    \egroup % end box A
+    \dimen@ = \wd\boxA % Length of text of entry
+    \global\setbox\boxA=\hbox\bgroup\unhbox\boxA
     % #1 is the page number.
     %
     % The following is kludged to not output a line of dots in the index if
     % there are no page numbers.  The next person who breaks this will be
     % cursed by a Unix daemon.
-    \setbox\boxA = \hbox{#1}%
-    \ifdim\wd\boxA = 0pt
+    \setbox\boxB = \hbox{#1}%
+    \ifdim\wd\boxB = 0pt
       \null\nobreak\hfill\ %
     \else
       %
@@ -5271,23 +5262,62 @@
         \hskip\skip\thinshrinkable #1%
       \fi
     \fi
-    % Parameters for formatting this paragraph, reset for each paragraph.
+    \egroup % end \boxA
+    \global\setbox\entryindexbox=\vtop\bgroup\noindent
+    % We want the text of the entries to be aligned to the left, and the
+    % page numbers to be aligned to the right.
+    %
+    \advance\leftskip by 0pt plus 1fil
+    \advance\leftskip by 0pt plus -1fill
+    \rightskip = 0pt plus -1fil
+    \advance\rightskip by 0pt plus 1fill
+    % Cause last line, which could consist of page numbers on their own if the 
+    % list of page numbers is long, to be aligned to the right.
+    \parfillskip=0pt plus -1fill
+    %
+    \hangindent=1em
+    %
+    \advance\rightskip by \entryrightmargin
+    % Determine how far we can stretch into the margin.
+    % This allows, e.g., "Appendix H  GNU Free Documentation License" to fit
+    % on one line.
+    \advance \parfillskip by 0pt minus .6\entryrightmargin
     %
-    % \hangindent is only relevant when the entry text and page number
-    % don't both fit on one line.  In that case, bob suggests starting the
-    % dots pretty far over on the line.  Unfortunately, a large
-    % indentation looks wrong when the entry text itself is broken across
-    % lines.  So we use a small indentation and put up with long leaders.
+    \ifdim\wd\boxA > \hsize % If the entry doesn't fit in one line
+    \ifdim\dimen@ > 0.9\hsize   % due to long index text
+      \dimen@ = 0.6\dimen@ % Try to split the text roughly evenly
+      \dimen@ii = \hsize
+      \advance \dimen@ii by -1em
+      \ifnum\dimen@>\dimen@ii
+        % If the entry is too long, use the whole line
+        \dimen@ = \dimen@ii
+      \else
+        % Cause stretch of 1fill at the end of the first line, to avoid
+        % extra spacing in a short first line.
+        \hskip 0pt plus 1fill
+      \fi
+      \parshape = 2 0pt \dimen@ 1em \dimen@ii
+      % Ideally we'd add a finite glue at the end of the first line only, but
+      % TeX doesn't seem to provide a way to do such a thing.
+    \fi\fi
+    \unhbox\boxA
     %
-    \hangafter = 1
-    \hangindent = 1em
-    \par
+    % Do not prefer a separate line ending with a hyphen to fewer lines.
+    \finalhyphendemerits = 0
+    %
+    % Word spacing - no stretch
+    \spaceskip=\fontdimen2\font minus \fontdimen4\font
+    %
+    \linepenalty=1000  % Discourage line breaks.
+    \hyphenpenalty=10000  % Discourage hyphenation.
+    %
+    \par % format the paragraph
     \egroup % The \vtop
   \endgroup
   % delay text of entry until after penalty
   \bgroup\aftergroup\insertindexentrybox
   \entryorphanpenalty
-}
+}}
 
 \newskip\thinshrinkable
 \skip\thinshrinkable=.15em minus .15em
@@ -5322,10 +5352,11 @@
 }
 
 % Like plain.tex's \dotfill, except uses up at least 1 em.
-% Using a finite stretch encourages several words to appear on a second line
-% if the entry is broken.
+% The filll stretch here overpowers both the fil and fill stretch to push
+% the page number to the right.
 \def\indexdotfill{\cleaders
-  \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus .4\hsize}
+  \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1filll}
+
 
 \def\primary #1{\line{#1\hfil}}