summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv78
1 files changed, 61 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv b/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv
index 3792b1c6370..49a1126b9a6 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv
+++ b/Master/texmf-dist/tex/context/base/mkiv/attr-ini.mkiv
@@ -57,31 +57,60 @@
\def\attr_basics_define {\attr_basics_define_indeed\s!public}
\def\attr_basics_define_system{\attr_basics_define_indeed\s!private}
- % here public means 'visible' so it's not to be confused with 'public' at the lua end
+% todo: define global !
+
+% here public means 'visible' so it's not to be confused with 'public' at the lua end
+
+% \def\attr_basics_define_indeed#1[#2][#3]%
+% {\ifcsname\??attributecount#2\endcsname\else
+% \scratchcounter\clf_defineattribute{#2}{#1}\relax
+% %\writestatus\m!system{defining #1 attribute #2 with number \number\scratchcounter}%
+% \expandafter\attributedef\csname\??attributecount#2\endcsname\scratchcounter
+% \expandafter\newconstant \csname\??attributeid#2\endcsname
+% \csname\??attributeid#2\endcsname\scratchcounter
+% % some attributes are always global
+% \doifelseinset\s!global{#3}%
+% {\etoksapp\t_attr_list_global{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
+% {\etoksapp\t_attr_list_local {\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
+% \doifinset\s!nomath{#3}%
+% {\etoksapp\t_attr_list_nomath{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
+% \doifinset\s!public{#3}%
+% {\expandafter\let\csname#2\s!attribute\expandafter\endcsname\csname\??attributeid#2\endcsname}%
+% \doifinset\s!pickup{#3}%
+% {\expandafter\newconstant\csname\??attributepickup#2\endcsname
+% \csname\??attributepickup#2\endcsname\attributeunsetvalue
+% \etoksapp\t_attr_list_pickup{\csname\??attributecount#2\endcsname\csname\??attributepickup#2\endcsname}%
+% \ifcsname#2\s!attribute\endcsname
+% \expandafter\edef\csname\s!pickup#2\s!attribute\endcsname
+% {\csname\??attributepickup#2\endcsname\csname\??attributecount#2\endcsname}%
+% \expandafter\edef\csname\s!forget#2\s!attribute\endcsname
+% {\csname\??attributepickup#2\endcsname\attributeunsetvalue}%
+% \fi}%
+% \fi}
\def\attr_basics_define_indeed#1[#2][#3]%
{\ifcsname\??attributecount#2\endcsname\else
\scratchcounter\clf_defineattribute{#2}{#1}\relax
%\writestatus\m!system{defining #1 attribute #2 with number \number\scratchcounter}%
- \expandafter\attributedef\csname\??attributecount#2\endcsname\scratchcounter
- \expandafter\newconstant \csname\??attributeid#2\endcsname
- \csname\??attributeid#2\endcsname\scratchcounter
+ \global\expandafter\attributedef\csname\??attributecount#2\endcsname\scratchcounter
+ \global\expandafter\newconstant \csname\??attributeid#2\endcsname
+ \global\csname\??attributeid#2\endcsname\scratchcounter
% some attributes are always global
\doifelseinset\s!global{#3}%
- {\etoksapp\t_attr_list_global{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
- {\etoksapp\t_attr_list_local {\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
+ {\xtoksapp\t_attr_list_global{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
+ {\xtoksapp\t_attr_list_local {\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
\doifinset\s!nomath{#3}%
- {\etoksapp\t_attr_list_nomath{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
+ {\xtoksapp\t_attr_list_nomath{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
\doifinset\s!public{#3}%
- {\expandafter\let\csname#2\s!attribute\expandafter\endcsname\csname\??attributeid#2\endcsname}%
+ {\expandafter\glet\csname#2\s!attribute\expandafter\endcsname\csname\??attributeid#2\endcsname}%
\doifinset\s!pickup{#3}%
- {\expandafter\newconstant\csname\??attributepickup#2\endcsname
- \csname\??attributepickup#2\endcsname\attributeunsetvalue
- \etoksapp\t_attr_list_pickup{\csname\??attributecount#2\endcsname\csname\??attributepickup#2\endcsname}%
+ {\global\expandafter\newconstant\csname\??attributepickup#2\endcsname
+ \global\csname\??attributepickup#2\endcsname\attributeunsetvalue
+ \xtoksapp\t_attr_list_pickup{\csname\??attributecount#2\endcsname\csname\??attributepickup#2\endcsname}%
\ifcsname#2\s!attribute\endcsname
- \expandafter\edef\csname\s!pickup#2\s!attribute\endcsname
+ \expandafter\xdef\csname\s!pickup#2\s!attribute\endcsname
{\csname\??attributepickup#2\endcsname\csname\??attributecount#2\endcsname}%
- \expandafter\edef\csname\s!forget#2\s!attribute\endcsname
+ \expandafter\xdef\csname\s!forget#2\s!attribute\endcsname
{\csname\??attributepickup#2\endcsname\attributeunsetvalue}%
\fi}%
\fi}
@@ -95,9 +124,13 @@
% \unexpanded\def\pickupattributelater#1%
% {\csname\??attributepickup#1\endcsname\csname\??attributecount#1\endcsname}
+% \unexpanded\def\newattribute#1%
+% {\attr_basics_define_indeed\s!public[\csstring#1][]%
+% \expandafter\let\expandafter#1\csname\??attributeid\csstring#1\endcsname}
+
\unexpanded\def\newattribute#1%
{\attr_basics_define_indeed\s!public[\csstring#1][]%
- \expandafter\let\expandafter#1\csname\??attributeid\csstring#1\endcsname}
+ \expandafter\glet\expandafter#1\csname\??attributeid\csstring#1\endcsname}
% expandable so we can \edef them for speed
@@ -108,8 +141,13 @@
\let\dompattribute\gobbletwoarguments
-\unexpanded\def\resetglobalattributes{\the\t_attr_list_global\attribute\zerocount\zerocount}
-\unexpanded\def\resetlocalattributes {\the\t_attr_list_local \attribute\zerocount\zerocount}
+\ifcase\contextlmtxmode
+ \unexpanded\def\resetglobalattributes{\the\t_attr_list_global\attribute\zerocount\zerocount}
+ \unexpanded\def\resetlocalattributes {\the\t_attr_list_local \attribute\zerocount\zerocount}
+\else
+ \unexpanded\def\resetglobalattributes{\the\t_attr_list_global\glyphdatafield \zerocount}
+ \unexpanded\def\resetlocalattributes {\the\t_attr_list_local \glyphdatafield \zerocount}
+\fi
\let\resetallattributes\resetlocalattributes
@@ -147,12 +185,18 @@
\unexpanded\def\showattributes{\clf_showattributes}
+%D Todo:
+
+% \appendtoks
+% \clf_cleanupattributes
+% \to \everyafterpagebreak
+
\protect \endinput
% for the luatex list:
%
% \attributedef\zeroattribute=0
-% \attributedef\someatriubute=999
+% \attributedef\someattribute=999
%
% \directlua {
% local createtoken = newtoken.create