summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/attr-ini.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-07-10 16:30:53 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-07-10 16:30:53 +0200
commitff693671b6540fa81d2ad7aecdbe786a4df97335 (patch)
tree979066b446d6d47fcec40fa7da9978c31a2bf802 /tex/context/base/mkiv/attr-ini.mkiv
parentf58860178fcd1497d52acaa3cb2ceda7531e46ac (diff)
downloadcontext-ff693671b6540fa81d2ad7aecdbe786a4df97335.tar.gz
2018-07-10 16:00:00
Diffstat (limited to 'tex/context/base/mkiv/attr-ini.mkiv')
-rw-r--r--tex/context/base/mkiv/attr-ini.mkiv26
1 files changed, 25 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/attr-ini.mkiv b/tex/context/base/mkiv/attr-ini.mkiv
index e3d328e3d..3792b1c63 100644
--- a/tex/context/base/mkiv/attr-ini.mkiv
+++ b/tex/context/base/mkiv/attr-ini.mkiv
@@ -24,6 +24,7 @@
\installcorenamespace{attributecount} % the counter representing the attribute (attrdef'd)
\installcorenamespace{attributeid} % the internal number
\installcorenamespace{attributestack} % the attribute specific stack
+\installcorenamespace{attributepickup}
\unexpanded\def\pushattribute#1%
{\global\advance\csname\??attributestack\string#1\endcsname\plusone
@@ -40,12 +41,15 @@
\newtoks \t_attr_list_global
\newtoks \t_attr_list_local
+\newtoks \t_attr_list_pickup
\newtoks \t_attr_list_nomath
\ifdefined \s!global \else \def\s!global {global} \fi % for metatex % or hard check later
\ifdefined \s!public \else \def\s!public {public} \fi % for metatex % or hard check later
\ifdefined \s!private \else \def\s!private {private} \fi % for metatex % or hard check later
\ifdefined \s!attribute \else \def\s!attribute{attribute} \fi % for metatex % or hard check later
+\ifdefined \s!pickup \else \def\s!pickup {pickup} \fi % for metatex % or hard check later
+\ifdefined \s!forget \else \def\s!forget {forget} \fi % for metatex % or hard check later
\unexpanded\def\defineattribute {\dodoubleempty\attr_basics_define}
\unexpanded\def\definesystemattribute{\dodoubleempty\attr_basics_define_system}
@@ -53,6 +57,8 @@
\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
+
\def\attr_basics_define_indeed#1[#2][#3]%
{\ifcsname\??attributecount#2\endcsname\else
\scratchcounter\clf_defineattribute{#2}{#1}\relax
@@ -66,11 +72,29 @@
{\etoksapp\t_attr_list_local {\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
\doifinset\s!nomath{#3}%
{\etoksapp\t_attr_list_nomath{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
- % here public means 'visible' so it's not to be confused with 'public' at the lua end
\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}
+\unexpanded\def\pickupattributes
+ {\the\t_attr_list_pickup\relax}
+
+% \unexpanded\def\pickupattribute#1%
+% {\csname\??attributecount#1\endcsname\csname\??attributepickup#1\endcsname}
+
+% \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}