summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/strc-blk.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/strc-blk.mkiv')
-rw-r--r--tex/context/base/mkiv/strc-blk.mkiv27
1 files changed, 16 insertions, 11 deletions
diff --git a/tex/context/base/mkiv/strc-blk.mkiv b/tex/context/base/mkiv/strc-blk.mkiv
index 1ff7ec51b..4d7437b37 100644
--- a/tex/context/base/mkiv/strc-blk.mkiv
+++ b/tex/context/base/mkiv/strc-blk.mkiv
@@ -35,14 +35,14 @@
\appendtoks
\clf_definestructureblock{\currentblock}%
\setuevalue{\e!begin\currentblock}{\dotripleempty\strc_blocks_begin[\currentblock]}%
- \setuevalue{\e!end \currentblock}{}%
+ \letvalue {\e!end \currentblock}\donothing
\to \everydefineblock
\unexpanded\def\strc_blocks_begin[#1][#2][#3]%
- {\normalexpanded{\buff_pickup{@block@}{\e!begin#1}{\e!end#1}}
- {}% before
- {\clf_savestructureblock{#1}{#2}{#3}{@block@}}%
- \plusone}% after
+ {\normalexpanded{\buff_pickup{\??block}{\e!begin#1}{\e!end#1}}
+ {}%
+ {\clf_savestructureblock{#1}{#2}{#3}{\??block}}%
+ \plusone}%
\let\strc_blocks_setup\relax
@@ -54,11 +54,13 @@
{\dostopnormalblock
\stopnointerference}
+\newconstant\c_strc_blocks_index
+
\unexpanded\def\dostartnormalblock#1#2% called at lua end
- {\bgroup
+ {\begingroup
\visibletrue % will change
- \edef\currentblock{#1}%
- \setupcurrentblock[#2]%
+ \edef\currentblock{#2}%
+ \c_strc_blocks_index#1\relax
\strc_blocks_setup
\let\strc_blocks_setup\relax
\blockparameter\c!before
@@ -70,13 +72,13 @@
{\removeunwantedspaces
\blockparameter\c!after
\par % todo: alternative = text, paragraph
- \egroup}
+ \endgroup}
\def\strc_blocks_set_state[#1][#2][#3]% state name tag
{\clf_setstructureblockstate{#1}{#2}{#3}}
\def\strc_blocks_select[#1][#2][#3][#4]% state name tag setups
- {\bgroup
+ {\begingroup
\doifelseassignment{#3}
{\getparameters[\??blocktemp][\c!criterium=\v!text,#3]%
\def\strc_blocks_setup{\setupcurrentblock[#3]}%
@@ -84,7 +86,10 @@
{\getparameters[\??blocktemp][\c!criterium=\v!text,#4]%
\def\strc_blocks_setup{\setupcurrentblock[#4]}%
\clf_selectstructureblock{#1}{#2}{#3}{\csname\??blocktemp\c!criterium\endcsname}}%
- \egroup}
+ \endgroup}
+
+\def\blockuservariable#1%
+ {\clf_structureblockuservariable\c_strc_blocks_index{#1}}
% hide : save, if [+] also hidden execute
% keep : save and normal execute