(\synindex, \syncodeindex): \closeout the redirected index.

From: Jakob Stoklund Olesen <stoklund@mi.aau.dk>
This commit is contained in:
Karl Berry 1998-04-01 00:36:53 +00:00
parent 2fcce1d3b0
commit 9d31f1e1f1

View file

@ -2281,20 +2281,24 @@ width0pt\relax} \fi
% @synindex foo bar makes index foo feed into index bar.
% Do this instead of @defindex foo if you don't want it as a separate index.
\def\synindex #1 #2 {%
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
\noexpand\doindex {#2}}%
% The \closeout helps reduce unnecessary open files; the limit on the
% Acorn RISC OS is a mere 16 files.
\def\synindex#1 #2 {%
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
\expandafter\closeout\csname#1indfile\endcsname
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
\expandafter\xdef\csname#1index\endcsname{% define \xxxindex
\noexpand\doindex{#2}}%
}
% @syncodeindex foo bar similar, but put all entries made for index foo
% inside @code.
\def\syncodeindex #1 #2 {%
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
\expandafter\xdef\csname#1index\endcsname{% % Define \xxxindex
\noexpand\docodeindex {#2}}%
\def\syncodeindex#1 #2 {%
\expandafter\let\expandafter\synindexfoo\expandafter=\csname#2indfile\endcsname
\expandafter\closeout\csname#1indfile\endcsname
\expandafter\let\csname#1indfile\endcsname=\synindexfoo
\expandafter\xdef\csname#1index\endcsname{% define \xxxindex
\noexpand\docodeindex{#2}}%
}
% Define \doindex, the driver for all \fooindex macros.