summaryrefslogtreecommitdiff
path: root/tex/context
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2021-02-08 17:58:41 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2021-02-08 17:58:41 +0100
commit45e121c1d9414786e677d931101af1357294e9b7 (patch)
tree9a674bf47646bb9b48ea9ec209e7e213e4adc1e1 /tex/context
parent5a7dd5d18ced4a73b05467f208d4c4b0d1afebc0 (diff)
downloadcontext-45e121c1d9414786e677d931101af1357294e9b7.tar.gz
2021-02-08 17:01:00
Diffstat (limited to 'tex/context')
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkii/mult-ro.mkii3
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/mult-prm.lua2
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin26132 -> 26122 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin255713 -> 255719 bytes
-rw-r--r--tex/context/base/mkxl/char-tex.lmt142
-rw-r--r--tex/context/base/mkxl/chem-str.mkxl9
-rw-r--r--tex/context/base/mkxl/cont-new.mkxl2
-rw-r--r--tex/context/base/mkxl/context.mkxl2
-rw-r--r--tex/context/base/mkxl/enco-ini.mkxl63
-rw-r--r--tex/context/base/mkxl/font-chk.lmt212
-rw-r--r--tex/context/base/mkxl/font-chk.mkxl3
-rw-r--r--tex/context/base/mkxl/font-sym.mklx2
-rw-r--r--tex/context/base/mkxl/java-ini.mkxl4
-rw-r--r--tex/context/base/mkxl/lpdf-emb.lmt13
-rw-r--r--tex/context/base/mkxl/math-rad.mklx22
-rw-r--r--tex/context/base/mkxl/mult-ini.lmt389
-rw-r--r--tex/context/base/mkxl/mult-ini.mkxl27
-rw-r--r--tex/context/base/mkxl/pack-rul.mkxl35
-rw-r--r--tex/context/base/mkxl/page-txt.mklx2
-rw-r--r--tex/context/base/mkxl/scrn-but.mklx8
-rw-r--r--tex/context/base/mkxl/scrn-wid.mklx4
-rw-r--r--tex/context/base/mkxl/spac-ali.mkxl17
-rw-r--r--tex/context/base/mkxl/spac-pag.mkxl12
-rw-r--r--tex/context/base/mkxl/spac-ver.mkxl3
-rw-r--r--tex/context/base/mkxl/strc-sec.mkxl8
-rw-r--r--tex/context/interface/mkii/keys-ro.xml3
30 files changed, 758 insertions, 237 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index e2adc3d91..f761ac5da 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2021.02.05 17:41}
+\newcontextversion{2021.02.08 16:58}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index 1c2b39e53..370bcbd2b 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.02.05 17:41}
+\edef\contextversion{2021.02.08 16:58}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-ro.mkii b/tex/context/base/mkii/mult-ro.mkii
index 21c69669f..e497b8d6b 100644
--- a/tex/context/base/mkii/mult-ro.mkii
+++ b/tex/context/base/mkii/mult-ro.mkii
@@ -774,6 +774,8 @@
\setinterfaceconstant{deepnumbercommand}{deepnumbercommand}
\setinterfaceconstant{deeptextcommand}{deeptextcommand}
\setinterfaceconstant{default}{implicit}
+\setinterfaceconstant{defaultheight}{defaultheight}
+\setinterfaceconstant{defaultwidth}{defaultwidth}
\setinterfaceconstant{define}{define}
\setinterfaceconstant{delay}{intarziere}
\setinterfaceconstant{depth}{inaltime}
@@ -1118,6 +1120,7 @@
\setinterfaceconstant{print}{print}
\setinterfaceconstant{printable}{tiparibil}
\setinterfaceconstant{process}{process}
+\setinterfaceconstant{processors}{processors}
\setinterfaceconstant{profile}{profile}
\setinterfaceconstant{properties}{properties}
\setinterfaceconstant{pubsep}{pubsep}
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index dfe225db7..cf28adc74 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.02.05 17:41}
+\newcontextversion{2021.02.08 16:58}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 7ce8e0ca0..70860c06e 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -45,7 +45,7 @@
%D {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2021.02.05 17:41}
+\edef\contextversion{2021.02.08 16:58}
%D Kind of special:
diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua
index e89571217..250a5dfc1 100644
--- a/tex/context/base/mkiv/mult-prm.lua
+++ b/tex/context/base/mkiv/mult-prm.lua
@@ -32,6 +32,8 @@ return {
"iffontchar",
"interactionmode",
"interlinepenalties",
+ "lastchkdim",
+ "lastchknum",
"lastlinefit",
"lastnodetype",
"marks",
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 35efbfdcb..1440a78aa 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index b5fcc04ae..c7fe78f1c 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkxl/char-tex.lmt b/tex/context/base/mkxl/char-tex.lmt
index 5d2883f21..918b6cc39 100644
--- a/tex/context/base/mkxl/char-tex.lmt
+++ b/tex/context/base/mkxl/char-tex.lmt
@@ -292,9 +292,9 @@ local ligaturemapping = allocate {
}
-- Older accent handling code can be found in char-def.lua but in the meantime
--- we moved on.
+-- we moved on. First the one with commands:
-local untex
+local untex, pattern
local function toutfpattern()
if not untex then
@@ -325,16 +325,12 @@ local function toutfpattern()
return untex
end
-texcharacters.toutfpattern = toutfpattern
-
-local pattern = nil
-
local function prepare()
pattern = Cs((toutfpattern() + P(1))^0)
return pattern
end
-function texcharacters.toutf(str,strip)
+local function textoutf(str,strip)
if str == "" then
return str
elseif not find(str,"\\",1,true) then
@@ -345,6 +341,9 @@ function texcharacters.toutf(str,strip)
end
end
+texcharacters.toutfpattern = toutfpattern
+texcharacters.toutf = textoutf
+
-- print(texcharacters.toutf([[\~{Z}]],true))
-- print(texcharacters.toutf([[\'\i]],true))
-- print(texcharacters.toutf([[\'{\i}]],true))
@@ -358,6 +357,105 @@ end
-- print(texcharacters.toutf([[fo{\"o}{\ss}ar]],true))
-- print(texcharacters.toutf([[H{\'a}n Th\^e\llap{\raise 0.5ex\hbox{\'{\relax}}} Th{\'a}nh]],true))
+-- Next the ones without backslash
+
+local untex, pattern
+
+local function toutfpattern()
+ if not untex then
+ local hash = { }
+ for k, v in next, accentmapping do
+ for kk, vv in next, v do
+ hash[k..kk] = vv
+ end
+ end
+ for k, v in next, commandmapping do
+ hash[k] = v
+ end
+ for k, v in next, ligaturemapping do
+ hash[k] = v
+ end
+ untex = utfchartabletopattern(hash) / hash
+ end
+ return untex
+end
+
+local function prepare()
+ pattern = Cs((toutfpattern() + P(1))^0)
+ return pattern
+end
+
+local function textoutf(str)
+ return lpegmatch(pattern or prepare(),str)
+end
+
+texcharacters.strtoutfpattern = toutfpattern
+texcharacters.strtextoutf = textoutf
+
+local collapse = utffilters.collapse
+
+--
+
+local pattern
+
+local hash = {
+ ["acute"] = "́", -- 0x300
+ ["breve"] = "̆", -- 0x301
+ ["caron"] = "̌", -- 0x302
+ ["cedilla"] = "̧", -- 0x303
+ ["circumflex"] = "̂", -- 0x304
+ ["diaeresis"] = "̈", -- 0x305
+ ["dieresis"] = "̈", -- 0x305
+ ["umlaut"] = "̈", -- 0x305
+ ["dot"] = "̇", -- 0x306
+ ["doublegrave"] = "̏", -- 0x307
+ ["doubleverticalline"] = "̎", -- 0x308
+ ["grave"] = "̀", -- 0x309
+ ["hook"] = "̉", -- 0x30A
+ ["hungarumlaut"] = "̋", -- 0x30B
+ ["macron"] = "̄", -- 0x30C
+ ["ogonek"] = "̨", -- 0x30D -- hm
+ ["overline"] = "̅", -- 0x30E
+ ["ring"] = "̊", -- 0x30F
+ ["tilde"] = "̃", -- 0x327
+ ["verticalline"] = "̍", -- 0x328
+}
+
+local function prepare()
+ pattern = Cs((utfchartabletopattern(hash) / hash + lpegpatterns.space/"" + lpegpatterns.utf8character)^0)
+ return pattern
+end
+
+local hash = table.setmetatableindex(function(t,k)
+ local f = ""
+ k = lpegmatch(pattern or prepare(),k) or k
+ local v = collapse(k) or k
+ if k == v then
+ v = commandmapping[k] or k
+ if k ~= v then
+ f = "\\"
+ end
+ end
+ if k == v then
+ v = textoutf(k) or k
+ if k ~= v then
+ f = "\\"
+ end
+ end
+ report_defining("instead of old school '%s%s' you can input the utf sequence %s",f,k,v)
+ t[k] = v
+ return v
+end)
+
+interfaces.implement {
+ name = "chr",
+ arguments = "argument",
+ public = true,
+ actions = function(str)
+ context(hash[str]) -- expandable
+ end
+}
+
function texcharacters.safechar(n) -- was characters.safechar
local c = data[n]
if c and c.contextname then
@@ -389,16 +487,28 @@ local ctxcatcodes = catcodes.numbers.ctxcatcodes
local texsetmacro = tokens.setters.macro
local texsetchar = tokens.setters.char
+-- function texcharacters.defineaccents()
+-- local ctx_dodefineaccentcommand = context.dodefineaccent
+-- local ctx_dodefineaccent = context.dodefineaccent
+-- local ctx_dodefinecommand = context.dodefinecommand
+-- for accent, group in next, accentmapping do
+-- ctx_dodefineaccentcommand(accent)
+-- for character, mapping in next, group do
+-- ctx_dodefineaccent(accent,character,mapping)
+-- end
+-- end
+-- for command, mapping in next, commandmapping do
+-- ctx_dodefinecommand(command,mapping)
+-- end
+-- os.exit()
+-- end
+
function texcharacters.defineaccents()
- local ctx_dodefineaccentcommand = context.dodefineaccentcommand
- local ctx_dodefineaccent = context.dodefineaccent
- local ctx_dodefinecommand = context.dodefinecommand
- for accent, group in next, accentmapping do
- ctx_dodefineaccentcommand(accent)
- for character, mapping in next, group do
- ctx_dodefineaccent(accent,character,mapping)
- end
- end
+ -- local ctx_dodefinecombine = context.dodefinecombine
+ local ctx_dodefinecommand = context.dodefinecommand
+ -- for accent, group in next, accentmapping do
+ -- ctx_dodefinecombine(accent)
+ -- end
for command, mapping in next, commandmapping do
ctx_dodefinecommand(command,mapping)
end
diff --git a/tex/context/base/mkxl/chem-str.mkxl b/tex/context/base/mkxl/chem-str.mkxl
index 03f006fdf..bd35ddb12 100644
--- a/tex/context/base/mkxl/chem-str.mkxl
+++ b/tex/context/base/mkxl/chem-str.mkxl
@@ -82,13 +82,12 @@
[\c!align=\v!normal,
\c!strut=\v!no]
+\mutable\let\currentdefinedchemical\empty
+
\permanent\protected\def\setupchemicalframed
{\setupframed[\??chemicalframed]}
-\permanent\protected\overloaded\def\definechemical % is global (so we don't use the commandhandler)
- {\dosingleargument\chem_define}
-
-\def\chem_define[#1]#2%
+\permanent\protected\tolerant\overloaded\def\definechemical[#1]#:#2% is global (so we don't use the commandhandler)
{\startnointerference
\edef\currentdefinedchemical{#1}%
\enforced\let\chemical\chem_chemical_nested
@@ -102,7 +101,7 @@
% chemical symbols
\permanent\tolerant\protected\def\definechemicalsymbol[#1]#*[#2]%
- {\ifarguments\else\setvalue{\??chemicalsymbol#1}{#2}\fi}
+ {\ifarguments\else\defcsname\??chemicalsymbol#1\endcsname{#2}\fi}
\permanent\protected\def\chemicalsymbol[#1]%
{\csname\??chemicalsymbol\ifcsname\??chemicalsymbol#1\endcsname#1\else\s!unknown\fi\endcsname}
diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl
index c130a9440..314016e36 100644
--- a/tex/context/base/mkxl/cont-new.mkxl
+++ b/tex/context/base/mkxl/cont-new.mkxl
@@ -13,7 +13,7 @@
% \normalend % uncomment this to get the real base runtime
-\newcontextversion{2021.02.05 17:41}
+\newcontextversion{2021.02.08 16:58}
%D This file is loaded at runtime, thereby providing an excellent place for hacks,
%D patches, extensions and new features. There can be local overloads in cont-loc
diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl
index abd86d3cd..6b6495394 100644
--- a/tex/context/base/mkxl/context.mkxl
+++ b/tex/context/base/mkxl/context.mkxl
@@ -29,7 +29,7 @@
%D {YYYY.MM.DD HH:MM} format.
\immutable\edef\contextformat {\jobname}
-\immutable\edef\contextversion{2021.02.05 17:41}
+\immutable\edef\contextversion{2021.02.08 16:58}
%overloadmode 1 % check frozen / warning
%overloadmode 2 % check frozen / error
diff --git a/tex/context/base/mkxl/enco-ini.mkxl b/tex/context/base/mkxl/enco-ini.mkxl
index 24ebc92a1..169f49465 100644
--- a/tex/context/base/mkxl/enco-ini.mkxl
+++ b/tex/context/base/mkxl/enco-ini.mkxl
@@ -49,16 +49,67 @@
\installcorenamespace{accents}
+%D These will go away:
+
\permanent\protected\def\defineaccent#1 #2 #3 %
{\dodefineaccentcommand{#1}%
\dodefineaccent{#1}{#2}{#3}}
\permanent\protected\def\dodefineaccentcommand#1%
- {\setevalue{\string#1}{\noexpand\dohandleaccent{\string#1}}}
+ {\ifcsname\string#1\endcsname\else
+ \setevalue{\string#1}{\noexpand\dohandleaccent{\string#1}}%
+ \fi}
\permanent\protected\def\dodefineaccent#1#2#3% no spaces, used low level
{\setvalue{\??accents\string#1\string#2\empty}{#3}}
+%D Because now have this (\type {\chr} issues a one|-|time warning):
+
+% \permanent\protected\def\dodefinecombine#1% \" \' \. \= \H \^ \` \c \k \r \u \v \~
+% {\ifcsname\string#1\endcsname\else
+% % for now permanent even as these are kind of obsolete
+% \permanent\protected\edefcsname\string#1\endcsname##1{\noexpand\chr{\string#1##1}}%
+% \fi}
+
+%D But, we now go for this:
+
+\permanent\protected\edef\withgrave #1{\noexpand\chr{#1\Uchar"300}} \aliased\let\` \withgrave
+\permanent\protected\edef\withacute #1{\noexpand\chr{#1\Uchar"301}} \aliased\let\' \withacute
+\permanent\protected\edef\withcircumflex #1{\noexpand\chr{#1\Uchar"302}} \aliased\let\^ \withcircumflex
+\permanent\protected\edef\withtilde #1{\noexpand\chr{#1\Uchar"303}} \aliased\let\~ \withtilde
+\permanent\protected\edef\withmacron #1{\noexpand\chr{#1\Uchar"304}} \aliased\let\= \withmacron
+% permanent\protected\edef\withoverline #1{\noexpand\chr{#1\Uchar"305}}
+\permanent\protected\edef\withbreve #1{\noexpand\chr{#1\Uchar"306}} \aliased\let\u \withbreve
+\permanent\protected\edef\withdot #1{\noexpand\chr{#1\Uchar"307}} \aliased\let\. \withdot
+\permanent\protected\edef\withdieresis #1{\noexpand\chr{#1\Uchar"308}} \aliased\let\" \withdieresis
+% permanent\protected\edef\withhook #1{\noexpand\chr{#1\Uchar"309}}
+\permanent\protected\edef\withring #1{\noexpand\chr{#1\Uchar"30A}} \aliased\let\r \withring
+\permanent\protected\edef\withhungarumlaut #1{\noexpand\chr{#1\Uchar"30B}} \aliased\let\H \withhungarumlaut
+\permanent\protected\edef\withcaron #1{\noexpand\chr{#1\Uchar"30C}} \aliased\let\v \withcaron
+% permanent\protected\edef\withverticalline #1{\noexpand\chr{#1\Uchar"30D}}
+% permanent\protected\edef\withdoubleverticalline#1{\noexpand\chr{#1\Uchar"30E}}
+% permanent\protected\edef\withdoublegrave #1{\noexpand\chr{#1\Uchar"30F}}
+\permanent\protected\edef\withcedilla #1{\noexpand\chr{#1\Uchar"327}} \aliased\let\c \withcedilla
+\permanent\protected\edef\withogonek #1{\noexpand\chr{#1\Uchar"328}} \aliased\let\k \withogonek
+
+\aliased\let\withdiaeresis\withdieresis
+
+% \starttabulate[||||]
+% \NC \getvalue{agrave} \NC \withgrave {a} \NC \`{a} \NC \NR
+% \NC \getvalue{aacute} \NC \withacute {a} \NC \'{a} \NC \NR
+% \NC \getvalue{acircumflex} \NC \withcircumflex {a} \NC \^{a} \NC \NR
+% \NC \getvalue{atilde} \NC \withtilde {a} \NC \~{a} \NC \NR
+% \NC \getvalue{amacron} \NC \withmacron {a} \NC \={a} \NC \NR
+% \NC \getvalue{ebreve} \NC \withbreve {e} \NC \u{e} \NC \NR
+% \NC \getvalue{cdotaccent} \NC \withdot {c} \NC \.{c} \NC \NR
+% \NC \getvalue{ediaeresis} \NC \withdieresis {e} \NC \"{e} \NC \NR
+% \NC \getvalue{uring} \NC \withring {u} \NC \r{u} \NC \NR
+% \NC \getvalue{uhungarumlaut} \NC \withhungarumlaut{u} \NC \H{u} \NC \NR
+% \NC \getvalue{ecaron} \NC \withcaron {e} \NC \v{e} \NC \NR
+% \NC \getvalue{ecedilla} \NC \withcedilla {e} \NC \c{e} \NC \NR
+% \NC \getvalue{eogonek} \NC \withogonek {e} \NC \k{e} \NC \NR
+% \stoptabulate
+
% the following dirty trick is needed to catch \asciimath{\^{1/5}log}:
\permanent\protected\def\dohandleaccent#1#2% expandable because we want them in the tuc file
@@ -74,17 +125,21 @@
\immutable\letvalue{\??accents}\empty
-\permanent\protected\def\dodefinecommand#1#2%
- {\frozen\setuvalue{\string#1}{#2}} % not permanent as these are kind of obsolete
-
\permanent\protected\def\definecharacter#1 #2 %
{\doifelsenumber{\string#2}
{\setevalue{\string#1}{\utfchar{#2}}} % or {\expandafter\chardef\csname#1\endcsname#2\relax}
{\setuvalue{\string#1}{#2}}}
+%D specials: \aa \ae \cc \i \ij \l \o \oe \sz \par
+%D SPECIALS: \AA \AE \CC \j \IJ \L \O \OE \SZ \par
+
\permanent\protected\def\definecommand#1 #2 %
{\setuvalue{\string#1}{#2}}
+\permanent\protected\def\dodefinecommand#1#2% \O \L \AE ...
+ {% not permanent as these are kind of obsolete
+ \frozen\protected\defcsname\string#1\endcsname{#2}}
+
%D \macros
%D {everyuppercase, everylowercase, everysanitize}
diff --git a/tex/context/base/mkxl/font-chk.lmt b/tex/context/base/mkxl/font-chk.lmt
index 9f5aa2aab..6f927e097 100644
--- a/tex/context/base/mkxl/font-chk.lmt
+++ b/tex/context/base/mkxl/font-chk.lmt
@@ -76,8 +76,10 @@ local nextglyph = nuts.traversers.glyph
local remove_node = nuts.remove
local insert_node_after = nuts.insert_after
+local insert_node_before = nuts.insert_before
+local copy_node = nuts.copy
-local action = false
+local actions = false
-- to tfmdata.properties ?
@@ -149,78 +151,9 @@ table.setmetatableindex(mapping, { "MissingUnknown", "darkgray" })
checkers.mapping = mapping
--- We provide access by (private) name for tracing purposes. We also need
--- to make sure the dimensions are known at the lua and tex end.
-
--- local cache = { }
---
--- local function add(tfmdata,name,color,size,collected)
--- local hash = formatters["%s_%s_%i"](name,color,floor(size))
--- local chardata = cache[hash]
--- if not chardata then
--- local fake = fakes[name]
--- local width = size * fake.width
--- local height = size * fake.height
--- local depth = size * fake.depth
--- chardata = {
--- width = width,
--- height = height,
--- depth = depth,
--- commands = {
--- { "frame", width, height, depth, 65536/5, false, true, true, color },
--- }
--- }
--- cache[hash] = chardata
--- end
--- if not hasprivate(tfmdata,privatename) then
--- local privatename = formatters["placeholder %s %s"](name,color)
--- local privatecode = addprivate(tfmdata, privatename, chardata)
--- collected[privatecode] = chardata
--- end
--- return chardata
--- end
---
--- function checkers.placeholder(font,char)
--- local tfmdata = fontdata[font or true]
--- local characters = tfmdata.characters
--- local size = tfmdata.parameters.size
--- local scale = size * bpfactor
--- local collected = { }
--- local category = chardata[char].category or "unknown"
--- local fakedata = mapping[category]
--- local chardata = add(tfmdata,fakedata[1],fakedata[2],size,collected)
--- collected [char] = chardata
--- characters[char] = chardata
--- addcharacters(font, { characters = collected })
--- return "char", char -- needed for math-noa
--- end
-
--- For old times sake we keep this: a whole bunch of fake symbols
-
--- local function addplaceholders(tfmdata,feature,value)
--- if value then
--- local properties = tfmdata.properties
--- local size = tfmdata.parameters.size
--- local scale = size * bpfactor
--- local collected = { }
--- local colors = { "darkred", "darkgreen", "darkblue", "darkcyan", "darkmagenta", "darkyellow", "darkgray" }
--- for name, v in sortedhash(fakes) do
--- for i=1,#colors do
--- add(tfmdata,name,colors[i],size,collected)
--- end
--- end
--- if next(collected) then
--- local id = properties.id
--- if id then
--- addcharacters(id, { characters = collected })
--- end
--- end
--- end
--- end
-
--- local chardata = characters.data
--- local fontdata = fonts.hashes.identifiers
--- local mapping = fonts.checkers.mapping
+-- We provide access by (private) name for tracing purposes. We also need to make
+-- sure the dimensions are known at the lua and tex end. For previous variants see
+-- the mkiv files or older lmtx files. I decided to just drop the old stuff here.
function checkers.placeholder(font,char)
local category = chardata[char].category or "lu" -- todo: unknown
@@ -242,77 +175,84 @@ function checkers.placeholder(font,char)
fonts.helpers.setmetaglyphs("missing", font, char, specification)
end
--- registerotffeature {
--- name = "missing",
--- description = "missing symbols",
--- default = false,
--- manipulators = {
--- base = addplaceholders,
--- node = addplaceholders,
--- }
--- }
-
--- fonts.loggers.add_placeholders = function(id) addplaceholders(fontdata[id or true]) end
--- fonts.loggers.category_to_placeholder = mapping
-
function checkers.missing(head)
- local lastfont = nil
- local characters = nil
- if action == "replace" then
- local addplaceholder = checkers.placeholder -- so we can overload
+ local lastfont = nil
+ local characters = nil
+ local found = nil
+ local addplaceholder = checkers.placeholder -- so we can overload
+ if actions.replace or actions.decompose then
for n, char, font in nextglyph, head do
if font ~= lastfont then
lastfont = font
characters = fontcharacters[font]
end
if font > 0 and not characters[char] and is_character[chardata[char].category or "unknown"] then
- onetimemessage(font,char,"missing (will be flagged)")
- local f, c = addplaceholder(font,char)
- if f and c then
- setchar(head, c, f)
+ if actions.decompose then
+ local c = chardata[char]
+ if c then
+ local s = c.specials
+ if s and s[1] == "char" then
+ local l = #s
+ if l > 2 then
+ -- check first
+ local okay = true
+ for i=2,l do
+ if not characters[s[i]] then
+ okay = false
+ break
+ end
+ end
+ if okay then
+ -- we work backward
+ local o = n -- we're not supposed to change n (lua 5.4+)
+ onetimemessage(font,char,"missing (decomposed)")
+ setchar(n,s[l])
+ for i=l-1,2,-1 do
+ head, o = insert_node_before(head,o,copy_node(n))
+ setchar(o,s[i])
+ end
+ goto DONE
+ end
+ end
+ end
+ end
end
- end
- end
- elseif action == "remove" then
- -- faster than while loop so we delay removal
- local found = nil
- for n, char, font in nextglyph, head do
- if font ~= lastfont then
- lastfont = font
- characters = fontcharacters[font]
- end
- if font > 0 and not characters[char] and is_character[chardata[char].category or "unknown"] then
- onetimemessage(font,char,"missing (will be deleted)")
- if not found then
- found = { n }
- else
- found[#found+1] = n
+ if actions.replace then
+ onetimemessage(font,char,"missing (replaced)")
+ local f, c = addplaceholder(font,char)
+ if f and c then
+ setchar(n, c, f)
+ end
+ goto DONE
end
+ if actions.remove then
+ onetimemessage(font,char,"missing (deleted)")
+ if not found then
+ found = { n }
+ else
+ found[#found+1] = n
+ end
+ goto DONE
+ end
+ onetimemessage(font,char,"missing (checked)")
+ ::DONE::
end
end
- if found then
- for i=1,#found do
- head = remove_node(head,found[i],true)
- end
- end
- else
- for n, char, font in nextglyph, head do
- if font ~= lastfont then
- lastfont = font
- characters = fontcharacters[font]
- end
- if font > 0 and not characters[char] and is_character[chardata[char].category or "unknown"] then
- onetimemessage(font,char,"missing")
- end
+ end
+ if found then
+ for i=1,#found do
+ head = remove_node(head,found[i],true)
end
end
return head
end
local relevant = {
- "missing (will be deleted)",
- "missing (will be flagged)",
- "missing"
+ "missing (decomposed)",
+ "missing (replaced)",
+ "missing (deleted)",
+ "missing (checked)",
+ "missing",
}
local function getmissing(id)
@@ -380,17 +320,19 @@ do
trackers.register("fonts.missing", function(v)
if v then
enableaction("processors","fonts.checkers.missing")
+ if v == true then
+ actions = { check = true }
+ else
+ actions = utilities.parsers.settings_to_set(v)
+ if not loaded and actions.replace then
+ metapost.simple("simplefun",'loadfile("mp-miss.mpxl");')
+ loaded = true
+ end
+ end
else
disableaction("processors","fonts.checkers.missing")
+ actions = false
end
- -- if v == "replace" then
- -- otffeatures.defaults.missing = true
- -- end
- if not loaded and v == "replace" then
- metapost.simple("simplefun",'loadfile("mp-miss.mpxl");')
- loaded = true
- end
- action = v
end)
logs.registerfinalactions(function()
diff --git a/tex/context/base/mkxl/font-chk.mkxl b/tex/context/base/mkxl/font-chk.mkxl
index f64756983..34d676482 100644
--- a/tex/context/base/mkxl/font-chk.mkxl
+++ b/tex/context/base/mkxl/font-chk.mkxl
@@ -22,9 +22,10 @@
% \definefontfeature[default][default][missing=yes]
% \enabletrackers[fonts.missing=replace]
-\permanent\protected\def\checkcharactersinfont {\enabletrackers[fonts.missing]}
+\permanent\protected\def\checkmissingcharacters {\enabletrackers[fonts.missing]}
\permanent\protected\def\removemissingcharacters {\enabletrackers[fonts.missing=remove]}
\permanent\protected\def\replacemissingcharacters{\enabletrackers[fonts.missing=replace]}
+\permanent\protected\def\handlemissingcharacters {\enabletrackers[fonts.missing={decompose,replace}]}
% \enableexperiments[fonts.compact]
diff --git a/tex/context/base/mkxl/font-sym.mklx b/tex/context/base/mkxl/font-sym.mklx
index c521582a2..806d2aff6 100644
--- a/tex/context/base/mkxl/font-sym.mklx
+++ b/tex/context/base/mkxl/font-sym.mklx
@@ -163,6 +163,8 @@
\font_basics_define_symbolic_font
\fi}
+\mutable\let\currentsymbolfont\empty
+
\def\font_basics_define_symbolic_font
{\definefont[currentsymbolfont][\askedsymbolfont]%
\currentsymbolfont
diff --git a/tex/context/base/mkxl/java-ini.mkxl b/tex/context/base/mkxl/java-ini.mkxl
index 513dc20e3..f0e260eea 100644
--- a/tex/context/base/mkxl/java-ini.mkxl
+++ b/tex/context/base/mkxl/java-ini.mkxl
@@ -102,7 +102,7 @@
{\begingroup
\obeylualines
\obeyluatokens
- \let\u\m_java_escape_u
+ \enforced\let\u\m_java_escape_u
\java_start_code}
\def\java_start_code#1\stopJScode
@@ -114,7 +114,7 @@
{\begingroup
\obeylualines
\obeyluatokens
- \let\u\m_java_escape_u
+ \enforced\let\u\m_java_escape_u
\java_start_preamble}
\def\java_start_preamble#1\stopJSpreamble
diff --git a/tex/context/base/mkxl/lpdf-emb.lmt b/tex/context/base/mkxl/lpdf-emb.lmt
index 3412a5a78..4337e5931 100644
--- a/tex/context/base/mkxl/lpdf-emb.lmt
+++ b/tex/context/base/mkxl/lpdf-emb.lmt
@@ -1574,9 +1574,8 @@ do
local name = f_glyph(nofglyphs)
local stream = nil
if fixdepth then
- local depth = data.depth or 0
- local height = data.height or 0
- if depth ~= 0 or height ~= 0 then
+ local depth = data.depth or 0
+ if depth ~= 0 then
local d = data.dropin.descriptions[data.index]
local b = d.boundingbox
local l = b[1]
@@ -1584,13 +1583,13 @@ do
local w = r - l
local scale = w / d.width
local x = l
- local y = - b[4] - b[2] - d.depth
+ -- local y = - b[4] - b[2] - (d.depth or 0)
+ local y = - (d.depth or 0)
local scale = w / (image.width * bpfactor)
stream = f_image_c_xy(scale,scale,x,y,name)
- else
- stream = f_image_c(name)
end
- else
+ end
+ if not stream then
stream = f_image_c(name)
end
useddoc[glyph] = image
diff --git a/tex/context/base/mkxl/math-rad.mklx b/tex/context/base/mkxl/math-rad.mklx
index 4196bd0f7..8906efdc8 100644
--- a/tex/context/base/mkxl/math-rad.mklx
+++ b/tex/context/base/mkxl/math-rad.mklx
@@ -92,23 +92,25 @@
\c!mpoffset=.25\exheight]
\appendtoks
- \frozen\instance\setuevalue{\currentmathradical}{\math_radical_handle{\currentmathradical}}
+ \frozen\protected\instance\edefcsname\currentmathradical\endcsname{\math_radical_handle{\currentmathradical}}
\to \everydefinemathradical
-\protected\def\math_radical_handle#tag%
+\mutable\let\currentmathradical \empty
+\mutable\let\currentmathradicaldegree\empty
+
+\tolerant\protected\def\math_radical_handle#tag#*[#degree]#:#body%
{\begingroup
\edef\currentmathradical{#tag}%
- \doifelsenextoptionalcs\math_radical_degree_yes\math_radical_degree_nop}
-
-\def\math_radical_alternative{\csname\??mathradicalalternative\mathradicalparameter\c!alternative\endcsname}
+ \edef\currentmathradicaldegree{#degree}%
+ \ifempty\currentmathradicaldegree
+ \let\currentmathradicaldegree\m_math_no_degree
+ \fi
+ \math_radical_alternative{#body}%
+ \endgroup}
\def\m_math_no_degree{{}}
-\def\math_radical_degree_yes[#degree]{\edef\currentmathradicaldegree{#degree}\math_radical_indeed}
-\def\math_radical_degree_nop {\let\currentmathradicaldegree\m_math_no_degree\math_radical_indeed}
-
-\def\math_radical_indeed#body%
- {\math_radical_alternative{#body}\endgroup}
+\def\math_radical_alternative{\csname\??mathradicalalternative\mathradicalparameter\c!alternative\endcsname}
\setvalue{\??mathradicalalternative\v!default}% #body%
{\rootradical{\currentmathradicaldegree}} % {#body}}
diff --git a/tex/context/base/mkxl/mult-ini.lmt b/tex/context/base/mkxl/mult-ini.lmt
new file mode 100644
index 000000000..7c60d5b33
--- /dev/null
+++ b/tex/context/base/mkxl/mult-ini.lmt
@@ -0,0 +1,389 @@
+if not modules then modules = { } end modules ['mult-ini'] = {
+ version = 1.001,
+ comment = "companion to mult-ini.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+local format, gmatch, match, find, sub = string.format, string.gmatch, string.match, string.find, string.sub
+local lpegmatch = lpeg.match
+local serialize, concat = table.serialize, table.concat
+local rawget, type, tonumber, next = rawget, type, tonumber, next
+
+local context = context
+local commands = commands
+local implement = interfaces.implement
+
+local allocate = utilities.storage.allocate
+local mark = utilities.storage.mark
+local prtcatcodes = catcodes.numbers.prtcatcodes
+local vrbcatcodes = catcodes.numbers.vrbcatcodes
+local contextsprint = context.sprint
+local setmetatableindex = table.setmetatableindex
+local formatters = string.formatters
+
+local report_interface = logs.reporter("interface","initialization")
+
+interfaces = interfaces or { }
+interfaces.constants = mark(interfaces.constants or { })
+interfaces.variables = mark(interfaces.variables or { })
+interfaces.elements = mark(interfaces.elements or { })
+interfaces.formats = mark(interfaces.formats or { })
+interfaces.translations = mark(interfaces.translations or { })
+interfaces.setupstrings = mark(interfaces.setupstrings or { })
+interfaces.corenamespaces = mark(interfaces.corenamespaces or { })
+interfaces.usednamespaces = mark(interfaces.usednamespaces or { })
+
+local registerstorage = storage.register
+local sharedstorage = storage.shared
+
+local constants = interfaces.constants
+local variables = interfaces.variables
+local elements = interfaces.elements
+local formats = interfaces.formats
+local translations = interfaces.translations
+local setupstrings = interfaces.setupstrings
+local corenamespaces = interfaces.corenamespaces
+local usednamespaces = interfaces.usednamespaces
+local reporters = { } -- just an optimization
+
+local setmacro = tokens.setters.macro
+
+registerstorage("interfaces/constants", constants, "interfaces.constants")
+registerstorage("interfaces/variables", variables, "interfaces.variables")
+registerstorage("interfaces/elements", elements, "interfaces.elements")
+registerstorage("interfaces/formats", formats, "interfaces.formats")
+registerstorage("interfaces/translations", translations, "interfaces.translations")
+registerstorage("interfaces/setupstrings", setupstrings, "interfaces.setupstrings")
+registerstorage("interfaces/corenamespaces", corenamespaces, "interfaces.corenamespaces")
+registerstorage("interfaces/usednamespaces", usednamespaces, "interfaces.usednamespaces")
+
+interfaces.interfaces = {
+ "cs", "de", "en", "fr", "it", "nl", "ro", "pe",
+}
+
+sharedstorage.currentinterface = sharedstorage.currentinterface or "en"
+sharedstorage.currentresponse = sharedstorage.currentresponse or "en"
+
+local currentinterface = sharedstorage.currentinterface
+local currentresponse = sharedstorage.currentresponse
+
+interfaces.currentinterface = currentinterface
+interfaces.currentresponse = currentresponse
+
+local complete = allocate()
+interfaces.complete = complete
+
+local function resolve(t,k) -- one access needed to get loaded (not stored!)
+ report_interface("loading interface definitions from 'mult-def.lua'")
+ complete = dofile(resolvers.findfile("mult-def.lua"))
+ report_interface("loading interface messages from 'mult-mes.lua'")
+ complete.messages = dofile(resolvers.findfile("mult-mes.lua"))
+ interfaces.complete = complete
+ return rawget(complete,k)
+end
+
+setmetatableindex(complete, resolve)
+
+local function valueiskey(t,k) -- will be helper
+ t[k] = k
+ return k
+end
+
+setmetatableindex(variables, valueiskey)
+setmetatableindex(constants, valueiskey)
+setmetatableindex(elements, valueiskey)
+setmetatableindex(formats, valueiskey)
+setmetatableindex(translations, valueiskey)
+setmetatableindex(setupstrings, valueiskey)
+
+function interfaces.registernamespace(n,namespace)
+ corenamespaces[n] = namespace
+ usednamespaces[namespace] = n
+end
+
+function interfaces.getnamespace(n)
+ return usednamespaces[n] .. ">"
+end
+
+if documentdata then
+
+ local prefix, getmacro
+
+ function documentdata.variable(name)
+ if not prefix then
+ prefix = usednamespaces.variables .. ">document:"
+ end
+ if not getmacro then
+ getmacro = tokens.getters.macro
+ end
+ return getmacro(prefix..name)
+ end
+
+end
+
+local function resolve(t,k)
+ local v = logs.reporter(k)
+ t[k] = v
+ return v
+end
+
+setmetatableindex(reporters,resolve)
+
+for category, _ in next, translations do
+ -- We pre-create reporters for already defined messages
+ -- because otherwise listing is incomplete and we want
+ -- to use that for checking so delaying makes not much
+ -- sense there.
+ local r = reporters[category]
+end
+
+-- adding messages
+
+local function add(target,tag,values)
+ local t = target[tag]
+ if not f then
+ target[tag] = values
+ else
+ for k, v in next, values do
+ if f[k] then
+ -- error
+ else
+ f[k] = v
+ end
+ end
+ end
+end
+
+function interfaces.settranslation(tag,values)
+ add(translations,tag,values)
+end
+
+function interfaces.setformat(tag,values)
+ add(formats,tag,values)
+end
+
+local function getsetupstring(tag)
+ return setupstrings[tag] or tag
+end
+
+interfaces.getsetupstring = getsetupstring
+
+-- the old method:
+
+local replacer = lpeg.replacer { { "--", "%%a" } }
+
+local function fulltag(category,tag)
+ return formatters["%s:%s"](category,lpegmatch(replacer,tag))
+end
+
+function interfaces.setmessages(category,str)
+ for tag, message in gmatch(str,"(%S+) *: *(.-) *[\n\r]") do
+ if tag == "title" then
+ translations[tag] = translations[tag] or tag
+ else
+ formats[fulltag(category,tag)] = lpegmatch(replacer,message)
+ end
+ end
+end
+
+function interfaces.setmessage(category,tag,message)
+ formats[fulltag(category,tag)] = lpegmatch(replacer,message)
+end
+
+function interfaces.getmessage(category,tag,default)
+ return formats[fulltag(category,tag)] or default or "unknown message"
+end
+
+function interfaces.doifelsemessage(category,tag)
+ return rawget(formats,fulltag(category,tag))
+end
+
+local splitter = lpeg.splitat(",")
+
+function interfaces.showmessage(category,tag,arguments)
+ local r = reporters[category]
+ local f = formats[fulltag(category,tag)]
+ local t = type(arguments)
+ if t == "string" and #arguments > 0 then
+ r(f,lpegmatch(splitter,arguments))
+ elseif t == "table" then
+ r(f,unpack(arguments))
+ elseif arguments then
+ r(f,arguments)
+ else
+ r(f)
+ end
+end
+
+-- till here
+
+function interfaces.setvariable(variable,given)
+ variables[given] = variable
+end
+
+function interfaces.setconstant(constant,given)
+ constants[given] = constant
+end
+
+function interfaces.setelement(element,given)
+ elements[given] = element
+end
+
+-- the real thing:
+
+logs.setmessenger(context.verbatim.ctxreport)
+
+interfaces.cachedsetups = interfaces.cachedsetups or { }
+interfaces.hashedsetups = interfaces.hashedsetups or { }
+
+local cachedsetups = interfaces.cachedsetups
+local hashedsetups = interfaces.hashedsetups
+
+storage.register("interfaces/cachedsetups", cachedsetups, "interfaces.cachedsetups")
+storage.register("interfaces/hashedsetups", hashedsetups, "interfaces.hashedsetups")
+
+function interfaces.cachesetup(t)
+ local hash = serialize(t)
+ local done = hashedsetups[hash]
+ if done then
+ return cachedsetups[done]
+ else
+ done = #cachedsetups + 1
+ cachedsetups[done] = t
+ hashedsetups[hash] = done
+ return t
+ end
+end
+
+function interfaces.interfacedcommand(name)
+ local command = complete.commands[name]
+ return command and command[currentinterface] or name
+end
+
+-- interface
+
+function interfaces.writestatus(category,message)
+ reporters[category](message) -- could also be a setmetatablecall
+end
+
+function interfaces.message(str)
+ texio.write(str) -- overloaded
+end
+
+implement { name = "registernamespace", actions = interfaces.registernamespace, arguments = { "integer", "string" } }
+implement { name = "setinterfaceconstant", actions = interfaces.setconstant, arguments = "2 strings" }
+implement { name = "setinterfacevariable", actions = interfaces.setvariable, arguments = "2 strings" }
+implement { name = "setinterfaceelement", actions = interfaces.setelement, arguments = "2 strings" }
+implement { name = "setinterfacemessage", actions = interfaces.setmessage, arguments = "3 strings" }
+implement { name = "setinterfacemessages", actions = interfaces.setmessages, arguments = "2 strings" }
+
+implement {
+ name = "showmessage",
+ public = true,
+ protected = true,
+ arguments = "3 arguments" ,
+ actions = interfaces.showmessage,
+}
+
+implement {
+ name = "doifelsemessage",
+ public = true,
+ protected = true,
+ arguments = "2 arguments",
+ actions = { interfaces.doifelsemessage, commands.doifelse },
+}
+
+implement {
+ name = "getmessage",
+ public = true,
+ protected = true,
+ arguments = "3 arguments",
+ actions = function(...)
+ setmacro("currentmessagetext", interfaces.getmessage(...))
+ end,
+}
+
+implement {
+ name = "writestatus",
+ overload = true,
+ public = true,
+ protected = true,
+ arguments = "2 arguments",
+ actions = interfaces.writestatus,
+}
+
+implement {
+ name = "message",
+ overload = true,
+ public = true,
+ protected = true,
+ arguments = "string",
+ actions = interfaces.message,
+}
+
+local function gss(s)
+ contextsprint(vrbcatcodes,getsetupstring(s))
+end
+
+implement { -- will be overloaded
+ name = "getsetupstring",
+ public = true,
+ -- protected = true,
+ arguments = "string",
+ actions = gss,
+}
+
+implement {
+ name = "rawsetupstring",
+ public = true,
+ arguments = "string",
+ actions = gss,
+}
+
+
+local function showassignerror(namespace,key,line)
+ -- if key and key ~= "" and key ~= "," then
+ local ns, instance = match(namespace,"^(%d+)[^%a]+(%a*)")
+ if ns then
+ namespace = corenamespaces[tonumber(ns)] or ns
+ end
+ -- injected in the stream for timing:
+ if instance and instance ~= "" then
+ context.writestatus("setup",formatters["error in line %a, namespace %a, instance %a, key %a"](line,namespace,instance,key))
+ else
+ context.writestatus("setup",formatters["error in line %a, namespace %a, key %a"](line,namespace,key))
+ end
+ -- end
+end
+
+implement {
+ name = "showassignerror",
+ actions = showassignerror,
+ arguments = { "string", "string", "integer" },
+}
+
+-- a simple helper
+
+local settings_to_hash = utilities.parsers.settings_to_hash
+
+local makesparse = function(t)
+ for k, v in next, t do
+ if not v or v == "" then
+ t[k] = nil
+ end
+ end
+ return t
+end
+
+function interfaces.checkedspecification(specification)
+ local kind = type(specification)
+ if kind == "table" then
+ return makesparse(specification)
+ elseif kind == "string" and specification ~= "" then
+ return makesparse(settings_to_hash(specification))
+ else
+ return { }
+ end
+end
diff --git a/tex/context/base/mkxl/mult-ini.mkxl b/tex/context/base/mkxl/mult-ini.mkxl
index f2dad6fac..17f63ef93 100644
--- a/tex/context/base/mkxl/mult-ini.mkxl
+++ b/tex/context/base/mkxl/mult-ini.mkxl
@@ -19,7 +19,7 @@
\unprotect
-\registerctxluafile{mult-ini}{}
+\registerctxluafile{mult-ini}{autosuffix}
\registerctxluafile{mult-fmt}{initexonly}
%D \macros
@@ -368,28 +368,25 @@
\aliased\let\stopmessages\relax
+\mutable\let\currentmessagetext\empty
+
\permanent\protected\def\setinterfacemessage#1#2#3%
- {\ifcsname\m!prefix!#1\endcsname\else\immutable\setgvalue{\m!prefix!#1}{#1}\fi
+ {\ifcsname\m!prefix!#1\endcsname\else\immutable\gdefcsname\m!prefix!#1\endcsname{#1}\fi
\clf_setinterfacemessage{#1}{#2}{#3}}
-\pushoverloadmode
-
-\permanent\protected\def\setmessagetext #1#2{\relax\edef\currentmessagetext{\clf_getmessage{#1}{#2}}}
-\permanent\protected\def\getmessage #1#2{\relax\clf_getmessage{#1}{#2}}
-\permanent\protected\def\doifelsemessage #1#2{\relax\clf_doifelsemessage{#1}{#2}}
-\permanent\protected\def\showmessage #1#2#3{\relax\clf_showmessage{#1}{#2}{#3}}
-\permanent\protected\def\writestatus #1#2{\relax\clf_writestatus{#1}{#2}}
-\permanent\protected\def\message {\relax\clf_message}
-
-\popoverloadmode
+% \getmessage % {tag} {index} -> \currentmessagetext
+% \doifelsemessage % {tag} {index}
+% \showmessage % {tag} {index} {detail}
+% \writestatus % {tag} {string}
+% \message % {string}
\aliased\let\doifmessageelse\doifelsemessage
\permanent\protected\def\inlinemessage #1{\dontleavehmode{\tttf#1}}
\permanent\protected\def\displaymessage#1{\blank\inlinemessage{#1}\blank}
-\permanent\let\getsetupstring\clf_getsetupstring
-\permanent\let\rawsetupstring\clf_rawsetupstring
+% \getsetupstring % {tag} defined at the lua end
+% \rawsetupstring % {tag} defined at the lua end
%D For old times sake:
@@ -753,6 +750,8 @@
%D So much for the basic multi||lingual interface commands. The macro's can be
%D enhanced with more testing facilities, but for the moment they suffice.
+% use \Uchar
+
\ifdefined\zwnj \else \immutable\edef\zwnj{\directlua{utf.char(\number"200C)}} \fi % needed for cont-pe % maybe to char-utf.mkiv
\ifdefined\zwj \else \immutable\edef\zwj {\directlua{utf.char(\number"200D)}} \fi % needed for cont-pe % maybe to char-utf.mkiv
diff --git a/tex/context/base/mkxl/pack-rul.mkxl b/tex/context/base/mkxl/pack-rul.mkxl
index e793b1e53..47f1b0a19 100644
--- a/tex/context/base/mkxl/pack-rul.mkxl
+++ b/tex/context/base/mkxl/pack-rul.mkxl
@@ -1357,22 +1357,25 @@
%D never occur. Nevertheless we implement the whole scheme, if not for future
%D extensions.
-%D \macros
-%D {doassigncheckedframeoffset}
-%D
-%D Offset helper (see menus):
-
-\def\doassigncheckedframeoffset#1#2% could be a fast \csname .. \endcsname
- {\edef\checkedframeoffset{#2}%
- #1%
- \ifempty\checkedframeoffset \zeropoint\orelse
- \ifx\checkedframeoffset\v!overlay\zeropoint\orelse
- \ifx\checkedframeoffset\v!none \zeropoint\orelse
- \ifx\checkedframeoffset\v!frame \zeropoint\orelse
- \ifx\checkedframeoffset\v!default\zeropoint\else
- #2%
- \fi
- \relax}
+% %D \macros
+% %D {doassigncheckedframeoffset}
+% %D
+% %D Offset helper (see menus):
+%
+% \def\doassigncheckedframeoffset#1#2% could be a fast \csname .. \endcsname
+% {\edef\checkedframeoffset{#2}%
+% #1%
+% \ifempty\checkedframeoffset \zeropoint\orelse
+% \ifx\checkedframeoffset\v!overlay\zeropoint\orelse
+% \ifx\checkedframeoffset\v!none \zeropoint\orelse
+% \ifx\checkedframeoffset\v!frame \zeropoint\orelse
+% \ifx\checkedframeoffset\v!default\zeropoint\else
+% #2%
+% \fi
+% \relax}
+%
+% \def\doassigncheckedframeoffset#1#2% could be a fast \csname .. \endcsname
+% {#1\ifchkdim#2\or#2\else\zeropoint\fi}%
%D \macros
%D {ifreshapeframebox}
diff --git a/tex/context/base/mkxl/page-txt.mklx b/tex/context/base/mkxl/page-txt.mklx
index 981a15089..10b5d1a74 100644
--- a/tex/context/base/mkxl/page-txt.mklx
+++ b/tex/context/base/mkxl/page-txt.mklx
@@ -422,7 +422,7 @@
%D The placement of a whole line is handled by the next two macros. These are hooked
%D into the general purpose token list registers mentioned before.
-\let\currentlayouttextline\relax
+\mutable\let\currentlayouttextline\relax
\def\page_layouts_place_text_line_indeed#vertical#height%
{\let\currentlayouttextline#vertical%
diff --git a/tex/context/base/mkxl/scrn-but.mklx b/tex/context/base/mkxl/scrn-but.mklx
index 4fd7bfffc..d9d7d22ed 100644
--- a/tex/context/base/mkxl/scrn-but.mklx
+++ b/tex/context/base/mkxl/scrn-but.mklx
@@ -434,10 +434,10 @@
\newconditional\c_scrn_menu_zerodimensions
\def\scrn_menu_set_used
- {\doassigncheckedframeoffset\d_scrn_menu_offset_left {\interactionmenuparameter\c!leftoffset }%
- \doassigncheckedframeoffset\d_scrn_menu_offset_right {\interactionmenuparameter\c!rightoffset }%
- \doassigncheckedframeoffset\d_scrn_menu_offset_top {\interactionmenuparameter\c!topoffset }%
- \doassigncheckedframeoffset\d_scrn_menu_offset_bottom{\interactionmenuparameter\c!bottomoffset}%
+ {\d_scrn_menu_offset_left \ifchkdim\interactionmenuparameter\c!leftoffset \or\lastchkdim\else\zeropoint\fi
+ \d_scrn_menu_offset_right \ifchkdim\interactionmenuparameter\c!rightoffset \or\lastchkdim\else\zeropoint\fi
+ \d_scrn_menu_offset_top \ifchkdim\interactionmenuparameter\c!topoffset \or\lastchkdim\else\zeropoint\fi
+ \d_scrn_menu_offset_bottom\ifchkdim\interactionmenuparameter\c!bottomoffset\or\lastchkdim\else\zeropoint\fi
\d_scrn_menu_asked_width \interactionmenuparameter\c!maxwidth
\d_scrn_menu_asked_height \interactionmenuparameter\c!maxheight
\d_scrn_menu_used_width\dimexpr
diff --git a/tex/context/base/mkxl/scrn-wid.mklx b/tex/context/base/mkxl/scrn-wid.mklx
index 225bdc161..5d1d67a99 100644
--- a/tex/context/base/mkxl/scrn-wid.mklx
+++ b/tex/context/base/mkxl/scrn-wid.mklx
@@ -599,7 +599,9 @@
% see usage. Probaly by that time this feature is dropped (as are other media
% rel;ated ones).
-\let\currentrendering\empty
+\mutable\let\currentrendering \empty
+\mutable\let\currentrenderingtype \empty
+\mutable\let\currentrenderingwindow\empty
\definereference[StartCurrentRendering] [\v!StartRendering {\currentrendering}]
\definereference[StopCurrentRendering] [\v!StopRendering {\currentrendering}]
diff --git a/tex/context/base/mkxl/spac-ali.mkxl b/tex/context/base/mkxl/spac-ali.mkxl
index 17886dfd3..67265c1a4 100644
--- a/tex/context/base/mkxl/spac-ali.mkxl
+++ b/tex/context/base/mkxl/spac-ali.mkxl
@@ -21,6 +21,23 @@
\registerctxluafile{spac-ali}{autosuffix,optimize}
+% Used once so ... replace it or use if more frequently ...
+
+\installcorenamespace {alignswitch}
+
+% maybe \setconstantvalue or so
+
+\expandafter\integerdef\csname\??alignswitch\v!left \endcsname\zerocount
+\expandafter\integerdef\csname\??alignswitch\v!middle\endcsname\plusone
+\expandafter\integerdef\csname\??alignswitch\v!right \endcsname\plustwo
+
+\mutable\integerdef\alignmentswitch\zerocount
+
+\permanent\protected\def\setalignmentswitch#1%
+ {\integerdef\alignmentswitch\csname\??alignswitch\ifcsname\??alignswitch#1\endcsname#1\else\v!left\fi\endcsname}
+
+% till here
+
\definesystemattribute[realign] [public] % might be combined with the next one
\definesystemattribute[alignstate][public] % will make a single attributes for several states
diff --git a/tex/context/base/mkxl/spac-pag.mkxl b/tex/context/base/mkxl/spac-pag.mkxl
index dbee431af..d9f7c67a1 100644
--- a/tex/context/base/mkxl/spac-pag.mkxl
+++ b/tex/context/base/mkxl/spac-pag.mkxl
@@ -15,18 +15,6 @@
\unprotect
-%D The code here has evolved over time and might not be the best
-%D around. Maybe much will be gone a some point.
-
-\installcorenamespace {alignswitch}
-
-\letvalue{\??alignswitch\v!left }\zerocount
-\letvalue{\??alignswitch\v!middle}\plusone
-\letvalue{\??alignswitch\v!right }\plustwo
-
-\permanent\protected\def\setalignmentswitch#1%
- {\chardef\alignmentswitch\csname\??alignswitch\ifcsname\??alignswitch#1\endcsname#1\else\v!left\fi\endcsname}
-
\newif \ifpagestatemismatch
\newcount \realpagestateno
\newconstant\frozenpagestate
diff --git a/tex/context/base/mkxl/spac-ver.mkxl b/tex/context/base/mkxl/spac-ver.mkxl
index 5c150f225..6764213e3 100644
--- a/tex/context/base/mkxl/spac-ver.mkxl
+++ b/tex/context/base/mkxl/spac-ver.mkxl
@@ -1708,6 +1708,9 @@
\permanent\protected\def\setupgridsnapping[#1]% less overhead than setuplayout (needs testing)
{\setlayoutparameter\c!grid{#1}\synchronizegridsnapping}
+\mutable\let\checkedgridmethod\empty % these can become private
+\mutable\let\checkedgridscope \v!local % these can become private
+
\permanent\protected\def\checkgridmethod#1%
{\edef\p_grid{#1}%
\ifempty\p_grid
diff --git a/tex/context/base/mkxl/strc-sec.mkxl b/tex/context/base/mkxl/strc-sec.mkxl
index 863c454a9..50a81610e 100644
--- a/tex/context/base/mkxl/strc-sec.mkxl
+++ b/tex/context/base/mkxl/strc-sec.mkxl
@@ -520,7 +520,7 @@
\pop_macro_currentheadparent
\pop_macro_currenthead}
-\let\currentnamedsection\empty
+\mutable\let\currentnamedsection\empty
\installmacrostack\currentnamedsection
@@ -572,10 +572,12 @@
\newtoks\everydefinesection
+\mutable\let\currentsection\empty % historic alias
+
\permanent\protected\def\definesection[#1]%
{\ifcsname\??headlevel#1\endcsname \else
- \edef\currentsection{#1}% not used, will go
\edef\currenthead{#1}%
+ \let\currentsection\currenthead % just an alias
\global\advance\maxstructuredepth\plusone
\setevalue{\??headlevel#1}{\the\maxstructuredepth}%
\setstructurelevel{#1}{\sectionlevel{#1}}%
@@ -613,7 +615,7 @@
% be part of the parent chain lookup mechanism; it's also
% mkii compatible. Somewhat weird that it's part of the
% top level structure but it will be flattened anyway.
- \let\currenthead\currentsection %
+ % \let\currenthead\currentsection % hm
\setheadparameter\c!textstyle {\directheadparameter\c!style}%
\setheadparameter\c!textcolor {\directheadparameter\c!color}%
\setheadparameter\c!numberstyle{\directheadparameter\c!style}%
diff --git a/tex/context/interface/mkii/keys-ro.xml b/tex/context/interface/mkii/keys-ro.xml
index ef5c385fc..bc9e87ddf 100644
--- a/tex/context/interface/mkii/keys-ro.xml
+++ b/tex/context/interface/mkii/keys-ro.xml
@@ -780,6 +780,8 @@
<cd:constant name='deepnumbercommand' value='deepnumbercommand'/>
<cd:constant name='deeptextcommand' value='deeptextcommand'/>
<cd:constant name='default' value='implicit'/>
+ <cd:constant name='defaultheight' value='defaultheight'/>
+ <cd:constant name='defaultwidth' value='defaultwidth'/>
<cd:constant name='define' value='define'/>
<cd:constant name='delay' value='intarziere'/>
<cd:constant name='depth' value='inaltime'/>
@@ -1124,6 +1126,7 @@
<cd:constant name='print' value='print'/>
<cd:constant name='printable' value='tiparibil'/>
<cd:constant name='process' value='process'/>
+ <cd:constant name='processors' value='processors'/>
<cd:constant name='profile' value='profile'/>
<cd:constant name='properties' value='properties'/>
<cd:constant name='pubsep' value='pubsep'/>