summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/scrn-int.mkii
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/scrn-int.mkii')
-rw-r--r--Master/texmf-dist/tex/context/base/scrn-int.mkii24
1 files changed, 18 insertions, 6 deletions
diff --git a/Master/texmf-dist/tex/context/base/scrn-int.mkii b/Master/texmf-dist/tex/context/base/scrn-int.mkii
index 9f1be68e193..cf55f864af6 100644
--- a/Master/texmf-dist/tex/context/base/scrn-int.mkii
+++ b/Master/texmf-dist/tex/context/base/scrn-int.mkii
@@ -269,18 +269,30 @@
\else
\let\openbookmarklist\empty
\fi
- \global\let\bookmarklevellist\empty
- \def\bookmarklevelcount{0}%
- \doprocessbookmarks[#1]\dogetbookmarkelement
- \dolistelement{}{}{}{}{}{}% needed to finish the first pass
- \doprocessbookmarks[#1]\doputbookmarkelement
- \flushbookmark
+ \xdef\doplacebookmarksindeed{\noexpand\dodoplacebookmarksindeed[#1][\openbookmarklist]}
\egroup
\else
\expanded{\placebookmarks\@EA[\getvalue{\??ih\v!content\c!list}]}%
\fi
\fi}
+\def\dodoplacebookmarksindeed[#1][#2]%
+ {\bgroup
+ \edef\openbookmarklist{#2}%
+ \global\let\bookmarklevellist\empty
+ \def\bookmarklevelcount{0}%
+ \doprocessbookmarks[#1]\dogetbookmarkelement
+ \dolistelement{}{}{}{}{}{}% needed to finish the first pass
+ \doprocessbookmarks[#1]\doputbookmarkelement
+ \flushbookmark
+ \egroup}
+
+\let\doplacebookmarksindeed\relax
+
+\prependtoks
+ \doplacebookmarksindeed % new, now postponed so that halfway defined commands work out ok
+\to \everystoptext
+
\def\doprocessbookmarks[#1]#2%
{\let\dolistelement#2\relax
\scratchcounter\zerocount