summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-05-24 17:32:43 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-05-24 17:32:43 +0200
commite52e58ff4a7007ca774905727391e5f78135f98d (patch)
tree55357f7bcd2825670a21f79b7f3c3fa9a1404e8f /tex
parent6a68bb9d4e7e8454b031143b9cd14edf3702a68d (diff)
downloadcontext-e52e58ff4a7007ca774905727391e5f78135f98d.tar.gz
2018-05-24 15:56:00
Diffstat (limited to 'tex')
-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-de.mkii1
-rw-r--r--tex/context/base/mkii/mult-ro.mkii1
-rw-r--r--tex/context/base/mkiv/anch-bck.mkvi4
-rw-r--r--tex/context/base/mkiv/anch-pgr.mkiv12
-rw-r--r--tex/context/base/mkiv/anch-pos.lua4
-rw-r--r--tex/context/base/mkiv/anch-pos.mkiv16
-rw-r--r--tex/context/base/mkiv/anch-snc.mkiv6
-rw-r--r--tex/context/base/mkiv/anch-tab.mkiv17
-rw-r--r--tex/context/base/mkiv/attr-ini.lua2
-rw-r--r--tex/context/base/mkiv/attr-ini.mkiv6
-rw-r--r--tex/context/base/mkiv/bibl-bib.mkiv6
-rw-r--r--tex/context/base/mkiv/cldf-ini.lua4
-rw-r--r--tex/context/base/mkiv/colo-ini.mkiv2
-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/file-job.mkvi6
-rw-r--r--tex/context/base/mkiv/file-mod.mkvi32
-rw-r--r--tex/context/base/mkiv/font-fil.mkvi26
-rw-r--r--tex/context/base/mkiv/font-gbn.lua2
-rw-r--r--tex/context/base/mkiv/font-ini.mkvi58
-rw-r--r--tex/context/base/mkiv/font-ots.lua8
-rw-r--r--tex/context/base/mkiv/font-set.mkvi4
-rw-r--r--tex/context/base/mkiv/font-sym.mkvi2
-rw-r--r--tex/context/base/mkiv/font-var.mkvi2
-rw-r--r--tex/context/base/mkiv/grph-trf.mkiv8
-rw-r--r--tex/context/base/mkiv/lang-ini.mkiv8
-rw-r--r--tex/context/base/mkiv/lpdf-ini.lua8
-rw-r--r--tex/context/base/mkiv/lpdf-mis.lua56
-rw-r--r--tex/context/base/mkiv/lpdf-tag.lua3
-rw-r--r--tex/context/base/mkiv/luat-ini.mkiv2
-rw-r--r--tex/context/base/mkiv/luat-usr.mkiv4
-rw-r--r--tex/context/base/mkiv/math-ali.mkiv29
-rw-r--r--tex/context/base/mkiv/math-arr.mkiv57
-rw-r--r--tex/context/base/mkiv/math-frc.mkiv42
-rw-r--r--tex/context/base/mkiv/math-ini.mkiv40
-rw-r--r--tex/context/base/mkiv/math-pln.mkiv2
-rw-r--r--tex/context/base/mkiv/math-stc.mkvi14
-rw-r--r--tex/context/base/mkiv/meta-ini.mkiv6
-rw-r--r--tex/context/base/mkiv/meta-pdh.mkiv24
-rw-r--r--tex/context/base/mkiv/mult-aux.mkiv119
-rw-r--r--tex/context/base/mkiv/mult-def.lua10
-rw-r--r--tex/context/base/mkiv/mult-low.lua4
-rw-r--r--tex/context/base/mkiv/mult-prm.lua1
-rw-r--r--tex/context/base/mkiv/node-fin.lua83
-rw-r--r--tex/context/base/mkiv/node-fnt.lua6
-rw-r--r--tex/context/base/mkiv/node-res.lua1
-rw-r--r--tex/context/base/mkiv/pack-bar.mkiv4
-rw-r--r--tex/context/base/mkiv/pack-box.mkiv1
-rw-r--r--tex/context/base/mkiv/pack-cut.mkiv78
-rw-r--r--tex/context/base/mkiv/pack-rul.mkiv38
-rw-r--r--tex/context/base/mkiv/page-imp.mkiv20
-rw-r--r--tex/context/base/mkiv/page-lay.mkiv33
-rw-r--r--tex/context/base/mkiv/page-mix.mkiv27
-rw-r--r--tex/context/base/mkiv/page-mul.mkiv18
-rw-r--r--tex/context/base/mkiv/page-run.mkiv6
-rw-r--r--tex/context/base/mkiv/page-sel.mkvi4
-rw-r--r--tex/context/base/mkiv/page-set.mkiv40
-rw-r--r--tex/context/base/mkiv/page-sid.mkiv4
-rw-r--r--tex/context/base/mkiv/page-str.mkiv2
-rw-r--r--tex/context/base/mkiv/page-txt.mkvi7
-rw-r--r--tex/context/base/mkiv/publ-ini.mkiv30
-rw-r--r--tex/context/base/mkiv/scrn-pag.mkvi20
-rw-r--r--tex/context/base/mkiv/spac-ali.mkiv16
-rw-r--r--tex/context/base/mkiv/spac-grd.mkiv4
-rw-r--r--tex/context/base/mkiv/spac-hor.mkiv36
-rw-r--r--tex/context/base/mkiv/spac-lin.mkiv4
-rw-r--r--tex/context/base/mkiv/spac-ver.mkiv26
-rw-r--r--tex/context/base/mkiv/status-files.log38
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin0 -> 26151 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin257460 -> 257583 bytes
-rw-r--r--tex/context/base/mkiv/strc-con.mkvi8
-rw-r--r--tex/context/base/mkiv/strc-flt.mkvi6
-rw-r--r--tex/context/base/mkiv/strc-itm.mkvi4
-rw-r--r--tex/context/base/mkiv/strc-lnt.mkvi6
-rw-r--r--tex/context/base/mkiv/strc-lst.mkvi4
-rw-r--r--tex/context/base/mkiv/strc-not.mkvi6
-rw-r--r--tex/context/base/mkiv/strc-ref.mkvi12
-rw-r--r--tex/context/base/mkiv/strc-reg.mkiv4
-rw-r--r--tex/context/base/mkiv/strc-ren.mkiv24
-rw-r--r--tex/context/base/mkiv/strc-sec.mkiv29
-rw-r--r--tex/context/base/mkiv/strc-tag.mkiv41
-rw-r--r--tex/context/base/mkiv/supp-box.mkiv131
-rw-r--r--tex/context/base/mkiv/supp-mat.mkiv2
-rw-r--r--tex/context/base/mkiv/syst-aux.mkiv115
-rw-r--r--tex/context/base/mkiv/syst-ini.mkiv10
-rw-r--r--tex/context/base/mkiv/tabl-com.mkiv64
-rw-r--r--tex/context/base/mkiv/tabl-ltb.mkiv8
-rw-r--r--tex/context/base/mkiv/tabl-ntb.mkiv22
-rw-r--r--tex/context/base/mkiv/tabl-tab.mkiv18
-rw-r--r--tex/context/base/mkiv/tabl-tbl.mkiv112
-rw-r--r--tex/context/base/mkiv/toks-ini.lua4
-rw-r--r--tex/context/base/mkiv/trac-vis.lua2
-rw-r--r--tex/context/base/mkiv/trac-vis.mkiv2
-rw-r--r--tex/context/base/mkiv/type-ini.mkvi75
-rw-r--r--tex/context/base/mkiv/typo-cap.lua13
-rw-r--r--tex/context/base/mkiv/typo-del.mkiv16
-rw-r--r--tex/context/base/mkiv/typo-rub.mkiv9
-rw-r--r--tex/context/base/mkiv/typo-scr.mkiv6
-rw-r--r--tex/context/base/mkiv/util-tab.lua1
-rw-r--r--tex/context/interface/mkii/keys-de.xml1
-rw-r--r--tex/context/interface/mkii/keys-ro.xml1
-rw-r--r--tex/context/interface/mkiv/context-en.xml95
-rw-r--r--tex/context/interface/mkiv/i-commandhandler.xml12
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin848019 -> 850668 bytes
-rw-r--r--tex/context/interface/mkiv/i-context.xml1
-rw-r--r--tex/context/interface/mkiv/i-hspace.xml4
-rw-r--r--tex/context/interface/mkiv/i-interactionscreen.xml1
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin61079 -> 61088 bytes
-rw-r--r--tex/context/modules/mkiv/m-oldfun.mkiv4
-rw-r--r--tex/context/modules/mkiv/m-oldnum.mkiv2
-rw-r--r--tex/context/modules/mkiv/m-units.mkiv14
-rw-r--r--tex/context/modules/mkiv/ppchtex.mkiv8
-rw-r--r--tex/context/modules/mkiv/s-article-basic.mkiv19
-rw-r--r--tex/context/modules/mkiv/s-article-titlepage.mkiv65
-rw-r--r--tex/context/modules/mkiv/s-article-titletop.mkiv68
-rw-r--r--tex/context/modules/mkiv/s-fonts-shapes.mkiv2
-rw-r--r--tex/context/modules/mkiv/x-mathml.mkiv2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua8
120 files changed, 1464 insertions, 809 deletions
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 6dfacb773..ba09a88df 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{2018.05.19 21:46}
+\newcontextversion{2018.05.24 15:49}
%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 a1e07e038..3ba85bde6 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{2018.05.19 21:46}
+\edef\contextversion{2018.05.24 15:49}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-de.mkii b/tex/context/base/mkii/mult-de.mkii
index a5269ff3f..2bd9353d0 100644
--- a/tex/context/base/mkii/mult-de.mkii
+++ b/tex/context/base/mkii/mult-de.mkii
@@ -1274,6 +1274,7 @@
\setinterfaceconstant{vcompact}{vcompact}
\setinterfaceconstant{vector}{vector}
\setinterfaceconstant{veroffset}{kopfoffset}
+\setinterfaceconstant{vfactor}{vfaktor}
\setinterfaceconstant{vfil}{vfil}
\setinterfaceconstant{viewerprefix}{viewerprefix}
\setinterfaceconstant{voffset}{voffset}
diff --git a/tex/context/base/mkii/mult-ro.mkii b/tex/context/base/mkii/mult-ro.mkii
index 46b61c882..411ef77e6 100644
--- a/tex/context/base/mkii/mult-ro.mkii
+++ b/tex/context/base/mkii/mult-ro.mkii
@@ -1274,6 +1274,7 @@
\setinterfaceconstant{vcompact}{vcompact}
\setinterfaceconstant{vector}{vector}
\setinterfaceconstant{veroffset}{veroffset}
+\setinterfaceconstant{vfactor}{vfactor}
\setinterfaceconstant{vfil}{vfil}
\setinterfaceconstant{viewerprefix}{viewerprefix}
\setinterfaceconstant{voffset}{voffset}
diff --git a/tex/context/base/mkiv/anch-bck.mkvi b/tex/context/base/mkiv/anch-bck.mkvi
index 911b1bca2..f8316349b 100644
--- a/tex/context/base/mkiv/anch-bck.mkvi
+++ b/tex/context/base/mkiv/anch-bck.mkvi
@@ -47,7 +47,7 @@
\unexpanded\def\anch_backgrounds_text_initialize
{\doifelsepositionsused\enableparpositions\donothing
- \global\let\anch_backgrounds_text_initialize\relax}
+ \glet\anch_backgrounds_text_initialize\relax}
\appendtoks
\anch_backgrounds_text_initialize
@@ -352,7 +352,7 @@
{\ifproductionrun
\enabletextarearegistration
\enablehiddenbackground
- \global\let\checkpositionoverlays\relax
+ \glet\checkpositionoverlays\relax
\fi}
% shape handling
diff --git a/tex/context/base/mkiv/anch-pgr.mkiv b/tex/context/base/mkiv/anch-pgr.mkiv
index e49d18b8f..5300a9a9c 100644
--- a/tex/context/base/mkiv/anch-pgr.mkiv
+++ b/tex/context/base/mkiv/anch-pgr.mkiv
@@ -66,7 +66,7 @@
\def\anch_positions_action_indeed_yes % we need a way to figure out if we have actions
{\begingroup
- \setbox\scratchbox\hbox
+ \setbox\scratchbox\hbox % \hpack
{\anch_positions_trace_action_yes
\the\everyinsertpositionaction
\the\everypositionaction
@@ -130,12 +130,12 @@
\else
\c_anch_page_width \paperwidth
\c_anch_page_height\paperheight
- \anch_make_page_box{#1}% \ifvbox#1\setbox#1\hbox{\box#1}\fi
+ \anch_make_page_box{#1}% \ifvbox#1\setbox#1\hpack{\box#1}\fi
\fi
\else
\c_anch_page_width \paperwidth
\c_anch_page_height\paperheight
- \anch_make_page_box{#1}% \ifvbox#1\setbox#1\hbox{\box#1}\fi
+ \anch_make_page_box{#1}% \ifvbox#1\setbox#1\hpack{\box#1}\fi
\fi
\fi\fi}
@@ -243,7 +243,7 @@
\let\MPanchor\MPoverlayanchor % no need to fetch it already, seldom used
\the\everyinsertpositionaction
\copyposition{\currentpositionoverlay::\MPanchoridentifier}\MPanchorid
- \setbox\scratchbox\hbox to \d_overlay_width
+ \setbox\scratchbox\hbox to \d_overlay_width % \hpack
{\dopositionaction{\currentpositionoverlay::\MPanchoridentifier}\hss}%
\ht\scratchbox\d_overlay_height
\dp\scratchbox\zeropoint
@@ -275,7 +275,7 @@
\let\MPanchor\MPoverlayanchor % no need to fetch it already, seldom used
\the\everyinsertpositionaction
\copyposition{\currentpositionoverlay::\MPanchoridentifier}\MPanchorid
- \setbox\scratchbox\hbox to \d_overlay_width
+ \setbox\scratchbox\hbox to \d_overlay_width % \hpack
{\dopositionaction{\currentpositionoverlay::\MPanchoridentifier}\hss}%
\ht\scratchbox\d_overlay_height
\dp\scratchbox\zeropoint
@@ -366,7 +366,7 @@
\anch_positions_meta_graphic_prepare
\obeyMPboxorigin % do we also set the size ? when needed this must be done in mp ... might change
\def\anch_positions_meta_graphic_direct{\anch_positions_meta_graphic_nested{#3}}% takes two extra arguments
- \setbox\b_anch_positions_graphic\hbox
+ \setbox\b_anch_positions_graphic\hbox % \hpack
{\ignorespaces\csname#1#2\endcsname\removelastspace}%
\smashbox\b_anch_positions_graphic
\box\b_anch_positions_graphic
diff --git a/tex/context/base/mkiv/anch-pos.lua b/tex/context/base/mkiv/anch-pos.lua
index e5f58c36c..e6a69b1bd 100644
--- a/tex/context/base/mkiv/anch-pos.lua
+++ b/tex/context/base/mkiv/anch-pos.lua
@@ -20,6 +20,10 @@ more efficient.</p>
-- this is one of the first modules using scanners and we need to replace
-- it by implement and friends
+-- we could have namespaces, like p, page, region, columnarea, textarea but then
+-- we need virtual table accessors as well as have tag/id accessors ... we don't
+-- save much here (at least not now)
+
local tostring, next, rawget, rawset, setmetatable, tonumber = tostring, next, rawget, rawset, setmetatable, tonumber
local sort, sortedhash, sortedkeys = table.sort, table.sortedhash, table.sortedkeys
local format, gmatch = string.format, string.gmatch
diff --git a/tex/context/base/mkiv/anch-pos.mkiv b/tex/context/base/mkiv/anch-pos.mkiv
index ab199eb1e..8d011d61a 100644
--- a/tex/context/base/mkiv/anch-pos.mkiv
+++ b/tex/context/base/mkiv/anch-pos.mkiv
@@ -155,7 +155,7 @@
\def\anch_positions_set_data_indeed#1#2#3#4%
{\anch_positions_initialize
- \hbox
+ \hbox % \hpack
{\edef\currentposition{#1}%
\dosetpositionwhd\currentposition{#2}{#3}{#4}% already \the\dimexpr
\anch_positions_trace_left
@@ -177,7 +177,7 @@
\def\anch_positions_set_box_finish#1%
{\anch_positions_initialize
- \hbox to \wd\nextbox
+ \hbox to \wd\nextbox % \hpack
{\edef\currentposition{#1}%
\dosetpositionbox\currentposition\nextbox
\anch_positions_trace_left
@@ -198,7 +198,7 @@
\def\anch_positions_set_strut_yes#1%
{\anch_positions_initialize
- \hbox to \zeropoint
+ \hbox to \zeropoint % \hpack
{\edef\currentposition{#1}%
\dosetpositionstrut\currentposition
\anch_positions_trace_left
@@ -215,7 +215,7 @@
\def\anch_positions_set_strut_kind_yes#1#2%
{\anch_positions_initialize
- \hbox to \zeropoint
+ \hbox to \zeropoint % \hpack
{\edef\currentposition{#1}%
\dosetpositionstrutkind\currentposition{#2}%
\anch_positions_trace_left
@@ -235,7 +235,7 @@
\def\anch_positions_set_plus_indeed#1#2#3#4#5%
{\anch_positions_initialize
- \hbox % just package
+ \hbox % \hpack
{\edef\currentposition{#1}%
\dosetpositionplus\currentposition{#2}{#3}{#4}{#5}% already \the\dimexpr
\anch_positions_trace_right
@@ -257,7 +257,7 @@
\def\anch_positions_set_plus_yes_finish#1#2%
{\anch_positions_initialize
- \hbox to \nextboxwd
+ \hbox to \nextboxwd % \hpack
{\edef\currentposition{#1}%
\dosetpositionplus\currentposition{\wd\nextbox}{\ht\nextbox}{\dp\nextbox}{#2}%
\anch_positions_trace_right
@@ -296,7 +296,7 @@
{\clf_markregionbox#1\relax}
\unexpanded\def\anch_mark_flow_box#1% will be extended / renamed
- {\hbox\bgroup
+ {\hbox\bgroup % \hpack
\global\advance\c_anch_text\plusone
\clf_markregionboxtagged#1{textarea:\the\c_anch_text}%
\box#1%
@@ -393,7 +393,7 @@
{\the\t_anch_positions_tracers}
\unexpanded\def\enableparpositions % global
- {\global\let\registerparoptions\doregisterparoptions
+ {\glet\registerparoptions\doregisterparoptions
\global\positioningtrue}
\let\disableparpositions\relax
diff --git a/tex/context/base/mkiv/anch-snc.mkiv b/tex/context/base/mkiv/anch-snc.mkiv
index 3e99da8a6..38cccef1d 100644
--- a/tex/context/base/mkiv/anch-snc.mkiv
+++ b/tex/context/base/mkiv/anch-snc.mkiv
@@ -25,9 +25,9 @@
\unexpanded\def\definesyncpositions[#1]%
{\ifcsname\s!num:\s!syncpos:#1\endcsname \else
- \global\let\flushsyncpositions\doflushsyncpositions % only when used
- \global\let\flushsyncresets \doflushsyncresets
- \global\let\flushsyncpresets \doflushsyncpresets
+ \glet\flushsyncpositions\doflushsyncpositions % only when used
+ \glet\flushsyncresets \doflushsyncresets
+ \glet\flushsyncpresets \doflushsyncpresets
\expandafter\newcount\csname\s!num:\s!syncpos:#1\endcsname
\doglobal\appendtoksonce\csname\s!reset :\s!syncpos:#1\endcsname\to\resetsyncpositions
\doglobal\appendtoksonce\csname\s!preset:\s!syncpos:#1\endcsname\to\presetsyncpositions
diff --git a/tex/context/base/mkiv/anch-tab.mkiv b/tex/context/base/mkiv/anch-tab.mkiv
index afa87c7b2..67afb22f7 100644
--- a/tex/context/base/mkiv/anch-tab.mkiv
+++ b/tex/context/base/mkiv/anch-tab.mkiv
@@ -84,8 +84,8 @@
\newcount \noftabpositions
\newtoks \posXCtoks
-\def\anch_tabulate_bpos{\bpos}
-\def\anch_tabulate_epos{\epos}
+\unexpanded\def\anch_tabulate_bpos{\bpos}
+\unexpanded\def\anch_tabulate_epos{\epos}
\installcorenamespace{positiontables}
@@ -134,15 +134,18 @@
{\anch_tables_append_GSC[#1:#1]}
\def\anch_tables_append_GSC[#1:#2:#3]%
- {\doglobal\appendtoks\anch_tables_process_GSC[#1:#2]\to\posXCtoks\NC}
+% {\doglobal\appendtoks\anch_tables_process_GSC[#1:#2]\to\posXCtoks\NC}
+ {\gtoksapp\posXCtoks{\anch_tables_process_GSC[#1:#2]}\NC}
\def\anch_tables_process_GSC[#1:#2]%
{\remappositionframed{#2}{\tbPOSprefix#1}%
\anch_tabulate_bpos{\tbPOSprefix#1}%
- \doglobal\appendtoks\@EA\anch_tabulate_epos\@EA{\tbPOSprefix#1}\to\posXCtoks}
+ \doglobal\appendtoks\expandafter\anch_tabulate_epos\expandafter{\tbPOSprefix#1}\to\posXCtoks}
+% \xtoksapp\posXCtoks{\anch_tabulate_epos{\tbPOSprefix#1}}}
\def\anch_tables_indeed_GFC[#1]%
{\doglobal\appendtoks\anch_tables_delayed_GFC[#1]\to\posXCtoks\NC}
+% {\gtoksapp\posXCtoks{\anch_tables_delayed_GFC[#1]}\NC}
\def\anch_tables_delayed_GFC[#1]%
{\processcommalist[#1]\anch_tables_step_GFC}
@@ -156,9 +159,11 @@
\def\anch_tables_indeed_GTC[#1]%
{\doglobal\appendtoks\anch_tables_delayed_GTC[#1]\to\posXCtoks\NC}
+% {\gtoksapp\posXCtoks{\anch_tables_delayed_GTC[#1]}\NC}
\def\anch_tables_delayed_GTC[#1]%
{\doglobal\appendtoks\anch_tables_process_GTC[#1]\to\posXCtoks}
+% {\gtoksapp\posXCtoks{\anch_tables_process_GTC[#1]}\NC}
\def\anch_tables_process_GTC[#1]%
{\processcommalist[#1]\anch_tables_step_GTC}
@@ -207,10 +212,10 @@
\let\anch_tabulate_flush_epos\relax
-\def\anch_tabulate_bpos_indeed
+\unexpanded\def\anch_tabulate_bpos_indeed
{\bpos}
-\def\anch_tabulate_epos_indeed#1%
+\unexpanded\def\anch_tabulate_epos_indeed#1%
{\ifvoid\b_tabl_tabulate_current\c_tabl_tabulate_column
\epos{#1}%
\glet\anch_tabulate_flush_epos\relax
diff --git a/tex/context/base/mkiv/attr-ini.lua b/tex/context/base/mkiv/attr-ini.lua
index 67faa9fc0..63015d205 100644
--- a/tex/context/base/mkiv/attr-ini.lua
+++ b/tex/context/base/mkiv/attr-ini.lua
@@ -62,7 +62,7 @@ ranges of numbers for them. Of course a the <l n='context'/> end a private attri
accessible too, so a private attribute can have a public appearance.</p>
--ldx]]--
-sharedstorage.attributes_last_private = sharedstorage.attributes_last_private or 127 -- very private (can become 15)
+sharedstorage.attributes_last_private = sharedstorage.attributes_last_private or 15 -- very private
sharedstorage.attributes_last_public = sharedstorage.attributes_last_public or 1024 -- less private
function attributes.private(name) -- at the lua end (hidden from user)
diff --git a/tex/context/base/mkiv/attr-ini.mkiv b/tex/context/base/mkiv/attr-ini.mkiv
index d537cebfa..451ab9dfa 100644
--- a/tex/context/base/mkiv/attr-ini.mkiv
+++ b/tex/context/base/mkiv/attr-ini.mkiv
@@ -62,10 +62,10 @@
\csname\??attributeid#2\endcsname\scratchcounter
% some attributes are always global
\doifelseinset\s!global{#3}%
- {\appendetoks\csname\??attributecount#2\endcsname\attributeunsetvalue\to\t_attr_list_global}%
- {\appendetoks\csname\??attributecount#2\endcsname\attributeunsetvalue\to\t_attr_list_local }%
+ {\etoksapp\t_attr_list_global{\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
+ {\etoksapp\t_attr_list_local {\csname\??attributecount#2\endcsname\attributeunsetvalue}}%
\doifinset\s!nomath{#3}%
- {\appendetoks\csname\??attributecount#2\endcsname\attributeunsetvalue\to\t_attr_list_nomath}%
+ {\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}%
diff --git a/tex/context/base/mkiv/bibl-bib.mkiv b/tex/context/base/mkiv/bibl-bib.mkiv
index 784c87a02..60291ee71 100644
--- a/tex/context/base/mkiv/bibl-bib.mkiv
+++ b/tex/context/base/mkiv/bibl-bib.mkiv
@@ -812,12 +812,12 @@
{\iflocation
\edef\temp{\bibtexcitationparameter\c!interaction}%
\ifx\temp\v!stop
- \@EA@EA@EA\secondoftwoarguments
+ \doubleexpandafter\secondoftwoarguments
\else
- \@EA@EA@EA\firstoftwoarguments
+ \doubleexpandafter\firstoftwoarguments
\fi
\else
- \@EA\secondoftwoarguments
+ \expandafter\secondoftwoarguments
\fi}
\let\doifbibtexinteractionelse\doifelsebibtexinteraction
diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua
index 8e4f2e729..f3bd0f563 100644
--- a/tex/context/base/mkiv/cldf-ini.lua
+++ b/tex/context/base/mkiv/cldf-ini.lua
@@ -703,6 +703,8 @@ local function writer(parent,command,...) -- already optimized before call
-- nothing
elseif ti == "" then
flush(currentcatcodes,"{}")
+ -- elseif ti == 1 then
+ -- flush(currentcatcodes,"{1}")
else
local typ = type(ti)
if typ == "string" then
@@ -719,7 +721,7 @@ local function writer(parent,command,...) -- already optimized before call
flush(currentcatcodes,"}")
end
elseif typ == "number" then
- -- numbers never have funny catcodes
+ -- numbers never have funny catcodesz
flush(currentcatcodes,"{",ti,"}")
elseif typ == "table" then
local tn = #ti
diff --git a/tex/context/base/mkiv/colo-ini.mkiv b/tex/context/base/mkiv/colo-ini.mkiv
index 7ecb05d23..57cecfcad 100644
--- a/tex/context/base/mkiv/colo-ini.mkiv
+++ b/tex/context/base/mkiv/colo-ini.mkiv
@@ -1058,7 +1058,7 @@
%D Here is a more efficient helper for pgf:
%D
-%D \starttying
+%D \starttyping
%D \startluacode
%D function commands.pgfxcolorspec(ca) -- {}{}{colorspace}{list}
%D local cv = attributes.colors.values[ca]
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 241534cbb..2790235d5 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2018.05.19 21:46}
+\newcontextversion{2018.05.24 15:49}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 12e208391..f88d9bc4c 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -42,7 +42,7 @@
%D has to match \type {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2018.05.19 21:46}
+\edef\contextversion{2018.05.24 15:49}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/file-job.mkvi b/tex/context/base/mkiv/file-job.mkvi
index f1f2d126f..a46e519c0 100644
--- a/tex/context/base/mkiv/file-job.mkvi
+++ b/tex/context/base/mkiv/file-job.mkvi
@@ -312,6 +312,12 @@
{\documentvariable\c!after
\stoptext}
+\unexpanded\def\doifelsedocumentvariable#name{\doifelsesomething{\documentvariable{#name}}}
+\unexpanded\def\doifdocumentvariable #name{\doifsomething {\documentvariable{#name}}}
+\unexpanded\def\doifnotdocumentvariable #name{\doifnot {\documentvariable{#name}}}
+
+\let\doifdocumentvariableelse\doifelsedocumentvariable
+
\def\documentvariable#name%
{\getvariable\s!document{#name}}
diff --git a/tex/context/base/mkiv/file-mod.mkvi b/tex/context/base/mkiv/file-mod.mkvi
index a2a3b7793..a06770e24 100644
--- a/tex/context/base/mkiv/file-mod.mkvi
+++ b/tex/context/base/mkiv/file-mod.mkvi
@@ -36,9 +36,9 @@
\let\usetexmodule\usemodules
\def\strc_modules_use[#category][#name][#parameters]% category=t|m|x|p|...
- {\pushmacro\currentmodule
- \pushmacro\currentmodulecategory
- \pushmacro\currentmoduleparameters
+ {\push_macro_currentmodule
+ \push_macro_currentmodulecategory
+ \push_macro_currentmoduleparameters
\ifthirdargument
\edef\currentmodulecategory {#category}%
\edef\currentmodule {#name}%
@@ -57,9 +57,9 @@
\let \currentmoduleparameters\empty
\fi\fi
\processcommacommand[\currentmodule]{\strc_modules_use_indeed\currentmodulecategory}%
- \popmacro\currentmoduleparameters
- \popmacro\currentmodulecategory
- \popmacro\currentmodule}
+ \pop_macro_currentmoduleparameters
+ \pop_macro_currentmodulecategory
+ \pop_macro_currentmodule}
\def\strc_modules_use_indeed#category#name%
{\ifx\currentmoduleparameters\empty\else
@@ -70,20 +70,24 @@
\installcorenamespace{module}
-\let\currentmoduleparameters\empty
\let\currentmodule \s!unknown
+\let\currentmodulecategory \empty
+\let\currentmoduleparameters\empty
-\newcount \c_syst_modules_nesting
+\installmacrostack\currentmodule
+\installmacrostack\currentmodulecategory
+\installmacrostack\currentmoduleparameters
-\newtoks\everysetupmodule
+\newcount\c_syst_modules_nesting
+\newtoks \everysetupmodule
\unexpanded\def\startmodule
{\doifelsenextoptionalcs\syst_modules_start_yes\syst_modules_start_nop}
\def\syst_modules_start_yes[#name]%
{\global\advance\c_syst_modules_nesting\plusone
- \pushmacro\currentmodule
- \pushmacro\currentmoduleparameters
+ \push_macro_currentmodule
+ \push_macro_currentmoduleparameters
\def\currentmodule{#name}}
\def\syst_modules_start_nop#name %
@@ -93,8 +97,8 @@
{\ifcase\c_syst_modules_nesting
\writestatus\m!system{module wrapping error in '\currentmodule'}%
\else
- \popmacro\currentmoduleparameters
- \popmacro\currentmodule
+ \pop_macro_currentmoduleparameters
+ \pop_macro_currentmodule
\global\advance\c_syst_modules_nesting\minusone
\fi}
@@ -203,7 +207,7 @@
{\ifcsname\??runtimeloaded#2\endcsname
% already loaded
\else
- \global\let#1\undefined
+ \glet#1\undefined
\startreadingfile
\startnointerference % \bgroup
\cleanupfeatures % better \setnormalcatcodes / test first
diff --git a/tex/context/base/mkiv/font-fil.mkvi b/tex/context/base/mkiv/font-fil.mkvi
index 01fa4a338..177b1fea1 100644
--- a/tex/context/base/mkiv/font-fil.mkvi
+++ b/tex/context/base/mkiv/font-fil.mkvi
@@ -42,19 +42,17 @@
%
% \setupbodyfont[palatino]
-\let\fontclass\empty
-
\unexpanded\def\startfontclass
{\dosingleempty\font_basics_start_font_class}
\def\font_basics_start_font_class[#class]%
- {\pushmacro\fontclass
+ {\push_macro_fontclass
\doifelse{#class}\v!each
{\let\fontclass\empty}
{\doifsomething{#class}{\def\fontclass{#class}}}}
\unexpanded\def\stopfontclass
- {\popmacro\fontclass}
+ {\pop_macro_fontclass}
\def\classfont#class#name{#class#name} % \definefont[whatever][\classfont{xx}{yy} at 10pt]
@@ -127,7 +125,7 @@
% helpers, some day these will be toks and counts
-% \def\fntsetdefname {\global\let\somefontname\defaultfontfile}
+% \def\fntsetdefname {\glet\somefontname\defaultfontfile}
% \def\fntsetsomename{\gdef\somefontname} % takes argument
% \def\fntsetnopsize {\let\somefontsize\empty}
% \def\fntsetsomesize{\def\somefontsize} % takes argument
@@ -145,10 +143,10 @@
\expandafter\let\csname\??fontfile\m_font_name\s!designsize\endcsname\undefined}
\def\font_basics_define_font_synonym_yes_nil
- {\global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!features \endcsname\undefined
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!fallbacks \endcsname\undefined
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!goodies \endcsname\undefined
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!designsize\endcsname\undefined}
+ {\expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!features \endcsname\undefined
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!fallbacks \endcsname\undefined
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!goodies \endcsname\undefined
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!designsize\endcsname\undefined}
\def\font_basics_get_font_parameter_nop_finish
{\expandafter\let\csname\??fontfile\m_font_name\s!features \endcsname\p_features
@@ -157,10 +155,10 @@
\expandafter\let\csname\??fontfile\m_font_name\s!designsize\endcsname\p_designsize}
\def\font_basics_get_font_parameter_yes_finish
- {\global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!features \endcsname\p_features
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!fallbacks \endcsname\p_fallbacks
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!goodies \endcsname\p_goodies
- \global\expandafter\let\csname\??fontfile\fontclass\m_font_name\s!designsize\endcsname\p_designsize}
+ {\expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!features \endcsname\p_features
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!fallbacks \endcsname\p_fallbacks
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!goodies \endcsname\p_goodies
+ \expandafter\glet\csname\??fontfile\fontclass\m_font_name\s!designsize\endcsname\p_designsize}
%\definefontsynonym [KopFont] [\fontclassname{officina}{SerifBold}]
%
@@ -306,6 +304,8 @@
#2%
\fi\fi}
+\installmacrostack\fontclass
+
%D Files or names can have properties and these need to be consulted
%D at some point. They can inherit them.
diff --git a/tex/context/base/mkiv/font-gbn.lua b/tex/context/base/mkiv/font-gbn.lua
index e2d245860..778b07740 100644
--- a/tex/context/base/mkiv/font-gbn.lua
+++ b/tex/context/base/mkiv/font-gbn.lua
@@ -137,7 +137,7 @@ local function nodepass(head,groupcode,size,packtype,direction)
end
if variants then
local char = getchar(n)
- if char >= 0xFE00 and (char <= 0xFE0F or (char >= 0xE0100 and char <= 0xE01EF)) then
+ if (char >= 0xFE00 and char <= 0xFE0F) or (char >= 0xE0100 and char <= 0xE01EF) then
local hash = variants[char]
if hash then
local p = getprev(n)
diff --git a/tex/context/base/mkiv/font-ini.mkvi b/tex/context/base/mkiv/font-ini.mkvi
index 6bb5c2eaa..e45179906 100644
--- a/tex/context/base/mkiv/font-ini.mkvi
+++ b/tex/context/base/mkiv/font-ini.mkvi
@@ -341,12 +341,16 @@
\the\everybodyfont
\settrue\c_font_synchronize}
+\let\savedfont\empty
+
+\installmacrostack\savedfont
+
\unexpanded\def\savefont
{\edef\savedfont{\the\font}% gives \csname
- \pushmacro\savedfont}
+ \push_macro_savedfont}
\unexpanded\def\restorefont
- {\popmacro\savedfont
+ {\pop_macro_savedfont
\savedfont}
\unexpanded\def\pushcurrentfont
@@ -424,7 +428,7 @@
%
% \def\normalizebodyfontsize_indeed#macro#body%
% {\edef#macro{\ctxcommand{nbfs(\number\dimexpr#body,\number\fontdigits)}}%
-% \global\expandafter\let\csname\??fontnormalizedbody\number\fontdigits:\number\dimexpr#body\endcsname#macro}
+% \expandafter\glet\csname\??fontnormalizedbody\number\fontdigits:\number\dimexpr#body\endcsname#macro}
%
% \def\thenormalizedbodyfontsize#body%
% {\ctxcommand{nbfs(\number\dimexpr#body\relax,\number\fontdigits)}}
@@ -439,7 +443,7 @@
\def\normalizebodyfontsize_indeed#macro#body%
{\edef#macro{\clf_nbfs\dimexpr#body\relax}%
- \global\expandafter\let\csname\??fontnormalizedbody\number\dimexpr#body\endcsname#macro}
+ \expandafter\glet\csname\??fontnormalizedbody\number\dimexpr#body\endcsname#macro}
\def\thenormalizedbodyfontsize#body%
{\clf_nbfs\dimexpr#body\relax}
@@ -771,7 +775,7 @@
\unexpanded\def\font_helpers_low_level_define#specification#csname%
{% we can now set more at the lua end
- \global\let\somefontname\defaultfontfile
+ \glet\somefontname\defaultfontfile
\let\somefontsize\empty
\clf_definefont_one{\detokenize\expandafter{\normalexpanded{#specification}}}% the escapestring catches at \somedimen
% sets \scaledfontmode and \somefontname and \somefontsize
@@ -908,7 +912,7 @@
%D The following macros are used at the \LUA\ end. Watch the \type {\normal}
%D hackery: this makes the mkvi parser happy.
-% \normaldef\fntsetdefname {\global\let\somefontname\defaultfontfile} % do before calling
+% \normaldef\fntsetdefname {\glet\somefontname\defaultfontfile} % do before calling
% \normaldef\fntsetnopsize {\let\somefontsize\empty} % do before calling
% \normaldef\fntsetsomename{\normalgdef\somefontname} % takes argument
% \normaldef\fntsetsomesize{\normaldef\somefontsize} % takes argument
@@ -1034,7 +1038,7 @@
{\begingroup
\font_basics_define_font[#name][#specification][#settings]%
\csname#name\endcsname
- \global\let\lastglobalrawfontcall\lastrawfontcall
+ \glet\lastglobalrawfontcall\lastrawfontcall
\endgroup
\expandafter\let\csname#name\endcsname\lastglobalrawfontcall}
@@ -1373,16 +1377,16 @@
%D settings (just to be sure, as it's not really needed).
\def\font_basics_define_body_font_environment_empty[#body][#settings][#dummy]%
- {\pushmacro\fontclass
+ {\push_macro_fontclass
\let\fontclass\empty
\font_basics_define_body_font_environment_class[][#body][#settings]%
- \popmacro\fontclass}
+ \pop_macro_fontclass}
\def\font_basics_define_body_font_environment_unset[#body][#dummya][#dummyb]%
- {\pushmacro\fontclass
+ {\push_macro_fontclass
\let\fontclass\empty
\font_basics_define_body_font_environment_class[][#body][]%
- \popmacro\fontclass}
+ \pop_macro_fontclass}
%D We don't check too soon as we can refer to later definitions.
@@ -1393,13 +1397,13 @@
\ifcsname\??fontenvironmentknown#class#normalizedbody\endcsname
% environment and size already defined
\else\ifproductionrun
- \pushmacro\fontclass
+ \push_macro_fontclass
\edef\fontclass{#class}%
\font_helpers_register_environment{#class}{#normalizedbody}%
\settrue\c_font_defining_environment_state
\font_helpers_define_unknown_font{#normalizedbody}% current class
\setfalse\c_font_defining_environment_state
- \popmacro\fontclass
+ \pop_macro_fontclass
\fi\fi
\font_helpers_register_fontbody{#normalizedbody}}
@@ -1523,12 +1527,12 @@
\fi}
\def\font_basics_define_body_font_class_given[#1][#2][#3]#4%
- {\pushmacro\fontclass
+ {\push_macro_fontclass
\doifelse{#4}\s!default
{\let\fontclass\empty}
{\def\fontclass{#4}}%
\definebodyfont[#1][#2][#3]%
- \popmacro\fontclass}
+ \pop_macro_fontclass}
\def\font_basics_define_body_font_class_known
{\ifthirdargument
@@ -1640,13 +1644,13 @@
\unexpanded\def\font_basics_define_body_font_yes_xx[#one#two#rest=#value]% global
{\ifcsname\m_font_asked_style#one#two#rest\endcsname\else\font_basics_check_fontname_combination\m_font_asked_style{#one#two}{#rest}\fi
- \global\expandafter\let\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-1\endcsname\undefined
+ \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-1\endcsname\undefined
\unexpanded\expandafter\normalxdef\csname\??fontinstanceready\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-0\endcsname
{\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest-0}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}%
- \global\expandafter\let\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-2\endcsname\undefined
+ \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-2\endcsname\undefined
\unexpanded\expandafter\normalxdef\csname\??fontinstanceready\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-4\endcsname
{\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest-4}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}%
- \global\expandafter\let\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-3\endcsname\undefined
+ \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-3\endcsname\undefined
\unexpanded\expandafter\normalxdef\csname\??fontinstanceready\fontclass-\m_font_asked_body-\m_font_asked_style-#one#two-#rest-5\endcsname
{\font_helpers_trigger{\m_font_asked_body-\m_font_asked_style-#one#two#rest-5}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}%
}
@@ -1669,9 +1673,9 @@
\unexpanded\def\font_basics_define_body_font_yes_mm[#one#two#rest=#value]% global
{%\ifcsname\s!mm\endcsname\else\font_basics_check_fontname_combination\s!mm{#one#two}{#rest}\fi
- \global\expandafter\let\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\s!mm-#one#two#rest-1\endcsname\undefined
- % \global\expandafter\let\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\s!mm-#one#two#rest-2\endcsname\undefined
- % \global\expandafter\let\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\s!mm-#one#two#rest-3\endcsname\undefined
+ \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\s!mm-#one#two#rest-1\endcsname\undefined
+ % \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\s!mm-#one#two#rest-2\endcsname\undefined
+ % \expandafter\glet\csname\??fontinstanceclass\fontclass-\m_font_asked_body-\s!mm-#one#two#rest-3\endcsname\undefined
\unexpanded\expandafter\normalxdef\csname\??fontinstanceready\fontclass-\m_font_asked_body-\s!mm-#one#two#rest\endcsname
{\font_helpers_trigger{\m_font_asked_body-\s!mm-#one#two#rest}{\number\p_font_rscale}{\m_font_asked_body}{\normalunexpanded{#value}}}%
}
@@ -2353,7 +2357,7 @@
\noexpand\edef\noexpand\xtextface {\currentbodyfontdimension\s!x }%
\noexpand\edef\noexpand\xxtextface {\currentbodyfontdimension\s!xx }%
}%
- \global\expandafter\let\csname\??fontbodyfaces\fontbody\endcsname\font_basics_set_faces}
+ \expandafter\glet\csname\??fontbodyfaces\fontbody\endcsname\font_basics_set_faces}
% \def\currentbodyfontdimension#parameter%
% {\the\dimexpr
@@ -2495,15 +2499,15 @@
%D \stoptyping
% \unexpanded\def\usebodyfont[#1]%
-% {\pushmacro\fontclass
+% {\push_macro_fontclass
% \switchtobodyfont[#1]%
-% \popmacro\fontclass
+% \pop_macro_fontclass
% \ifx\fontclass\empty\else\setupbodyfont\relax\fi}
% \unexpanded\def\usebodyfont[#1]%
-% {\pushmacro\fontclass
+% {\push_macro_fontclass
% \font_helpers_set_font\zerocount{#1}%
-% \popmacro\fontclass
+% \pop_macro_fontclass
% \ifx\fontclass\empty \else
% \font_basics_setupbodyfont_nop
% \fi}
@@ -2706,7 +2710,7 @@
\unexpanded\def\font_basics_predefine#1#2%
{\font_basics_defined_font_yes[#2]%
- \global\expandafter\let\csname#1\expandafter\endcsname\csname\v_font_identifier_basic\endcsname}
+ \expandafter\glet\csname#1\expandafter\endcsname\csname\v_font_identifier_basic\endcsname}
\unexpanded\def\font_basics_predefined#1%
{\font_basics_predefine{\??predefinedfont#1}{#1}}
diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua
index abe4caea4..e3389b9da 100644
--- a/tex/context/base/mkiv/font-ots.lua
+++ b/tex/context/base/mkiv/font-ots.lua
@@ -2813,6 +2813,9 @@ local function handle_contextchain(head,start,dataset,sequence,contexts,rlmode,s
notmatchpre = { }
notmatchpost = { }
notmatchreplace = { }
+ -- notmatchpre = { a = 1, b = 1 } notmatchpre .a = nil notmatchpre .b = nil
+ -- notmatchpost = { a = 1, b = 1 } notmatchpost .a = nil notmatchpost .b = nil
+ -- notmatchreplace = { a = 1, b = 1 } notmatchreplace.a = nil notmatchreplace.b = nil
end
return head, start, done
end
@@ -3852,8 +3855,9 @@ do
-- local done = false
local datasets = otfdataset(tfmdata,font,attr)
- local dirstack = { } -- could move outside function but we can have local runs
+ local dirstack = { nil } -- could move outside function but we can have local runs
sweephead = { }
+ -- sweephead = { a = 1, b = 1 } sweephead.a = nil sweephead.b = nil
-- Keeping track of the headnode is needed for devanagari. (I generalized it a bit
-- so that multiple cases are also covered.) We could prepend a temp node.
@@ -4127,7 +4131,7 @@ do
local nofsteps = sequence.nofsteps
local done = false
- local dirstack = { } -- could move outside function but we can have local runs
+ local dirstack = { nil } -- could move outside function but we can have local runs (maybe a few more nils)
local start = head
local initialrl = direction == "TRT" and -1 or 0
-- local initialrl = (direction == 1 or direction == "TRT") and -1 or 0
diff --git a/tex/context/base/mkiv/font-set.mkvi b/tex/context/base/mkiv/font-set.mkvi
index 2c6d065d8..fe0fb6cad 100644
--- a/tex/context/base/mkiv/font-set.mkvi
+++ b/tex/context/base/mkiv/font-set.mkvi
@@ -122,14 +122,14 @@
\font_preloads_reset
\else
\font_preloads_reset
- \pushmacro\fontstyle
+ \push_macro_fontstyle
\ifcsname\??fontclass\fontclass\s!mm\s!features\endcsname \else
\font_preload_default_fonts_mm
\fi
\ifcsname\??fontclass\fontclass\s!tt\s!features\endcsname \else
\font_preload_default_fonts_tt
\fi
- \popmacro\fontstyle
+ \pop_macro_fontstyle
\font_preloads_reset_checked % reset third, mm and tt
\setupbodyfont[\fontstyle]%
\fi}
diff --git a/tex/context/base/mkiv/font-sym.mkvi b/tex/context/base/mkiv/font-sym.mkvi
index 0e709f161..3ff85fb4a 100644
--- a/tex/context/base/mkiv/font-sym.mkvi
+++ b/tex/context/base/mkiv/font-sym.mkvi
@@ -167,7 +167,7 @@
\def\font_basics_define_symbolic_font
{\definefont[currentsymbolfont][\askedsymbolfont]%
\currentsymbolfont
- \global\expandafter\let\csname\??symbolfont\askedsymbolfont\endcsname\lastrawfontcall}
+ \expandafter\glet\csname\??symbolfont\askedsymbolfont\endcsname\lastrawfontcall}
\unexpanded\def\getnamedglyphstyled#fontname#character{{\setstyledsymbolicfont{#fontname}\clf_fontchar{#character}}}
\unexpanded\def\getnamedglyphdirect#fontname#character{{\setdirectsymbolicfont{#fontname}\clf_fontchar{#character}}}
diff --git a/tex/context/base/mkiv/font-var.mkvi b/tex/context/base/mkiv/font-var.mkvi
index fb60b711c..8520a5c32 100644
--- a/tex/context/base/mkiv/font-var.mkvi
+++ b/tex/context/base/mkiv/font-var.mkvi
@@ -50,6 +50,8 @@
\let\fontsize \defaultfontsize
\let\fontface \!!zerocount
+\installmacrostack\fontstyle
+
% we can use an indirect mapping for fontclasses (map string onto numbers) and indeed this
% is somewhat more efficient but also makes the code messy ... maybe some day ...
diff --git a/tex/context/base/mkiv/grph-trf.mkiv b/tex/context/base/mkiv/grph-trf.mkiv
index 6bd0e65cc..454c54700 100644
--- a/tex/context/base/mkiv/grph-trf.mkiv
+++ b/tex/context/base/mkiv/grph-trf.mkiv
@@ -146,10 +146,10 @@
\d_grph_scale_ht\ht\nextbox
\d_grph_scale_dp\dp\nextbox
%
- \global\let\finalscaleboxxscale \!!plusone
- \global\let\finalscaleboxyscale \!!plusone
- \xdef \finalscaleboxwidth {\the\d_grph_scale_wd}%
- \xdef \finalscaleboxheight{\the\d_grph_scale_ht}%
+ \glet\finalscaleboxxscale \!!plusone
+ \glet\finalscaleboxyscale \!!plusone
+ \xdef\finalscaleboxwidth {\the\d_grph_scale_wd}%
+ \xdef\finalscaleboxheight{\the\d_grph_scale_ht}%
%
\forgetall
\dontcomplain
diff --git a/tex/context/base/mkiv/lang-ini.mkiv b/tex/context/base/mkiv/lang-ini.mkiv
index 9c7b5641b..bb31da839 100644
--- a/tex/context/base/mkiv/lang-ini.mkiv
+++ b/tex/context/base/mkiv/lang-ini.mkiv
@@ -317,13 +317,15 @@
\let\lang_basics_synchronize\relax % be nice for setups till we have one
\fi
+\installmacrostack\currentlanguage
+
\def\lang_basics_setup[#1][#2]%
{\ifsecondargument
- \pushmacro\currentlanguage % can be default
+ \push_macro_currentlanguage % can be default
\edef\currentsetuplanguage{\reallanguagetag{#1}}%
\getparameters[\??language\currentsetuplanguage][#2]%
\the\everysetuplanguage
- \popmacro\currentlanguage
+ \pop_macro_currentlanguage
%\doif\currentsetuplanguage\currentlanguage we can have influenced inheritance (default)
\else
\let\currentsetuplanguage\currentlanguage
@@ -449,7 +451,7 @@
\appendtoks
% we need to reassign the number because new patterns can be defined later on
% so let's hope not that many \setups happen during a run
- \global\expandafter\let\csname\??languagenumbers\currentlanguage\endcsname\undefined
+ \expandafter\glet\csname\??languagenumbers\currentlanguage\endcsname\undefined
\to \everysetuplanguage
\def\lang_basics_synchronize_yes
diff --git a/tex/context/base/mkiv/lpdf-ini.lua b/tex/context/base/mkiv/lpdf-ini.lua
index 89b87ed11..f9000f537 100644
--- a/tex/context/base/mkiv/lpdf-ini.lua
+++ b/tex/context/base/mkiv/lpdf-ini.lua
@@ -559,7 +559,9 @@ end
local cache = { } -- can be weak
local function pdfnumber(n,default) -- 0-10
- n = n or default
+ if not n then
+ n = default
+ end
local c = cache[n]
if not c then
c = setmetatable({ n },mt_n)
@@ -581,7 +583,9 @@ end
local escaped = Cs(Cc("/") * (S(forbidden)/replacements + P(1))^0)
local function pdfconstant(str,default)
- str = str or default or ""
+ if not str then
+ str = default or ""
+ end
local c = cache[str]
if not c then
-- c = setmetatable({ "/" .. str },mt_c)
diff --git a/tex/context/base/mkiv/lpdf-mis.lua b/tex/context/base/mkiv/lpdf-mis.lua
index 6d1b09ca0..bf156ebe5 100644
--- a/tex/context/base/mkiv/lpdf-mis.lua
+++ b/tex/context/base/mkiv/lpdf-mis.lua
@@ -72,6 +72,9 @@ local v_page = variables.page
local v_paper = variables.paper
local v_attachment = variables.attachment
local v_layer = variables.layer
+local v_lefttoright = variables.lefttoright
+local v_righttoleft = variables.righttoleft
+local v_title = variables.title
local positive = register(pdfpageliteral("/GSpositive gs"))
local negative = register(pdfpageliteral("/GSnegative gs"))
@@ -304,14 +307,26 @@ local plusspecs = {
[v_paper] = {
paper = true,
},
+ [v_title] ={
+ title = true,
+ },
+ [v_lefttoright] ={
+ direction = "L2R",
+ },
+ [v_righttoleft] ={
+ direction = "R2R",
+ },
}
local pagespecs = {
--
- [v_max] = plusspecs[v_max],
- [v_bookmark] = plusspecs[v_bookmark],
- [v_attachment] = plusspecs[v_attachment],
- [v_layer] = plusspecs[v_layer],
+ [v_max] = plusspecs[v_max],
+ [v_bookmark] = plusspecs[v_bookmark],
+ [v_attachment] = plusspecs[v_attachment],
+ [v_layer] = plusspecs[v_layer],
+ [v_lefttoright] = plusspecs[v_lefttoright],
+ [v_righttoleft] = plusspecs[v_righttoleft],
+ [v_title] = plusspecs[v_title],
--
[v_none] = {
},
@@ -433,13 +448,15 @@ local function documentspecification()
end
end
end
- --
- local layout = spec.layout
- local mode = spec.mode
- local fit = spec.fit
- local fixed = spec.fixed
- local duplex = spec.duplex
- local paper = spec.paper
+ -- maybe interfaces.variables
+ local layout = spec.layout
+ local mode = spec.mode
+ local fit = spec.fit
+ local fixed = spec.fixed
+ local duplex = spec.duplex
+ local paper = spec.paper
+ local title = spec.title
+ local direction = spec.direction
if layout then
addtocatalog("PageLayout",pdfconstant(layout))
end
@@ -458,18 +475,21 @@ local function documentspecification()
prints = pdfarray(flattened(pages.toranges(marked)))
end
end
- if fit or fixed or duplex or copies or paper or prints then
+ if fit or fixed or duplex or copies or paper or prints or title or direction then
addtocatalog("ViewerPreferences",pdfdictionary {
- FitWindow = fit and true or nil,
- PrintScaling = fixed and pdfconstant("None") or nil,
- Duplex = duplex and pdfconstant(duplex) or nil,
- NumCopies = copies and copies or nil,
- PickTrayByPDFSize = paper and true or nil,
- PrintPageRange = prints or nil,
+ FitWindow = fit and true or nil,
+ PrintScaling = fixed and pdfconstant("None") or nil,
+ Duplex = duplex and pdfconstant(duplex) or nil,
+ NumCopies = copies and copies or nil,
+ PickTrayByPDFSize = paper and true or nil,
+ PrintPageRange = prints or nil,
+ DisplayDocTitle = title and true or nil,
+ Direction = direction and pdfconstant(direction) or nil,
})
end
addtoinfo ("Trapped", pdfconstant("False")) -- '/Trapped' in /Info, 'Trapped' in XMP
addtocatalog("Version", pdfconstant(format("1.%s",pdfminorversion())))
+ addtocatalog("Lang", pdfstring(tokens.getters.macro("currentmainlanguage")))
end
-- temp hack: the mediabox is not under our control and has a precision of 5 digits
diff --git a/tex/context/base/mkiv/lpdf-tag.lua b/tex/context/base/mkiv/lpdf-tag.lua
index b3d117c4b..cc3823fef 100644
--- a/tex/context/base/mkiv/lpdf-tag.lua
+++ b/tex/context/base/mkiv/lpdf-tag.lua
@@ -170,6 +170,7 @@ local index, pageref, pagenum, list = 0, nil, 0, nil
local pdf_mcr = pdfconstant("MCR")
local pdf_struct_element = pdfconstant("StructElem")
+local pdf_s = pdfconstant("S")
local function initializepage()
index = 0
@@ -182,6 +183,8 @@ end
local function finishpage()
-- flush what can be flushed
addtopageattributes("StructParents",pagenum-1)
+ -- there might be more
+ addtopageattributes("Tabs",s)
end
-- here we can flush and free elements that are finished
diff --git a/tex/context/base/mkiv/luat-ini.mkiv b/tex/context/base/mkiv/luat-ini.mkiv
index 872d27e77..93f908a07 100644
--- a/tex/context/base/mkiv/luat-ini.mkiv
+++ b/tex/context/base/mkiv/luat-ini.mkiv
@@ -314,6 +314,6 @@
\normalprotected\def\resetctxscanner#1%
{\edef\m_syst_name{\csstring#1}%
\global\expandafter\chardef\csname\??luafunction\m_syst_name\endcsname\zerocount
- \global\expandafter\let\csname\m_syst_name\endcsname\relax}
+ \expandafter\glet\csname\m_syst_name\endcsname\relax}
\protect \endinput
diff --git a/tex/context/base/mkiv/luat-usr.mkiv b/tex/context/base/mkiv/luat-usr.mkiv
index 760de9f21..f3868ccf4 100644
--- a/tex/context/base/mkiv/luat-usr.mkiv
+++ b/tex/context/base/mkiv/luat-usr.mkiv
@@ -69,7 +69,7 @@
\obeyluatokens
\csname\??luacode#1\endcsname}%
%
- \global\expandafter\let\csname\s!stop#1\s!code\endcsname\relax
+ \expandafter\glet\csname\s!stop#1\s!code\endcsname\relax
%
\normalexpanded{\xdef\csname\??luacode#1\endcsname##1\csname\s!stop#1\s!code\endcsname}%
{\noexpand\expandafter\endgroup
@@ -77,7 +77,7 @@
\expandafter\noexpand\csname clf_\fullname\endcsname
\noexpand\expandafter{\noexpand\normalexpanded{##1}}}%
%
- \global\expandafter\let\csname#1\s!code\expandafter\endcsname\csname clf_\fullname\endcsname
+ \expandafter\glet\csname#1\s!code\expandafter\endcsname\csname clf_\fullname\endcsname
\fi
\fi
\egroup}
diff --git a/tex/context/base/mkiv/math-ali.mkiv b/tex/context/base/mkiv/math-ali.mkiv
index 083fb7645..ecfac6887 100644
--- a/tex/context/base/mkiv/math-ali.mkiv
+++ b/tex/context/base/mkiv/math-ali.mkiv
@@ -321,11 +321,18 @@
\def\math_alignment_EQ
{\NC=}
+\installmacrostack\NC % maybe more to shared table definitions
+\installmacrostack\NN % maybe more to shared table definitions
+\installmacrostack\EQ % maybe more to shared table definitions
+\installmacrostack\NR % maybe more to shared table definitions
+\installmacrostack\BC % maybe more to shared table definitions
+\installmacrostack\EC % maybe more to shared table definitions
+
\appendtoks
- \pushmacro\NC
- \pushmacro\NN
- \pushmacro\EQ
- \pushmacro\NR
+ \push_macro_NC
+ \push_macro_NN
+ \push_macro_EQ
+ \push_macro_NR
\let\NC\math_alignment_NC
\let\NN\math_alignment_NN
\let\EQ\math_alignment_EQ
@@ -334,10 +341,10 @@
\to \everymathalignment
\appendtoks
- \popmacro\NR
- \popmacro\EQ
- \popmacro\NN
- \popmacro\NC
+ \pop_macro_NR
+ \pop_macro_EQ
+ \pop_macro_NN
+ \pop_macro_NC
\to \everymathalignmentdone
\let\math_alignment_snap_start\relax
@@ -694,11 +701,11 @@
{\unskip
\math_cases_end_math
\aligntab
- \global\let\math_cases_NC\math_cases_NC_first
+ \glet\math_cases_NC\math_cases_NC_first
\dodirectdoubleempty\math_cases_NR}
\def\math_cases_NC_first
- {\global\let\math_cases_NC\math_cases_NC_second}
+ {\glet\math_cases_NC\math_cases_NC_second}
\def\math_cases_NC_second
{\math_cases_end_math\aligntab}
@@ -722,7 +729,7 @@
\let\NC\math_cases_NC_zero
\let\MC\math_cases_MC_zero
\let\NR\math_cases_NR_zero
- \global\let\math_cases_NC\math_cases_NC_first
+ \glet\math_cases_NC\math_cases_NC_first
\normalbaselines
\mathsurround\zeropoint
\everycr\emptytoks
diff --git a/tex/context/base/mkiv/math-arr.mkiv b/tex/context/base/mkiv/math-arr.mkiv
index a0dda66b9..2edb91465 100644
--- a/tex/context/base/mkiv/math-arr.mkiv
+++ b/tex/context/base/mkiv/math-arr.mkiv
@@ -67,39 +67,46 @@
\def\math_arrows_construct#1#2#3#4#5% hm, looks like we do a double mathrel (a bit cleaned up .. needs checking)
{\begingroup
- \def\m_math_arrows_factor{1}%
- \def\m_math_arrows_extra {0}%
+ \let\m_math_arrows_factor\!!plusone
+ \let\m_math_arrows_extra \!!zerocount
\edef\p_math_spacing{#1}%
\csname\??matharrowsettings
\ifcsname\??matharrowsettings\p_math_spacing\endcsname\p_math_spacing\else\s!unknown\fi
\endcsname
\mathsurround\zeropoint
- \muskip0=\muexpr\m_math_arrows_factor\muexpr\thirdoffourarguments #2\onemuskip\relax+\m_math_arrows_extra\onemuskip+\firstoffourarguments #2\onemuskip\relax
- \muskip2=\muexpr\m_math_arrows_factor\muexpr\fourthoffourarguments#2\onemuskip\relax+\m_math_arrows_extra\onemuskip+\secondoffourarguments#2\onemuskip\relax
- \setbox0\hbox{\normalstartimath
- \scriptstyle
- \mkern\muskip0\relax
- #5\relax
- \mkern\muskip2\relax
- \normalstopimath}%
- \setbox2\hbox{\normalstartimath
- \scriptstyle
- \mkern\muskip0\relax
- #4\relax
- \mkern\muskip2\relax
- \normalstopimath}%
- \setbox4\hbox{#3\displaystyle}%
- \dimen0\wd0\relax
- \ifdim\wd2>\dimen0
- \dimen0\wd2\relax
+ \scratchmuskipone\muexpr\m_math_arrows_factor\muexpr\thirdoffourarguments #2\onemuskip\relax+\m_math_arrows_extra\onemuskip+\firstoffourarguments #2\onemuskip\relax
+ \scratchmuskiptwo\muexpr\m_math_arrows_factor\muexpr\fourthoffourarguments#2\onemuskip\relax+\m_math_arrows_extra\onemuskip+\secondoffourarguments#2\onemuskip\relax
+ \setbox\scratchboxone\hbox
+ {\normalstartimath
+ \scriptstyle
+ \mkern\scratchmuskipone\relax
+ #5\relax
+ \mkern\scratchmuskiptwo\relax
+ \normalstopimath}%
+ \setbox\scratchboxtwo\hbox
+ {\normalstartimath
+ \scriptstyle
+ \mkern\scratchmuskipone\relax
+ #4\relax
+ \mkern\scratchmuskiptwo\relax
+ \normalstopimath}%
+ \setbox\scratchboxthree\hbox{#3\displaystyle}%
+ \scratchdimenone\wd\scratchboxone\relax
+ \ifdim\wd\scratchboxtwo>\scratchdimenone
+ \scratchdimenone\wd\scratchboxtwo\relax
\fi
- \ifdim\wd4>\dimen0
- \dimen0\wd4\relax
+ \ifdim\wd\scratchboxthree>\scratchdimenone
+ \scratchdimenone\wd\scratchboxthree\relax
\fi
- \ifdim\wd4=\dimen0\else
- \setbox4\hbox to \dimen0{#3\displaystyle}%
+ \ifdim\wd\scratchboxthree=\scratchdimenone\else
+ \setbox\scratchboxthree\hbox to \scratchdimenone{#3\displaystyle}%
\fi
- \mathrel{\mathop{\hbox to \dimen0{\hss\copy4\hss}}\limits\normalsuperscript{\box0}\normalsubscript{\box2}}% pack ?
+ \mathrel
+ {\mathop
+ {\hpack to \scratchdimenone{\hss\box\scratchboxthree\hss}}% pack ? copy ?
+ \limits
+ \normalsuperscript{\box\scratchboxone}%
+ \normalsubscript {\box\scratchboxtwo}}%
\endgroup}
\let\math_arrows_construct_single\math_arrows_construct
diff --git a/tex/context/base/mkiv/math-frc.mkiv b/tex/context/base/mkiv/math-frc.mkiv
index 9a5ce62b0..97107a6bf 100644
--- a/tex/context/base/mkiv/math-frc.mkiv
+++ b/tex/context/base/mkiv/math-frc.mkiv
@@ -611,6 +611,46 @@
% \unexpanded\def\ShowMathFractions#1#2%
% {\mathematics{x+\tfrac{#1}{#2}+1+\frac{#1}{#2}+2+\sfrac{#1}{#2}+g}}
+%D More fracking (for Alan):
+
+\def\s!vfrac{vfrac}
+
+\unexpanded\def\math_frac_colored_vulgar#1#2%
+ {\savecolor
+ \colo_helpers_activate\p_math_fractions_color
+ {\restorecolor#1}\Uskewed/{\restorecolor#2}}
+
+\unexpanded\def\math_frac_normal_vulgar#1#2%
+ {{#1}\Uskewed/{#2}}
+
+\unexpanded\def\vfrac#1#2%
+ {\bgroup
+ \edef\p_math_fractions_color{\namedmathfractionparameter\s!vfrac\c!color}%
+ \ifx\p_math_fractions_color\empty
+ \expandafter\math_frac_normal_vulgar
+ \else
+ \expandafter\math_frac_colored_vulgar
+ \fi
+ {#1}%
+ {#2}%
+ \egroup}
+
+\appendtoks
+ \edef\p_hfactor{\namedmathfractionparameter\s!vfrac\c!hfactor}%
+ \edef\p_vfactor{\namedmathfractionparameter\s!vfrac\c!vfactor}%
+ \Umathskewedfractionhgap\textstyle \p_hfactor\fontemwidth \mathstylefont\textstyle
+ \Umathskewedfractionhgap\scriptstyle \p_hfactor\fontemwidth \mathstylefont\scriptstyle
+ \Umathskewedfractionhgap\scriptscriptstyle\p_hfactor\fontemwidth \mathstylefont\scriptscriptstyle
+ \Umathskewedfractionvgap\textstyle \p_vfactor\fontexheight\mathstylefont\textstyle
+ \Umathskewedfractionvgap\scriptstyle \p_vfactor\fontexheight\mathstylefont\scriptstyle
+ \Umathskewedfractionvgap\scriptscriptstyle\p_vfactor\fontexheight\mathstylefont\scriptscriptstyle
+\to \everysetupmathfraction
+
+\setupmathfraction
+ [\s!vfrac]
+ [\c!hfactor=.2,
+ \c!vfactor=.1]
+
\protect \endinput
% I have no clue what \mthfrac and \mthsqrt are supposed to do but
@@ -660,7 +700,7 @@
% \unexpanded\def\mthfrac#1#2#3{[mthfrac: #1 #2 #3]}
% \unexpanded\def\mthsqrt#1#2#3{[mthsqrt: #1 #2 #3]}
-% used for prototypine \Uskewed
+% used for prototyping \Uskewed
%
% \unexpanded\def\skewedfractiona#1#2{%
% \raise
diff --git a/tex/context/base/mkiv/math-ini.mkiv b/tex/context/base/mkiv/math-ini.mkiv
index 9dfc317dd..dc88f82aa 100644
--- a/tex/context/base/mkiv/math-ini.mkiv
+++ b/tex/context/base/mkiv/math-ini.mkiv
@@ -217,18 +217,20 @@
\unexpanded\def\startmathematics % no grouping, if ever then also an optional second
{\doifelsenextoptionalcs\math_mathematics_start_yes\math_mathematics_start_nop}
+\installmacrostack\currentmathematics
+
\unexpanded\def\math_mathematics_start_yes[#1]%
- {\pushmacro\currentmathematics
+ {\push_macro_currentmathematics
\edef\currentmathematics{#1}% check for valid
\the\everyswitchmathematics}
\unexpanded\def\math_mathematics_start_nop
- {\pushmacro\currentmathematics
+ {\push_macro_currentmathematics
\let\currentmathematics\empty
\the\everyswitchmathematics}
\unexpanded\def\stopmathematics
- {\popmacro\currentmathematics
+ {\pop_macro_currentmathematics
\the\everyswitchmathematics}
\definemathematics[\v!default] % not needed, but nicer when nesting back to normal
@@ -734,28 +736,26 @@
%
% \def\math_op{\ifx\nexttoken\bgroup\else\nexttoken\egroup\fi}
-
% this one too: \letvalue{\??mathcodecommand op}\mathop ?
\unexpanded\def\normalmbox
- {\normalhbox\bgroup
+ {\hbox\bgroup
\usemathematicsstyleandcolor\c!textstyle\c!textcolor % new
- \dowithnextboxcs\math_mbox_finish\normalhbox}
+ \dowithnextboxcs\math_mbox_finish\hbox}
\def\math_mbox_finish
{\flushnextbox
\egroup}
\unexpanded\def\mbox % we cannot add \dontleavehmode ... else no \setbox0\mbox possible
- {\ifmmode\normalmbox\else\normalhbox\fi}
+ {\ifmmode\normalmbox\else\hbox\fi}
\unexpanded\def\enablembox
{\appendtoks\math_enable_mbox\to \everymathematics}
{\everymathematics\expandafter{\the\everymathematics\math_enable_mbox}}
\def\math_enable_mbox
- {\ifdefined\normalhbox\else\let\normalhbox\hbox\fi % ?
- \let\hbox\mbox}
+ {\let\hbox\mbox}
\unexpanded\def\snappedmath#1% sort of \struttedbox
{\dontleavehmode
@@ -1077,8 +1077,8 @@
% most math fonts have messed up primes, just test this: $\prime^{\prime^{\prime}}$
-{ \catcode\circumflexasciicode\othercatcode \global\let\othercircumflextoken ^ }
-{ \catcode\circumflexasciicode\superscriptcatcode \global\let\superscriptcircumflextoken^ }
+{ \catcode\circumflexasciicode\othercatcode \glet\othercircumflextoken ^ }
+{ \catcode\circumflexasciicode\superscriptcatcode \glet\superscriptcircumflextoken^ }
\ifdefined \prime \else
\Umathchardef\prime "0 "0 "2032
@@ -1446,7 +1446,7 @@
\def\math_collapsing_initialize
{\ifnum\c_math_collapsing_attribute=\attributeunsetvalue \else
\clf_initializemathcollapsing % one time
- \global\let\math_collapsing_initialize\relax
+ \glet\math_collapsing_initialize\relax
\fi}
\appendtoks
@@ -1483,7 +1483,7 @@
\def\math_italics_initialize
{\ifnum\c_math_italics_attribute=\attributeunsetvalue \else
\clf_initializemathitalics % one time
- \global\let\math_italics_initialize\relax
+ \glet\math_italics_initialize\relax
\fi}
\appendtoks
@@ -1523,7 +1523,7 @@
\def\math_kernpairs_initialize
{\ifnum\c_math_kernpairs_attribute=\attributeunsetvalue \else
\clf_initializemathkernpairs % one time
- \global\let\math_kernpairs_initialize\relax
+ \glet\math_kernpairs_initialize\relax
\fi}
\appendtoks
@@ -2355,7 +2355,7 @@
% \c_math_styles_state_cramped\zerocount
% \c_math_styles_state_size \zerocount
% \rawprocesscommacommand[\m_math_style_asked]\math_style_collect
-% \global\expandafter\let\csname\??mathstylecache\m_math_style_asked\normalexpanded{\endcsname\math_style_add_to_cache_choice}%
+% \expandafter\glet\csname\??mathstylecache\m_math_style_asked\normalexpanded{\endcsname\math_style_add_to_cache_choice}%
% \csname\??mathstylecache\m_math_style_asked\endcsname}
\def\math_style_set_indeed
@@ -2377,7 +2377,7 @@
\c_math_styles_state_cramped\zerocount
\c_math_styles_state_size \zerocount
\rawprocesscommacommand[\m_math_style_asked]\math_style_collect
- \global\expandafter\let\csname\??mathstylecache\m_math_style_asked\normalexpanded{\endcsname\math_style_add_to_cache_choice}%
+ \expandafter\glet\csname\??mathstylecache\m_math_style_asked\normalexpanded{\endcsname\math_style_add_to_cache_choice}%
\csname\??mathstylecache\m_math_style_asked\endcsname}
\letvalue{\??mathstyle \??mathstyle }\math_style_set_mathstyle_mathstyle % still needed?
@@ -2544,7 +2544,7 @@
% this can become an option:
\unexpanded\def\math_display_align_hack % I don't like the global, maybe we should push and pop
- {\global\let\math_display_align_hack_indeed\math_display_align_hack_remove_skip
+ {\glet\math_display_align_hack_indeed\math_display_align_hack_remove_skip
\math_openup\displayopenupvalue % was \math_openup\jot
\everycr{\noalign{\math_display_align_hack_indeed}}}
@@ -2552,7 +2552,7 @@
{\ifdim\prevdepth>-\thousandpoint
\vskip\dimexpr-\lineskiplimit+\normallineskiplimit\relax
\fi
- \global\let\math_display_align_hack_indeed\math_display_align_hack_insert_penalty}
+ \glet\math_display_align_hack_indeed\math_display_align_hack_insert_penalty}
\def\math_display_align_hack_insert_penalty
{\penalty\interdisplaylinepenalty}
@@ -2782,7 +2782,7 @@
\def\math_domain_initialize
{\ifnum\c_math_domain_attribute=\attributeunsetvalue \else
\clf_initializemathdomain % one time
- \global\let\math_domain_initialize\relax
+ \glet\math_domain_initialize\relax
\fi}
\appendtoks
@@ -2806,7 +2806,7 @@
\installcorenamespace{mathrules}
-\unexpanded\def\enablemathrules{\global\letvalue{\??mathrules\fontclass}\plusone}
+\unexpanded\def\enablemathrules{\letgvalue{\??mathrules\fontclass}\plusone}
\appendtoks
\mathrulesmode\ifcsname\??mathrules\fontclass\endcsname
diff --git a/tex/context/base/mkiv/math-pln.mkiv b/tex/context/base/mkiv/math-pln.mkiv
index d0e7e377d..1003444b8 100644
--- a/tex/context/base/mkiv/math-pln.mkiv
+++ b/tex/context/base/mkiv/math-pln.mkiv
@@ -171,7 +171,7 @@
\crcr
\noalign\bgroup
\kern\scratchdimentwo
- \global\let\cr\endline
+ \glet\cr\endline
\egroup
}%
\ialign{%
diff --git a/tex/context/base/mkiv/math-stc.mkvi b/tex/context/base/mkiv/math-stc.mkvi
index c9d469d61..92325d0af 100644
--- a/tex/context/base/mkiv/math-stc.mkvi
+++ b/tex/context/base/mkiv/math-stc.mkvi
@@ -413,13 +413,13 @@
\fi
%
\ifdim\wd\scratchboxone<\scratchwidth
- \setbox\scratchboxone\hbox to \scratchwidth{\hss\unhbox\scratchboxone\hss}% unhboxing makes leaders work
+ \setbox\scratchboxone\hpack to \scratchwidth{\hss\unhbox\scratchboxone\hss}% unhboxing makes leaders work
\fi
\ifdim\wd\scratchboxtwo<\scratchwidth
- \setbox\scratchboxtwo\hbox to \scratchwidth{\hss\unhbox\scratchboxtwo\hss}%
+ \setbox\scratchboxtwo\hpack to \scratchwidth{\hss\unhbox\scratchboxtwo\hss}%
\fi
\ifdim\wd\scratchboxthree<\scratchwidth
- \setbox\scratchboxthree\hbox to \scratchwidth{\hss\unhbox\scratchboxthree\hss}%
+ \setbox\scratchboxthree\hpack to \scratchwidth{\hss\unhbox\scratchboxthree\hss}%
\fi
%
\ifcsname\??mathstackerslocation\p_location\endcsname
@@ -448,7 +448,7 @@
\fi
%
\ifzeropt\scratchdistance\else
- \setbox\scratchboxthree\hbox{\lower\scratchdistance\box\scratchboxthree}%
+ \setbox\scratchboxthree\hpack{\lower\scratchdistance\box\scratchboxthree}%
\fi
%
\math_stackers_normalize_three
@@ -603,7 +603,7 @@
\advance\scratchwidth2\scratchhoffset
%
\setbox\scratchboxtwo\csname\??mathstackersalternative\p_alternative\endcsname
- \setbox\scratchboxthree\hbox to \scratchwidth{\hss\box\scratchboxthree\hss}%
+ \setbox\scratchboxthree\hpack to \scratchwidth{\hss\box\scratchboxthree\hss}%
%
\scratchunicode#codeextra\relax
\ifcase\scratchunicode\else
@@ -803,10 +803,10 @@
\advance\scratchwidth2\scratchhoffset
%
\ifdim\wd\scratchboxone<\scratchwidth
- \setbox\scratchboxone\hbox to \scratchwidth{\hss\unhbox\scratchboxone\hss}%
+ \setbox\scratchboxone\hpack to \scratchwidth{\hss\unhbox\scratchboxone\hss}%
\fi
\ifdim\wd\scratchboxthree<\scratchwidth
- \setbox\scratchboxthree\hbox to \scratchwidth{\hss\unhbox\scratchboxthree\hss}%
+ \setbox\scratchboxthree\hpack to \scratchwidth{\hss\unhbox\scratchboxthree\hss}%
\fi
%
\math_stackers_normalize_three
diff --git a/tex/context/base/mkiv/meta-ini.mkiv b/tex/context/base/mkiv/meta-ini.mkiv
index 61e3523e6..00010f52a 100644
--- a/tex/context/base/mkiv/meta-ini.mkiv
+++ b/tex/context/base/mkiv/meta-ini.mkiv
@@ -365,12 +365,12 @@
\let\MPdrawingdata\empty
\unexpanded\def\resetMPdrawing
- {\global\let\MPdrawingdata\empty
+ {\glet\MPdrawingdata\empty
\global\MPdrawingdonefalse}
\unexpanded\def\pushMPdrawing
{\globalpushmacro\MPdrawingdata
- \global\let\MPdrawingdata\empty}
+ \glet\MPdrawingdata\empty}
\unexpanded\def\popMPdrawing
{\globalpopmacro\MPdrawingdata}
@@ -728,7 +728,7 @@
% \def\meta_start_use_graphic#1#2#3\stopuseMPgraphic
% %{\setgvalue{\??mpgraphic#1}{\meta_handle_use_graphic{#1}{#2}{#3}}}
% %{\setxvalue{\??mpgraphic#1}{\noexpand\meta_handle_use_graphic{#1}{\normalunexpanded{#2}}{\normalunexpanded{#3}}}}
-% {\global\expandafter\gdef\csname\??mpgraphic#1\expandafter\endcsname\expandafter{\expandafter\meta_handle_use_graphic\expandafter{\normalexpanded{#1}}{#2}{#3}}}
+% {\expandafter\gdef\csname\??mpgraphic#1\expandafter\endcsname\expandafter{\expandafter\meta_handle_use_graphic\expandafter{\normalexpanded{#1}}{#2}{#3}}}
%
% cleaner:
diff --git a/tex/context/base/mkiv/meta-pdh.mkiv b/tex/context/base/mkiv/meta-pdh.mkiv
index f9eff73ca..e4ac92fb4 100644
--- a/tex/context/base/mkiv/meta-pdh.mkiv
+++ b/tex/context/base/mkiv/meta-pdh.mkiv
@@ -92,15 +92,15 @@
{\ifx\objectoffset\undefined\zeropoint\else\objectoffset\fi}
\def\resetMPvariables#1#2#3%
- {\global\let\MPwidth \!!zeropoint
- \global\let\MPheight\!!zeropoint
- \global\let\MPllx \!!zerocount
- \global\let\MPlly \!!zerocount
- \global\let\MPurx \!!zerocount
- \global\let\MPury \!!zerocount
- \xdef\MPxscale {#2}\ifx\MPxscale\empty\let\MPxscale\!!plusone\fi
- \xdef\MPyscale {#3}\ifx\MPyscale\empty\let\MPyscale\!!plusone\fi
- \xdef\MPfilename {#1}}
+ {\glet\MPwidth \!!zeropoint
+ \glet\MPheight \!!zeropoint
+ \glet\MPllx \!!zerocount
+ \glet\MPlly \!!zerocount
+ \glet\MPurx \!!zerocount
+ \glet\MPury \!!zerocount
+ \xdef\MPxscale {#2}\ifx\MPxscale\empty\let\MPxscale\!!plusone\fi
+ \xdef\MPyscale {#3}\ifx\MPyscale\empty\let\MPyscale\!!plusone\fi
+ \xdef\MPfilename {#1}}
%D The main macro:
@@ -164,7 +164,7 @@
\else
\getMPPDFobject
\fi
- \global\let\currentPDFresources\empty
+ \glet\currentPDFresources\empty
\else
\box#1%
\fi}
@@ -250,12 +250,12 @@
%D Some day we may consider collecting local resources.
\appendtoks
- \global\let\currentPDFresources\empty % kind of redundant
+ \glet\currentPDFresources\empty % kind of redundant
\to \MPstartresources
% \appendtoks
% \collectPDFresources
-% \global\let\currentPDFresources\collectedPDFresources
+% \glet\currentPDFresources\collectedPDFresources
% \to \MPstopresources
\appendtoksonce
diff --git a/tex/context/base/mkiv/mult-aux.mkiv b/tex/context/base/mkiv/mult-aux.mkiv
index bb716c1d4..8edd0a7bb 100644
--- a/tex/context/base/mkiv/mult-aux.mkiv
+++ b/tex/context/base/mkiv/mult-aux.mkiv
@@ -1321,9 +1321,30 @@
\expandafter\noexpand\csname current#2parent\endcsname
\expandafter\noexpand\csname inject#2parent\endcsname}}
+% Faster but not used that much to make a dent in performance. But, because it's
+% cleaner anyway and also gives less tracing, we apply it a few times.
+
+\unexpanded\def\syst_helpers_install_macro_stack#1#2#3%
+ {\xdef\m_syst_helpers_push_macro{\csstring#1}%
+ \expandafter\newcount\csname#3\m_syst_helpers_push_macro\endcsname
+ \expandafter\edef\csname push_macro_\m_syst_helpers_push_macro\endcsname
+ {\noexpand\expandafter\glet
+ \noexpand\csname\m_syst_helpers_push_macro\noexpand\the\csname#3\m_syst_helpers_push_macro\endcsname\endcsname
+ \noexpand#1%
+ \global\advance\csname#3\m_syst_helpers_push_macro\endcsname\plusone}%
+ \expandafter\edef\csname pop_macro_\m_syst_helpers_push_macro\endcsname
+ {\global\advance\csname#3\m_syst_helpers_push_macro\endcsname\minusone
+ \noexpand\expandafter#2%
+ \noexpand\expandafter\noexpand#1%
+ \noexpand\csname\m_syst_helpers_push_macro\noexpand\the\csname#3\m_syst_helpers_push_macro\endcsname\endcsname}}
+
+\unexpanded\def\installmacrostack #1{\syst_helpers_install_macro_stack#1\let \??localpushedmacro }
+\unexpanded\def\installglobalmacrostack#1{\syst_helpers_install_macro_stack#1\glet\??globalpushedmacro}
+
\protect
-%\unprotect
+% \unprotect
+%
% \installcorenamespace {test} \installcommandhandler \??test {test} \??test
% \unexpanded\def\TestMeA[#1]%
% {\edef\currenttest{#1}
@@ -1338,12 +1359,92 @@
% \unexpanded\def\TestMeD[#1]%
% {\edef\currenttest{#1}
% \doubleexpandafter\ifx\testparameter\c!before\empty \relax \else \relax \fi}
-% \protect
%
-% \starttext
-% \definetest[foo] \definetest[bar][foo] \setuptest[bar][before=indeed]
-% \resettimer \dorecurse{100000}{\TestMeA[bar]} A:\elapsedtime \par % 0.502
-% \resettimer \dorecurse{100000}{\TestMeB[bar]} B:\elapsedtime \par % 0.530
-% \resettimer \dorecurse{100000}{\TestMeC[bar]} C:\elapsedtime \par % 0.487
-% \resettimer \dorecurse{100000}{\TestMeD[bar]} D:\elapsedtime \par % 0.493
-% \stoptext
+% \protect
+%
+% \starttext
+% \definetest[foo] \definetest[bar][foo] \setuptest[bar][before=indeed]
+% \resettimer \dorecurse{100000}{\TestMeA[bar]} A:\elapsedtime \par % 0.502
+% \resettimer \dorecurse{100000}{\TestMeB[bar]} B:\elapsedtime \par % 0.530
+% \resettimer \dorecurse{100000}{\TestMeC[bar]} C:\elapsedtime \par % 0.487
+% \resettimer \dorecurse{100000}{\TestMeD[bar]} D:\elapsedtime \par % 0.493
+% \stoptext
+
+% There is no real demand for this ... even if this is twice as fast we only gain
+% a few milliseconds:
+%
+% \unexpanded\def\foo#1{[foo:#1]}
+%
+% \installcommalistprocessor {foo} \foo
+% \installcommalistprocessorcommand \processfoolist {foo} \foo
+%
+% \commalistprocessor{foo}[a,b,c,d]
+% \processfoolist [a, b, c, d]
+%
+% \testfeatureonce{30000}{} \elapsedtime\par % 0.01 -> 0.00
+% \testfeatureonce{30000}{\processfoolist [fixed,middle]} \elapsedtime\par % 0.07 -> 0.06
+% \testfeatureonce{30000}{\commalistprocessor{foo}[fixed,middle]} \elapsedtime\par % 0.09 -> 0.08
+% \testfeatureonce{30000}{\processcommalist [fixed,middle]\foo} \elapsedtime\par % 0.13 -> 0.12
+%
+% For instance the luatex manual only has some 3000 calls. But I keep this around as one
+% never knows when we might need it.
+%
+% \installcorenamespace{commalistprocessor}
+% \installcorenamespace{commalistprocessorcheck}
+% \installcorenamespace{commalistprocessorwrap}
+% \installcorenamespace{commalistprocessorfirst}
+% \installcorenamespace{commalistprocessorcheckspace}
+% \installcorenamespace{commalistprocessorcheckfinish}
+% \installcorenamespace{commalistprocessoraction}
+% \installcorenamespace{commalistprocessorgobblespace}
+%
+% \unexpanded\def\installcommalistprocessor#1#2% 7 macro names overhead
+% {\let\nexttoken\relax
+% %
+% \unexpanded\expandafter\edef\csname\??commalistprocessor#1\endcsname[%
+% {\futurelet\nexttoken\csname\??commalistprocessorcheck#1\endcsname}%
+% %
+% \unexpanded\expandafter\edef\csname\??commalistprocessorcheck#1\endcsname
+% {\noexpand\ifx\nexttoken]%
+% \noexpand\expandafter\noexpand\gobblethreearguments
+% \noexpand\else
+% \noexpand\expandafter\csname\??commalistprocessorwrap#1\endcsname
+% \noexpand\fi
+% \relax}% this one preserved the next {}
+% %
+% \unexpanded\expandafter\edef\csname\??commalistprocessorwrap#1\endcsname##1]%
+% {\csname\??commalistprocessorfirst#1\endcsname##1,]\relax}%
+% %
+% \unexpanded\expandafter\edef\csname\??commalistprocessorfirst#1\endcsname##1% picks up \relax
+% {\csname\??commalistprocessorcheckspace#1\endcsname}%
+% %
+% \unexpanded\expandafter\edef\csname\??commalistprocessorcheckspace#1\endcsname
+% {\noexpand\ifx\nexttoken\noexpand\blankspace
+% \noexpand\expandafter\csname\??commalistprocessorgobblespace#1\endcsname
+% \noexpand\else
+% \noexpand\expandafter\csname\??commalistprocessorcheckfinish#1\endcsname
+% \noexpand\fi}%
+% %
+% \unexpanded\expandafter\edef\csname\??commalistprocessorcheckfinish#1\endcsname
+% {\noexpand\ifx\nexttoken]%
+% \noexpand\expandafter\noexpand\gobbleoneargument
+% \noexpand\else
+% \noexpand\expandafter\csname\??commalistprocessoraction#1\endcsname
+% \noexpand\fi}%
+% %
+% \unexpanded\expandafter\edef\csname\??commalistprocessoraction#1\endcsname##1,%
+% {\noexpand#2{##1}%
+% \futurelet\nexttoken\csname\??commalistprocessorcheckspace#1\endcsname}%
+% %
+% \let\next\:%
+% \unexpanded\edef \:{\csname\??commalistprocessorgobblespace#1\endcsname}%
+% \unexpanded\expandafter\edef\: {\futurelet\nexttoken\csname\??commalistprocessorcheckspace#1\endcsname}%
+% \let\:\next
+% %
+% }
+%
+% \unexpanded\def\installcommalistprocessorcommand#1#2#3%
+% {\installcommalistprocessor{#2}{#3}%
+% \expandafter\let\expandafter#1\csname\??commalistprocessor#2\endcsname}
+%
+% \unexpanded\def\commalistprocessor#1{\csname\??commalistprocessor#1\endcsname}
diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua
index 925c22cd2..01a512bc6 100644
--- a/tex/context/base/mkiv/mult-def.lua
+++ b/tex/context/base/mkiv/mult-def.lua
@@ -8278,7 +8278,7 @@ return {
["ro"]="inaltime",
},
["hfactor"]={
- ["cs"]="vfaktor",
+ ["cs"]="hfaktor",
["de"]="hfaktor",
["en"]="hfactor",
["fr"]="facteurhauteur",
@@ -8287,6 +8287,14 @@ return {
["pe"]="عامل‌ارتفاع",
["ro"]="hfactor",
},
+ ["vfactor"]={
+ ["cs"]="vfaktor",
+ ["de"]="vfaktor",
+ ["en"]="vfactor",
+ ["it"]="vfactor",
+ ["nl"]="vfactor",
+ ["ro"]="vfactor",
+ },
["hfil"]={
["cs"]="hfil",
["de"]="hfil",
diff --git a/tex/context/base/mkiv/mult-low.lua b/tex/context/base/mkiv/mult-low.lua
index ddcc690e3..1b794ef73 100644
--- a/tex/context/base/mkiv/mult-low.lua
+++ b/tex/context/base/mkiv/mult-low.lua
@@ -101,7 +101,9 @@ return {
"startcomponent", "stopcomponent", "component",
"startproduct", "stopproduct", "product",
"startproject", "stopproject", "project",
- "starttext", "stoptext", "startnotext", "stopnotext","startdocument", "stopdocument", "documentvariable", "unexpandeddocumentvariable", "setupdocument", "presetdocument",
+ "starttext", "stoptext", "startnotext", "stopnotext",
+ "startdocument", "stopdocument", "documentvariable", "unexpandeddocumentvariable", "setupdocument", "presetdocument",
+ "doifelsedocumentvariable", "doifdocumentvariableelse", "doifdocumentvariable", "doifnotdocumentvariable",
"startmodule", "stopmodule", "usemodule", "usetexmodule", "useluamodule","setupmodule","currentmoduleparameter","moduleparameter",
"everystarttext", "everystoptext",
--
diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua
index 86806d113..edb66b991 100644
--- a/tex/context/base/mkiv/mult-prm.lua
+++ b/tex/context/base/mkiv/mult-prm.lua
@@ -254,6 +254,7 @@ return {
"fontid",
"formatname",
"gleaders",
+ "glet",
"hjcode",
"hyphenationbounds",
"hyphenationmin",
diff --git a/tex/context/base/mkiv/node-fin.lua b/tex/context/base/mkiv/node-fin.lua
index f7e2c7904..3139263ab 100644
--- a/tex/context/base/mkiv/node-fin.lua
+++ b/tex/context/base/mkiv/node-fin.lua
@@ -725,6 +725,89 @@ local function stacker(attribute,head,default) -- no triggering, no inheritance,
return head
end
+-- local nextid = nodes.nuts.traversers.id
+--
+-- local function stacker(attribute,head,default) -- no triggering, no inheritance, but list-wise
+--
+-- -- nsbegin()
+-- local stacked = false
+--
+-- local current = head
+-- local previous = head
+-- local attrib = default or unsetvalue
+-- local check = false
+-- local leader = false
+--
+-- local id = getid(current)
+-- while current do
+-- if id == glyph_code then
+-- check = true
+-- elseif id == glue_code then
+-- leader = getleader(current)
+-- if leader then
+-- check = true
+-- end
+-- elseif id == hlist_code or id == vlist_code then
+-- local content = getlist(current)
+-- if content then
+-- local list
+-- if nslistwise then
+-- local a = getattr(current,attribute)
+-- if a and attrib ~= a and nslistwise[a] then -- viewerlayer
+-- head = insert_node_before(head,current,copy_node(nsdata[a]))
+-- list = stacker(attribute,content,a)
+-- head, current = insert_node_after(head,current,copy_node(nsnone))
+-- else
+-- list = stacker(attribute,content,attrib)
+-- end
+-- else
+-- list = stacker(attribute,content,default)
+-- end
+-- if list ~= content then
+-- setlist(current,list)
+-- end
+-- end
+-- elseif id == rule_code then
+-- check = getwidth(current) ~= 0
+-- end
+--
+-- if check then
+-- local a = getattr(current,attribute) or unsetvalue
+-- if a ~= attrib then
+-- if not stacked then
+-- stacked = true
+-- nsbegin()
+-- end
+-- local n = nsstep(a)
+-- if n then
+-- head = insert_node_before(head,current,tonut(n)) -- a
+-- end
+-- attrib = a
+-- if leader then
+-- -- tricky as a leader has to be a list so we cannot inject before
+-- local list = stacker(attribute,leader,attrib)
+-- leader = false
+-- end
+-- end
+-- check = false
+-- end
+--
+-- previous = current
+--
+-- current, id = nextid(current,current)
+-- end
+--
+-- if stacked then
+-- local n = nsend()
+-- while n do
+-- head = insert_node_after(head,previous,tonut(n))
+-- n = nsend()
+-- end
+-- end
+--
+-- return head
+-- end
+
states.stacker = function(namespace,attribute,head,default)
local head = stacker(attribute,head,default)
nsreset()
diff --git a/tex/context/base/mkiv/node-fnt.lua b/tex/context/base/mkiv/node-fnt.lua
index 044be8ca8..59a0ba671 100644
--- a/tex/context/base/mkiv/node-fnt.lua
+++ b/tex/context/base/mkiv/node-fnt.lua
@@ -648,7 +648,7 @@ if LUATEXVERSION >= 1.090 then
for n, char, font in nextchar, head do
-- local attr = (none and prevattr) or getattr(n,0) or 0 -- zero attribute is reserved for fonts in context
- local attr = getattr(n,0) or 0 -- zero attribute is reserved for fonts in context
+ local attr = getattr(n) or 0 -- zero attribute is reserved for fonts in context
if font ~= prevfont or attr ~= prevattr then
prevfont = font
prevattr = attr
@@ -665,7 +665,7 @@ if LUATEXVERSION >= 1.090 then
lastnone = n
end
if variants then
- if char >= 0xFE00 and (char <= 0xFE0F or (char >= 0xE0100 and char <= 0xE01EF)) then
+ if (char >= 0xFE00 and char <= 0xFE0F) or (char >= 0xE0100 and char <= 0xE01EF) then
local hash = variants[char]
if hash then
local p = getprev(n)
@@ -769,7 +769,7 @@ if LUATEXVERSION >= 1.090 then
local prevattr = nil
local none = false
for n, char, font in nextchar, r do
- local attr = getattr(n,0) or 0 -- zero attribute is reserved for fonts in context
+ local attr = getattr(n) or 0 -- zero attribute is reserved for fonts in context
if font ~= prevfont or attr ~= prevattr then
prevfont = font
prevattr = attr
diff --git a/tex/context/base/mkiv/node-res.lua b/tex/context/base/mkiv/node-res.lua
index a33766d77..723562027 100644
--- a/tex/context/base/mkiv/node-res.lua
+++ b/tex/context/base/mkiv/node-res.lua
@@ -6,6 +6,7 @@ if not modules then modules = { } end modules ['node-res'] = {
license = "see context related readme files"
}
+local type, next = type, next
local gmatch, format = string.gmatch, string.format
--[[ldx--
diff --git a/tex/context/base/mkiv/pack-bar.mkiv b/tex/context/base/mkiv/pack-bar.mkiv
index 06eeebd14..c4b3fca62 100644
--- a/tex/context/base/mkiv/pack-bar.mkiv
+++ b/tex/context/base/mkiv/pack-bar.mkiv
@@ -72,7 +72,7 @@
\vskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}}
\unexpanded\def\horizontalgrowingbar[#1]%
- {\hbox to \hsize
+ {\hpack to \hsize
{\setuppositionbar[#1]%
\usepositionbarstyleandcolor\c!style\c!color
\leaders\vrule\hskip\zeropoint\s!plus \numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill
@@ -81,7 +81,7 @@
\hskip\zeropoint\s!plus-\positionbarparameter\c!n \s!fill}}
\unexpanded\def\verticalgrowingbar[#1]%
- {\vbox to \vsize
+ {\vpack to \vsize
{\setuppositionbar[#1]%
\usepositionbarstyleandcolor\c!style\c!color
\leaders\hrule\vskip\zeropoint\s!plus\numexpr\positionbarparameter\c!n-\positionbarparameter\c!min+\plusone\relax\s!fill
diff --git a/tex/context/base/mkiv/pack-box.mkiv b/tex/context/base/mkiv/pack-box.mkiv
index c53b4520c..bf6d4662d 100644
--- a/tex/context/base/mkiv/pack-box.mkiv
+++ b/tex/context/base/mkiv/pack-box.mkiv
@@ -108,6 +108,7 @@
{\global\advance\c_pack_anchors_n\plusone
\pagereference[\v!layer:\v!anchor:\number\c_pack_anchors_n]%
\putboxincache\v!anchor{\number\c_pack_anchors_n}\b_pack_anchors
+% \xtoksapp\t_pack_anchors_flush{\pack_anchors_flush{\number\c_pack_anchors_n}{#1}{#2}}%
\doglobal\appendetoks
\pack_anchors_flush{\number\c_pack_anchors_n}{#1}{#2}%
\to \t_pack_anchors_flush
diff --git a/tex/context/base/mkiv/pack-cut.mkiv b/tex/context/base/mkiv/pack-cut.mkiv
index ffd0251d5..84c14d648 100644
--- a/tex/context/base/mkiv/pack-cut.mkiv
+++ b/tex/context/base/mkiv/pack-cut.mkiv
@@ -65,85 +65,87 @@
\def\cutmarkrulethickness{\onepoint}
\unexpanded\def\horizontalcuts
- {\normalhbox to \d_pack_cutmarks_width
- {\dorecurse\horizontalcutmarks{\vrule\s!width\cutmarkrulethickness\s!height\cutmarklength\normalhfill}%
+ {\hpack to \d_pack_cutmarks_width
+ {\dorecurse\horizontalcutmarks{\vrule\s!width\cutmarkrulethickness\s!height\cutmarklength\hfill}%
\unskip}}
\unexpanded\def\verticalcuts
- {\normalvbox to \dimexpr\d_pack_cutmarks_height+\d_pack_cutmarks_depth\relax
+ {\vpack to \dimexpr\d_pack_cutmarks_height+\d_pack_cutmarks_depth\relax
{\hsize\cutmarklength
- \dorecurse\verticalcutmarks{\vrule\s!height\cutmarkrulethickness\s!width\hsize\normalvfill}%
+ \dorecurse\verticalcutmarks{\vrule\s!height\cutmarkrulethickness\s!width\hsize\vfill}%
\unskip}}
\unexpanded\def\baselinecuts
{\ifdim\d_pack_cutmarks_depth>\zeropoint
- \normalvbox to \dimexpr\d_pack_cutmarks_height+\d_pack_cutmarks_depth\relax
+ \vpack to \dimexpr\d_pack_cutmarks_height+\d_pack_cutmarks_depth\relax
{\hsize\dimexpr\cutmarklength/2\relax
- \normalvskip\zeropoint\s!plus\d_pack_cutmarks_height
+ \vskip\zeropoint\s!plus\d_pack_cutmarks_height
\vrule\s!height\cutmarkrulethickness\s!width\hsize
- \normalvskip\zeropoint\s!plus\d_pack_cutmarks_depth}%
+ \vskip\zeropoint\s!plus\d_pack_cutmarks_depth}%
\fi}
\unexpanded\def\cutmarksymbols#1%
- {\normalhbox to \d_pack_cutmarks_width
- {\setbox\scratchbox\normalhbox to \cutmarklength
- {\normalhss\infofont\cutmarksymbol\normalhss}%
- \normalhss
- \normalvbox to \cutmarklength
+ {\hpack to \d_pack_cutmarks_width
+ {\setbox\scratchbox\hbox to \cutmarklength
+ {\hss\infofont\cutmarksymbol\hss}%
+ \hss
+ \vpack to \cutmarklength
{\scratchdimen\dimexpr\cutmarklength/2\relax
\scratchskip \ifx\cutmarkhoffset\empty\cutmarkoffset\scratchdimen\else\cutmarkhoffset\fi
- \normalvss
- \hpack to \d_pack_cutmarks_width
- {\llap{\copy\scratchbox\normalhskip\scratchskip}%
- \normalhskip\scratchdimen\hss\infofont#1\hss\normalhskip\scratchdimen
- \rlap{\normalhskip\scratchskip\copy\scratchbox}}%
- \normalvss}%
- \normalhss}}
+ \vss
+ \hbox to \d_pack_cutmarks_width
+ {\llap{\copy\scratchbox\hskip\scratchskip}%
+ \hskip\scratchdimen\hss
+ \infofont#1%
+ \hss\hskip\scratchdimen
+ \rlap{\hskip\scratchskip\copy\scratchbox}}%
+ \vss}%
+ \hss}}
\unexpanded\def\makecutbox#1%
{\bgroup
\d_pack_cutmarks_height\ht#1%
\d_pack_cutmarks_depth \dp#1%
\d_pack_cutmarks_width \wd#1%
- \setbox#1\normalhbox
+ \setbox#1\hpack
{\dontcomplain
\forgetall
\boxmaxdepth\maxdimen
\offinterlineskip
\scratchdimen\dimexpr\cutmarklength/2\relax
\hsize\d_pack_cutmarks_width
- \setbox\scratchbox\normalvbox
- {\setbox\scratchbox\normalhbox{\horizontalcuts}%
+ \setbox\scratchbox\vpack
+ {\setbox\scratchbox\hpack{\horizontalcuts}%
\scratchskip\ifx\cutmarkvoffset\empty\cutmarkoffset\scratchdimen\else\cutmarkvoffset\fi
- \tlap{\copy\scratchbox\normalvskip\scratchskip}%
+ \tlap{\copy\scratchbox\vskip\scratchskip}%
\hpack to \d_pack_cutmarks_width
{\scratchskip\ifx\cutmarkhoffset\empty\cutmarkoffset\scratchdimen\else\cutmarkhoffset\fi
- \setbox\scratchbox\normalhbox{\verticalcuts}%
- \llap{\copy\scratchbox\normalhskip\scratchskip}%
+ \setbox\scratchbox\hpack{\verticalcuts}%
+ \llap{\copy\scratchbox\hskip\scratchskip}%
\ifdim\d_pack_cutmarks_depth=\zeropoint
- \normalhfill
+ \hfill
\else
\bgroup
- \setbox\scratchbox\normalhbox{\baselinecuts}%
- \llap{\copy\scratchbox\normalhskip\scratchskip}%
- \normalhfill
- \rlap{\normalhskip\scratchskip\copy\scratchbox}%
+ \setbox\scratchbox\hpack{\baselinecuts}%
+ \llap{\copy\scratchbox\hskip\scratchskip}%
+ \hfill
+ \rlap{\hskip\scratchskip\copy\scratchbox}%
\egroup
\fi
- \rlap{\normalhskip\scratchskip\copy\scratchbox}}%
- \blap{\normalvskip\scratchskip\copy\scratchbox}}%
+ \rlap{\hskip\scratchskip\copy\scratchbox}}%
+ \blap{\vskip\scratchskip\copy\scratchbox}}%
\ht\scratchbox\d_pack_cutmarks_height
\dp\scratchbox\d_pack_cutmarks_depth
\wd\scratchbox\zeropoint
\startcolor[\defaulttextcolor]%
\box\scratchbox
\ifx\cutmarksymbol\relax \else
- \setbox\scratchbox\normalvbox
+ \setbox\scratchbox\vpack
{\scratchskip\ifx\cutmarkvoffset\empty\cutmarkoffset\scratchdimen\else\cutmarkvoffset\fi
\vskip-\dimexpr\scratchskip+\cutmarklength\relax
- \normalhbox{\cutmarksymbols\cutmarktoptext}%
+ \hpack{\cutmarksymbols\cutmarktoptext}%
\vskip\dimexpr\scratchskip+\d_pack_cutmarks_height+\d_pack_cutmarks_depth+\scratchskip\relax
- \normalhbox{\cutmarksymbols\cutmarkbottomtext}}%
+ \hpack{\cutmarksymbols\cutmarkbottomtext}}%
\ht\scratchbox\d_pack_cutmarks_height
\dp\scratchbox\d_pack_cutmarks_depth
\wd\scratchbox\zeropoint
@@ -156,8 +158,8 @@
\dp#1\d_pack_cutmarks_depth
\egroup}
-\unexpanded\def\cuthbox{\normalhbox\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\normalhbox}
-\unexpanded\def\cutvbox{\normalvbox\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\normalvbox}
-\unexpanded\def\cutvtop{\normalvtop\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\normalvtop}
+\unexpanded\def\cuthbox{\hpack\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\hbox}
+\unexpanded\def\cutvbox{\vpack\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\vbox}
+\unexpanded\def\cutvtop{\tpack\bgroup\dowithnextbox{\makecutbox\nextbox\flushnextbox\egroup}\vtop}
\protect \endinput
diff --git a/tex/context/base/mkiv/pack-rul.mkiv b/tex/context/base/mkiv/pack-rul.mkiv
index c208baaf0..93527e787 100644
--- a/tex/context/base/mkiv/pack-rul.mkiv
+++ b/tex/context/base/mkiv/pack-rul.mkiv
@@ -487,7 +487,7 @@
\unexpanded\def\executedefinedoverlay#1#2% we can share the definitions
{\bgroup % redundant grouping
- \setbox\scratchbox\hbox\bgroup
+ \setbox\scratchbox\hbox\bgroup % \hpack ?
\ifzeropt\d_framed_target_dp
\the\everyoverlay#2% saves wrapping (and lua call)
\else
@@ -614,7 +614,7 @@
\fi}
\def\pack_framed_add_background
- {\setbox\b_framed_normal\hbox % was vbox % see also *1*
+ {\setbox\b_framed_normal\hpack % was vbox % see also *1*
{%\pack_framed_forgetall % can be relaxed
\boxmaxdepth\maxdimen
\framedbackgroundoffset\d_framed_backgroundoffset
@@ -631,7 +631,7 @@
\setlayoutcomponentattribute{\v!background:\p_framed_component}%
\fi
\let\foregroundbox\pack_framed_background_box_content
- \hbox \layoutcomponentboxattribute to \framedbackgroundwidth\bgroup % width in case 'foreground' is used as overlay
+ \hpack \layoutcomponentboxattribute to \framedbackgroundwidth\bgroup % width in case 'foreground' is used as overlay
\the\everybackgroundbox % moved
\expandafter\pack_framed_process_backgrounds\p_framed_background,\s!unknown,\relax % hm, messy .. look into it
\box\b_framed_normal
@@ -692,10 +692,10 @@
\scratchdimen\zeropoint
\fi
\edef\overlaylinecolor{\framedparameter\c!framecolor}% twice, also in background
- \setbox\b_framed_extra\hbox
+ \setbox\b_framed_extra\hpack
{\kern-\d_framed_frameoffset
\raise\scratchdimen
- \hbox{\ifx\overlaylinecolor\empty\else\dousecolorparameter\overlaylinecolor\fi\pack_framed_stroked_box}}%
+ \hpack{\ifx\overlaylinecolor\empty\else\dousecolorparameter\overlaylinecolor\fi\pack_framed_stroked_box}}%
\wd\b_framed_extra\wd\b_framed_normal
\ht\b_framed_extra\ht\b_framed_normal
\dp\b_framed_extra\dp\b_framed_normal
@@ -728,7 +728,7 @@
{\setbox\scratchbox\vpack \bgroup
\csname \??framedtop\p_framed_frame\framedparameter\c!topframe \endcsname
\nointerlineskip % new (needed for fences)
- \hbox \bgroup
+ \hpack \bgroup
\csname \??framedleft\p_framed_frame\framedparameter\c!leftframe \endcsname
\novrule
\s!width \d_framed_target_wd
@@ -2203,7 +2203,7 @@
\ignorespaces}
\def\dododoformatonelinerbox
- {\hbox to \hsize % maybe \hpack
+ {\hpack to \hsize % was \hbox
{\ifcase\raggedstatus\or\hss\or\hss \fi
\unhbox\nextbox \removeunwantedspaces
\ifcase\raggedstatus\or \or\hss\or\hss\fi}%
@@ -2324,7 +2324,7 @@
\doformatonelinerbox}
\def\pack_framed_format_format_vsize
- {\vbox to \d_framed_height
+ {\vbox to \d_framed_height % no vpack .. maybe grid
\bgroup
\let\postprocessframebox\relax
% \pack_framed_forgetall
@@ -2551,9 +2551,9 @@
\par
\kern-\d_framed_linewidth
\dontleavehmode
- \hpack to \zeropoint{\normalhss\vrule\s!height\d_framed_linewidth\s!depth\zeropoint\s!width\scratchwidth}%
+ \hpack to \zeropoint{\hss\vrule\s!height\d_framed_linewidth\s!depth\zeropoint\s!width\scratchwidth}%
\hfill
- \hpack to \zeropoint{\vrule\s!height\d_framed_linewidth\s!depth\zeropoint\s!width\scratchwidth\normalhss}%
+ \hpack to \zeropoint{\vrule\s!height\d_framed_linewidth\s!depth\zeropoint\s!width\scratchwidth\hss}%
\par
\nointerlineskip
\kern\scratchoffset
@@ -2792,7 +2792,7 @@
\csname\??framedtextlocation\framedtextparameter\c!location\endcsname
\resetframedtextparameter\c!location
\pack_framed_text_check
- \setbox\b_framed_normal\vbox
+ \setbox\b_framed_normal\vbox % \vpack
\startboxedcontent
\hsize\localhsize
% \insidefloattrue % ? better
@@ -3069,7 +3069,7 @@
\fi}
\def\pack_framed_start_content_indeed
- {\setbox\b_framed_normal\hbox\bgroup % maybe \hpack
+ {\setbox\b_framed_normal\hpack\bgroup
\setlocalhsize
\hsize\localhsize
\scratchleftoffset \framedcontentparameter\c!leftoffset \relax
@@ -3079,16 +3079,16 @@
\advance\hsize\dimexpr-\scratchleftoffset-\scratchrightoffset \relax
\advance\vsize\dimexpr-\scratchtopoffset -\scratchbottomoffset\relax
\kern\scratchleftoffset
- \vbox\bgroup
+ \vpack\bgroup
\vskip\scratchtopoffset
- \vbox\bgroup
- \forgetall
- \blank[\v!disable]}
+ \vbox\bgroup
+ \forgetall
+ \blank[\v!disable]}
\def\pack_framed_stop_content_indeed
- {\removelastskip
- \egroup
- \vskip\scratchbottomoffset
+ {\removelastskip
+ \egroup
+ \vskip\scratchbottomoffset
\egroup
\kern\scratchrightoffset
\egroup
diff --git a/tex/context/base/mkiv/page-imp.mkiv b/tex/context/base/mkiv/page-imp.mkiv
index d4526a59f..b80a3b266 100644
--- a/tex/context/base/mkiv/page-imp.mkiv
+++ b/tex/context/base/mkiv/page-imp.mkiv
@@ -26,7 +26,7 @@
\newtoks\t_page_text_data
\unexpanded\def\starttextdata#1\stoptextdata
- {\global\let\page_shipouts_flush_text_data\page_shipouts_flush_text_data_indeed
+ {\glet\page_shipouts_flush_text_data\page_shipouts_flush_text_data_indeed
\globaladdtotoks\t_page_text_data{#1}}
\let\stoptextdata\relax
@@ -34,7 +34,7 @@
\def\page_shipouts_flush_text_data_indeed
{\vsmashed{\the\t_page_text_data}%
\global\t_page_text_data\emptytoks
- \global\let\page_shipouts_flush_text_data\relax}
+ \glet\page_shipouts_flush_text_data\relax}
\let\page_shipouts_flush_text_data\relax
@@ -320,14 +320,14 @@
\let\pusharrangedpage\relax
\def\dosetuparrangement#1#2#3#4#5#6#7#8%
- {\global\arrangedpageX #1%
- \global\arrangedpageY #2%
- \global\arrangedpageT #3%
- \global\c_page_marks_nx #4%
- \global\c_page_marks_ny #5%
- \global\let\pusharrangedpage #6%
- \global\let\poparrangedpages #7%
- \global\let\handlearrangedpage#8}
+ {\global\arrangedpageX #1%
+ \global\arrangedpageY #2%
+ \global\arrangedpageT #3%
+ \global\c_page_marks_nx #4%
+ \global\c_page_marks_ny #5%
+ \glet \pusharrangedpage #6%
+ \glet \poparrangedpages #7%
+ \glet \handlearrangedpage#8}
\installpagearrangement {\v!normal}
{\global\arrangingpagesfalse}
diff --git a/tex/context/base/mkiv/page-lay.mkiv b/tex/context/base/mkiv/page-lay.mkiv
index 7b80dadb9..d285c3a58 100644
--- a/tex/context/base/mkiv/page-lay.mkiv
+++ b/tex/context/base/mkiv/page-lay.mkiv
@@ -149,12 +149,12 @@
\let\currentlayout\empty
\fi
\letlayoutparameter\c!state\v!normal % global ? still needed ?
- \global\let\currentlayout\currentlayout % global
+ \glet\currentlayout\currentlayout % global
\page_layouts_synchronize
\page_layouts_check_next
\or % \setuplayout (reverts to main layout)
\letlayoutparameter\c!state\v!normal % global ? still needed ?
- \global\let\currentlayout\empty % global
+ \glet\currentlayout\empty % global
\page_layouts_synchronize
\page_layouts_check_next
\fi
@@ -462,7 +462,7 @@
\appendtoks
\page_paper_reinstate
- \global\let\page_paper_reinstate\relax
+ \glet\page_paper_reinstate\relax
\to \everyaftershipout
\unexpanded\def\page_paper_set_restore#1#2%
@@ -538,7 +538,7 @@
\ifx\currentlayouttarget\empty
\let\currentlayouttarget\currentpage
\fi
- \global\let\papersize\currentlayouttarget
+ \glet\papersize\currentlayouttarget
\page_paper_reset_paper
\processcommacommand[\m_page_asked_paper]\page_paper_handle_page_option
\global\paperwidth \layouttargetparameter\c!width \relax
@@ -561,7 +561,7 @@
% locate paper target
\page_paper_reset_print
\processcommacommand[\m_page_asked_print]\page_paper_identify_target
- \global\let\printpapersize\currentlayouttarget
+ \glet\printpapersize\currentlayouttarget
\page_paper_reset_print
\processcommacommand[\m_page_asked_print]\page_paper_handle_print_option
\global\printpaperwidth \layouttargetparameter\c!width \relax
@@ -814,18 +814,18 @@
{\edef\m_page_check{#1}
\edef\m_page_state{\namedlayoutparameter\m_page_check\c!state}%
\ifx\m_page_state\v!start
- \global\let\v_page_layouts_pre_check\currentlayout
- \global\let\currentlayout\m_page_check
+ \glet\v_page_layouts_pre_check\currentlayout
+ \glet\currentlayout\m_page_check
\page_layouts_synchronize
\else\ifx\m_page_state\v!repeat
- \global\let\v_page_layouts_pre_check\relax
- \global\let\currentlayout\m_page_check
+ \glet\v_page_layouts_pre_check\relax
+ \glet\currentlayout\m_page_check
\page_layouts_synchronize
\fi\fi}
\def\page_layouts_check_revert
- {\global\let\currentlayout\v_page_layouts_pre_check
- \global\let\v_page_layouts_pre_check\relax
+ {\glet\currentlayout\v_page_layouts_pre_check
+ \glet\v_page_layouts_pre_check\relax
\page_layouts_synchronize}
\def\page_layouts_check_default
@@ -1040,8 +1040,8 @@
\page_otr_command_set_vsize
%
\page_backgrounds_recalculate
- \global\let\page_adepts_push\relax
- \global\let\page_adepts_pop\page_adepts_pop_indeed}
+ \glet\page_adepts_push\relax
+ \glet\page_adepts_pop\page_adepts_pop_indeed}
% \def\page_adapts_check
% {\csname\??pageadaptations\the\ifcsname\??pageadaptations\the\realpageno\endcsname\realpageno\else\zerocount\fi\endcsname}
@@ -1067,8 +1067,8 @@
{\global\textheight \d_page_adepts_pushed_text_height
\global\footerheight\d_page_adepts_pushed_footer_height
\page_layouts_synchronize
- \global\let\page_adepts_push\page_adepts_push_indeed
- \global\let\page_adepts_pop\relax}
+ \glet\page_adepts_push\page_adepts_push_indeed
+ \glet\page_adepts_pop\relax}
\appendtoks \page_adapts_check \to \everystarttext
\appendtoks \page_adapts_reset \to \everyshipout
@@ -1181,9 +1181,6 @@
%D it is used in cross referencing. The next switch is set
%D when we start at an even page.
-% We could use nested if here plus some \@EAEAEA's but but the
-% next variant has less expansion which is nicer in tracing.
-
% #single #left #right
\def\doifelseoddpage
diff --git a/tex/context/base/mkiv/page-mix.mkiv b/tex/context/base/mkiv/page-mix.mkiv
index 684ebc585..436c4a1dc 100644
--- a/tex/context/base/mkiv/page-mix.mkiv
+++ b/tex/context/base/mkiv/page-mix.mkiv
@@ -371,6 +371,9 @@
\let\currentmixedcolumnsmethod\empty
+\installmacrostack\currentmixedcolumns
+\installmacrostack\currentmixedcolumnsmethod
+
\unexpanded\def\startmixedcolumns
{\dodoubleempty\page_mix_start_columns}
@@ -385,8 +388,8 @@
\fi\fi}
\unexpanded\def\page_mix_start_columns
- {\pushmacro\currentmixedcolumns
- \pushmacro\currentmixedcolumnsmethod
+ {\push_macro_currentmixedcolumns
+ \push_macro_currentmixedcolumnsmethod
\ifsecondargument
\singleexpandafter\page_mix_start_columns_a
\else\iffirstargument
@@ -462,8 +465,8 @@
\let\stopmixedcolumns\page_mix_columns_stop_nop}
\unexpanded\def\page_mix_fast_columns_start#1%
- {\pushmacro\currentmixedcolumns
- \pushmacro\currentmixedcolumnsmethod
+ {\push_macro_currentmixedcolumns
+ \push_macro_currentmixedcolumnsmethod
\edef\currentmixedcolumns{#1}%
\edef\currentmixedcolumnsmethod{\mixedcolumnsparameter\c!method}%
\mixedcolumnsparameter\c!before\relax % so, it doesn't listen to local settings !
@@ -492,15 +495,15 @@
\endgroup
\begincsname\??mixedcolumnsafter\currentmixedcolumnsmethod\endcsname\relax
\mixedcolumnsparameter\c!after\relax
- \popmacro\currentmixedcolumnsmethod
- \popmacro\currentmixedcolumns
+ \pop_macro_currentmixedcolumnsmethod
+ \pop_macro_currentmixedcolumns
\the\t_page_mix_at_the_end\global\t_page_mix_at_the_end\emptytoks}
\unexpanded\def\page_mix_columns_stop_nop
{\page_mix_finalize_columns
\endgroup
- \popmacro\currentmixedcolumnsmethod
- \popmacro\currentmixedcolumns
+ \pop_macro_currentmixedcolumnsmethod
+ \pop_macro_currentmixedcolumns
\the\t_page_mix_at_the_end\global\t_page_mix_at_the_end\emptytoks}
% \unexpanded\def\page_mix_columns_stop_yes
@@ -509,12 +512,12 @@
% \begincsname\??mixedcolumnsafter\currentmixedcolumnsmethod\endcsname\relax
% \mixedcolumnsparameter\c!after\relax
% \ifx\currentmixedcolumnsmethod\s!otr
-% \popmacro\currentmixedcolumnsmethod
-% \popmacro\currentmixedcolumns
+% \pop_macro_currentmixedcolumnsmethod
+% \pop_macro_currentmixedcolumns
% \synchronizeoutput % brrr, otherwise sometimes issues in itemize
% \else
-% \popmacro\currentmixedcolumnsmethod
-% \popmacro\currentmixedcolumns
+% \pop_macro_currentmixedcolumnsmethod
+% \pop_macro_currentmixedcolumns
% \fi
% }
diff --git a/tex/context/base/mkiv/page-mul.mkiv b/tex/context/base/mkiv/page-mul.mkiv
index 51af24b6a..a855a3d02 100644
--- a/tex/context/base/mkiv/page-mul.mkiv
+++ b/tex/context/base/mkiv/page-mul.mkiv
@@ -471,7 +471,7 @@
\page_mul_postprocess_lines
\page_mul_postprocess_columns
\dohandleallcolumns
- {\global\setbox\currentcolumnbox\hbox to \d_page_mul_used_width
+ {\global\setbox\currentcolumnbox\hpack to \d_page_mul_used_width
{\box\currentcolumnbox}%
\wd\currentcolumnbox\d_page_mul_used_width
\ifheightencolumns
@@ -479,12 +479,12 @@
\fi}%
\page_mul_calculate_column_result_dimensions
\overlaycolumnfootnotes
- \setbox\columnpagebox\vbox
- {\hbox \ifconditional\c_page_mul_reverse dir TRT \fi to \makeupwidth
+ \setbox\columnpagebox\vpack % \vbox
+ {\hpack \ifconditional\c_page_mul_reverse dir TRT \fi to \makeupwidth
{\hskip\ifconditional\c_page_mul_reverse\d_page_mul_rightskip\else\d_page_mul_leftskip\fi\relax
\dohandleallcolumns
{\finishcolumnbox
- {\setbox\scratchbox\hbox
+ {\setbox\scratchbox\hpack
{\ifx\finishcolumnbox\relax\else\strut\fi
\box\currentcolumnbox}% hm, why strut
\anch_mark_column_box\scratchbox
@@ -499,13 +499,13 @@
\fi
\global\setbox\currenttopcolumnbox\emptybox}%
\advance\scratchdimen \ht\columnpagebox
- \setbox\scratchbox\hbox to \makeupwidth
+ \setbox\scratchbox\hbox to \makeupwidth % between can be something so no \hpack
{\vrule
\s!width \zeropoint
\s!height\scratchdimen
\s!depth \dp\columnpagebox
\dostepwiserecurse\plustwo\nofcolumns\plusone{\hfil\page_mul_between_columns}\hfil}%
- \setbox\columnpagebox\hbox
+ \setbox\columnpagebox\hpack
{\box\columnpagebox
\hskip-\makeupwidth
\box\scratchbox}%
@@ -1135,7 +1135,7 @@
% \global\savednoffloats\zerocount
% \global\setfalse\c_page_floats_some_waiting
% \else
-% \global\let\page_floats_column_pop_saved\relax
+% \glet\page_floats_column_pop_saved\relax
% \fi}
%
% \let\page_floats_column_pop_saved\relax
@@ -1249,7 +1249,7 @@
\xdef\insertionheight{\the\dimen0}%
\egroup
\else
- \global\let\insertionheight\zeropoint
+ \glet\insertionheight\zeropoint
\fi}
\def\docolumnroomfloat
@@ -1364,7 +1364,7 @@
\global\setbox\currenttopcolumnbox\vbox
{\snaptogrid\vbox
{\copy\currenttopcolumnbox
- \hbox{\vphantom{\vskip\floatheight}}}% known from previous
+ \hpack{\vphantom{\vskip\floatheight}}}% known from previous
\whitespace % nodig ?
\blank[\rootfloatparameter\c!spaceafter]}%
\else
diff --git a/tex/context/base/mkiv/page-run.mkiv b/tex/context/base/mkiv/page-run.mkiv
index 19adfaa9c..847e82996 100644
--- a/tex/context/base/mkiv/page-run.mkiv
+++ b/tex/context/base/mkiv/page-run.mkiv
@@ -179,13 +179,13 @@
\gridboxlinemode \c_page_grids_line_mode
\gridboxlinenomode\c_page_grids_lineno_mode
\setgridbox\scratchbox\makeupwidth\textheight % todo: check color
- \global\setbox#1\hbox % global ?
+ \global\setbox#1\hpack % global ?
{\ifcase\c_page_grids_location\or\or\box#1\hskip-\makeupwidth\fi
\begingroup % color
\ifcase\layoutcolumns\else
\gray
\setlayoutcomponentattribute{\v!grid:\v!columns}%
- \hbox \layoutcomponentboxattribute to \makeupwidth
+ \hpack \layoutcomponentboxattribute to \makeupwidth
{\dorecurse\layoutcolumns
{\hskip\layoutcolumnwidth
\ifnum\recurselevel<\layoutcolumns
@@ -197,7 +197,7 @@
\hskip-\makeupwidth
\fi
\setlayoutcomponentattribute{\v!grid:\v!lines}%
- \hbox \layoutcomponentboxattribute{\box\scratchbox}%
+ \hpack \layoutcomponentboxattribute{\box\scratchbox}%
\endgroup
\ifcase\c_page_grids_location\or\hskip-\makeupwidth\box#1\fi}%
\stopcolor}
diff --git a/tex/context/base/mkiv/page-sel.mkvi b/tex/context/base/mkiv/page-sel.mkvi
index 335d01187..e11a50f5b 100644
--- a/tex/context/base/mkiv/page-sel.mkvi
+++ b/tex/context/base/mkiv/page-sel.mkvi
@@ -342,7 +342,7 @@
\def\page_selectors_slice_indeed[#filename][#oddsettings][#evensettings]%
{\bgroup
\dontcomplain
- \global\let\slicedpagenumber\!!zerocount
+ \glet\slicedpagenumber\!!zerocount
\getfiguredimensions[#filename]%
\setupcurrentwithpages
[\c!offset=\zeropoint,%
@@ -366,7 +366,7 @@
\c!header=\zeropoint,\c!footer=\zeropoint]%
\fi
\dorecurse\noffigurepages
- {\global\let\slicedpagenumber\recurselevel
+ {\glet\slicedpagenumber\recurselevel
\ifnum\c_page_selectors_n>\plusone
\dorecurse\c_page_selectors_n
{\let\slicedpagestepx\recurselevel
diff --git a/tex/context/base/mkiv/page-set.mkiv b/tex/context/base/mkiv/page-set.mkiv
index 3579e3b48..d5bfe657e 100644
--- a/tex/context/base/mkiv/page-set.mkiv
+++ b/tex/context/base/mkiv/page-set.mkiv
@@ -248,8 +248,8 @@
\!!counta#1\relax
\fi
\fi
- \relax % needed ! ! ! ! else lookahead over \fi and \@EA
- \@EA\egroup\@EA\scratchcounter\the\!!counta\relax}
+ \relax % needed ! ! ! ! else lookahead over \fi and \expandafter
+ \expandafter\egroup\expandafter\scratchcounter\the\!!counta\relax}
\def\OTRSETsetcorrectcellht
{\bgroup
@@ -260,8 +260,8 @@
\restoreglobalbodyfont
\fi
\advance\!!dimena\strutht
- \relax % needed ! ! ! ! else lookahead over \fi and \@EA
- \@EA\egroup\@EA\scratchdimen\the\!!dimena\relax}
+ \relax % needed ! ! ! ! else lookahead over \fi and \expandafter
+ \expandafter\egroup\expandafter\scratchdimen\the\!!dimena\relax}
\def\doOTRSETsetgridcells#1#2#3#4#5#6% placeholder col row wid hei {data}
{\!!countd#2\advance\!!countd#4\advance\!!countd\minusone
@@ -642,7 +642,7 @@
{\page_set_command_set_vsize}
\def\doOTRSETcolumnseparator
- {\hbox to \zeropoint{\hss\red\vl\hss}}
+ {\hpack to \zeropoint{\hss\red\vl\hss}}
\let\OTRSETcolumnseparator\relax
@@ -754,7 +754,7 @@
\fi}%
\ifdim\lastskipinotr>\zeropoint
\scratchskip\ht\scratchbox
- \setbox\scratchbox\hbox
+ \setbox\scratchbox\hpack
{\lower\strutdepth\box\scratchbox}%
\dp\scratchbox\scratchdimen
\ht\scratchbox\scratchskip
@@ -942,7 +942,7 @@
\fi
\ifenoughcolumncells
\OTRSETsetgridcells\mofcolumns\columnfirstcell\columnhcells\columnvcells
- {\hbox{\copy#1}}%
+ {\hpack{\copy#1}}%
\page_set_command_set_vsize
\else
\OTRSETsavebox{#1}%
@@ -1155,7 +1155,7 @@
%OTRSETprepareforcolumnslot3{#1}%
%ruledvskip\columnslotspacing\lineheight
\blank[\number\columnslotspacing*\v!line]%
- \snaptogrid\hbox to \hsize{\hss\box#1\hss}% strange, why the centering
+ \snaptogrid\hpack to \hsize{\hss\box#1\hss}% strange, why the centering
\blank[\number\columnslotspacing*\v!line]%
\else
\OTRSETstoreincolumnslotSOMEWHERE2{#1}%
@@ -1336,7 +1336,7 @@
% a quick hack ... will be redone
%
\ifdim\wd\floatbox<\floatwidth \ifhbox\floatbox
- \global\setbox\floatbox\hbox{\unhbox\floatbox}%
+ \global\setbox\floatbox\hpack{\unhbox\floatbox}%
\fi \fi
%
\dp\floatbox\zeropoint
@@ -1417,7 +1417,7 @@
{\advance\totalcolumnspace \OTRSETlocalwidth\recurselevel
\advance\totalcolumnspace \namedcolumnsetparameter{\currentcolumnset:\recurselevel}\c!distance}%
\ifdim\totalcolumnspace>\wd\scratchbox
- \setbox\scratchbox\hbox to \totalcolumnspace{\hss\box\scratchbox\hss}%
+ \setbox\scratchbox\hpack to \totalcolumnspace{\hss\box\scratchbox\hss}%
\fi
\page_set_cell_set\currenthcell\currentvcell\box\scratchbox
\egroup
@@ -1619,7 +1619,7 @@
\def\dostartcolumnset[#1][#2]%
{\increment\columnsetlevel\relax
- \global\let\localcolumnmaxcells\!!zerocount
+ \glet\localcolumnmaxcells\!!zerocount
\global\setfalse\OTRSETfinish
\ifnum\columnsetlevel=\plusone
\bgroup
@@ -1678,7 +1678,7 @@
\ifvoid\OTRfinalpagebox\else
% probably balanced
\ifdim\ht\OTRfinalpagebox<\textheight
- \snaptogrid[\v!page]\hbox{\box\OTRfinalpagebox}%
+ \snaptogrid[\v!page]\hpack{\box\OTRfinalpagebox}%
\else
\box\OTRfinalpagebox
\fi
@@ -1765,7 +1765,7 @@
\def\OTRSETstartnextpage
{\doifsomething\OTRSETlist
{\getfromcommacommand[\OTRSETlist][1]%
- \global\let\OTRSETidentifier\commalistelement
+ \glet\OTRSETidentifier\commalistelement
\xdef\currentcolumnset{\commalistelement}%
\checkcolumnsetparent
\let\newcommalistelement\empty
@@ -1848,7 +1848,7 @@
{\unvbox\normalpagebox
\global\lastskipinotr\lastskip}%
\ifdim\lastskipinotr>\zeropoint
- \global\setbox\b_page_set_preceding\hbox
+ \global\setbox\b_page_set_preceding\hpack
{\lower\strutdepth\box\b_page_set_preceding}%
\fi
\dp\b_page_set_preceding\strutdepth
@@ -1970,7 +1970,7 @@
\def\columnplaceholder#1#2%
{\hbox
- {\setbox\scratchbox\hbox to \hsize
+ {\setbox\scratchbox\hpack to \hsize
{\iftracecolumnset
\hskip-.5ex%
\startcolor[columnset:#2]\vrule\s!width\exheight\s!height.5\exheight\s!depth.5\exheight\stopcolor
@@ -2032,7 +2032,7 @@
\def\page_set_place_float_slot
{\setbox\floatbox\vbox{\page_otr_command_flush_float_box}%
\dp\floatbox\strutdp
- \@EA\uppercasestring\floatmethod\to\floatmethod
+ \expandafter\uppercasestring\floatmethod\to\floatmethod
\OTRSETstoreincolumnslot\floatmethod\floatbox
\page_floats_report_total}
@@ -2337,11 +2337,11 @@
\advance\!!countb \minusone
% new (*)
\doif{\columntextareaparameter\c!location}\v!depth
- {\setbox\scratchbox\hbox{\lower\strutdepth\box\scratchbox}%
+ {\setbox\scratchbox\hpack{\lower\strutdepth\box\scratchbox}%
\dp\scratchbox\zeropoint
\ht\scratchbox\!!heighta}%
%
- \setbox0\hbox
+ \setbox0\hpack
{\ifcase\!!countc
\copy\scratchbox % \box
\else
@@ -2360,7 +2360,7 @@
\advance\!!counta \columntextareaparameter\c!nx
\advance\!!counta -\!!countc
\advance\!!widtha -\!!widthb
- \setbox0\hbox
+ \setbox0\hpack
% {\hskip-\namedlayoutparameter\v!odd\c!backspace
{\hskip-\layoutparameter\c!backspace
\clip
@@ -2560,7 +2560,7 @@
% todo: nboven/onder
%\OTRSETstoreincolumnslotHERE\scratchbox
\edef\floatmethod{\namedframedtextparameter{\??columnsetspan#1}\c!default}%
- \@EA\uppercasestring\floatmethod\to\floatmethod
+ \expandafter\uppercasestring\floatmethod\to\floatmethod
% todo : \v!here -> here enzovoorts
\OTRSETstoreincolumnslot\floatmethod\scratchbox
\checknextindentation[\namedframedtextparameter{\??columnsetspan#1}\c!indentnext]%
diff --git a/tex/context/base/mkiv/page-sid.mkiv b/tex/context/base/mkiv/page-sid.mkiv
index 6f5d9f357..32dc94f6a 100644
--- a/tex/context/base/mkiv/page-sid.mkiv
+++ b/tex/context/base/mkiv/page-sid.mkiv
@@ -557,14 +557,14 @@
\def\page_sides_check_floats_after_par
{\page_sides_check_floats_indeed
\ifdim\d_page_sides_pagetotal=\pagetotal \else
- \global\let\page_sides_check_floats\page_sides_check_floats_indeed
+ \glet\page_sides_check_floats\page_sides_check_floats_indeed
\page_sides_flush_floats
\global\c_page_sides_n_of_lines\zerocount % here !
\fi}
\unexpanded\def\page_sides_flush_floats_after_par
{\global\d_page_sides_pagetotal\pagetotal
- \global\let\page_sides_check_floats\page_sides_check_floats_after_par}
+ \glet\page_sides_check_floats\page_sides_check_floats_after_par}
\unexpanded\def\page_sides_forget_floats
{\global\d_page_sides_vsize\d_page_sides_vsize_reset
diff --git a/tex/context/base/mkiv/page-str.mkiv b/tex/context/base/mkiv/page-str.mkiv
index 57a465603..354c1f3c3 100644
--- a/tex/context/base/mkiv/page-str.mkiv
+++ b/tex/context/base/mkiv/page-str.mkiv
@@ -56,7 +56,7 @@
\unexpanded\def\disableoutputstream
{\inoutputstreamfalse
- \global\let\currentoutputstream\s!default
+ \glet\currentoutputstream\s!default
\clf_disablestream}
\unexpanded\def\startoutputstream[#1]%
diff --git a/tex/context/base/mkiv/page-txt.mkvi b/tex/context/base/mkiv/page-txt.mkvi
index b043b60c7..2640633ec 100644
--- a/tex/context/base/mkiv/page-txt.mkvi
+++ b/tex/context/base/mkiv/page-txt.mkvi
@@ -98,8 +98,8 @@
{\expandafter\normalgdef\csname\??layouttextsreset#vertical\endcsname{\page_layouts_set_element_status_normal#vertical}}
\def\page_layouts_set_element_status_normal#vertical%
- {\global\expandafter\let\csname\namedlayoutelementhash#vertical\c!state\endcsname\v!normal
- \global\expandafter\let\csname\??layouttextsreset#vertical\endcsname\relax
+ {\expandafter\glet\csname\namedlayoutelementhash#vertical\c!state\endcsname\v!normal
+ \expandafter\glet\csname\??layouttextsreset#vertical\endcsname\relax
\page_layouts_synchronize_element{#vertical}}
\def\page_layouts_synchronize_element#vertical%
@@ -863,7 +863,8 @@
\vskip\dimexpr\headerheight+\headerdistance+\textdistance\relax
\dontleavehmode
%\page_prepare_backgrounds{#2}%
- \hbox to \makeupwidth
+% \hbox to \makeupwidth
+ \hpack to \makeupwidth
{\begingroup
\swapmargins
\goleftonpage
diff --git a/tex/context/base/mkiv/publ-ini.mkiv b/tex/context/base/mkiv/publ-ini.mkiv
index 9f970547d..587341355 100644
--- a/tex/context/base/mkiv/publ-ini.mkiv
+++ b/tex/context/base/mkiv/publ-ini.mkiv
@@ -107,23 +107,27 @@
%D to split between cite and list here as it only complicates matters (timing) and is
%D not clear either.
-\let\currentbtxspecification\empty
+\let\currentbtxspecification \empty
+\let\currentbtxspecificationfallback\empty
+
+\installmacrostack\currentbtxspecification
+\installmacrostack\currentbtxspecificationfallback
\unexpanded\def\startbtxrenderingdefinitions[#1]%
{\unprotect
- \pushmacro\currentbtxspecification
+ \push_macro_currentbtxspecification
\edef\currentbtxspecification{#1}}
\unexpanded\def\stopbtxrenderingdefinitions
- {\popmacro\currentbtxspecification
+ {\pop_macro_currentbtxspecification
\protect}
\unexpanded\def\loadbtxdefinitionfile [#1]{\clf_btxloaddefinitionfile {#1}}
\unexpanded\def\loadbtxreplacementfile[#1]{\clf_btxloadreplacementfile{#1}}
\unexpanded\def\publ_specification_push#1%
- {\pushmacro\currentbtxspecification
- \pushmacro\currentbtxspecificationfallback
+ {\push_macro_currentbtxspecification
+ \push_macro_currentbtxspecificationfallback
\edef\currentbtxspecification{#1}%
\edef\currentbtxspecificationfallback{\namedbtxparameter\currentbtxspecification\c!default}%
\ifx\currentbtxspecificationfallback\currentbtxspecification
@@ -132,8 +136,8 @@
\clf_btxsetspecification{\currentbtxspecification}}
\unexpanded\def\publ_specification_pop
- {\popmacro\currentbtxspecificationfallback
- \popmacro\currentbtxspecification
+ {\pop_macro_currentbtxspecificationfallback
+ \pop_macro_currentbtxspecification
\clf_btxsetspecification{\currentbtxspecification}}
\unexpanded\def\publ_specification_set#1% beware: is global
@@ -223,9 +227,6 @@
\installcommandhandler \??btxregister {btxregister} \??btxregister
\installcommandhandler \??btxrendering {btxrendering} \??btxrendering
-\let\currentbtxcitealternative \empty
-\let\currentbtxspecificationfallback\empty
-
\unexpanded\def\setbtxparameterset#1#2%
{\edef\currentbtx
{\ifcsname\??btx\currentbtxspecification:#1:#2:\s!parent\endcsname
@@ -341,10 +342,10 @@
\def\publ_command_nop#1%
{\ifcsname#1\endcsname
\showmessage\m!publications{10}{#1,#1}%
- \global\expandafter\let\csname\??btxcommand#1\expandafter\endcsname\csname#1\endcsname
+ \expandafter\glet\csname\??btxcommand#1\expandafter\endcsname\csname#1\endcsname
\else\ifcsname\utfupper{#1}\endcsname
\showmessage\m!publications{10}{#1}{\utfupper{#1}}%
- \global\expandafter\let\csname\??btxcommand#1\expandafter\endcsname\csname\utfupper{#1}\endcsname
+ \expandafter\glet\csname\??btxcommand#1\expandafter\endcsname\csname\utfupper{#1}\endcsname
\else
\showmessage\m!publications{11}{#1}%
\setugvalue{\??btxcommand#1}{\underbar{\tttf#1}}%
@@ -1113,7 +1114,8 @@
\let\btxcitereference\btx_cite_reference_inject
-\let\currentbtxnumbering\empty
+\let\currentbtxnumbering \empty
+\let\currentbtxcitealternative \empty
\appendtoks
\edef\currentbtxnumbering{\btxrenderingparameter\c!numbering}%
@@ -1185,7 +1187,7 @@
\unexpanded\def\btxflushauthorinverted {\btx_flush_author{inverted}} % #1
\unexpanded\def\btxflushauthorinvertedshort{\btx_flush_author{invertedshort}} % #1
-\let\currentbtxauthorfield\s!author
+\let\currentbtxauthorfield \s!author
\unexpanded\def\btxsetauthorfield#1{\edef\currentbtxauthorfield{#1}}
diff --git a/tex/context/base/mkiv/scrn-pag.mkvi b/tex/context/base/mkiv/scrn-pag.mkvi
index 7695443ad..a3b0a78c6 100644
--- a/tex/context/base/mkiv/scrn-pag.mkvi
+++ b/tex/context/base/mkiv/scrn-pag.mkvi
@@ -188,13 +188,13 @@
\let\scrn_canvas_synchronize_complex\relax
\appendtoks
- \global\let\scrn_canvas_synchronize_simple \scrn_canvas_synchronize_simple_indeed
- \global\let\scrn_canvas_synchronize_complex\scrn_canvas_synchronize_complex_indeed
+ \glet\scrn_canvas_synchronize_simple \scrn_canvas_synchronize_simple_indeed
+ \glet\scrn_canvas_synchronize_complex\scrn_canvas_synchronize_complex_indeed
\to \everysetuplayout
\appendtoks
- \global\let\scrn_canvas_synchronize_simple \scrn_canvas_synchronize_simple_indeed
- \global\let\scrn_canvas_synchronize_complex\scrn_canvas_synchronize_complex_indeed
+ \glet\scrn_canvas_synchronize_simple \scrn_canvas_synchronize_simple_indeed
+ \glet\scrn_canvas_synchronize_complex\scrn_canvas_synchronize_complex_indeed
\to \everysetuplayouttarget
\def\scrn_canvas_synchronize_only
@@ -213,8 +213,8 @@
\def\scrn_canvas_synchronize_simple_indeed
{\scrn_canvas_synchronize_only
- %\global\let\scrn_canvas_synchronize_simple \relax
- \global\let\scrn_canvas_synchronize_complex\relax}
+ %\glet\scrn_canvas_synchronize_simple \relax
+ \glet\scrn_canvas_synchronize_complex\relax}
\def\scrn_canvas_synchronize_complex_indeed
{\scrn_canvas_calculate % otherwise we need to hook it into setuppage etc
@@ -235,8 +235,8 @@
copies \numexpr\interactionscreenparameter\c!copies\relax
print {\interactionscreenparameter\c!print}%
\relax
- %\global\let\scrn_canvas_synchronize_simple \relax
- \global\let\scrn_canvas_synchronize_complex\relax}
+ %\glet\scrn_canvas_synchronize_simple \relax
+ \glet\scrn_canvas_synchronize_complex\relax}
\appendtoks
\begingroup
@@ -262,8 +262,8 @@
\c!option=\v!auto]
\appendtoks
- \global\let\scrn_canvas_synchronize_simple \scrn_canvas_synchronize_simple_indeed
- \global\let\scrn_canvas_synchronize_complex\scrn_canvas_synchronize_complex_indeed
+ \glet\scrn_canvas_synchronize_simple \scrn_canvas_synchronize_simple_indeed
+ \glet\scrn_canvas_synchronize_complex\scrn_canvas_synchronize_complex_indeed
\to \everysetupinteractionscreen
%D Conditional page breaks:
diff --git a/tex/context/base/mkiv/spac-ali.mkiv b/tex/context/base/mkiv/spac-ali.mkiv
index fbcf45caa..ac24cb43c 100644
--- a/tex/context/base/mkiv/spac-ali.mkiv
+++ b/tex/context/base/mkiv/spac-ali.mkiv
@@ -247,12 +247,12 @@
inline:\ifconditional \inlinelefttoright l2r\else r2l\fi\space
]\endgroup}
-\unexpanded\def\righttolefthbox#1#{\normalhbox dir TRT #1\bgroup\righttoleft\let\next} \let\rtlhbox\righttolefthbox
-\unexpanded\def\lefttorighthbox#1#{\normalhbox dir TLT #1\bgroup\lefttoright\let\next} \let\ltrhbox\lefttorighthbox
-\unexpanded\def\righttoleftvbox#1#{\normalvbox dir TRT #1\bgroup\righttoleft\let\next} \let\rtlvbox\righttoleftvbox
-\unexpanded\def\lefttorightvbox#1#{\normalvbox dir TLT #1\bgroup\lefttoright\let\next} \let\ltrvbox\lefttorightvbox
-\unexpanded\def\righttoleftvtop#1#{\normalvtop dir TRT #1\bgroup\righttoleft\let\next} \let\rtlvtop\righttoleftvtop
-\unexpanded\def\lefttorightvtop#1#{\normalvtop dir TLT #1\bgroup\lefttoright\let\next} \let\ltrvtop\lefttorightvtop
+\unexpanded\def\righttolefthbox#1#{\hbox dir TRT #1\bgroup\righttoleft\let\next} \let\rtlhbox\righttolefthbox
+\unexpanded\def\lefttorighthbox#1#{\hbox dir TLT #1\bgroup\lefttoright\let\next} \let\ltrhbox\lefttorighthbox
+\unexpanded\def\righttoleftvbox#1#{\vbox dir TRT #1\bgroup\righttoleft\let\next} \let\rtlvbox\righttoleftvbox
+\unexpanded\def\lefttorightvbox#1#{\vbox dir TLT #1\bgroup\lefttoright\let\next} \let\ltrvbox\lefttorightvbox
+\unexpanded\def\righttoleftvtop#1#{\vtop dir TRT #1\bgroup\righttoleft\let\next} \let\rtlvtop\righttoleftvtop
+\unexpanded\def\lefttorightvtop#1#{\vtop dir TLT #1\bgroup\lefttoright\let\next} \let\ltrvtop\lefttorightvtop
\unexpanded\def\autodirhbox#1#{\hbox#1\bgroup\synchronizeinlinedirection\let\next}
\unexpanded\def\autodirvbox#1#{\vbox#1\bgroup\synchronizeinlinedirection\let\next} % maybe also pardir or maybe just a \vbox
@@ -643,8 +643,8 @@
}}% kept, nice for tracing
\edef\raggedcommand {\the\t_spac_align_collected }%
\edef\updateraggedskips{\spac_align_flush_horizontal}%
- \global\expandafter\let\csname\??alignmentnormalcache\m_spac_align_asked\endcsname\raggedcommand
- \global\expandafter\let\csname\??alignmentraggedcache\m_spac_align_asked\endcsname\updateraggedskips}
+ \expandafter\glet\csname\??alignmentnormalcache\m_spac_align_asked\endcsname\raggedcommand
+ \expandafter\glet\csname\??alignmentraggedcache\m_spac_align_asked\endcsname\updateraggedskips}
\def\spac_align_collect#1%
{\csname\??aligncommand#1\endcsname}
diff --git a/tex/context/base/mkiv/spac-grd.mkiv b/tex/context/base/mkiv/spac-grd.mkiv
index 73c6e0dd1..72d017836 100644
--- a/tex/context/base/mkiv/spac-grd.mkiv
+++ b/tex/context/base/mkiv/spac-grd.mkiv
@@ -108,8 +108,8 @@
\newbox \b_spac_lines_correction_after
\def\spac_lines_initialize_corrections
- {\setbox\b_spac_lines_correction_before\hbox{\setstrut\strut}%
- \setbox\b_spac_lines_correction_after \hbox{(}%
+ {\setbox\b_spac_lines_correction_before\hpack{\setstrut\strut}%
+ \setbox\b_spac_lines_correction_after \hbox {(}%
\d_spac_lines_correction_before\dimexpr\ht\b_spac_lines_correction_before-\ht\b_spac_lines_correction_after\relax
\d_spac_lines_correction_after \dimexpr\dp\b_spac_lines_correction_before-\dp\b_spac_lines_correction_after\relax
\ifdim\d_spac_lines_correction_before<\zeropoint\d_spac_lines_correction_before\zeropoint\fi
diff --git a/tex/context/base/mkiv/spac-hor.mkiv b/tex/context/base/mkiv/spac-hor.mkiv
index ce747a202..3e4c28157 100644
--- a/tex/context/base/mkiv/spac-hor.mkiv
+++ b/tex/context/base/mkiv/spac-hor.mkiv
@@ -205,6 +205,9 @@
\let\checkindentation\relax
+\installmacrostack\checkindentation
+\installmacrostack\ifindentation
+
\def\spac_indentation_remove
{\ifdim\parindent=\zeropoint \else
\begingroup
@@ -218,21 +221,21 @@
\def\spac_indentation_do_toggle_indeed
{\global\indentationfalse
- \global\let\checkindentation\spac_indentation_no_toggle_indeed
+ \glet\checkindentation\spac_indentation_no_toggle_indeed
\spac_indentation_remove}
\def\spac_indentation_no_toggle_indeed
{\global\indentationtrue
- \global\let\checkindentation\spac_indentation_do_toggle_indeed}
+ \glet\checkindentation\spac_indentation_do_toggle_indeed}
\def\spac_indentation_do_indeed
{\global\indentationtrue}
\def\spac_indentation_do_toggle
- {\global\let\checkindentation\spac_indentation_do_toggle_indeed}
+ {\glet\checkindentation\spac_indentation_do_toggle_indeed}
\def\spac_indentation_no_toggle
- {\global\let\checkindentation\spac_indentation_no_toggle_indeed}
+ {\glet\checkindentation\spac_indentation_no_toggle_indeed}
\def\spac_indentation_check_toggle
{\ifcase\c_spac_indentation_toggle_state
@@ -244,22 +247,22 @@
\fi}
\def\spac_indentation_variant_yes
- {\global\let\checkindentation\spac_indentation_do_indeed}
+ {\glet\checkindentation\spac_indentation_do_indeed}
\def\spac_indentation_no_next_check
{\spac_indentation_remove
- \global\let\checkindentation\spac_indentation_do_indeed}
+ \glet\checkindentation\spac_indentation_do_indeed}
\def\spac_indentation_variant_no % made global
{\ifinpagebody \else
\global\indentationfalse
- \global\let\checkindentation\spac_indentation_no_next_check
+ \glet\checkindentation\spac_indentation_no_next_check
\fi}
\def\nonoindentation % bv bij floats
{\ifinpagebody \else
\global\indentationtrue
- \global\let\checkindentation\spac_indentation_do_indeed
+ \glet\checkindentation\spac_indentation_do_indeed
\fi}
\def\spac_indentation_variant_force
@@ -271,13 +274,13 @@
\fi \fi}
\appendtoks
- \pushmacro\checkindentation
- \pushmacro\ifindentation
+ \push_macro_checkindentation
+ \push_macro_ifindentation
\to \everypushsomestate
\appendtoks
- \popmacro\ifindentation
- \popmacro\checkindentation
+ \pop_macro_ifindentation
+ \pop_macro_checkindentation
\to \everypopsomestate
% public:
@@ -287,16 +290,16 @@
\let\doindentation\spac_indentation_variant_yes % public
\def\dontrechecknextindentation % public (in macros)
- {\global\let\dorechecknextindentation\relax}
+ {\glet\dorechecknextindentation\relax}
\let\dorechecknextindentation\relax % public (in macros)
\unexpanded\def\spac_indentation_check_next_indentation
- {\global\let\dorechecknextindentation\relax
+ {\glet\dorechecknextindentation\relax
\doifelsenextchar\par\donothing\spac_indentation_variant_no} % messy check as next is seldom \par
\def\spac_indentation_variant_auto
- {\global\let\dorechecknextindentation\spac_indentation_check_next_indentation}
+ {\glet\dorechecknextindentation\spac_indentation_check_next_indentation}
%D This one sets up the local indentation behaviour (i.e. either or not
%D a next paragraph will be indented).
@@ -604,6 +607,9 @@
\fi
+\unexpanded\def\negenspace{\kern-.5\emwidth}
+\unexpanded\def\negemspace{\kern- \emwidth}
+
\let\emspace\quad
\unexpanded\def\charspace{ } % the unexpandable \space (as space can also be delimiter for numbers)
diff --git a/tex/context/base/mkiv/spac-lin.mkiv b/tex/context/base/mkiv/spac-lin.mkiv
index 6558cb111..d862f6d81 100644
--- a/tex/context/base/mkiv/spac-lin.mkiv
+++ b/tex/context/base/mkiv/spac-lin.mkiv
@@ -86,7 +86,7 @@
\let\spac_lines_break\relax
\fi
\linesparameter\c!before
- \pushmacro\checkindentation
+ \push_macro_checkindentation
\whitespace
\dostarttaggedchained\t!lines\currentlines\??lines
\begingroup
@@ -126,7 +126,7 @@
{\dostoptagged
\endgroup
\dostoptagged
- \popmacro\checkindentation
+ \pop_macro_checkindentation
\linesparameter\c!after
\egroup}
diff --git a/tex/context/base/mkiv/spac-ver.mkiv b/tex/context/base/mkiv/spac-ver.mkiv
index b71e28219..70f79bdad 100644
--- a/tex/context/base/mkiv/spac-ver.mkiv
+++ b/tex/context/base/mkiv/spac-ver.mkiv
@@ -165,6 +165,8 @@
\installcommandhandler \??interlinespace {interlinespace} \??interlinespace
+\installmacrostack\currentinterlinespace
+
\unexpanded\def\setupinterlinespace
{\dodoubleempty\spac_linespacing_setup}
@@ -205,7 +207,7 @@
\ifx\p_spac_checked_interlinespace\empty
\spac_linespacing_synchronize_local
\else\ifcsname\namedinterlinespacehash\p_spac_checked_interlinespace\s!parent\endcsname % we could have a \s!check
- \pushmacro\currentinterlinespace
+ \push_macro_currentinterlinespace
\let\currentinterlinespace\p_spac_checked_interlinespace
\spac_linespacing_setup_specified_interline_space % \dosetupspecifiedinterlinespaceindeed
\iflocalinterlinespace
@@ -215,7 +217,7 @@
\the\everysetuplocalinterlinespace
\localinterlinespacefalse
\fi
- \popmacro\currentinterlinespace
+ \pop_macro_currentinterlinespace
\else
\normalexpanded{\noexpand\doifelseassignment{\p_spac_checked_interlinespace}%
\setupspecifiedinterlinespace\setuprelativeinterlinespace[\p_spac_checked_interlinespace]}%
@@ -230,9 +232,9 @@
\unexpanded\def\setuplocalinterlinespace[#1]%
{\localinterlinespacetrue
- \pushmacro\currentinterlinespace
+ \push_macro_currentinterlinespace
\setupinterlinespace[#1]%
- \popmacro\currentinterlinespace
+ \pop_macro_currentinterlinespace
\localinterlinespacefalse}
\let\switchtointerlinespace\setuplocalinterlinespace
@@ -1361,7 +1363,7 @@
\let\restoreinterlinepenalty\relax
\unexpanded\def\spac_penalties_restore
- {\global\let\restoreinterlinepenalty\relax
+ {\glet\restoreinterlinepenalty\relax
\global\resetpenalties\interlinepenalties
\global\c_spac_keep_lines_together\zerocount}
@@ -1369,7 +1371,7 @@
{\ifnum#1>\c_spac_keep_lines_together
\global\c_spac_keep_lines_together#1%
\global\setpenalties\interlinepenalties\c_spac_keep_lines_together\plustenthousand
- \global\let\restoreinterlinepenalty\spac_penalties_restore
+ \glet\restoreinterlinepenalty\spac_penalties_restore
\fi}
\def\defaultdisplaywidowpenalty {50}
@@ -1701,7 +1703,7 @@
\fi
\doifelsenothing{#1}{\spac_grids_snap_value_set\v!normal}{\spac_grids_snap_value_set{#1}}%
\clf_vspacingsnap\nextbox\attribute\snapmethodattribute\relax
- \ifvbox\nextbox\vbox\else\hbox\fi attr \snapmethodattribute \zerocount {\box\nextbox}% *pack ?
+ \ifvbox\nextbox\vbox\else\hbox\fi attr \snapmethodattribute \zerocount {\box\nextbox}% no pack (?), we snap
\egroup}
\def\spac_grids_check_nop
@@ -1816,15 +1818,15 @@
\unexpanded\def\gridboxvbox
{\ifcase\gridboxlinemode
- \vbox
+ \vpack
\or
- \ruledvbox
+ \ruledvpack
\or
- \vbox
+ \vpack
\or
- \ruledvbox
+ \ruledvpack
\else
- \ruledvbox
+ \ruledvpack
\fi}
\def\gridboxwidth{\ifcase\gridboxlinemode0\or.5\or.5\or0\else.5\fi\linewidth}
diff --git a/tex/context/base/mkiv/status-files.log b/tex/context/base/mkiv/status-files.log
deleted file mode 100644
index 076bf6bb6..000000000
--- a/tex/context/base/mkiv/status-files.log
+++ /dev/null
@@ -1,38 +0,0 @@
-open source > level 1, order 1, name 'cont-yes.mkiv'
-system >
-system > ConTeXt ver: 2018.05.19 21:46 MKIV beta fmt: 2018.5.19 int: english/english
-system >
-system > 'cont-new.mkiv' loaded
-open source > level 2, order 2, name 'cont-new.mkiv'
-system > beware: some patches loaded from cont-new.mkiv
-close source > level 2, order 2, name 'cont-new.mkiv'
-system > 'cont-loc.mkiv' loaded
-open source > level 2, order 3, name 'c:/data/develop/context/sources/cont-loc.mkiv'
-system > beware: enabling timing (for testing)
-system > beware: enabling subpages
-system > beware: wiping package.path
-system > beware: testing mixed columns replacement
-system > beware: testing new columnset code
-open source > level 3, order 4, name 'page-cst.mkiv'
-loading > ConTeXt Page Macros / Page Grids
-resolvers > lua > loading file 'page-cst.lua' succeeded
-close source > level 3, order 4, name 'page-cst.mkiv'
-close source > level 2, order 4, name 'c:/data/develop/context/sources/cont-loc.mkiv'
-system > 'cont-exp.mkiv' loaded
-interface > macros > processed mkvi file 'c:/data/develop/context/sources/cont-exp.mkiv', delta 40
-interface > macros > processed mkvi file 'c:/data/develop/context/sources/cont-exp.mkiv', delta 0
-open source > level 2, order 5, name 'c:/data/develop/context/sources/cont-exp.mkiv'
-system > beware: math flattening patches loaded from cont-exp.mkiv
-system > beware: toks appending patches loaded from cont-exp.mkiv
-system > beware: direction patches loaded from cont-exp.mkiv
-close source > level 2, order 5, name 'c:/data/develop/context/sources/cont-exp.mkiv'
-system > files > jobname 's-inf-01', input 'c:/data/develop/tex-context/tex/texmf-context/tex/context/modules/mkiv/s-inf-01.mkvi', result 'status-files.pdf'
-fonts > latin modern fonts are not preloaded
-languages > language 'en' is active
-interface > macros > processed mkvi file 'c:/data/develop/tex-context/tex/texmf-context/tex/context/modules/mkiv/s-inf-01.mkvi', delta 138
-interface > macros > processed mkvi file 'c:/data/develop/tex-context/tex/texmf-context/tex/context/modules/mkiv/s-inf-01.mkvi', delta 0
-open source > level 2, order 6, name 'c:/data/develop/tex-context/tex/texmf-context/tex/context/modules/mkiv/s-inf-01.mkvi'
-fonts > preloading latin modern fonts (second stage)
-fonts > 'fallback modern-designsize rm 12pt' is loaded
-backend > xmp > using file 'lpdf-pdx.xml'
-! error: (nodes): attempt to free an impossible node 56385222 \ No newline at end of file
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
new file mode 100644
index 000000000..f177ab844
--- /dev/null
+++ 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 a11b5c957..102f1ce2d 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/mkiv/strc-con.mkvi b/tex/context/base/mkiv/strc-con.mkvi
index 57b69cc7f..a5360f52a 100644
--- a/tex/context/base/mkiv/strc-con.mkvi
+++ b/tex/context/base/mkiv/strc-con.mkvi
@@ -980,11 +980,11 @@
\xdef\currentconstructionincrementnumber{\constructionparameter\c!incrementnumber}%
%
\ifx\currentconstructionexpansion\empty
- \global\let\currentconstructionexpansion\v!no
+ \glet\currentconstructionexpansion\v!no
\fi
%
\ifx\currentconstructionreferenceprefix\empty
- \global\let\currentconstructionreferenceprefix\referenceprefix
+ \glet\currentconstructionreferenceprefix\referenceprefix
\fi
\ifx\currentconstructionexpansion\s!xml
\xmlstartraw
@@ -994,9 +994,9 @@
\xdef\currentconstructionlist {\constructionparameter\c!list}%
\xmlstopraw
\ifx\currentconstructionlist\empty
- \global\let\currentconstructionlist\currentconstructiontitle
+ \glet\currentconstructionlist\currentconstructiontitle
\fi
- \global\let\currentconstructioncoding\s!xml
+ \glet\currentconstructioncoding\s!xml
\else
\ifx\currentconstructionexpansion\v!yes
\xdef\currentconstructiontitle {\constructionparameter\c!title}%
diff --git a/tex/context/base/mkiv/strc-flt.mkvi b/tex/context/base/mkiv/strc-flt.mkvi
index 1107cb494..f3fb1182c 100644
--- a/tex/context/base/mkiv/strc-flt.mkvi
+++ b/tex/context/base/mkiv/strc-flt.mkvi
@@ -482,7 +482,7 @@
\donothing
{\writestatus\m!floatblocks{unknown float type '\currentfloat'}%
\let\currentfloat\v!figure}% also a hack
- \global\let\lastplacedfloat\currentfloat
+ \glet\lastplacedfloat\currentfloat
\let\m_strc_floats_saved_userdata\empty
\let\currentfloatcaption\currentfloat}
@@ -493,8 +493,8 @@
{\global\emptyfloatcaptionfalse
\global\nofloatcaptionfalse
\global\nofloatnumberfalse
- \global\let\askedfloatmethod \empty
- \global\let\askedfloatoptions\empty}
+ \glet\askedfloatmethod \empty
+ \glet\askedfloatoptions\empty}
% place
diff --git a/tex/context/base/mkiv/strc-itm.mkvi b/tex/context/base/mkiv/strc-itm.mkvi
index 0bea62de8..0fc204320 100644
--- a/tex/context/base/mkiv/strc-itm.mkvi
+++ b/tex/context/base/mkiv/strc-itm.mkvi
@@ -352,8 +352,8 @@
\csname\??itemgroupsetting\currentitemgroup\endcsname}
\def\strc_itemgroups_reset_continue_state
- {\global\expandafter\let\csname\??itemgroupoption \currentitemgroup\endcsname\relax
- \global\expandafter\let\csname\??itemgroupsetting\currentitemgroup\endcsname\relax}
+ {\expandafter\glet\csname\??itemgroupoption \currentitemgroup\endcsname\relax
+ \expandafter\glet\csname\??itemgroupsetting\currentitemgroup\endcsname\relax}
% These will become keywords. We will also add a feature to keep the while set
% together.
diff --git a/tex/context/base/mkiv/strc-lnt.mkvi b/tex/context/base/mkiv/strc-lnt.mkvi
index cd10c9def..4a6f14245 100644
--- a/tex/context/base/mkiv/strc-lnt.mkvi
+++ b/tex/context/base/mkiv/strc-lnt.mkvi
@@ -242,13 +242,13 @@
\def\strc_linenotes_traced_indeed#1%
{\iftracelinenotes
- \hbox to \zeropoint
+ \hpack to \zeropoint
{\forgetall
\hsize\zeropoint
\hss
- \vbox to \strutheight{\llap{\red\infofont\setstrut\the\c_strc_linenotes}\vss}%
+ \vpack to \strutheight{\llap{\red\infofont\setstrut\the\c_strc_linenotes}\vss}%
{\color[blue]{\vl}}%
- \vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
+ \vpack to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
\hss}%
\prewordbreak
\fi}
diff --git a/tex/context/base/mkiv/strc-lst.mkvi b/tex/context/base/mkiv/strc-lst.mkvi
index 153d879b7..c450e1884 100644
--- a/tex/context/base/mkiv/strc-lst.mkvi
+++ b/tex/context/base/mkiv/strc-lst.mkvi
@@ -177,7 +177,7 @@
view {\interactionparameter\c!focus}%
\relax % this will change
\xdef\currentstructurelistattribute{\the\lastdestinationattribute}%
- \dontleavehmode\hbox attr \destinationattribute \lastdestinationattribute{}% todo
+ \dontleavehmode\hpack attr \destinationattribute \lastdestinationattribute{}% todo
\else
% and this one doesn't
\clf_enhancelist\currentlistnumber\relax
@@ -1091,7 +1091,7 @@
\fi
\ifconditional\c_lists_has_page
\ifconditional\c_lists_show_page
- \setbox\b_strc_lists_page\hbox {
+ \setbox\b_strc_lists_page\hpack {
\scratchdimen\listalternativeparameter\c!width
\hbox \strc_lists_get_reference_attribute\v!pagenumber \ifdim\scratchdimen>\zeropoint to \scratchdimen\fi {
\hfill
diff --git a/tex/context/base/mkiv/strc-not.mkvi b/tex/context/base/mkiv/strc-not.mkvi
index 8952f0e9c..e2c60d1b1 100644
--- a/tex/context/base/mkiv/strc-not.mkvi
+++ b/tex/context/base/mkiv/strc-not.mkvi
@@ -1551,7 +1551,7 @@
\unexpanded\def\postponenotes
{\ifconditional\postponingnotes\else
\global\settrue\postponingnotes
- \global\let\flushnotes\doflushnotes
+ \glet\flushnotes\doflushnotes
\clf_postponenotes
\fi}
@@ -1560,7 +1560,7 @@
\unexpanded\def\startpostponingnotes % experimental, page-mix
{\ifconditional\postponingnotes\else
\global\settrue\postponingnotes
- %\global\let\flushnotes\doflushnotes
+ %\glet\flushnotes\doflushnotes
\clf_postponenotes
\fi}
@@ -1581,7 +1581,7 @@
\clf_flushpostponednotes% this also resets the states !
\global\setfalse\postponednote
\global\setfalse\postponingnotes
- \global\let\flushnotes\relax
+ \glet\flushnotes\relax
\endgroup
\fi}
diff --git a/tex/context/base/mkiv/strc-ref.mkvi b/tex/context/base/mkiv/strc-ref.mkvi
index 6d0e369b1..0cef07780 100644
--- a/tex/context/base/mkiv/strc-ref.mkvi
+++ b/tex/context/base/mkiv/strc-ref.mkvi
@@ -477,10 +477,10 @@
{\scratchwidth \wd\nextbox
\scratchheight\ht\nextbox
\scratchdepth \dp\nextbox
- \setbox\nextbox\hbox % \hpack ?
+ \setbox\nextbox\hpack
{\framed[\c!frame=\v!off,#2]{\box\nextbox}}%
\strc_references_set_simple_reference{#1}%
- \setbox\nextbox\hbox attr \destinationattribute \currentdestinationattribute % \hpack ?
+ \setbox\nextbox\hpack attr \destinationattribute \currentdestinationattribute % \hpack ?
{\strc_references_flush_destination_nodes
\box\nextbox}%
\setbox\nextbox\hpack{\box\nextbox}%
@@ -492,7 +492,7 @@
\def\strc_references_content_nop_finish#1#2%
{\strc_references_set_simple_reference{#1}%
- \hbox attr \destinationattribute \currentdestinationattribute % \hpack ?
+ \hpack attr \destinationattribute \currentdestinationattribute % \hpack ?
{\strc_references_flush_destination_nodes
\box\nextbox}%
\egroup}
@@ -794,7 +794,7 @@
\clf_setinternalreference
reference {#kind:#name}% no view
\relax
- \hbox attr \destinationattribute\lastdestinationattribute{}%
+ \hpack attr \destinationattribute\lastdestinationattribute{}%
\endgroup}
\installcorenamespace{savedinternalreference}
@@ -1084,7 +1084,7 @@
\expandafter\sixthofsixarguments \fi}
\unexpanded\def\referencesymbol
- {\hbox\bgroup
+ {\hpack\bgroup
\strut
\markreferencepage
\high
@@ -1670,7 +1670,7 @@
\clf_doifelsereference{\referenceprefix}{#label}{\extrareferencearguments}%
{\clf_injectcurrentreference
\global\lastsavedreferenceattribute\lastreferenceattribute
- \hbox attr \referenceattribute \lastreferenceattribute {\box\scratchbox}}
+ \hpack attr \referenceattribute \lastreferenceattribute {\box\scratchbox}}
{\box\scratchbox}%
\endgroup}
diff --git a/tex/context/base/mkiv/strc-reg.mkiv b/tex/context/base/mkiv/strc-reg.mkiv
index ac8e35913..3f401bbac 100644
--- a/tex/context/base/mkiv/strc-reg.mkiv
+++ b/tex/context/base/mkiv/strc-reg.mkiv
@@ -159,8 +159,8 @@
%D Registering:
-\global\let\currentregistername \empty
-\global\let\currentregisternumber\!!zerocount
+\glet\currentregistername \empty
+\glet\currentregisternumber\!!zerocount
\def\strc_registers_register_page_entry
{\iftrialtypesetting
diff --git a/tex/context/base/mkiv/strc-ren.mkiv b/tex/context/base/mkiv/strc-ren.mkiv
index 66dcf6ed1..526ae26c6 100644
--- a/tex/context/base/mkiv/strc-ren.mkiv
+++ b/tex/context/base/mkiv/strc-ren.mkiv
@@ -120,7 +120,7 @@
\setheadmarking
\doresetstructureheadnumbercontent
\ifconditional\c_strc_sectioning_empty
- \setbox\b_strc_rendering_head\hbox \headreferenceattributes to \zeropoint{\strut}%
+ \setbox\b_strc_rendering_head\hpack \headreferenceattributes to \zeropoint{\strut}%
\else
\docheckheadreference
\setbox\b_strc_rendering_head\hbox \headreferenceattributes
@@ -139,7 +139,7 @@
\dosetstructureheadnumbercontent
\doresetstructureheadnumbercontent
\ifconditional\c_strc_sectioning_empty
- \setbox\b_strc_rendering_head\hbox \headreferenceattributes to \zeropoint{\strut}%
+ \setbox\b_strc_rendering_head\hpack \headreferenceattributes to \zeropoint{\strut}%
\else % = needed
\docheckheadreference
\setbox\b_strc_rendering_head\hbox \headreferenceattributes
@@ -779,18 +779,18 @@
\startsetups[\??headrenderings:\v!bottom]
\ifconditional\headshownumber
- \setbox0\hbox {
+ \setbox\scratchboxone\hbox {
\headnumbercontent
}
- \setbox2\vbox {
+ \setbox\scratchboxtwo\vbox {
\headsetupspacing
- \advance\hsize-\wd0\relax
+ \advance\hsize-\wd\scratchboxone\relax
\headtextcontent
}
\hbox {
- \box0
+ \box\scratchboxone
\hskip\headnumberdistance
- \box2
+ \box\scratchboxtwo
}
\else
\vbox {
@@ -808,18 +808,18 @@
\startsetups[\??headrenderings:\v!top]
\ifconditional\headshownumber
- \setbox0\hbox {
+ \setbox\scratchboxone\hbox {
\headnumbercontent
}
- \setbox2\vtop {
+ \setbox\scratchboxtwo\vtop {
\headsetupspacing
- \advance\hsize-\wd0\relax
+ \advance\hsize-\wd\scratchboxone\relax
\headtextcontent
}
\hbox {
- \box0
+ \box\scratchboxone
\hskip\headnumberdistance
- \box2
+ \box\scratchboxtwo
}
\else
\vtop{
diff --git a/tex/context/base/mkiv/strc-sec.mkiv b/tex/context/base/mkiv/strc-sec.mkiv
index c96ec8a47..4cc2c7bd6 100644
--- a/tex/context/base/mkiv/strc-sec.mkiv
+++ b/tex/context/base/mkiv/strc-sec.mkiv
@@ -53,6 +53,10 @@
\def\m_strc_references_prefix_yes{+}
\def\m_strc_references_prefix_nop{-}
+\let\currentstructurereferenceprefix\empty
+
+\installglobalmacrostack\currentstructurereferenceprefix
+
\def\strc_sectioning_set_reference_prefix
{\ifx\currentstructurereferenceprefix\empty
% nothing
@@ -64,7 +68,7 @@
\else
\setupglobalreferenceprefix[\currentstructurereferenceprefix]%
\fi\fi\fi
- \let\currentstructurereferenceprefix\referenceprefix}
+ \glet\currentstructurereferenceprefix\referenceprefix}
% why xdef ?
@@ -340,6 +344,9 @@
\installcommandhandler \??head {head} \??head
+\installmacrostack\currenthead
+\installmacrostack\currentheadparent
+
\setuphead [%
%\c!after=,
%\c!align=,
@@ -479,16 +486,18 @@
\to \everysetuphead
\unexpanded\def\doredefinehead#1#2% called at lua end
- {\pushmacro\currenthead
- \pushmacro\currentheadparent
+ {\push_macro_currenthead
+ \push_macro_currentheadparent
\edef\currenthead{#1}%
\edef\currentheadparent{#2}%
\the\everyredefinehead\relax
- \popmacro\currentheadparent
- \popmacro\currenthead}
+ \pop_macro_currentheadparent
+ \pop_macro_currenthead}
\let\currentnamedsection\empty
+\installmacrostack\currentnamedsection
+
\unexpanded\def\startnamedsection
{\dotripleempty\strc_sectioning_start_named_section}
@@ -577,7 +586,7 @@
\fi}
\def\strc_sectioning_setup_indeed[#1][#2][#3]%
- {\pushmacro\currenthead
+ {\push_macro_currenthead
\ifthirdargument
\edef\currenthead{#1#2}% % not used at any more in mkiv (sets now)
\setupcurrenthead[#3]%
@@ -585,7 +594,7 @@
\edef\currenthead{#1}%
\setupcurrenthead[#2]%
\fi
- \popmacro\currenthead}
+ \pop_macro_currenthead}
% we share the parameters as sections are roots of heads so eventually we can
% consider \definesection -> \definehead with one argument
@@ -638,7 +647,8 @@
{\strc_sectioning_handle{#1}{\c!reference={#2},\c!title={#3}}{}} % name ref nr title --
\unexpanded\def\strc_sectioning_start_named_section[#1][#2][#3]% for the moment no grouping, too annoying with page breaks
- {\pushmacro\currentnamedsection
+ {\push_macro_currentnamedsection
+ \push_macro_currentstructurereferenceprefix
\edef\currentnamedsection{#1}%
\setfalse\currentstructureown
%\globalpushmacro\currenthead % this does not work out well
@@ -659,7 +669,8 @@
\headparameter\c!aftersection
\the\everyafterhead
\resetsystemmode\currenthead
- \popmacro\currentnamedsection} % new, also here now
+ \pop_macro_currentstructurereferenceprefix
+ \pop_macro_currentnamedsection} % new, also here now
\let\dostarthead\strc_sectioning_start % used at lua end
\let\dostophead \strc_sectioning_stop % used at lua end
diff --git a/tex/context/base/mkiv/strc-tag.mkiv b/tex/context/base/mkiv/strc-tag.mkiv
index 2ee71d67c..0f8b46df9 100644
--- a/tex/context/base/mkiv/strc-tag.mkiv
+++ b/tex/context/base/mkiv/strc-tag.mkiv
@@ -297,8 +297,13 @@
% {\let\dostarttagged\strc_tags_start_yes
% \let\dostoptagged \strc_tags_stop_yes}
+\newconditional\c_strc_tags_enabled
+
\unexpanded\def\strc_tags_enable
- {\let\dostarttagged \strc_tags_enabled_start_detail
+ {% once enable one is toast
+ \global\settrue\c_strc_tags_enabled
+ % and gets:
+ \let\dostarttagged \strc_tags_enabled_start_detail
\let\dostarttaggednodetail\strc_tags_enabled_start_no_detail
\let\dostarttaggedchained \strc_tags_enabled_start_chained
\let\dostoptagged \strc_tags_enabled_stop
@@ -306,12 +311,21 @@
\let\dostopignoretagging \strc_tags_stop_yes_ignore}
\unexpanded\def\strc_tags_disable
- {\let\dostarttagged \strc_tags_start_nop_detail
- \let\dostarttaggednodetail\strc_tags_start_nop_no_detail
- \let\dostarttaggedchained \strc_tags_start_nop_chained
- \let\dostoptagged \strc_tags_stop_nop
- \let\dostartignoretagging \strc_tags_start_nop_ignore
- \let\dostopignoretagging \strc_tags_stop_nop_ignore}
+ {\ifconditional\c_strc_tags_enabled
+ % so now all are artifacts
+ \let\dostarttagged \strc_tags_start_nop_ignore
+ \let\dostarttaggednodetail\strc_tags_start_nop_no_detail
+ \let\dostarttaggedchained \strc_tags_start_nop_chained
+ \let\dostoptagged \strc_tags_stop_nop_ignore
+ \else
+ % initial
+ \let\dostarttagged \strc_tags_start_nop_detail
+ \let\dostarttaggednodetail\strc_tags_start_nop_no_detail
+ \let\dostarttaggedchained \strc_tags_start_nop_chained
+ \let\dostoptagged \strc_tags_stop_nop
+ \let\dostartignoretagging \strc_tags_start_nop_ignore
+ \let\dostopignoretagging \strc_tags_stop_nop_ignore
+ \fi}
% for luigi (beware: fully expandable):
@@ -468,8 +482,19 @@
%D This will only work well with sane use.
+% \appendtoks
+% {%
+% \doglobal\appendtoks
+% \strc_tags_start_yes_ignore
+% \to \everybeforepagebody
+% \doglobal\appendtoks
+% \strc_tags_stop_yes_ignore
+% \to \everyafterpagebody
+% }%
+% \to \everyenableelements
+
\appendtoks
- \dostartignoretagging
+ \dostartignoretagging
\to \everybeforepagebody
\appendtoks
diff --git a/tex/context/base/mkiv/supp-box.mkiv b/tex/context/base/mkiv/supp-box.mkiv
index 5fc34ba74..c78a83fd3 100644
--- a/tex/context/base/mkiv/supp-box.mkiv
+++ b/tex/context/base/mkiv/supp-box.mkiv
@@ -208,8 +208,8 @@
%D \smashedvbox to ... {...}
%D \stoptyping
-\unexpanded\def\smashedhbox{\hbox\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\hbox}
-\unexpanded\def\smashedvbox{\vbox\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\vbox}
+\unexpanded\def\smashedhbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\hbox}
+\unexpanded\def\smashedvbox{\vpack\bgroup\dowithnextboxcs\syst_boxes_smashed_nextbox\vbox}
%D First we define a helper. We use a \LUATEX\ feature in order to avoid
%D mathpalettes.
@@ -576,7 +576,7 @@
\unexpanded\def\doifelsetext#1%
{\begingroup
- \setbox\scratchbox\hbox
+ \setbox\scratchbox\hpack
{\settrialtypesetting
\ignorespaces#1\removeunwantedspaces}%
\ifzeropt\wd\scratchbox
@@ -589,7 +589,7 @@
\unexpanded\def\doiftext#1%
{\begingroup
- \setbox\scratchbox\hbox
+ \setbox\scratchbox\hpack
{\settrialtypesetting
\ignorespaces#1\removeunwantedspaces}%
\ifzeropt\wd\scratchbox
@@ -670,7 +670,7 @@
%D \afterassignment\syst_boxes_with_next_box_indeed
%D \else\ifx#2\vbox
%D \afterassignment\syst_boxes_with_next_box_indeed
-%D \else\ifx#2\normalvtop
+%D \else\ifx#2\vtop
%D \afterassignment\syst_boxes_with_next_box_indeed
%D \else\ifx#2\normalvcenter
%D \afterassignment\syst_boxes_with_next_box_indeed
@@ -730,9 +730,9 @@
%D Some well known friends, but we implement them our own
%D way. We want the macros to work in both math and text mode.
-\def\dodorlap{\hpack to \zeropoint{\box\nextbox\normalhss}\endgroup}
-\def\dodollap{\hpack to \zeropoint{\normalhss\box\nextbox}\endgroup}
-\def\dodoclap{\hpack to \zeropoint{\normalhss\box\nextbox\normalhss}\endgroup}
+\def\dodorlap{\hpack to \zeropoint{\box\nextbox\hss}\endgroup}
+\def\dodollap{\hpack to \zeropoint{\hss\box\nextbox}\endgroup}
+\def\dodoclap{\hpack to \zeropoint{\hss\box\nextbox\hss}\endgroup}
\def\dorlap{\begingroup\dowithnextboxcs\dodorlap\hbox}
\def\dollap{\begingroup\dowithnextboxcs\dodollap\hbox}
@@ -746,8 +746,8 @@
\unexpanded\def\llap{\mathortext\domathllap\dollap}
\unexpanded\def\clap{\mathortext\domathclap\doclap}
-\def\dodotlap{\vpack to \zeropoint{\normalvss\box\nextbox}\endgroup}
-\def\dodoblap{\vpack to \zeropoint{\box\nextbox\normalvss}\endgroup}
+\def\dodotlap{\vpack to \zeropoint{\vss\box\nextbox}\endgroup}
+\def\dodoblap{\vpack to \zeropoint{\box\nextbox\vss}\endgroup}
\unexpanded\def\tlap{\begingroup\dowithnextboxcs\dodotlap\vbox}
\unexpanded\def\blap{\begingroup\dowithnextboxcs\dodoblap\vbox}
@@ -1183,8 +1183,8 @@
%D complex macro than needed at first sight.
\def\dodoboundtext#1%
- {\setbox0\hbox{#1}%
- \advance\scratchdimen -\wd0
+ {\setbox\scratchboxone\hbox{#1}%
+ \advance\scratchdimen -\wd\scratchboxone
\ifdim\scratchdimen>\zeropoint\relax#1\fi}%
\def\doboundtext#1#2#3% still used?
@@ -1243,7 +1243,7 @@
\ifdim\wd\nextbox>\scratchdimen
\setbox\scratchbox\hbox{\ifdone\space#2\else#2\space\fi}%
\advance\scratchdimen -\wd\scratchbox
- \setbox0\box\nextbox
+ \setbox\scratchboxone\box\nextbox
\setbox\nextbox\vbox
{\hsize\scratchdimen
\hfuzz\maxdimen
@@ -1254,7 +1254,7 @@
\rightskip\zeropoint
\hskip\zeropoint \s!plus 1\s!fill % \hsize
\fi
- \unhcopy0}%
+ \unhcopy\scratchboxone}%
\ifdim\ht\nextbox>\strutht
\setbox\nextbox\vbox % if omitted: missing brace reported
{\splittopskip\openstrutheight
@@ -1262,7 +1262,7 @@
\setbox\nextbox\vsplit\nextbox to \strutht
\else
\doloop
- {\setbox0\vsplit\nextbox to \strutht
+ {\setbox\scratchboxone\vsplit\nextbox to \strutht
\ifdim\ht\nextbox>\strutht \else \exitloop \fi}%
\fi
\unvbox\nextbox
@@ -1304,13 +1304,13 @@
{%\dontleavehmode
\bgroup
\let\speciallimitatetext\firstoffourarguments
- \setbox0\hbox
+ \setbox\scratchboxone\hbox
{\nohyphens
\normallimitatetext{#1}{+#2}{}#4%
\normallimitatetext{#1}{-#3}{}}%
- \setbox2\hbox
+ \setbox\scratchboxtwo\hbox
{#1}%
- \ifdim\wd2<\wd0 #1\else\unhbox0\fi
+ \ifdim\wd\scratchboxtwo<\wd\scratchboxone #1\else\unhbox\scratchboxone\fi
\egroup}
\unexpanded\def\limitatetext#1#2#3% \expanded added 2003/01/16
@@ -1328,7 +1328,7 @@
%D \stoptyping
\unexpanded\def\limitatefirstline#1#2#3%
- {\hbox\bgroup\strut
+ {\hbox\bgroup\strut % \hpack
\setbox\scratchbox\hbox{\begstrut#1\endstrut}%
\ifdim\wd\scratchbox>#2\relax
\setbox\scratchbox\hbox{#3}%
@@ -1340,7 +1340,7 @@
{\unvbox\scratchbox
\global\setbox\plusone\lastbox
\global\setbox\plusone\hbox{\strut\unhbox\plusone}%
- \hbox % to #2
+ \hbox % to #2 % \hpack
{\ifx\clip\undefined
\box\plusone
\else\ifdim\wd\plusone>\hsize
@@ -1533,7 +1533,7 @@
%D a strut.
\unexpanded\def\struttedbox
- {\hbox\bgroup
+ {\hpack\bgroup
\dowithnextboxcs\syst_boxes_struttedbox_finish\hbox}
\def\syst_boxes_struttedbox_finish
@@ -1550,7 +1550,7 @@
%D equals strutdepth.
\unexpanded\def\topskippedbox
- {\hbox\bgroup\dowithnextboxcs\syst_boxes_topskippedbox_finish\hbox}
+ {\hpack\bgroup\dowithnextboxcs\syst_boxes_topskippedbox_finish\hbox}
\def\syst_boxes_topskippedbox_finish
{\edef\m_boxes_tmp{\ifdim\strutdepth=\dp\nextbox\dp\nextbox\the\dp\nextbox\fi}%
@@ -1606,22 +1606,22 @@
\unexpanded\def\centeredbox#1#% height +/-dimen width +/-dimen
{\bgroup
- \setbox0\vpack to \vsize
+ \setbox\scratchboxone\vpack to \vsize
\bgroup
\dontcomplain
\forgetall
- \setbox0\hbox{\vrule\s!width \zeropoint#1}%
- \setbox2\vbox{\hrule\s!height\zeropoint#1}%
- \advance\vsize \ht2
- \advance\hsize \wd0
+ \setbox\scratchboxone\hpack{\vrule\s!width \zeropoint#1}%
+ \setbox\scratchboxtwo\vpack{\hrule\s!height\zeropoint#1}%
+ \advance\vsize \ht\scratchboxtwo
+ \advance\hsize \wd\scratchboxone
\vpack to \vsize
\bgroup
- \vskip-\ht2
+ \vskip-\ht\scratchboxtwo
\vss
\hpack to \hsize
\bgroup
\dowithnextbox
- {\hskip-\wd0
+ {\hskip-\wd\scratchboxone
\hss
\box\nextbox
\hss
@@ -1629,14 +1629,13 @@
\vss
\egroup
\egroup
- \wd0\hsize
- \ht0\vsize
- \box0
+ \wd\scratchboxone\hsize
+ \ht\scratchboxone\vsize
+ \box\scratchboxone
\egroup}
\hbox}
-%D For those who don't want to deal with \type {\hsize}
-%D and \type {\vsize}, we have:
+%D For those who don't want to deal with \type {\hsize} and \type {\vsize}, we have:
%D
%D \starttyping
%D \centerednextbox width 2bp height 2bp
@@ -1670,9 +1669,9 @@
{\bgroup
\dowithnextbox
{\setlocalhsize
- \setbox\scratchbox\hbox{\vrule\s!width \zeropoint#1}%
+ \setbox\scratchbox\hpack{\vrule\s!width \zeropoint#1}%
\ifzeropt\wd\scratchbox\else\hsize\wd\scratchbox\fi
- \setbox\scratchbox\vbox{\hrule\s!height\zeropoint#1}%
+ \setbox\scratchbox\vpack{\hrule\s!height\zeropoint#1}%
\ifzeropt\ht\scratchbox\else\vsize\ht\scratchbox\fi
\vpack to \vsize{\vss\hpack to \hsize{\hss\box\nextbox\hss}\vss}%
\egroup}%
@@ -1764,7 +1763,7 @@
{\dorecurse\rigidcolumns
{\setbox\scratchbox\vsplit\rigidcolumnbox to \scratchdimen
\dp\scratchbox\openstrutdepth
- \setbox\scratchbox\normalvtop
+ \setbox\scratchbox\vtop
\ifalignrigidcolumns to
\ifstretchrigidcolumns\vsize\else\scratchdimen\fi
\fi
@@ -1874,21 +1873,21 @@
\unexpanded\def\convertvboxtohbox
{\makehboxofhboxes
- \setbox0\hbox{\unhbox0 \removehboxes}%
- \noindent\unhbox0\par}
+ \setbox\scratchboxone\hpack{\unhbox\scratchboxone\removehboxes}% \hpack
+ \noindent\unhbox\scratchboxone\par}
\unexpanded\def\makehboxofhboxes
- {\setbox0\emptyhbox
- \loop % \doloop { .. \exitloop .. }
- \setbox2\lastbox
- \ifhbox2
- \setbox0\hbox{\box2\unhbox0}%
+ {\setbox\scratchboxone\emptyhbox
+ \loop % \doloop { .. \exitloop .. }
+ \setbox\scratchboxtwo\lastbox
+ \ifhbox\scratchboxtwo
+ \setbox\scratchboxone\hpack{\box\scratchboxtwo\unhbox\scratchboxone}%
\repeat}
\unexpanded\def\removehboxes
- {\setbox0\lastbox
- \ifhbox0
- {\removehboxes}\unhbox0
+ {\setbox\scratchboxone\lastbox
+ \ifhbox\scratchboxone
+ {\removehboxes}\unhbox\scratchboxone
\fi}
% And one special for notes:
@@ -1947,7 +1946,7 @@
\doloop
{\setbox\hhbox\vsplit\unhhedbox to \lineheight
\ifvoid\unhhedbox
- \setbox\hhbox\hbox{\strut\hboxofvbox\hhbox}%
+ \setbox\hhbox\hbox{\strut\hboxofvbox\hhbox}% \hpack
\fi
\ht\hhbox\strutht
\dp\hhbox\strutdp
@@ -2198,9 +2197,9 @@
\unexpanded\def\cbox#1#{\vbox#1\syst_boxes_lrc_process\raggedcenter}
\unexpanded\def\rbox#1#{\vbox#1\syst_boxes_lrc_process\raggedright }
-\unexpanded\def\ltop#1#{\normalvtop#1\syst_boxes_lrc_process\raggedleft }
-\unexpanded\def\ctop#1#{\normalvtop#1\syst_boxes_lrc_process\raggedcenter}
-\unexpanded\def\rtop#1#{\normalvtop#1\syst_boxes_lrc_process\raggedright }
+\unexpanded\def\ltop#1#{\vtop#1\syst_boxes_lrc_process\raggedleft }
+\unexpanded\def\ctop#1#{\vtop#1\syst_boxes_lrc_process\raggedcenter}
+\unexpanded\def\rtop#1#{\vtop#1\syst_boxes_lrc_process\raggedright }
%D The alternatives \type {\tbox} and \type {\bbox} can be used
%D to properly align boxes, like in:
@@ -2222,8 +2221,8 @@
%D
%D \getbuffer
-\unexpanded\def\tbox{\hbox\bgroup\dowithnextboxcs\syst_boxes_tbox_finish\hbox}
-\unexpanded\def\bbox{\hbox\bgroup\dowithnextboxcs\syst_boxes_bbox_finish\hbox}
+\unexpanded\def\tbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_tbox_finish\hbox}
+\unexpanded\def\bbox{\hpack\bgroup\dowithnextboxcs\syst_boxes_bbox_finish\hbox}
\def\syst_boxes_tbox_finish
{\scratchdepth\dimexpr\ht\nextbox+\dp\nextbox-\ht\strutbox\relax
@@ -2289,7 +2288,7 @@
{\ifx\next\bgroup
\expanded{\egroup#1 to \the\sizeofbox}%
\else
- \@EA\afterassignment\@EA\docommand\@EA\scratchdimen
+ \expandafter\afterassignment\expandafter\docommand\expandafter\scratchdimen
\fi}%
\docommand}
@@ -2337,7 +2336,7 @@
\newbox\fakedboxcursor
-\setbox\fakedboxcursor\hbox
+\setbox\fakedboxcursor\hpack
{\vrule\s!width\zeropoint\s!height\zeropoint\s!depth\zeropoint}
\unexpanded\def\boxcursor % overloaded in core-vis
@@ -2723,7 +2722,7 @@
% vcenter in text, we kunnen vcenter overloaden
\unexpanded\def\halfwaybox
- {\hbox\bgroup
+ {\hpack\bgroup
\dowithnextboxcs\syst_boxes_halfwaybox_finish\hbox}
\def\syst_boxes_halfwaybox_finish
@@ -2732,7 +2731,7 @@
\egroup}
\unexpanded\def\depthonlybox
- {\vtop\bgroup
+ {\tpack\bgroup
\dowithnextboxcs\syst_boxes_depthonlybox_finish\vbox}
\def\syst_boxes_depthonlybox_finish
@@ -2764,7 +2763,7 @@
\dowithnextboxcs\syst_boxes_vcenter_finish\vbox}
\def\syst_boxes_vcenter_finish
- {\hpack{\normalstartimath\normalvcenter{\box\nextbox}\normalstopimath}%
+ {\hpack{\normalstartimath\vcenter{\box\nextbox}\normalstopimath}%
\egroup}
% could be \everymathematics
@@ -2780,7 +2779,7 @@
%D A not so well unhboxable box can be made with:
\unexpanded\def\frozenhbox
- {\hbox\bgroup
+ {\hpack\bgroup
\dowithnextboxcs\syst_boxes_frozenhbox_finish\hbox}
\def\syst_boxes_frozenhbox_finish
@@ -2837,19 +2836,19 @@
\unexpanded\def\spreadhbox#1% rebuilds \hbox{<box><hss><box><hss><box>}
{\bgroup
\ifhbox#1\relax
- \setbox2\emptybox
+ \setbox\scratchboxtwo\emptybox
\unhbox#1%
\doloop
{\unpenalty\unskip\unpenalty\unskip\unpenalty\unskip
- \setbox0\lastbox
- \ifvoid0
+ \setbox\scratchboxone\lastbox
+ \ifvoid\scratchboxone
\exitloop
\else
- \setbox2\hbox
- {\ifhbox0 \spreadhbox0\else\box0\fi
- \ifvoid2 \else\hss\unhbox2\fi}%
+ \setbox\scratchboxtwo\hbox
+ {\ifhbox\scratchboxone \spreadhbox\scratchboxone\else\box\scratchboxone\fi
+ \ifvoid\scratchboxtwo \else\hss\unhbox\scratchboxtwo\fi}%
\fi}%
- \ifvoid2\else\unhbox2\fi
+ \ifvoid\scratchboxtwo\else\unhbox\scratchboxtwo\fi
\else
\box#1%
\fi
diff --git a/tex/context/base/mkiv/supp-mat.mkiv b/tex/context/base/mkiv/supp-mat.mkiv
index 176233ae5..f72a0ff89 100644
--- a/tex/context/base/mkiv/supp-mat.mkiv
+++ b/tex/context/base/mkiv/supp-mat.mkiv
@@ -179,7 +179,7 @@
\popmacro\dodimensionsignal}
\unexpanded\def\nodimension#1%
- {\unskip#1\global\let\dodimensionsignal\relax}
+ {\unskip#1\glet\dodimensionsignal\relax}
%D \macros
%D {cramped}
diff --git a/tex/context/base/mkiv/syst-aux.mkiv b/tex/context/base/mkiv/syst-aux.mkiv
index 7d27e8bde..8a49d3769 100644
--- a/tex/context/base/mkiv/syst-aux.mkiv
+++ b/tex/context/base/mkiv/syst-aux.mkiv
@@ -181,12 +181,9 @@
%D These are not needed any more now that we have wide screens (and bytes come
%D cheap).
-\let\@EA \singleexpandafter
-\let\@EAEAEA \doubleexpandafter
-\let\@EAEAEAEAEAEA\tripleexpandafter
-
-\let\@NX \noexpand
-\def\@EAEA {\expandafter\expandafter} % can often be avoided
+\let\@EA \singleexpandafter % obsolete
+\let\@EAEAEA \doubleexpandafter % obsolete
+\let\@EAEAEAEAEAEA\tripleexpandafter % obsolete
%D Sometimes we pass macros as arguments to commands that don't expand them
%D before interpretation. Such commands can be enclosed with \type {\expanded},
@@ -564,7 +561,7 @@
%D \setevalue {name}{...} = \edef\name{...}
%D \setxvalue {name}{...} = \xdef\name{...}
%D \letvalue {name}=\... = \let\name=\...
-%D \letgvalue {name}=\... = \global\let\name=\...
+%D \letgvalue {name}=\... = \glet\name=\...
%D \getvalue {name} = \name
%D \resetvalue {name} = \def\name{}
%D \stoptyping
@@ -572,16 +569,16 @@
%D As we will see, \CONTEXT\ uses these commands many times, which is mainly due to
%D its object oriented and parameter driven character.
-\def\setvalue #1{\expandafter \def\csname#1\endcsname}
+\def\setvalue #1{\expandafter\def \csname#1\endcsname}
\def\setgvalue #1{\expandafter\gdef\csname#1\endcsname}
\def\setevalue #1{\expandafter\edef\csname#1\endcsname}
\def\setxvalue #1{\expandafter\xdef\csname#1\endcsname}
\def\getvalue #1{\csname#1\endcsname}
-\def\letvalue #1{\expandafter\let\csname#1\endcsname}
-\def\letgvalue #1{\global\expandafter\let\csname#1\endcsname}
-\def\resetvalue #1{\expandafter\let\csname#1\endcsname\empty}
-\def\undefinevalue#1{\expandafter\let\csname#1\endcsname\undefined}
-\def\ignorevalue#1#2{\expandafter\let\csname#1\endcsname\empty}
+\def\letvalue #1{\expandafter\let \csname#1\endcsname}
+\def\letgvalue #1{\expandafter\glet\csname#1\endcsname}
+\def\resetvalue #1{\expandafter\let \csname#1\endcsname\empty}
+\def\undefinevalue#1{\expandafter\let \csname#1\endcsname\undefined}
+\def\ignorevalue#1#2{\expandafter\let \csname#1\endcsname\empty}
\def\setuvalue #1{\normalprotected\expandafter \def\csname#1\endcsname}
\def\setuevalue #1{\normalprotected\expandafter\edef\csname#1\endcsname}
@@ -597,7 +594,11 @@
%D tokens will save us some $300\times4=1200$ bytes of format file on a 32~bit
%D system. Not that it matters much today. This shortcut is already defined:
-\unexpanded\def\glet{\global\let} \let\globallet\glet
+\ifdefined\glet\else
+ \unexpanded\def\glet{\global\let}
+\fi
+
+\let\globallet\glet
%D \macros
%D {doifundefined,doifdefined,
@@ -670,7 +671,7 @@
{\ifcsname#1\endcsname\expandafter\let\csname#1\endcsname\undefined\fi}
\def\globalundefine#1% conditional
- {\ifcsname#1\endcsname\expandafter\global\let\csname#1\endcsname\undefined\fi}
+ {\ifcsname#1\endcsname\expandafter\glet\csname#1\endcsname\undefined\fi}
%D Beware, being \type {\undefined} in \ETEX\ means that the macro {\em is} defined!
%D
@@ -3496,7 +3497,7 @@
\begingroup
\def\\ {\syst_helpers_get_grouped_argument\syst_helpers_get_grouped_argument_yes\syst_helpers_get_grouped_argument_nop}
- \global\let\syst_helpers_get_grouped_argument_e\\
+ \glet\syst_helpers_get_grouped_argument_e\\
\endgroup
\def\syst_helpers_get_grouped_argument_f
@@ -3627,13 +3628,13 @@
%D
%D Trivial:
-\unexpanded\def\letempty #1{\let#1\empty}
-\unexpanded\def\globalletempty#1{\global\let#1\empty}
+\unexpanded\def\letempty #1{\let #1\empty}
+\unexpanded\def\globalletempty#1{\glet#1\empty}
-\unexpanded\def\letvalueempty #1{\expandafter\let\csname#1\endcsname\empty}
-\unexpanded\def\letgvalueempty#1{\global\expandafter\let\csname#1\endcsname\empty}
-\unexpanded\def\letvaluerelax #1{\expandafter\let\csname#1\endcsname\relax}
-\unexpanded\def\letgvalurelax #1{\global\expandafter\let\csname#1\endcsname\relax}
+\unexpanded\def\letvalueempty #1{\expandafter\let \csname#1\endcsname\empty}
+\unexpanded\def\letgvalueempty#1{\expandafter\glet\csname#1\endcsname\empty}
+\unexpanded\def\letvaluerelax #1{\expandafter\let \csname#1\endcsname\relax}
+\unexpanded\def\letgvalurelax #1{\expandafter\glet\csname#1\endcsname\relax}
\unexpanded\def\relaxvalueifundefined#1%
{\ifcsname#1\endcsname \else
@@ -3849,7 +3850,7 @@
% \bgroup \obeylines
%
-% \global\let\stoptexdefinition\relax
+% \glet\stoptexdefinition\relax
%
% \unexpanded\gdef\starttexdefinition%
% {\bgroup%
@@ -3906,7 +3907,7 @@
% \bgroup \obeylines
%
-% \global\let\stoptexdefinition\relax
+% \glet\stoptexdefinition\relax
%
% \unexpanded\gdef\starttexdefinition%
% {\bgroup%
@@ -3925,7 +3926,7 @@
\bgroup \obeylines
-\global\let\stoptexdefinition\relax
+\glet\stoptexdefinition\relax
\unexpanded\gdef\starttexdefinition%
{\bgroup%
@@ -4142,8 +4143,8 @@
\unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
{\global\advance\outerrecurse \plusone
- \global\expandafter\def\csname\??recurseaction\the\outerrecurse\endcsname{#4}%
- \global\expandafter\let\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
+ \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#4}%
+ \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\ifnum#3>\zerocount\relax
\ifnum#2<#1\relax
\let\syst_helpers_stepwise_next\syst_helpers_stepwise_exit
@@ -4240,13 +4241,13 @@
\unexpanded\def\syst_helpers_recurse_x#1#2%
{\global\advance\outerrecurse \plusone
- \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#2}%
- \global\expandafter\let \csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
+ \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#2}%
+ \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\expandafter\syst_helpers_recurse_indeed\expandafter1\expandafter{\number#1}}
\unexpanded\def\syst_helpers_recurse_y#1#2%
{\global\advance\outerrecurse \plusone
- \global\expandafter\let\csname\??recurseindex\the\outerrecurse\endcsname\recurselevel
+ \expandafter\glet\csname\??recurseindex\the\outerrecurse\endcsname\recurselevel
\let\recurselevel\!!plusone
#2%
\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
@@ -4312,8 +4313,8 @@
\unexpanded\def\doloop#1%
{\global\advance\outerrecurse \plusone
- \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#1}%
- \global\expandafter\let \csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
+ \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname{#1}%
+ \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\let\endofloop\syst_helpers_loop
\syst_helpers_loop1} % no \plusone else \recurselevel wrong
@@ -4380,23 +4381,23 @@
\unexpanded\def\syst_helpers_recurse_x#1#2%
{\global\advance\outerrecurse \plusone
- \global\expandafter\def\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#2}%
- \global\expandafter\let\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
+ \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#2}%
+ \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\expandafter\syst_helpers_recurse_indeed\expandafter1\expandafter{\number#1}}
\unexpanded\def\syst_helpers_recurse_y#1#2%
{\global\advance\outerrecurse \plusone
- \global\expandafter\let\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
+ \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\let\recurselevel\!!plusone
- \global\expandafter\def\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#2}%
+ \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#2}%
\syst_helpers_recurse_content
\expandafter\let\expandafter\recurselevel\csname\??recurseindex\the\outerrecurse\endcsname
\global\advance\outerrecurse \minusone}
\unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
{\global\advance\outerrecurse \plusone
- \global\expandafter\def\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
- \global\expandafter\let\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
+ \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
+ \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\ifnum#3>\zerocount\relax
\ifnum#2<#1\relax
\let\syst_helpers_stepwise_next\syst_helpers_stepwise_exit
@@ -4417,8 +4418,8 @@
\unexpanded\def\doloop#1%
{\global\advance\outerrecurse \plusone
- \global\expandafter\def\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#1}%
- \global\expandafter\let\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
+ \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#1}%
+ \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\let\endofloop\syst_helpers_loop
\syst_helpers_loop1} % no \plusone else \recurselevel wrong
@@ -4426,8 +4427,8 @@
% \unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
% {\global\advance\outerrecurse \plusone
-% \global\expandafter\def\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
-% \global\expandafter\let\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
+% \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
+% \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
% \csname @swr%
% \ifnum#3>\zerocount
% \ifnum#2<#1\else d\fi
@@ -4444,8 +4445,8 @@
\unexpanded\def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
{\global\advance\outerrecurse \plusone
- \global\expandafter\def\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
- \global\expandafter\let\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
+ \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
+ \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
\csname\??recursestepwise
% we need the x in order to avoid the \relax that tex adds
\ifnum#3>\zerocount
@@ -4464,8 +4465,8 @@
%
% \def\dostepwiserecurse#1#2#3#4% can be made faster by postponing #4
% {\global\advance\outerrecurse \plusone
-% \global\expandafter\def\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
-% \global\expandafter\let\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
+% \expandafter\gdef\csname\??recurseaction\the\outerrecurse\endcsname##1##2{#4}%
+% \expandafter\glet\csname\??recurseindex \the\outerrecurse\endcsname\recurselevel
% \normalexpanded
% {\ifnum#3>\zerocount
% \ifnum#2<#1
@@ -6099,7 +6100,7 @@
\fi}
\unexpanded\def\globalprocesscommalist[#1]#2%
- {\global\let\m_syst_helpers_comma_list_command_global#2%
+ {\glet\m_syst_helpers_comma_list_command_global#2%
\expandafter\syst_helpers_comma_list_command_global_step#1,],}
%D \macros
@@ -6161,9 +6162,9 @@
\unexpanded\def\swapcounts#1#2{\c_syst_helpers_swapped #1\relax#1#2\relax#2\c_syst_helpers_swapped}
\unexpanded\def\swapmacros#1#2{\let\m_syst_helpers_swapped#1\let #1#2\let #2\m_syst_helpers_swapped}
-\unexpanded\def\globalswapdimens#1#2{\d_syst_helpers_swapped #1\global #1#2\global #2\d_syst_helpers_swapped}
-\unexpanded\def\globalswapcounts#1#2{\c_syst_helpers_swapped #1\global #1#2\global #2\c_syst_helpers_swapped}
-\unexpanded\def\globalswapmacros#1#2{\let\m_syst_helpers_swapped#1\global\let#1#2\global\let#2\m_syst_helpers_swapped}
+\unexpanded\def\globalswapdimens#1#2{\d_syst_helpers_swapped #1\global#1#2\global#2\d_syst_helpers_swapped}
+\unexpanded\def\globalswapcounts#1#2{\c_syst_helpers_swapped #1\global#1#2\global#2\c_syst_helpers_swapped}
+\unexpanded\def\globalswapmacros#1#2{\let\m_syst_helpers_swapped#1\glet #1#2\glet #2\m_syst_helpers_swapped}
%D \macros
%D {pushmacro,popmacro}
@@ -6188,11 +6189,11 @@
% \expandafter\newcount\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname
% \fi
% \global\advance\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname \plusone
-% \global\expandafter\let\csname\the\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname\m_syst_helpers_push_macro\endcsname#1}
+% \expandafter\glet\csname\the\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname\m_syst_helpers_push_macro\endcsname#1}
%
% \unexpanded\def\globalpopmacro#1%
% {\xdef\m_syst_helpers_push_macro{\string#1}%
-% \global\expandafter\let\expandafter#1\csname\the\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname\m_syst_helpers_push_macro\endcsname
+% \expandafter\glet\expandafter#1\csname\the\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname\m_syst_helpers_push_macro\endcsname
% \global\advance\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname \minusone}
%
% \unexpanded\def\localpushmacro#1% this one can be used to push a value over an \egroup
@@ -6201,7 +6202,7 @@
% \expandafter\newcount\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname
% \fi
% \global\advance\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname \plusone
-% \global\expandafter\let\csname\the\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname\m_syst_helpers_push_macro\endcsname#1}
+% \expandafter\glet\csname\the\csname\??localpushedmacro\m_syst_helpers_push_macro\endcsname\m_syst_helpers_push_macro\endcsname#1}
%
% \unexpanded\def\localpopmacro#1%
% {\xdef\m_syst_helpers_push_macro{\string#1}%
@@ -6212,6 +6213,8 @@
% \let\popmacro \localpopmacro
%
% slightly faster but more important: less tracing
+%
+% possible optimization \installmacrostack\foo: \syst_push_foo \syst_pop_foo
\let\m_syst_helpers_push_macro\empty
@@ -6232,7 +6235,7 @@
\else
\syst_helpers_push_macro_new_global
\fi
- \global\expandafter\let\csname\the\lastnamedcs\m_syst_helpers_push_macro\endcsname#1}
+ \expandafter\glet\csname\the\lastnamedcs\m_syst_helpers_push_macro\endcsname#1}
\unexpanded\def\localpushmacro#1% this one can be used to push a value over an \egroup
{\xdef\m_syst_helpers_push_macro{\csstring#1}%
@@ -6241,13 +6244,13 @@
\else
\syst_helpers_push_macro_new_local
\fi
- \global\expandafter\let\csname\the\lastnamedcs\m_syst_helpers_push_macro\endcsname#1}
+ \expandafter\glet\csname\the\lastnamedcs\m_syst_helpers_push_macro\endcsname#1}
\unexpanded\def\globalpopmacro#1%
{\xdef\m_syst_helpers_push_macro{\csstring#1}%
\c_syst_helpers_pop_count\csname\??globalpushedmacro\m_syst_helpers_push_macro\endcsname
\global\advance\lastnamedcs \minusone
- \global\expandafter\let\expandafter#1\csname\the\c_syst_helpers_pop_count\m_syst_helpers_push_macro\endcsname}
+ \expandafter\glet\expandafter#1\csname\the\c_syst_helpers_pop_count\m_syst_helpers_push_macro\endcsname}
\unexpanded\def\localpopmacro#1%
{\xdef\m_syst_helpers_push_macro{\csstring#1}%
diff --git a/tex/context/base/mkiv/syst-ini.mkiv b/tex/context/base/mkiv/syst-ini.mkiv
index c4cc2002a..dcf7810b7 100644
--- a/tex/context/base/mkiv/syst-ini.mkiv
+++ b/tex/context/base/mkiv/syst-ini.mkiv
@@ -348,6 +348,7 @@
%D 128-1023 are private and should not be touched.
\let\attributeunsetvalue\c_syst_min_counter_value % used to be \minusone
+
\normalprotected\def\newattribute{\syst_basics_allocate\c_syst_last_allocated_attribute\attribute\attributedef\c_syst_max_allocated_register}
%D Not used by \CONTEXT\ but for instance \PICTEX\ needs it. It's a trick to force
@@ -506,8 +507,8 @@
\def\unvoidbox{\unhbox\voidbox}
\def\emptybox {\box \voidbox} % used in initializations so no attributes
-\def\emptyvbox{\normalvbox{}} % no copy as we need to set attributes
-\def\emptyhbox{\normalhbox{}} % no copy as we need to set attributes
+\def\emptyvbox{\normalvpack{}} % no copy as we need to set attributes
+\def\emptyhbox{\normalhpack{}} % no copy as we need to set attributes
\let\leavevmode\unvoidbox % we prefer to use \dontleavehmode
@@ -839,7 +840,8 @@
\normalprotected\def\newmacro #1{\let#1\empty}
\normalprotected\def\setnewmacro#1{\let#1}
-\def\!!plusone{1}
+\def\!!zerocount{0}
+\def\!!plusone {1}
\normalprotected\def\newfraction#1{\let#1\!!plusone}
@@ -1235,6 +1237,8 @@
%D For now:
+\ifdefined\glet \else \normalprotected\def\glet{\global\let} \fi
+
\ifdefined\protrusionboundary \else \let\protrusionboundary\boundary \fi
\ifdefined\wordboundary \else \let\wordboundary \noboundary \fi
diff --git a/tex/context/base/mkiv/tabl-com.mkiv b/tex/context/base/mkiv/tabl-com.mkiv
index e90086368..01a55e313 100644
--- a/tex/context/base/mkiv/tabl-com.mkiv
+++ b/tex/context/base/mkiv/tabl-com.mkiv
@@ -15,39 +15,51 @@
\unprotect
-\let\VL\relax
-
-\let\NC\relax
-\let\RC\relax
-\let\HC\relax
-\let\EQ\relax
-
-\let\RQ\relax
-\let\HQ\relax
-
-\let\NG\relax
-\let\NN\relax
-\let\ND\relax
-\let\NR\relax
-\let\NB\relax
-
+\let\AR\relax
+\let\BA\relax
+\let\BC\relax
+\let\BL\relax
\let\CC\relax
\let\CL\relax
\let\CM\relax
\let\CR\relax
-
-\let\SR\relax
+\let\DB\relax
+\let\EQ\relax
+\let\FB\relax
+\let\FL\relax
\let\FR\relax
-\let\MR\relax
+\let\HC\relax
+\let\HL\relax
+\let\HQ\relax
+\let\HR\relax
+\let\LB\relax
+\let\LL\relax
\let\LR\relax
-\let\AR\relax
-
-\let\FL\relax
\let\ML\relax
-\let\LL\relax
+\let\MR\relax
+\let\NA\relax
+\let\NB\relax
+\let\NC\relax
+\let\ND\relax
+\let\NF\relax
+\let\NG\relax
+\let\NI\relax
+\let\NL\relax
+\let\NN\relax
+\let\NP\relax
+\let\NR\relax
+\let\PB\relax
+\let\RC\relax
+\let\RQ\relax
+\let\SR\relax
\let\TL\relax
-\let\BL\relax
-\let\HL\relax
-\let\HR\relax
+\let\VL\relax
+
+\installmacrostack\BC
+\installmacrostack\EC
+\installmacrostack\EQ
+\installmacrostack\NC
+\installmacrostack\NN
+\installmacrostack\NR
\protect \endinput
diff --git a/tex/context/base/mkiv/tabl-ltb.mkiv b/tex/context/base/mkiv/tabl-ltb.mkiv
index 3147fa1cc..20ae8bf5a 100644
--- a/tex/context/base/mkiv/tabl-ltb.mkiv
+++ b/tex/context/base/mkiv/tabl-ltb.mkiv
@@ -705,14 +705,14 @@
\else
\t_tabl_lines_head\emptytoks
\fi
- \pushmacro\BC
- \pushmacro\EC
+ \push_macro_BC
+ \push_macro_EC
\def\BC##1\EC{\appendtoks##1\to\t_tabl_lines_head}%
\let\EC\relax} % signal
\unexpanded\def\tabl_lines_EH
- {\popmacro\EC
- \popmacro\BC
+ {\pop_macro_EC
+ \pop_macro_BC
\expandafter\startlinetablehead\the\t_tabl_lines_head\stoplinetablehead}
\let\startlinetablebody\relax
diff --git a/tex/context/base/mkiv/tabl-ntb.mkiv b/tex/context/base/mkiv/tabl-ntb.mkiv
index d545ccc38..54eca6cd3 100644
--- a/tex/context/base/mkiv/tabl-ntb.mkiv
+++ b/tex/context/base/mkiv/tabl-ntb.mkiv
@@ -271,10 +271,10 @@
\letvalue{\??naturaltablesqueeze\v!broad}\donetrue
\letvalue{\??naturaltablesqueeze\v!local}\donetrue
-\def\tabl_ntb_let_gal{\global\expandafter\let\csname\??naturaltablegal\m_tabl_tbl_level\endcsname}
+\def\tabl_ntb_let_gal{\expandafter\glet\csname\??naturaltablegal\m_tabl_tbl_level\endcsname}
\def\tabl_ntb_get_gal{\csname\??naturaltablegal\m_tabl_tbl_level\endcsname}
-\def\tabl_ntb_let_tal#1{\global\expandafter\let\csname\??naturaltabletal\m_tabl_tbl_level:\number#1\endcsname}
+\def\tabl_ntb_let_tal#1{\expandafter\glet\csname\??naturaltabletal\m_tabl_tbl_level:\number#1\endcsname}
\def\tabl_ntb_get_tal#1{\csname\??naturaltabletal\m_tabl_tbl_level:\number#1\endcsname}
\def\tabl_ntb_set_nob#1{\expandafter\let\csname\??naturaltablenob\m_tabl_tbl_level:\number#1\endcsname\plusone}
@@ -291,8 +291,8 @@
%def\tabl_ntb_set_wd#1#2{\expandafter\xdef\csname\??naturaltablewd\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
\def\tabl_ntb_set_ht#1#2{\expandafter\xdef\csname\??naturaltableht\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
-%def\tabl_ntb_let_wd#1#2{\global\expandafter\let\csname\??naturaltablewd\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
-\def\tabl_ntb_let_ht#1#2{\global\expandafter\let\csname\??naturaltableht\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
+%def\tabl_ntb_let_wd#1#2{\expandafter\glet\csname\??naturaltablewd\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
+\def\tabl_ntb_let_ht#1#2{\expandafter\glet\csname\??naturaltableht\m_tabl_tbl_level:\number#1:\number#2\endcsname} % global !
\def\tabl_ntb_get_tag#1#2{\csname\??naturaltabletag\m_tabl_tbl_level:\number#1:\number#2\endcsname}
\def\tabl_ntb_get_col#1#2{\csname\??naturaltablecol\m_tabl_tbl_level:\number#1:\number#2\endcsname}
@@ -306,10 +306,10 @@
\def\tabl_ntb_set_dis#1{\expandafter\xdef\csname\??naturaltabledis\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
\def\tabl_ntb_set_aut#1{\expandafter\xdef\csname\??naturaltableaut\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_let_wid#1{\global\expandafter\let\csname\??naturaltablewid\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_let_hei#1{\global\expandafter\let\csname\??naturaltablehei\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_let_dis#1{\global\expandafter\let\csname\??naturaltabledis\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
-\def\tabl_ntb_let_aut#1{\global\expandafter\let\csname\??naturaltableaut\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
+\def\tabl_ntb_let_wid#1{\expandafter\glet\csname\??naturaltablewid\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
+\def\tabl_ntb_let_hei#1{\expandafter\glet\csname\??naturaltablehei\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
+\def\tabl_ntb_let_dis#1{\expandafter\glet\csname\??naturaltabledis\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
+\def\tabl_ntb_let_aut#1{\expandafter\glet\csname\??naturaltableaut\m_tabl_tbl_level:\number#1\endcsname} % {#2} global !
\def\tabl_ntb_get_wid#1{\ifcsname\??naturaltablewid\m_tabl_tbl_level:\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
\def\tabl_ntb_get_hei#1{\ifcsname\??naturaltablehei\m_tabl_tbl_level:\number#1\endcsname\lastnamedcs\else\zeropoint\fi}
@@ -1206,9 +1206,9 @@
\xdef\m_tabl_ntb_same_page {#3}}
\unexpanded\def\tabl_ntb_row_align_reset
- {\global\let\m_tabl_ntb_before_split\empty
- \global\let\m_tabl_ntb_after_split \empty
- \global\let\m_tabl_ntb_same_page \empty}
+ {\glet\m_tabl_ntb_before_split\empty
+ \glet\m_tabl_ntb_after_split \empty
+ \glet\m_tabl_ntb_same_page \empty}
\def\tabl_ntb_prelocate_error
{\writestatus\m!TABLE{fatal error: use \string\prelocateTBLrows\space to increase table memory (now: \the\c_tabl_prelocated_rows)}}
diff --git a/tex/context/base/mkiv/tabl-tab.mkiv b/tex/context/base/mkiv/tabl-tab.mkiv
index a7a1572d5..244ead530 100644
--- a/tex/context/base/mkiv/tabl-tab.mkiv
+++ b/tex/context/base/mkiv/tabl-tab.mkiv
@@ -928,7 +928,7 @@
\global\c_tabl_table_n_of_vrules\plusone
\unskip
\fi
- \global\let\m_tabl_table_vrule_color\empty
+ \glet\m_tabl_table_vrule_color\empty
\hfil
\aligntab}
@@ -1370,8 +1370,8 @@
{\tabl_tables_chuck_auto_row % before the tail, else noalign problem
\tabl_table_insert_tail
\starttablenoalign
- \global\let\tabl_table_head\empty
- \global\let\tabl_table_tail\empty
+ \glet\tabl_table_head\empty
+ \glet\tabl_table_tail\empty
\stoptablenoalign
\tabl_table_finish
\ifx\p_tabl_table_frame\empty
@@ -1481,7 +1481,7 @@
\tabl_table_restart
% \starttablenoalign
% \globalpushmacro\simpletableHL
-% \global\let\simpletableHL\doverysimpletableHL
+% \glet\simpletableHL\doverysimpletableHL
% \stoptablenoalign
\tabl_table_insert_head
\ifsplittables \ifconditional \c_tabl_table_repeat_tail
@@ -1593,8 +1593,8 @@
\egroup
\dontcomplain
\tabl_table_split_box\tablecontentbox
- \global\let\tabl_table_head\empty % new here
- \global\let\tabl_table_tail\empty % new here
+ \glet\tabl_table_head\empty % new here
+ \glet\tabl_table_tail\empty % new here
\flushnotes
\egroup}
@@ -1914,7 +1914,7 @@
\dosingleempty\table_tabl_VL_indeed}
\def\table_tabl_VL_indeed[#1]%
- {\global\let\m_tabl_table_vrule_color\empty
+ {\glet\m_tabl_table_vrule_color\empty
\global\c_tabl_table_vrule_thickness_factor\m_tabl_table_VLwidth\relax
\iffirstargument
\rawprocesscommalist[#1]\tabl_table_vrulecommand
@@ -1961,7 +1961,7 @@
\bgroup
\global\c_tabl_table_hrule_thickness_factor\m_tabl_table_HLheight\relax
\iffirstargument
- \global\let\m_tabl_table_hrule_color\empty
+ \glet\m_tabl_table_hrule_color\empty
\rawprocesscommalist[#1]\tabl_table_hrulecommand
\ifx\m_tabl_table_hrule_color\empty\else
\switchtocolor[\m_tabl_table_hrule_color]%
@@ -2083,7 +2083,7 @@
\global\c_tabl_table_hrule_thickness_factor\m_tabl_table_HLheight\relax
\global\c_tabl_table_drule_span\zerocount
\iffirstargument
- \global\let\m_tabl_table_hrule_color\empty
+ \glet\m_tabl_table_hrule_color\empty
\rawprocesscommalist[#1]\tabl_table_drulecommand
% \ifx\m_tabl_table_hrule_color\empty\else
% \switchtocolor[\m_tabl_table_hrule_color]% see *DL*
diff --git a/tex/context/base/mkiv/tabl-tbl.mkiv b/tex/context/base/mkiv/tabl-tbl.mkiv
index 6384b5a61..e274b7185 100644
--- a/tex/context/base/mkiv/tabl-tbl.mkiv
+++ b/tex/context/base/mkiv/tabl-tbl.mkiv
@@ -369,8 +369,8 @@
\ifx\m_tabl_tabulate_color_local\empty
\xdef\m_tabl_tabulate_color{#1}%
\else
- \global\let\m_tabl_tabulate_color\m_tabl_tabulate_color_local
- \global\let\m_tabl_tabulate_color_local\empty
+ \glet\m_tabl_tabulate_color\m_tabl_tabulate_color_local
+ \glet\m_tabl_tabulate_color_local\empty
\fi
\ifcase\c_tabl_tabulate_localcolorspan
\global\c_tabl_tabulate_colorspan#2\relax
@@ -396,8 +396,8 @@
\ifx\m_tabl_tabulate_vrule_color_local\empty
\xdef\m_tabl_tabulate_vrule_color{#1}%
\else
- \global\let\m_tabl_tabulate_vrule_color\m_tabl_tabulate_vrule_color_local
- \global\let\m_tabl_tabulate_vrule_color_local\empty
+ \glet\m_tabl_tabulate_vrule_color\m_tabl_tabulate_vrule_color_local
+ \glet\m_tabl_tabulate_vrule_color_local\empty
\fi}
\let\tabl_tabulate_check_local_color \gobbletwoarguments
@@ -719,6 +719,28 @@
\fi
\tabl_tabulate_set_preamble}
+% faster but seldom used
+%
+% \installcorenamespace{tabulatewidth}
+%
+% \setvalue{\??tabulatewidth\v!fit }{\c_tabl_tabulate_modus\plusthree}
+% \setvalue{\??tabulatewidth\v!fixed}{\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_nopbreak}
+% \setvalue{\??tabulatewidth\v!auto }{\c_tabl_tabulate_modus\plusthree\settrue\c_tabl_tabulate_reshape}
+%
+% \def\tabl_tabulate_set_width_step#1%
+% {\ifcsname\??tabulatewidth#1\endcsname
+% \lastnamedcs
+% \else
+% \d_tabl_tabulate_width#1\relax
+% \fi}
+%
+% \def\tabl_tabulate_set_width_indeed(#1)%
+% {\rawprocesscommacommand[#1]\tabl_tabulate_set_width_step
+% \ifconditional\c_tabl_tabulate_pwidth_set
+% \global\advance\d_tabl_tabulate_width_p\d_tabl_tabulate_width % accumulated parwidth
+% \fi
+% \tabl_tabulate_set_preamble}
+%
\def\tabl_tabulate_set_raggedright {\ifnum\c_tabl_tabulate_type=\plusone \else\raggedright \fi}
\def\tabl_tabulate_set_raggedcenter{\ifnum\c_tabl_tabulate_type=\plusone \else\raggedcenter\fi}
\def\tabl_tabulate_set_raggedleft {\ifnum\c_tabl_tabulate_type=\plusone \else\raggedleft \fi}
@@ -787,10 +809,10 @@
\t_tabl_tabulate_emath\emptytoks
\t_tabl_tabulate_font\emptytoks
\t_tabl_tabulate_settings\emptytoks
- \global\let\m_tabl_tabulate_alignment\empty
- \global\let\m_tabl_tabulate_color\empty
- \global\let\m_tabl_tabulate_text_color\empty
- \global\let\m_tabl_tabulate_vrule_color\empty
+ \glet\m_tabl_tabulate_alignment\empty
+ \glet\m_tabl_tabulate_color\empty
+ \glet\m_tabl_tabulate_text_color\empty
+ \glet\m_tabl_tabulate_vrule_color\empty
\global\c_tabl_tabulate_colorspan\zerocount
\global\setfalse\c_tabl_auto_align_mode
\global\advance\c_tabl_tabulate_columns\plusone
@@ -814,8 +836,8 @@
\fi}
\def\tabl_tabulate_set_last_entry#1% rulespec
- {\global\let\m_tabl_tabulate_color\empty
- \global\let\m_tabl_tabulate_vrule_color\empty
+ {\glet\m_tabl_tabulate_color\empty
+ \glet\m_tabl_tabulate_vrule_color\empty
\edef\currenttabulationtrulespec{#1}%
\ifx\currenttabulationtrulespec\empty
\global\d_tabl_tabulate_vrulethickness\zeropoint
@@ -1191,9 +1213,12 @@
\expandafter\tabl_start_regular_one
\fi}
+\def\tabl_default_format{|l|p|}
+
\def\tabl_start_regular_one[#1][#2]%
{\doifelseassignment{#1}
- {\setupcurrenttabulation[\c!format={|l|p|},#1]}
+ {\lettabulationparameter\c!format\tabl_default_format
+ \setupcurrenttabulation[#1]}
{\def\p_format{#1}%
\ifx\p_format\empty
\def\p_format{|l|p|}%
@@ -1204,7 +1229,7 @@
\def\tabl_start_regular_two[#1][#2]%
{\def\p_format{#1}%
\ifx\p_format\empty
- \def\p_format{|l|p|}%
+ \let\p_format\tabl_default_format
\fi
\lettabulationparameter\c!format\p_format
\setupcurrenttabulation[#2]%
@@ -1392,12 +1417,12 @@
\let\m_tabl_tabulate_blank_default \empty
\appendtoks
- \global\let\m_tabl_tabulate_color_previous \empty
- \global\let\m_tabl_tabulate_color \empty
- \global\let\m_tabl_tabulate_text_color \empty
- \global\let\m_tabl_tabulate_color_local \empty
- \global\let\m_tabl_tabulate_vrule_color \empty
- \global\let\m_tabl_tabulate_vrule_color_local \empty
+ \glet\m_tabl_tabulate_color_previous \empty
+ \glet\m_tabl_tabulate_color \empty
+ \glet\m_tabl_tabulate_text_color \empty
+ \glet\m_tabl_tabulate_color_local \empty
+ \glet\m_tabl_tabulate_vrule_color \empty
+ \glet\m_tabl_tabulate_vrule_color_local \empty
\global \d_tabl_tabulate_vrulethickness_local\zeropoint
\to \t_tabl_tabulate_every_row
@@ -1489,7 +1514,7 @@
% ruled columns
\def\tabl_tabulate_column_vruled_preset
- {\global\let\m_tabl_tabulate_vrule_color_local\m_tabl_tabulate_vrule_color_default
+ {\glet\m_tabl_tabulate_vrule_color_local\m_tabl_tabulate_vrule_color_default
\global\d_tabl_tabulate_vrulethickness_local\d_tabl_tabulate_vrulethickness_default}
\def\tabl_tabulate_column_vruled#1#2%
@@ -1532,7 +1557,7 @@
\global\c_tabl_tabulate_max_vrulecolumn\zerocount}
\def\tabl_tabulate_vrule_reset_step % undefined or relax
- {\global\expandafter\let\csname\??tabulatevrule\the\fastloopindex\endcsname\undefined}
+ {\expandafter\glet\csname\??tabulatevrule\the\fastloopindex\endcsname\undefined}
\appendtoks
\tabl_tabulate_vrule_reset
@@ -1625,12 +1650,12 @@
\egroup}
\def\tabl_tabulate_hrule_spec_ignore#1%
- {%\global\let\currenttabulationlocalhrulecolor\empty
+ {%\glet\currenttabulationlocalhrulecolor\empty
%\global\d_tabl_tabulate_hrulethickness_local\d_tabl_tabulate_hrulethickness_default
\doifelsefastoptionalcheck#1#1}
\def\tabl_tabulate_hrule_spec_pickup#1%
- {\global\let\currenttabulationlocalhrulecolor\m_tabl_tabulate_hrule_color_default
+ {\glet\currenttabulationlocalhrulecolor\m_tabl_tabulate_hrule_color_default
\global\d_tabl_tabulate_hrulethickness_local\d_tabl_tabulate_hrulethickness_default
\doifelsefastoptionalcheck{\tabl_tabulate_hrule_preset#1}#1}
@@ -1706,13 +1731,13 @@
\unexpanded\def\tabl_tabulate_color_set#1% we could store the attributes at the cost of a lua call
{\begingroup
\clf_enablebackgroundalign % was \node_backgrounds_align_initialize
- \global\let\tabl_tabulate_color_repeat\tabl_tabulate_color_repeat_second
+ \glet\tabl_tabulate_color_repeat\tabl_tabulate_color_repeat_second
\global\settrue\c_tabl_tabulate_has_colors
\ifnum\c_tabl_tabulate_column>\c_tabl_tabulate_max_colorcolumn
\global\c_tabl_tabulate_max_colorcolumn\c_tabl_tabulate_column
\fi
- \global\expandafter\xdef\csname\??tabulatecolor\the\c_tabl_tabulate_column\endcsname{#1}%
- \hbox \thealignbackgroundcolorattr{#1}{}% pack ?
+ \expandafter\xdef\csname\??tabulatecolor\the\c_tabl_tabulate_column\endcsname{#1}%
+ \hpack \thealignbackgroundcolorattr{#1}{}% pack ?
\endgroup}
\def\tabl_tabulate_color_repeat_second % for split off lines
@@ -1720,7 +1745,7 @@
\scratchcounter\numexpr\c_tabl_tabulate_column-\plusone\relax % ugly !
\ifcsname\??tabulatecolor\the\scratchcounter\endcsname
%\hbox \thealignbackgroundcolorattr{\csname\??tabulatecolor\the\scratchcounter\endcsname}{}% pack ?
- \hbox \thealignbackgroundcolorattr{\lastnamedcs}{}% pack ?
+ \hpack \thealignbackgroundcolorattr{\lastnamedcs}{}% pack ?
\fi
\endgroup}
@@ -1742,7 +1767,7 @@
{\dofastloopcs\c_tabl_tabulate_max_colorcolumn\tabl_tabulate_color_reset_step}
\def\tabl_tabulate_color_reset_step % undefined or empty?
- {\global\expandafter\let\csname\??tabulatecolor\number\fastloopindex\endcsname\undefined}
+ {\expandafter\glet\csname\??tabulatecolor\number\fastloopindex\endcsname\undefined}
\appendtoks
\tabl_tabulate_color_reset
@@ -1791,17 +1816,20 @@
\tabl_tabulate_register_par_options
\to \t_tabl_tabulate_every_row
+\def\tabl_tabulate_flush_indent_indeed
+ {\hbox to \d_tabl_tabulate_indent % pack ?
+ {% we now have a local hsize, and since we want to
+ % register positional info (i.e. real hsizes) we
+ % need to reconstitute the original hsize
+ \advance\hsize\d_tabl_tabulate_indent
+ % this is indeed rather messy and took a few hours
+ % to dis/uncover
+ \the\t_tabl_tabulate_every_row
+ \hss}}
+
\def\tabl_tabulate_flush_indent
{\ifnum\c_tabl_tabulate_column=\zerocount
- \hbox to \d_tabl_tabulate_indent % pack ?
- {% we now have a local hsize, and since we want to
- % register positional info (i.e. real hsizes) we
- % need to reconstitute the original hsize
- \advance\hsize\d_tabl_tabulate_indent
- % this is indeed rather messy and took a few hours
- % to dis/uncover
- \the\t_tabl_tabulate_every_row
- \hss}%
+ \tabl_tabulate_flush_indent_indeed
\fi}
\def\tabl_tabulate_digits{\digits}
@@ -1820,7 +1848,7 @@
\unexpanded\def\tabl_tabulate_bskip_first {\setbox\b_tabl_tabulate\vbox\bgroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_nop}
\unexpanded\def\tabl_tabulate_eskip_first {\par\egroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_yes}
-\unexpanded\def\tabl_tabulate_xbskip_first{\hbox\bgroup\vbox\bgroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_nop}
+\unexpanded\def\tabl_tabulate_xbskip_first{\hpack\bgroup\vbox\bgroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_nop}
\unexpanded\def\tabl_tabulate_xeskip_first{\par\egroup\egroup\glet\tabl_tabulate_hook\tabl_tabulate_hook_yes}
\let\tabl_tabulate_bbskip\relax
@@ -1851,12 +1879,12 @@
% \def\tabl_tabulate_break_state_set
% {%\writestatus{SET}{\the\c_tabl_tabulate_noflines}%
-% \global\expandafter\let\csname\??tabulatenobreak\the\c_tabl_tabulate_noflines\endcsname\conditionaltrue}
+% \expandafter\glet\csname\??tabulatenobreak\the\c_tabl_tabulate_noflines\endcsname\conditionaltrue}
%
% \def\tabl_tabulate_break_state_reset
% {\ifcsname\??tabulatenobreak\the\c_tabl_tabulate_noflines\endcsname
% %\writestatus{RESET}{\the\c_tabl_tabulate_noflines}%
-% \global\expandafter\let\csname\??tabulatenobreak\the\c_tabl_tabulate_noflines\endcsname\undefined
+% \expandafter\glet\csname\??tabulatenobreak\the\c_tabl_tabulate_noflines\endcsname\undefined
% \fi}
%
% \def\tabl_tabulate_break_state_allowbreak
@@ -1932,8 +1960,6 @@
%D
%D \typebuffer \getbuffer
-\let\NI\relax
-
\unexpanded\def\tabl_tabulate_NI_first{\doifelsefastoptionalcheck\tabl_tbl_NI_yes\tabl_tbl_NI_nop}
\def\tabl_tbl_NI_yes[#1]{\NC \itemtag[#1]\NC}
@@ -2224,9 +2250,9 @@
% \tabl_tabulate_break_no
% \ifx\dotabulateautoline\dotabulatelinerule\kern-\lineheight\fi
% \ifnum\noftabulatelines=\totalnoftabulatelines
-% \@EA\dotabulatenobreak
+% \expandafter\dotabulatenobreak
% \else
-% \@EA\tabl_tabulate_break_allow
+% \expandafter\tabl_tabulate_break_allow
% \fi
% \stoptabulatenoalign
% \dotabulateautoline
diff --git a/tex/context/base/mkiv/toks-ini.lua b/tex/context/base/mkiv/toks-ini.lua
index 15e5df267..481858971 100644
--- a/tex/context/base/mkiv/toks-ini.lua
+++ b/tex/context/base/mkiv/toks-ini.lua
@@ -69,6 +69,8 @@ local scan_token = token.scan_token
local scan_word = token.scan_word
local scan_number = token.scan_number
local scan_csname = token.scan_csname
+local scan_real = token.scan_real
+local scan_float = token.scan_float
local get_next = token.get_next
@@ -240,6 +242,8 @@ tokens.scanners = { -- these expand
glue = scan_glue,
skip = scan_glue,
integer = scan_int,
+ real = scan_real,
+ float = scan_float,
count = scan_int,
string = scan_string,
argument = scan_argument,
diff --git a/tex/context/base/mkiv/trac-vis.lua b/tex/context/base/mkiv/trac-vis.lua
index a9df0a91d..5c92a80f8 100644
--- a/tex/context/base/mkiv/trac-vis.lua
+++ b/tex/context/base/mkiv/trac-vis.lua
@@ -777,7 +777,7 @@ local ruledbox do
)
--
setlisttransparency(info,c_text)
- -- info = new_hlist(info)
+ info = new_hlist(info) -- important
--
setattr(info,a_layer,layer)
if vertical then
diff --git a/tex/context/base/mkiv/trac-vis.mkiv b/tex/context/base/mkiv/trac-vis.mkiv
index b7e506faf..570e6a7c7 100644
--- a/tex/context/base/mkiv/trac-vis.mkiv
+++ b/tex/context/base/mkiv/trac-vis.mkiv
@@ -76,7 +76,7 @@
\to \everyshipout
\appendtoks
- \global\let\syst_visualizers_speedup\relax
+ \glet\syst_visualizers_speedup\relax
\to \t_syst_visualizers_optimize
\def\syst_visualizers_speedup{\the\t_syst_visualizers_optimize}
diff --git a/tex/context/base/mkiv/type-ini.mkvi b/tex/context/base/mkiv/type-ini.mkvi
index cb9e5f160..ea8260ecd 100644
--- a/tex/context/base/mkiv/type-ini.mkvi
+++ b/tex/context/base/mkiv/type-ini.mkvi
@@ -45,18 +45,30 @@
\let\currenttypescripts\empty
\let\currenttypefile \empty
+\installmacrostack\currenttypefile
+
\let\typescriptone \empty % public, used in typescripts
\let\typescripttwo \empty % public, used in typescripts
\let\typescriptthree\empty % public, used in typescripts
+\installmacrostack\typescriptone
+\installmacrostack\typescripttwo
+\installmacrostack\typescriptthree
+
\let\fontclassstyle \empty
+\installmacrostack\fontclassstyle
+
\let\m_font_typescripts_one \empty
\let\m_font_typescripts_two \empty
\let\m_font_typescripts_three\empty
\let\m_font_typescripts_check\empty
\let\m_font_typescripts_match\empty
+\installmacrostack\m_font_typescripts_one
+\installmacrostack\m_font_typescripts_two
+\installmacrostack\m_font_typescripts_three
+
\let\t_font_typescripts\relax % uses as synonym
\installcorenamespace{typescriptcache}
@@ -75,6 +87,9 @@
\let\typescriptmethod\plusone % 1: empty==all==true 2: empty==false
\let\typescriptstate \plustwo % 1: process 2: store
+\installmacrostack\typescriptmethod
+\installmacrostack\typescriptstate
+
\unexpanded\def\starttypescriptcollection
{\dosingleempty\font_typescripts_collection_start}
@@ -95,19 +110,21 @@
\def\font_typescripts_use_one{\let\typescriptmethod\plusone\font_typescripts_use}
\def\font_typescripts_use_two{\let\typescriptmethod\plustwo\font_typescripts_use}
+\installmacrostack\stoptypescript
+
\unexpanded\def\font_typescripts_use[#one][#two][#three]%
- {\pushmacro\m_font_typescripts_one
- \pushmacro\m_font_typescripts_two
- \pushmacro\m_font_typescripts_three
+ {\push_macro_m_font_typescripts_one
+ \push_macro_m_font_typescripts_two
+ \push_macro_m_font_typescripts_three
\edef\m_font_typescripts_one {\truetypescript{#one}}%
\edef\m_font_typescripts_two {\truetypescript{#two}}%
\edef\m_font_typescripts_three{\truetypescript{#three}}%
- \pushmacro\typescriptone
- \pushmacro\typescripttwo
- \pushmacro\typescriptthree
- \pushmacro\typescriptmethod
- \pushmacro\typescriptstate
- \pushmacro\stoptypescript
+ \push_macro_typescriptone
+ \push_macro_typescripttwo
+ \push_macro_typescriptthree
+ \push_macro_typescriptmethod
+ \push_macro_typescriptstate
+ \push_macro_stoptypescript
\typescriptfoundfalse
\let\typescriptstate\plusone % why
\iftracetypescripts
@@ -119,15 +136,15 @@
\font_typescripts_use_display
\fi
\setfalse\c_font_typescripts_first_pass
- \popmacro\stoptypescript
- \popmacro\typescriptstate
- \popmacro\typescriptmethod
- \popmacro\typescriptthree
- \popmacro\typescripttwo
- \popmacro\typescriptone
- \popmacro\m_font_typescripts_three
- \popmacro\m_font_typescripts_two
- \popmacro\m_font_typescripts_one}
+ \pop_macro_stoptypescript
+ \pop_macro_typescriptstate
+ \pop_macro_typescriptmethod
+ \pop_macro_typescriptthree
+ \pop_macro_typescripttwo
+ \pop_macro_typescriptone
+ \pop_macro_m_font_typescripts_three
+ \pop_macro_m_font_typescripts_two
+ \pop_macro_m_font_typescripts_one}
\def\font_typescripts_use_display
{\processcommacommand[\typescriptfiles]\font_typescripts_load_file
@@ -170,10 +187,10 @@
% 1 then, it doesn't get stored without doing that explicitly
\unexpanded\def\loadtypescriptfile[#1]%
- {\pushmacro\typescriptstate
+ {\push_macro_typescriptstate
\let\typescriptstate\plustwo % assumes 2 at the outer level
\clf_loadtypescriptfile{#1}%
- \popmacro\typescriptstate}
+ \pop_macro_typescriptstate}
\unexpanded\def\loadfoundtypescriptfile#1%
{\startreadingfile
@@ -207,14 +224,14 @@
\def\font_typescripts_load_file#filename%
{\setfalse\c_font_typescripts_quit
- \pushmacro\currenttypefile
+ \push_macro_currenttypefile
\def\currenttypefile{#filename}%
\ifconditional\c_font_typescripts_preload
\font_typescript_process_typescript_file_and_store
\else
\font_typescript_process_typescript_file
\fi
- \popmacro\currenttypefile
+ \pop_macro_currenttypefile
\ifconditional\c_font_typescripts_quit
\quitcommalist
\setfalse\c_font_typescripts_quit
@@ -343,10 +360,10 @@
\let\font_typescripts_start_process_again_three\font_typescripts_start_process_yes
\def\font_typescripts_start_process_indeed
- {\pushmacro\fontclass}
+ {\push_macro_fontclass}
\unexpanded\def\stoptypescript
- {\popmacro\fontclass}
+ {\pop_macro_fontclass}
\def\font_typescripts_check#asked#target#followup[#value]% script use value next
{\donefalse
@@ -520,8 +537,8 @@
\let\@@tsdirection \empty
\let\@@tsdesignsize\empty
\geteparameters[\??ts][#settings]% todo raw
- \pushmacro\fontclass
- \pushmacro\fontclassstyle
+ \push_macro_fontclass
+ \push_macro_fontclassstyle
\setcurrentfontclass{#name}%
\savefontclassparameters{#style}\@@tsrscale\@@tsfeatures\@@tsfallbacks\@@tsgoodies\@@tsdesignsize\@@tsdirection
\the\everybeforedefinetypeface}
@@ -535,8 +552,8 @@
\def\font_typefaces_defining_stop
{\the\everyafterdefinetypeface
- \popmacro\fontclassstyle
- \popmacro\fontclass}
+ \pop_macro_fontclassstyle
+ \pop_macro_fontclass}
\def\dofastdefinetypeface#name#style#fontshape#fontsize#settings% called from the lua end (via case d)
{\font_typefaces_define_indeed[#name][#style]%
@@ -596,7 +613,7 @@
{\doifelsenothing{#styles}
{\font_typescripts_inherit_indeed[#name][\s!rm,\s!ss,\s!tt,\s!mm][\fontclass]}
{\doifnot{#name}{#parentclass}
- {\global\let\font_typescripts_inherit_check\font_typescripts_inherit_check_indeed
+ {\glet\font_typescripts_inherit_check\font_typescripts_inherit_check_indeed
\def\font_typescripts_inherit_check_step#style{\setevalue{\??typescriptinheritances#name:#style}{#parentclass}}%
\processcommalist[#styles]\font_typescripts_inherit_check_step}}}
diff --git a/tex/context/base/mkiv/typo-cap.lua b/tex/context/base/mkiv/typo-cap.lua
index 4383dc6b9..3937fb8ca 100644
--- a/tex/context/base/mkiv/typo-cap.lua
+++ b/tex/context/base/mkiv/typo-cap.lua
@@ -97,19 +97,6 @@ local function get(a)
extract(a, 0, 8) -- run
end
--- local function get(a)
--- return
--- (a >> 8) & ~(-1 << 8), -- & 0x0FF -- tag
--- (a >> 16) & ~(-1 << 12), -- & 0xFFF -- font
--- (a >> 0) & ~(-1 << 8) -- & 0x0FF -- run
--- end
-
--- print(get(set( 1, 0)))
--- print(get(set( 1, 99)))
--- print(get(set( 2, 96)))
--- print(get(set( 30, 922)))
--- print(get(set(250,4000)))
-
-- a previous implementation used char(0) as placeholder for the larger font, so we needed
-- to remove it before it can do further harm ... that was too tricky as we use char 0 for
-- other cases too
diff --git a/tex/context/base/mkiv/typo-del.mkiv b/tex/context/base/mkiv/typo-del.mkiv
index 7b222a851..0770be5af 100644
--- a/tex/context/base/mkiv/typo-del.mkiv
+++ b/tex/context/base/mkiv/typo-del.mkiv
@@ -278,6 +278,8 @@
\let\currentdelimitedtext\s!unknown
+\installglobalmacrostack\currentdelimitedtext
+
\let\delimitedtextlevel\!!zerocount
\def\c_typo_delimited_nesting{\csname\??delimitedtextlevel\currentparentdelimitedtext\endcsname}
@@ -302,6 +304,8 @@
\let\currentdelimitedlanguage\empty
+\installglobalmacrostack\currentdelimitedlanguage
+
\def\typo_delimited_set_language_nop
{\setusedlanguage{\delimitedtextparameter\c!language}}
@@ -334,8 +338,8 @@
\let\m_delimited_argument\empty}
\def\typo_delimited_push#1#2%
- {\globalpushmacro\currentdelimitedtext % can we combine these two
- \globalpushmacro\currentdelimitedlanguage % the language used for hyphenation
+ {\push_macro_currentdelimitedtext % can we combine these two
+ \push_macro_currentdelimitedlanguage % the language used for hyphenation
\edef\currentdelimitedtext{#1}%
\edef\m_delimited_argument{#2}%
\ifx\m_delimited_argument\empty
@@ -351,8 +355,8 @@
\def\typo_delimited_pop
{\global\advance\c_typo_delimited_nesting\minusone
- \globalpopmacro\currentdelimitedlanguage
- \globalpopmacro\currentdelimitedtext}
+ \pop_macro_currentdelimitedlanguage
+ \pop_macro_currentdelimitedtext}
\installcorenamespace{delimitedtext}
\installcorenamespace{delimitedtextlevel}
@@ -494,7 +498,7 @@
\let\typo_delimited_stop_par_indeed\stopnarrower
\fi
% so far
- \pushmacro\checkindentation
+ \push_macro_checkindentation
\useindentingparameter\delimitedtextparameter
%
\begingroup
@@ -516,7 +520,7 @@
{\typo_delimited_stop_content
\rightdelimitedtextmark
\carryoverpar\endgroup % new per 2013-01-21 ... please left floats
- \popmacro\checkindentation
+ \pop_macro_checkindentation
\typo_delimited_stop_par_indeed
\delimitedtextparameter\c!after
\edef\p_delimited_spaceafter{\delimitedtextparameter\c!spaceafter}%
diff --git a/tex/context/base/mkiv/typo-rub.mkiv b/tex/context/base/mkiv/typo-rub.mkiv
index d51c53aa4..cc1571ad7 100644
--- a/tex/context/base/mkiv/typo-rub.mkiv
+++ b/tex/context/base/mkiv/typo-rub.mkiv
@@ -26,6 +26,7 @@
\installcorenamespace {ruby}
\installcorenamespace {rubyanalyze}
\installcorenamespace {rubyplacement}
+\installcorenamespace {rubynumber}
\installcommandhandler \??ruby {ruby} \??ruby
@@ -135,6 +136,14 @@
\c!hoffset=\zeropoint,
\c!voffset=-2\exheight]
+%D Experiment too:
+
+\unexpanded\def\numberedruby[#1]#2%
+ {\doifnotcounter{\??rubynumber#1}{\definecounter[\??rubynumber#1]\setcounter[\??rubynumber#1][1]}%
+ \ruby[#1]{#2}{\convertedcounter[\??rubynumber#1]}%
+ \incrementcounter[\??rubynumber#1]%
+ \relax}
+
\protect \endinput
% \usemodule[art-01]\setupbodyfont[dejavu,12pt]
diff --git a/tex/context/base/mkiv/typo-scr.mkiv b/tex/context/base/mkiv/typo-scr.mkiv
index d4881b80a..0dfd111ae 100644
--- a/tex/context/base/mkiv/typo-scr.mkiv
+++ b/tex/context/base/mkiv/typo-scr.mkiv
@@ -142,8 +142,8 @@
\unexpanded\def\typo_scripts_lowhigh_indeed[#1]#2#3% todo: align .. [#1] is compatible hack
{\dostarttagged\t!subsup\currentlowhigh
- \setbox\plusfour\hbox{\typo_scripts_lowhigh_low_high\lower\c!down\t!sub{#2}}%
- \setbox\plussix \hbox{\typo_scripts_lowhigh_low_high\raise\c!up \t!sup{#3}}%
+ \setbox\plusfour\hpack{\typo_scripts_lowhigh_low_high\lower\c!down\t!sub{#2}}%
+ \setbox\plussix \hpack{\typo_scripts_lowhigh_low_high\raise\c!up \t!sup{#3}}%
\doif{#1}{\v!left}
{\ifdim\wd\plusfour<\wd\plussix
\setbox\plusfour\hpack to \wd\plussix {\hss\box\plusfour}%
@@ -166,7 +166,7 @@
{\dontleavehmode
\begingroup
\kern\lowhighparameter\c!distance\relax
- \setbox\scratchbox\hbox\bgroup
+ \setbox\scratchbox\hpack\bgroup
#1\lowhighparameter#2\hbox\bgroup
\ifx\fontsize\empty
\ifmmode
diff --git a/tex/context/base/mkiv/util-tab.lua b/tex/context/base/mkiv/util-tab.lua
index 1b069e2ae..f395f43de 100644
--- a/tex/context/base/mkiv/util-tab.lua
+++ b/tex/context/base/mkiv/util-tab.lua
@@ -819,3 +819,4 @@ if setinspector then
end
end)
end
+
diff --git a/tex/context/interface/mkii/keys-de.xml b/tex/context/interface/mkii/keys-de.xml
index f399f128a..9b742d4b1 100644
--- a/tex/context/interface/mkii/keys-de.xml
+++ b/tex/context/interface/mkii/keys-de.xml
@@ -1280,6 +1280,7 @@
<cd:constant name='vcompact' value='vcompact'/>
<cd:constant name='vector' value='vector'/>
<cd:constant name='veroffset' value='kopfoffset'/>
+ <cd:constant name='vfactor' value='vfaktor'/>
<cd:constant name='vfil' value='vfil'/>
<cd:constant name='viewerprefix' value='viewerprefix'/>
<cd:constant name='voffset' value='voffset'/>
diff --git a/tex/context/interface/mkii/keys-ro.xml b/tex/context/interface/mkii/keys-ro.xml
index c0308086c..b255ae87a 100644
--- a/tex/context/interface/mkii/keys-ro.xml
+++ b/tex/context/interface/mkii/keys-ro.xml
@@ -1280,6 +1280,7 @@
<cd:constant name='vcompact' value='vcompact'/>
<cd:constant name='vector' value='vector'/>
<cd:constant name='veroffset' value='veroffset'/>
+ <cd:constant name='vfactor' value='vfactor'/>
<cd:constant name='vfil' value='vfil'/>
<cd:constant name='viewerprefix' value='viewerprefix'/>
<cd:constant name='voffset' value='voffset'/>
diff --git a/tex/context/interface/mkiv/context-en.xml b/tex/context/interface/mkiv/context-en.xml
index 1d66d20df..a1daf81ee 100644
--- a/tex/context/interface/mkiv/context-en.xml
+++ b/tex/context/interface/mkiv/context-en.xml
@@ -5658,6 +5658,16 @@
<cd:csname/>
</cd:arguments>
</cd:command>
+ <cd:command file="mult-aux.mkiv" level="system" name="installmacrostack">
+ <cd:arguments>
+ <cd:csname/>
+ </cd:arguments>
+ </cd:command>
+ <cd:command file="mult-aux.mkiv" level="system" name="installglobalmacrostack">
+ <cd:arguments>
+ <cd:csname/>
+ </cd:arguments>
+ </cd:command>
</cd:interface>
<cd:interface file="i-comment.xml">
<cd:command category="pdf" file="scrn-wid.mkvi" level="style" name="definecomment">
@@ -15233,10 +15243,12 @@
<cd:command category="whitespace" file="spac-hor.mkiv" level="style" name="thinspace"/>
<cd:command category="whitespace" file="spac-hor.mkiv" level="style" name="negthinspace"/>
<cd:command category="whitespace" file="spac-hor.mkiv" level="style" name="enspace"/>
+ <cd:command category="whitespace" file="spac-hor.mkiv" level="style" name="negenspace"/>
<cd:command category="whitespace" file="spac-hor.mkiv" level="style" name="enskip"/>
<cd:command category="whitespace" file="spac-hor.mkiv" level="style" name="quad"/>
<cd:command category="whitespace" file="spac-hor.mkiv" level="style" name="qquad"/>
<cd:command category="whitespace" file="spac-hor.mkiv" level="style" name="emspace"/>
+ <cd:command category="whitespace" file="spac-hor.mkiv" level="style" name="negemspace"/>
<cd:command category="whitespace" file="spac-hor.mkiv" level="system" name="dotfskip">
<cd:arguments>
<cd:keywords delimiters="braces">
@@ -16501,6 +16513,7 @@
<cd:constant type="paper"/>
<cd:constant type="attachment"/>
<cd:constant type="layer"/>
+ <cd:constant type="title"/>
</cd:parameter>
<cd:parameter name="copies">
<cd:constant type="cd:number"/>
@@ -33870,6 +33883,88 @@
</cd:arguments>
</cd:command>
</cd:interface>
+ <cd:interface file="i-ruby.xml">
+ <cd:command category="fonts" file="typo-rub.mkiv" level="style" name="defineruby">
+ <cd:arguments>
+ <cd:keywords>
+ <cd:constant type="cd:name"/>
+ </cd:keywords>
+ <cd:keywords optional="yes">
+ <cd:constant type="cd:name"/>
+ </cd:keywords>
+ <cd:assignments list="yes" optional="yes">
+ <cd:inherit name="setupruby"/>
+ </cd:assignments>
+ </cd:arguments>
+ </cd:command>
+ <cd:command category="fonts" file="typo-rub.mkiv" level="style" name="setupruby">
+ <cd:arguments>
+ <cd:keywords list="yes" optional="yes">
+ <cd:constant type="cd:name"/>
+ </cd:keywords>
+ <cd:assignments list="yes">
+ <cd:parameter name="location">
+ <cd:constant default="yes" type="top"/>
+ <cd:constant type="left"/>
+ <cd:constant type="right"/>
+ </cd:parameter>
+ <cd:parameter name="align">
+ <cd:constant type="auto"/>
+ <cd:constant type="flushleft"/>
+ <cd:constant default="yes" type="middle"/>
+ <cd:constant type="flushright"/>
+ </cd:parameter>
+ <cd:parameter name="stretch">
+ <cd:constant type="yes"/>
+ <cd:constant default="yes" type="no"/>
+ </cd:parameter>
+ <cd:parameter name="hoffset">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="voffset">
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="distance">
+ <cd:constant type="none"/>
+ <cd:constant type="cd:dimension"/>
+ </cd:parameter>
+ <cd:parameter name="left">
+ <cd:constant type="cd:command"/>
+ </cd:parameter>
+ <cd:parameter name="right">
+ <cd:constant type="cd:command"/>
+ </cd:parameter>
+ <cd:parameter name="style">
+ <cd:constant type="cd:style"/>
+ <cd:constant type="cd:command"/>
+ </cd:parameter>
+ <cd:parameter name="color">
+ <cd:constant type="cd:color"/>
+ </cd:parameter>
+ </cd:assignments>
+ </cd:arguments>
+ </cd:command>
+ <cd:command category="fonts" file="typo-rub.mkiv" level="document" name="ruby">
+ <cd:arguments>
+ <cd:keywords optional="yes">
+ <cd:constant type="cd:name"/>
+ </cd:keywords>
+ <cd:keywords delimiters="braces">
+ <cd:constant type="cd:text"/>
+ </cd:keywords>
+ <cd:keywords delimiters="braces">
+ <cd:constant type="cd:text"/>
+ </cd:keywords>
+ </cd:arguments>
+ </cd:command>
+ <cd:command category="fonts" file="typo-rub.mkiv" level="document" name="ruby" type="environment">
+ <cd:arguments>
+ <cd:keywords>
+ <cd:constant type="cd:name"/>
+ </cd:keywords>
+ </cd:arguments>
+ </cd:command>
+ </cd:interface>
<cd:interface file="i-scale.xml">
<cd:command category="graphics" file="grph-trf.mkiv" level="style" name="definescale">
<cd:arguments>
diff --git a/tex/context/interface/mkiv/i-commandhandler.xml b/tex/context/interface/mkiv/i-commandhandler.xml
index 40da525f3..6accac865 100644
--- a/tex/context/interface/mkiv/i-commandhandler.xml
+++ b/tex/context/interface/mkiv/i-commandhandler.xml
@@ -311,4 +311,16 @@
</cd:arguments>
</cd:command>
+ <cd:command name="installmacrostack" level="system" file="mult-aux.mkiv">
+ <cd:arguments>
+ <cd:csname/>
+ </cd:arguments>
+ </cd:command>
+
+ <cd:command name="installglobalmacrostack" level="system" file="mult-aux.mkiv">
+ <cd:arguments>
+ <cd:csname/>
+ </cd:arguments>
+ </cd:command>
+
</cd:interface>
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index 5668dc50a..77855e8c0 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-context.xml b/tex/context/interface/mkiv/i-context.xml
index 73bd3d4ae..a328b6772 100644
--- a/tex/context/interface/mkiv/i-context.xml
+++ b/tex/context/interface/mkiv/i-context.xml
@@ -188,6 +188,7 @@
<cd:interfacefile filename="i-renderingwindow.xml"/>
<cd:interfacefile filename="i-replacement.xml"/>
<cd:interfacefile filename="i-rotatation.xml"/>
+ <cd:interfacefile filename="i-ruby.xml"/>
<cd:interfacefile filename="i-scale.xml"/>
<cd:interfacefile filename="i-script.xml"/>
<cd:interfacefile filename="i-section.xml"/>
diff --git a/tex/context/interface/mkiv/i-hspace.xml b/tex/context/interface/mkiv/i-hspace.xml
index c1626e7b1..5926d864d 100644
--- a/tex/context/interface/mkiv/i-hspace.xml
+++ b/tex/context/interface/mkiv/i-hspace.xml
@@ -91,6 +91,7 @@
<cd:command name="negthinspace" level="style" category="whitespace" file="spac-hor.mkiv"/>
<cd:command name="enspace" level="style" category="whitespace" file="spac-hor.mkiv"/>
+ <cd:command name="negenspace" level="style" category="whitespace" file="spac-hor.mkiv"/>
<cd:command name="enskip" level="style" category="whitespace" file="spac-hor.mkiv"/>
@@ -99,6 +100,7 @@
<cd:command name="qquad" level="style" category="whitespace" file="spac-hor.mkiv"/>
<cd:command name="emspace" level="style" category="whitespace" file="spac-hor.mkiv"/>
+ <cd:command name="negemspace" level="style" category="whitespace" file="spac-hor.mkiv"/>
<cd:command name="dotfskip" level="system" category="whitespace" file="spac-hor.mkiv">
<cd:arguments>
@@ -162,4 +164,4 @@
</cd:arguments>
</cd:command>
-</cd:interface> \ No newline at end of file
+</cd:interface>
diff --git a/tex/context/interface/mkiv/i-interactionscreen.xml b/tex/context/interface/mkiv/i-interactionscreen.xml
index bf26cd962..7ead396b8 100644
--- a/tex/context/interface/mkiv/i-interactionscreen.xml
+++ b/tex/context/interface/mkiv/i-interactionscreen.xml
@@ -47,6 +47,7 @@
<cd:constant type="paper"/>
<cd:constant type="attachment"/>
<cd:constant type="layer"/>
+ <cd:constant type="title"/>
</cd:parameter>
<cd:parameter name="copies">
<cd:constant type="cd:number"/>
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index 40ebc7cd2..903c92bb2 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/context/modules/mkiv/m-oldfun.mkiv b/tex/context/modules/mkiv/m-oldfun.mkiv
index 3f2ec0263..7ec779c41 100644
--- a/tex/context/modules/mkiv/m-oldfun.mkiv
+++ b/tex/context/modules/mkiv/m-oldfun.mkiv
@@ -355,14 +355,14 @@
\ifdim\wd2=\zeropoint
\setbox0\emptybox
\setbox2\emptybox
- \@EA\grabfirstline
+ \expandafter\grabfirstline
\else\ifdim\wd2>\hsize
\hbox to \hsize{\strut\unhbox0}#2\egroup
\break##1\
\egroup
\else
\setbox0\box2
- \@EAEAEA\grabfirstline
+ \doubleexpandafter\grabfirstline
\fi\fi}%
\grabfirstline}
diff --git a/tex/context/modules/mkiv/m-oldnum.mkiv b/tex/context/modules/mkiv/m-oldnum.mkiv
index 382c56eb6..658c28051 100644
--- a/tex/context/modules/mkiv/m-oldnum.mkiv
+++ b/tex/context/modules/mkiv/m-oldnum.mkiv
@@ -210,7 +210,7 @@
\fi
\def\doscandigit#1%
- {\ifcase\skipdigit\@EA\hbox\else\@EA\hphantom\fi\bgroup
+ {\ifcase\skipdigit\expandafter\hbox\else\expandafter\hphantom\fi\bgroup
\mathematics % brr, needed because of stored punctuation
{\ifnum\digitinputmode=#1\relax
\ifcase\digitoutputmode
diff --git a/tex/context/modules/mkiv/m-units.mkiv b/tex/context/modules/mkiv/m-units.mkiv
index f85a8ba8a..4f25fffc6 100644
--- a/tex/context/modules/mkiv/m-units.mkiv
+++ b/tex/context/modules/mkiv/m-units.mkiv
@@ -212,7 +212,7 @@
\setbox2\hbox{m}%
\ifdim\wd0=\wd2
\endgroup
- \@EAEAEA\gobbleoneargument
+ \doubleexpandafter\gobbleoneargument
\else
\endgroup
\fi
@@ -220,8 +220,8 @@
\unexpanded\def\dimension#1%
{\begingroup
- \global\let\savedthedimensionprefix\thedimensionprefix
- \global\let\savedthedimensionpower\thedimensionpower
+ \glet\savedthedimensionprefix\thedimensionprefix
+ \glet\savedthedimensionpower\thedimensionpower
\unexpanded\def\dimension##1{\global\nesteddimensiontrue}%
\let\dimensionprefix\dimension
\let\dimensionmidfix\dimension
@@ -229,8 +229,8 @@
\let\dimensionpower \dimension
\global\nesteddimensionfalse
\setbox\scratchbox\hbox{\ustartmathmode#1\ustopmathmode}% pre-roll
- \global\let\thedimensionprefix\savedthedimensionprefix
- \global\let\thedimensionpower \savedthedimensionpower
+ \glet\thedimensionprefix\savedthedimensionprefix
+ \glet\thedimensionpower \savedthedimensionpower
\endgroup
\ifnesteddimension#1\else\dodimension{#1}\fi}
@@ -278,8 +278,8 @@
\else
\hskip\dimensionpowersignal
\fi
- \global\let\thedimensionprefix\empty
- \global\let\thedimensionpower\empty}
+ \glet\thedimensionprefix\empty
+ \glet\thedimensionpower\empty}
%D \macros
%D {dontbreakdimension,
diff --git a/tex/context/modules/mkiv/ppchtex.mkiv b/tex/context/modules/mkiv/ppchtex.mkiv
index d1167d414..5348d2e1a 100644
--- a/tex/context/modules/mkiv/ppchtex.mkiv
+++ b/tex/context/modules/mkiv/ppchtex.mkiv
@@ -1747,7 +1747,7 @@
\def\dosimplechemicalA#1#2#3% % evt: {#1,\relax}
{\let\chemicalspace=\relax
- \@EA\dosimplechemical\@EA{\@@chemicalchemicaloffset,#1}{#2}{#3}%
+ \expandafter\dosimplechemical\expandafter{\@@chemicalchemicaloffset,#1}{#2}{#3}%
\egroup}
\def\dosimplechemicalB#1#2#3%
@@ -1849,9 +1849,9 @@
\setevalue{\??chemical\c!text\the\levchemical}{\the\txtchemical}%
\txtchemical=0
\dodochemical[#1][#2]%
- % \@EA\txtchemical\@EA\csname\??chemical\c!text\the\levchemical\endcsname
+ % \expandafter\txtchemical\expandafter\csname\??chemical\c!text\the\levchemical\endcsname
\txtchemical\csname\??chemical\c!text\the\levchemical\endcsname
- \@EA\let\@EA\unknownchemical\csname\??chemical\s!unknown\the\levchemical\endcsname
+ \expandafter\let\expandafter\unknownchemical\csname\??chemical\s!unknown\the\levchemical\endcsname
\advance\levchemical -1
%\egroup
\ignorespaces}
@@ -2099,7 +2099,7 @@
\verchemical=\getvalue{\s!chemical y1}\relax
\else
\restorechemicalvalues{\getvalue{\s!chemical n\the\chemicalstack}}%
- %\@EA\let\@EA\@@chemicalpostponed\@EA=\csname\s!chemical p\the\chemicalstack\endcsname
+ %\expandafter\let\expandafter\@@chemicalpostponed\expandafter=\csname\s!chemical p\the\chemicalstack\endcsname
\let\@@chemicalpostponed=\relax
\horchemical=\getvalue{\s!chemical x\the\chemicalstack}\relax
\verchemical=\getvalue{\s!chemical y\the\chemicalstack}\relax
diff --git a/tex/context/modules/mkiv/s-article-basic.mkiv b/tex/context/modules/mkiv/s-article-basic.mkiv
index 69a577961..677867381 100644
--- a/tex/context/modules/mkiv/s-article-basic.mkiv
+++ b/tex/context/modules/mkiv/s-article-basic.mkiv
@@ -11,6 +11,21 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
+
+% \usemodule[article-basic,article-titletop]
+% \usemodule[article-basic,article-titlepage]
+%
+% \startdocument
+% [title={Some title},
+% subject={Some Subject},
+% author={Hans \& Ton},
+% affiliation={PRAGMA ADE},
+% date=\currentdate]
+%
+% \samplefile{ward}
+%
+% \stopdocument
+
\startmodule[article-basic]
\unprotect
@@ -70,6 +85,10 @@
\setuplist
[\c!interaction=\v!all]
+\setupdocument
+ [\c!before=\directsetup{document:titlepage}]
+
\protect
\stopmodule
+
diff --git a/tex/context/modules/mkiv/s-article-titlepage.mkiv b/tex/context/modules/mkiv/s-article-titlepage.mkiv
new file mode 100644
index 000000000..abfb957c2
--- /dev/null
+++ b/tex/context/modules/mkiv/s-article-titlepage.mkiv
@@ -0,0 +1,65 @@
+%D \module
+%D [ file=s-article-titlepage,
+%D version=2018.05.20,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Article Title Page,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startmodule[article-titlepage]
+
+\unprotect
+
+% \startalignment[middle]
+% \let\\=\par
+% \bfb
+% \setupinterlinespace
+% \documentvariable {subject}
+% \par
+% \stopalignment
+
+\defineframed
+ [titlepageframed]
+ [\c!frame=\v!off,
+ \c!align=\v!middle]
+
+\startsetups document:titlepage
+ \startstandardmakeup[\c!align=\v!middle]
+ \doifdocumentvariable {title} {
+ \dontleavehmode \titlepageframed
+ [\c!foregroundstyle=\bfd\setupinterlinespace]
+ {\documentvariable {title}}
+ }
+ \doifdocumentvariable {subject} {
+ \blank[2*\v!big]
+ \dontleavehmode \titlepageframed
+ [\c!foregroundstyle=\bfb\setupinterlinespace]
+ {\documentvariable {subject}}
+ }
+ \doifdocumentvariable {author} {
+ \blank[4*\v!big]
+ \dontleavehmode \titlepageframed
+ [\c!foregroundstyle=\bfa\setupinterlinespace]
+ {\documentvariable {author}}
+ }
+ \vfill
+ \doifdocumentvariable {affiliation} {
+ \dontleavehmode \titlepageframed
+ [\c!foregroundstyle=\bfa\setupinterlinespace]
+ {\documentvariable {affiliation}}
+ }
+ \doifdocumentvariable {date} {
+ \blank[\v!big]
+ \dontleavehmode \titlepageframed
+ [\c!foregroundstyle=\bfa\setupinterlinespace]
+ {\documentvariable {date}}
+ }
+ \stopstandardmakeup
+\stopsetups
+
+\stopmodule
diff --git a/tex/context/modules/mkiv/s-article-titletop.mkiv b/tex/context/modules/mkiv/s-article-titletop.mkiv
new file mode 100644
index 000000000..e68bed79b
--- /dev/null
+++ b/tex/context/modules/mkiv/s-article-titletop.mkiv
@@ -0,0 +1,68 @@
+%D \module
+%D [ file=s-article-titletop,
+%D version=2018.05.20,
+%D title=\CONTEXT\ Style File,
+%D subtitle=Article Top Title,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startmodule[article-titletop]
+
+\unprotect
+
+\defineframed
+ [titlepageframed]
+ [\c!frame=\v!off,
+ \c!align=\v!middle]
+
+\startsetups document:titlepage
+ \setupheader[\c!state=\v!high]
+ \start
+ \forgetall
+ \startalignment[\v!middle]
+ \doifdocumentvariable {title} {
+ \dontleavehmode \titlepageframed
+ [\c!foregroundstyle=\bfd\setupinterlinespace]
+ {\documentvariable {title}}
+ \par
+ }
+ \doifdocumentvariable {subject} {
+ \dontleavehmode \titlepageframed
+ [\c!foregroundstyle=\bfb\setupinterlinespace]
+ {\documentvariable {subject}}
+ \par
+ }
+ \doifdocumentvariable {author} {
+ \dontleavehmode \titlepageframed
+ [\c!foregroundstyle=\bfa\setupinterlinespace]
+ {\documentvariable {author}}
+ \par
+ }
+ \doifdocumentvariable {affiliation} {
+ \dontleavehmode \titlepageframed
+ [\c!foregroundstyle=\bfa\setupinterlinespace]
+ {\documentvariable {affiliation}}
+ \par
+ }
+ \doifdocumentvariable {date} {
+ \dontleavehmode \titlepageframed
+ [\c!foregroundstyle=\bfa\setupinterlinespace]
+ {\documentvariable {date}}
+ \par
+ }
+ \blank[3*\v!big]
+ \stopalignment
+ \stop
+\stopsetups
+
+\setupdocument
+ [\c!before=\directsetup{document:titlepage}]
+
+\protect
+
+\stopmodule
diff --git a/tex/context/modules/mkiv/s-fonts-shapes.mkiv b/tex/context/modules/mkiv/s-fonts-shapes.mkiv
index d05438f3d..05515ae37 100644
--- a/tex/context/modules/mkiv/s-fonts-shapes.mkiv
+++ b/tex/context/modules/mkiv/s-fonts-shapes.mkiv
@@ -30,7 +30,7 @@
\startsetups module:showallglyphshapes:start
\unexpanded\def\modulefontsstartshowglyphshape##1##2##3{
- \startTEXpage[\c!offset=\exheight,\c!frame=\v!on]
+ \startTEXpage[\c!offset=\exheight] % ,\c!frame=\v!on]
\edef\lastshownglyphshapefieldunicode{##1}%
\edef\lastshownglyphshapefieldname {##2}%
\edef\lastshownglyphshapefieldindex {##3}%
diff --git a/tex/context/modules/mkiv/x-mathml.mkiv b/tex/context/modules/mkiv/x-mathml.mkiv
index ea7f7d2e9..adc494314 100644
--- a/tex/context/modules/mkiv/x-mathml.mkiv
+++ b/tex/context/modules/mkiv/x-mathml.mkiv
@@ -350,7 +350,7 @@
%
% \def\postponedMMLactions
% {\global\setfalse\somepostponedMMLactions
-% \@EA\global\@EA\@@postponedMMLactions\@EA\emptytoks
+% \expandafter\global\expandafter\@@postponedMMLactions\expandafter\emptytoks
% \the\@@postponedMMLactions}
\startxmlsetups mml:apply
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 5e43f0026..54e95b3af 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 05/19/18 21:46:20
+-- merge date : 05/24/18 15:49:05
do -- begin closure to overcome local limits and interference
@@ -27458,7 +27458,7 @@ do
end
local initialrl=direction=="TRT" and -1 or 0
local datasets=otfdataset(tfmdata,font,attr)
- local dirstack={}
+ local dirstack={ nil }
sweephead={}
for s=1,#datasets do
local dataset=datasets[s]
@@ -27674,7 +27674,7 @@ do
local steps=sequence.steps
local nofsteps=sequence.nofsteps
local done=false
- local dirstack={}
+ local dirstack={ nil }
local start=head
local initialrl=direction=="TRT" and -1 or 0
local rlmode=initialrl
@@ -36466,7 +36466,7 @@ local function nodepass(head,groupcode,size,packtype,direction)
end
if variants then
local char=getchar(n)
- if char>=0xFE00 and (char<=0xFE0F or (char>=0xE0100 and char<=0xE01EF)) then
+ if (char>=0xFE00 and char<=0xFE0F) or (char>=0xE0100 and char<=0xE01EF) then
local hash=variants[char]
if hash then
local p=getprev(n)