From e02235dda0e68d2131b9cf111af5448fa125ad58 Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Sun, 29 Jan 2017 22:32:58 +0000
Subject: koma-script (29jan17)

git-svn-id: svn://tug.org/texlive/trunk@43084 c570f23f-e606-0410-a88d-b1316a301751
---
 .../source/latex/koma-script/tocbasic.dtx          | 44 ++++++++++++++++++----
 1 file changed, 36 insertions(+), 8 deletions(-)

(limited to 'Master/texmf-dist/source/latex/koma-script/tocbasic.dtx')

diff --git a/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx b/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx
index 572059fd698..e3d6d3a6fbd 100644
--- a/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx
+++ b/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx
@@ -1,4 +1,4 @@
-% \CheckSum{1512}
+% \CheckSum{1535}
 % \iffalse meta-comment
 % ======================================================================
 % tocbasic.dtx
@@ -55,7 +55,7 @@
 %   Right brace   \}     Tilde         \~}
 %
 % \iffalse
-%%% From File: $Id: tocbasic.dtx 2477 2016-06-12 09:52:43Z kohm $
+%%% From File: $Id: tocbasic.dtx 2499 2016-09-06 07:00:45Z kohm $
 %<identify>%%%            (run: identify)
 %<prepare>%%%            (run: prepare)
 %<option>%%%            (run: option)
@@ -66,7 +66,7 @@
 \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi
 \begingroup
   \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}}
-  \filedate$Date: 2016-06-12 11:52:43 +0200 (Sun, 12 Jun 2016) $
+  \filedate$Date: 2016-09-06 09:00:45 +0200 (Tue, 06 Sep 2016) $
   \def\filerevision$#1: #2 ${\gdef\filerevision{r#2}}
   \filerevision$Revision: 1962 $
 \endgroup
@@ -325,6 +325,21 @@
 %    \end{macrocode}
 % \end{macro}
 %
+% \begin{macro}{\owneroftoc}
+%   \changes{v3.22}{2016/08/09}{new}
+%   Returns the owner of a TOC or uses the owner of a TOC as argument of the
+%   optional argument, if it exists.
+%    \begin{macrocode}
+\newcommand*{\owneroftoc}[2][\@firstofone]{%
+  \begingroup
+    \let\reserved@a\endgroup
+    \def\do##1##2{\ifstr{#2}{##1}{\def\reserved@a{\endgroup#1{##2}}}{}}%
+    \tb@listoftocs
+  \reserved@a
+}
+%    \end{macrocode}
+% \end{macro}
+%
 % \begin{macro}{\AtAddToTocList}
 %   \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
 %     \cs{kernel@ifnextchar}}^^A
@@ -395,6 +410,10 @@
 % \begin{macro}{\removefromtoclist}
 %   \changes{v3.20}{2016/04/12}{\cs{@ifnextchar} replaced by
 %     \cs{kernel@ifnextchar}}^^A
+% \begin{macro}{\@removefromtoclist}
+%   \changes{v3.22}{2016/09/06}{missing \cs{global} added}^^A
+% \begin{macro}{\@@removefromtoclist}
+%   \changes{v3.22}{2016/09/06}{missing \cs{global} added}^^A
 %   This command will remove an extension from the list of toc-files. If the
 %   first, optional argument is given, the extension will only be removed, if
 %   it was added by the given owner. NOTE: An empty first argument is not the
@@ -411,9 +430,10 @@
       \edef\reserved@a{##1}%
       \ifx\reserved@a\reserved@b
         \begingroup
-          \edef\reserved@a{##2}%
+          \edef\@currext{##2}%
           \edef\reserved@b{#1}%
-          \ifx\reserved@a\reserved@b\else
+          \ifx\@currext\reserved@b
+          \else
             \g@addto@macro\tb@listoftocs{\do{##1}{##2}}%
           \fi
         \endgroup
@@ -421,7 +441,7 @@
         \g@addto@macro\tb@listoftocs{\do{##1}{##2}}%
       \fi
     }%
-    \edef\reserved@b{#2}\let\tb@listoftocs\@empty
+    \edef\reserved@b{#2}\global\let\tb@listoftocs\@empty
     \tb@oldlist
   \endgroup
 }
@@ -430,16 +450,19 @@
     \let\tb@oldlist\tb@listoftocs
     \def\do##1##2{%
       \edef\reserved@a{##1}%
-      \ifx\reserved@a\reserved@b\else
+      \ifx\reserved@a\reserved@b
+      \else
         \g@addto@macro\tb@listoftocs{\do{##1}{##2}}%
       \fi
     }%
-    \edef\reserved@b{#1}\let\tb@listoftocs\@empty
+    \edef\reserved@b{#1}\global\let\tb@listoftocs\@empty
     \tb@oldlist
   \endgroup
 }
 %    \end{macrocode}
 % \end{macro}
+% \end{macro}
+% \end{macro}
 %
 % \begin{macro}{\doforeachtocfile}
 %   \changes{v3.09}{2011/03/01}{\cs{@currext} defined using \cs{edef} instead
@@ -1519,6 +1542,11 @@
   \expandafter\let\csname ext@\tb@nt@type\endcsname\tb@nt@ext
   \addtotoclist[\tb@nt@owner]{\csname ext@\tb@nt@type\endcsname}%
 %    \end{macrocode}
+% And we save the type of the extension at \cs{tb@nt@type@\meta{extension}}
+% for later usage.
+%    \begin{macrocode}
+  \expandafter\let\csname tb@nt@type@\tb@nt@ext\endcsname\tb@nt@type
+%    \end{macrocode}
 % Then we need the TOC itself with a name:
 %    \begin{macrocode}
   \scr@ifundefinedorrelax{tb@nt@types}{%
-- 
cgit v1.2.3

