From e9ccab5308d2b6fec79e36c355c03aad4e1e5dec Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sun, 4 Jun 2023 19:46:50 +0200 Subject: 2023-06-04 16:40:00 --- .../documents/general/manuals/luametatex.pdf | Bin 1470739 -> 1505488 bytes doc/context/documents/general/qrcs/setup-de.pdf | Bin 845187 -> 845252 bytes doc/context/documents/general/qrcs/setup-en.pdf | Bin 848873 -> 848819 bytes doc/context/documents/general/qrcs/setup-fr.pdf | Bin 843810 -> 843645 bytes doc/context/documents/general/qrcs/setup-it.pdf | Bin 844906 -> 844777 bytes .../documents/general/qrcs/setup-mapping-de.pdf | Bin 319172 -> 319137 bytes .../documents/general/qrcs/setup-mapping-en.pdf | Bin 316827 -> 316907 bytes .../documents/general/qrcs/setup-mapping-fr.pdf | Bin 320303 -> 320375 bytes .../documents/general/qrcs/setup-mapping-it.pdf | Bin 318817 -> 318773 bytes .../documents/general/qrcs/setup-mapping-nl.pdf | Bin 318196 -> 318217 bytes doc/context/documents/general/qrcs/setup-nl.pdf | Bin 840853 -> 840533 bytes .../general/manuals/lowlevel/lowlevel-macros.tex | 51 +++++++ .../manuals/luametatex/luametatex-enhancements.tex | 32 +++++ .../general/manuals/luametatex/luametatex.tex | 8 +- .../sources/general/manuals/ontarget/ontarget.tex | 1 + scripts/context/lua/mtxrun.lua | 8 +- scripts/context/stubs/mswin/mtxrun.lua | 8 +- scripts/context/stubs/unix/mtxrun | 8 +- scripts/context/stubs/win64/mtxrun.lua | 8 +- source/luametatex/source/lua/lmtfontlib.c | 6 +- source/luametatex/source/lua/lmtinterface.h | 6 +- source/luametatex/source/lua/lmttexlib.c | 25 ++-- source/luametatex/source/lua/lmttokenlib.c | 91 +++++++----- source/luametatex/source/luametatex.h | 2 +- source/luametatex/source/tex/texalign.c | 18 +-- source/luametatex/source/tex/texcommands.c | 4 + source/luametatex/source/tex/texcommands.h | 2 + source/luametatex/source/tex/texconditional.c | 22 ++- source/luametatex/source/tex/texdumpdata.h | 2 +- source/luametatex/source/tex/texequivalents.c | 2 + source/luametatex/source/tex/texequivalents.h | 17 ++- source/luametatex/source/tex/texexpand.c | 46 ++++-- source/luametatex/source/tex/texinputstack.c | 6 +- source/luametatex/source/tex/texmaincontrol.c | 10 +- source/luametatex/source/tex/texmath.c | 10 +- source/luametatex/source/tex/texmlist.c | 24 +++- source/luametatex/source/tex/texnodes.c | 72 +++++----- source/luametatex/source/tex/texnodes.h | 1 + source/luametatex/source/tex/texprimitive.c | 46 +++++- source/luametatex/source/tex/texprimitive.h | 10 +- source/luametatex/source/tex/texscanning.c | 20 +++ source/luametatex/source/tex/textoken.c | 59 ++++---- source/luametatex/source/tex/textypes.h | 4 + tex/context/base/mkii/cont-new.mkii | 2 +- tex/context/base/mkii/context.mkii | 2 +- tex/context/base/mkii/mult-de.mkii | 2 + tex/context/base/mkiv/cont-new.mkiv | 2 +- tex/context/base/mkiv/context.mkiv | 2 +- tex/context/base/mkiv/mult-def.lua | 6 + tex/context/base/mkiv/status-files.pdf | Bin 24568 -> 24581 bytes tex/context/base/mkiv/status-lua.pdf | Bin 270890 -> 270902 bytes tex/context/base/mkiv/util-str.lua | 5 + tex/context/base/mkxl/anch-bar.mkxl | 2 +- tex/context/base/mkxl/anch-pgr.mkxl | 18 +-- tex/context/base/mkxl/anch-pos.mkxl | 16 +-- tex/context/base/mkxl/buff-ini.mkxl | 4 +- tex/context/base/mkxl/buff-par.mklx | 4 +- tex/context/base/mkxl/buff-ver.lmt | 17 ++- tex/context/base/mkxl/buff-ver.mkxl | 29 ++-- tex/context/base/mkxl/chem-str.mkxl | 6 +- tex/context/base/mkxl/colo-ini.mkxl | 24 ++-- tex/context/base/mkxl/cont-new.mkxl | 2 +- tex/context/base/mkxl/context.mkxl | 2 +- tex/context/base/mkxl/core-dat.mkxl | 4 +- tex/context/base/mkxl/core-pag.mkxl | 2 +- tex/context/base/mkxl/file-job.mklx | 6 +- tex/context/base/mkxl/file-mod.mklx | 8 +- tex/context/base/mkxl/font-fil.mklx | 2 +- tex/context/base/mkxl/font-ini.mklx | 50 +++---- tex/context/base/mkxl/font-sol.mklx | 2 +- tex/context/base/mkxl/font-sty.mklx | 6 +- tex/context/base/mkxl/grph-inc.mkxl | 10 +- tex/context/base/mkxl/grph-trf.mkxl | 4 +- tex/context/base/mkxl/lang-ini.mkxl | 6 +- tex/context/base/mkxl/lang-lab.mkxl | 16 +-- tex/context/base/mkxl/lang-tra.mkxl | 6 +- tex/context/base/mkxl/lxml-ini.mkxl | 8 +- tex/context/base/mkxl/math-ali.mkxl | 16 +-- tex/context/base/mkxl/math-del.mkxl | 2 +- tex/context/base/mkxl/math-dld.mklx | 2 +- tex/context/base/mkxl/math-fen.mkxl | 25 +++- tex/context/base/mkxl/math-ini.mkxl | 57 +++++--- tex/context/base/mkxl/math-rad.mklx | 4 +- tex/context/base/mkxl/math-stc.mklx | 24 ++-- tex/context/base/mkxl/meta-ini.mkxl | 48 +++---- tex/context/base/mkxl/mult-aux.mkxl | 154 +++++++++++++++------ tex/context/base/mkxl/mult-sys.mkxl | 1 + tex/context/base/mkxl/node-rul.mkxl | 2 +- tex/context/base/mkxl/pack-box.mkxl | 4 +- tex/context/base/mkxl/pack-com.mkxl | 6 +- tex/context/base/mkxl/pack-lyr.mkxl | 6 +- tex/context/base/mkxl/pack-mat.mkxl | 4 +- tex/context/base/mkxl/pack-mis.mklx | 2 +- tex/context/base/mkxl/pack-pos.mkxl | 4 +- tex/context/base/mkxl/pack-rul.mkxl | 28 ++-- tex/context/base/mkxl/page-bck.mkxl | 6 +- tex/context/base/mkxl/page-brk.mkxl | 2 +- tex/context/base/mkxl/page-cst.mkxl | 10 +- tex/context/base/mkxl/page-ffl.mkxl | 10 +- tex/context/base/mkxl/page-flt.mkxl | 2 +- tex/context/base/mkxl/page-flw.mkxl | 4 +- tex/context/base/mkxl/page-inj.mklx | 6 +- tex/context/base/mkxl/page-ins.mkxl | 4 +- tex/context/base/mkxl/page-lay.mkxl | 4 +- tex/context/base/mkxl/page-lin.mklx | 4 +- tex/context/base/mkxl/page-mak.mklx | 6 +- tex/context/base/mkxl/page-mbk.mklx | 2 +- tex/context/base/mkxl/page-mix.mkxl | 6 +- tex/context/base/mkxl/page-pcl.mkxl | 2 +- tex/context/base/mkxl/page-txt.mklx | 43 +++--- tex/context/base/mkxl/phys-dim.mkxl | 4 +- tex/context/base/mkxl/scrn-bar.mklx | 4 +- tex/context/base/mkxl/scrn-but.mklx | 14 +- tex/context/base/mkxl/scrn-hlp.mklx | 4 +- tex/context/base/mkxl/scrn-ini.mklx | 6 +- tex/context/base/mkxl/scrn-wid.mklx | 8 +- tex/context/base/mkxl/scrp-ini.mkxl | 2 +- tex/context/base/mkxl/spac-flr.mkxl | 4 +- tex/context/base/mkxl/spac-hor.mkxl | 10 +- tex/context/base/mkxl/spac-lin.mkxl | 2 +- tex/context/base/mkxl/spac-prf.mklx | 14 +- tex/context/base/mkxl/spac-ver.mkxl | 2 +- tex/context/base/mkxl/strc-blk.mkxl | 2 +- tex/context/base/mkxl/strc-con.mklx | 2 +- tex/context/base/mkxl/strc-flt.mklx | 4 +- tex/context/base/mkxl/strc-ind.mkxl | 12 +- tex/context/base/mkxl/strc-itm.mklx | 4 +- tex/context/base/mkxl/strc-lnt.mklx | 4 +- tex/context/base/mkxl/strc-lst.mklx | 20 +-- tex/context/base/mkxl/strc-mat.mkxl | 2 +- tex/context/base/mkxl/strc-not.mklx | 18 +-- tex/context/base/mkxl/strc-num.mkxl | 6 +- tex/context/base/mkxl/strc-reg.mkxl | 22 +-- tex/context/base/mkxl/strc-sbe.mkxl | 4 +- tex/context/base/mkxl/strc-sec.mkxl | 14 +- tex/context/base/mkxl/strc-syn.mkxl | 26 ++-- tex/context/base/mkxl/strc-tag.mkxl | 4 +- tex/context/base/mkxl/strc-usr.mkxl | 4 +- tex/context/base/mkxl/symb-ini.mkxl | 2 +- tex/context/base/mkxl/syst-aux.lmt | 2 +- tex/context/base/mkxl/tabl-frm.mkxl | 16 +-- tex/context/base/mkxl/tabl-mis.mkxl | 8 +- tex/context/base/mkxl/tabl-tbl.mkxl | 10 +- tex/context/base/mkxl/tabl-xtb.mklx | 10 +- tex/context/base/mkxl/toks-ini.lmt | 4 +- tex/context/base/mkxl/trac-tex.lmt | 7 + tex/context/base/mkxl/type-ini.mklx | 4 +- tex/context/base/mkxl/typo-ada.mkxl | 2 +- tex/context/base/mkxl/typo-cap.mkxl | 4 +- tex/context/base/mkxl/typo-del.mkxl | 4 +- tex/context/base/mkxl/typo-drp.mkxl | 2 +- tex/context/base/mkxl/typo-fln.mkxl | 2 +- tex/context/base/mkxl/typo-krn.mkxl | 6 +- tex/context/base/mkxl/typo-lbx.mkxl | 14 +- tex/context/base/mkxl/typo-plc.mkxl | 2 +- tex/context/base/mkxl/typo-pnc.mkxl | 2 +- tex/context/base/mkxl/typo-rub.mkxl | 4 +- tex/context/base/mkxl/typo-scr.mkxl | 8 +- tex/context/interface/mkii/keys-de.xml | 2 + tex/context/interface/mkiv/context-en.xml | 4 + tex/context/interface/mkiv/i-context.pdf | Bin 848873 -> 848819 bytes tex/context/interface/mkiv/i-readme.pdf | Bin 24428 -> 24430 bytes tex/context/interface/mkiv/i-verbatim.xml | 4 + tex/context/modules/third/mtx-install-imp-tikz.lua | 2 +- tex/context/sample/common/knuth-gpt.tex | 4 + tex/generic/context/luatex/luatex-fonts-merged.lua | 4 +- 166 files changed, 1090 insertions(+), 669 deletions(-) create mode 100644 tex/context/sample/common/knuth-gpt.tex diff --git a/doc/context/documents/general/manuals/luametatex.pdf b/doc/context/documents/general/manuals/luametatex.pdf index a6c0d6c42..9115f400d 100644 Binary files a/doc/context/documents/general/manuals/luametatex.pdf and b/doc/context/documents/general/manuals/luametatex.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf index 376c18b26..8a03859f6 100644 Binary files a/doc/context/documents/general/qrcs/setup-de.pdf and b/doc/context/documents/general/qrcs/setup-de.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf index 0a88e801a..989f3e3b8 100644 Binary files a/doc/context/documents/general/qrcs/setup-en.pdf and b/doc/context/documents/general/qrcs/setup-en.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf index 2789cbecb..19a367c9c 100644 Binary files a/doc/context/documents/general/qrcs/setup-fr.pdf and b/doc/context/documents/general/qrcs/setup-fr.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf index 3d249de41..4620bb0ad 100644 Binary files a/doc/context/documents/general/qrcs/setup-it.pdf and b/doc/context/documents/general/qrcs/setup-it.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf index 8f41b3565..8db14d6cd 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-de.pdf and b/doc/context/documents/general/qrcs/setup-mapping-de.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf index ad70efa10..a200514a5 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-en.pdf and b/doc/context/documents/general/qrcs/setup-mapping-en.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf index bc5c4b275..106c0220a 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf and b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf index 9807d106c..9279ec27f 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-it.pdf and b/doc/context/documents/general/qrcs/setup-mapping-it.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf index 5bb2d68af..ec6e61d10 100644 Binary files a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf and b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf differ diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf index 2962780a1..618bd1915 100644 Binary files a/doc/context/documents/general/qrcs/setup-nl.pdf and b/doc/context/documents/general/qrcs/setup-nl.pdf differ diff --git a/doc/context/sources/general/manuals/lowlevel/lowlevel-macros.tex b/doc/context/sources/general/manuals/lowlevel/lowlevel-macros.tex index 83e43818f..cbb52f25c 100644 --- a/doc/context/sources/general/manuals/lowlevel/lowlevel-macros.tex +++ b/doc/context/sources/general/manuals/lowlevel/lowlevel-macros.tex @@ -991,6 +991,57 @@ in turn only needs incrementing a reference counter. \stopsectionlevel +\startsectionlevel[title=Passing parameters] + +When you define a macro, the \type {#1} and more parameters are embedded as a +reference to a parameter that is passed. When we have four parameters, the +parameter stack has four entries and when an entry is eventually accessed a new +input level is pushed and tokens are fetched from that list. This has some side +effects when we check a parameter. This can happen multiple times, depending on +how often we access a parameter. Take the following: + +\startbuffer +\def\oof#1{#1} + +\tolerant\def\foo[#1]#*[#2]% + {1:\ifparameter#1\or Y\else N\fi\quad + 2:\ifparameter#2\or Y\else N\fi\quad + \oof{3:\ifparameter #1\or Y\else N\fi\quad + 4:\ifparameter #2\or Y\else N\fi\quad}% + \par} + +\foo \foo[] \foo[][] \foo[A] \foo[A][B] +\stopbuffer + +\typebuffer + +This gives: + +\startpacked \tttf +\inlinebuffer +\stoppacked + +as you probably expect. However the first two checks +are different from the embedded checks because they can check against the +parameter reference. When we expand \type {\oof} its argument gets passed to the +macro as a list and when the scanner collects the next token it will then push +the parameter content on the input stack. So, then, instead of a reference we get +the referenced parameter list. Internally that means that in 3 and 4 we check for +a token and not for the length of the list (as in case 1 & 2). This means that + +\starttyping +\iftok{#1}\emptytoks Y\else N\fi +\ifparameter#1\or Y\else N\fi +\stoptyping + +are different. In the first case we have a proper token list and nested +conditionals in that list are okay. In the second case we just look ahead to see +if there is an \type {\or}, \type {\else} or other condition related command and +if so we decide that there is no parameter. So, if \type {\ifparameter} is a +suitable check for empty depends on the need for expansion. + +\stopsectionlevel + \stopdocument % freezing pitfalls: diff --git a/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex b/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex index ba320440b..0cafa118f 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex-enhancements.tex @@ -2512,6 +2512,38 @@ Unit equivalent to ten Toves or one Edith. \stopsection +\startsection[title=Registers] + + +\startsubsection[title={32 bit floats}] + +The engine has native float registers which means that we have a similar set of +primitives as for dimensions and integers: \prm {float}, \prm {floatdef}, \prm +{floatexpr} and \prm {iffloat}. In the context if an integer a rounded value is +used, in the context of a dimensions the floating point number is interpreted as +points. Internally floats are stored as so called posits, which gives more accuracy +for smaller values. + +\stopsubsection + +\startsubsection[title={32 bit posits}] + +{\em This is a playground. It will stay but might evolve.} + +\stopsubsection + +\startsubsection[title={Extra features}] + +There are \prm {ifabsnum}, \prm {ifabsdim} and \prm {ifabsfloat} that compare +absolute values of quantities. The primitives \prm{ifzeronum}, \prm{ifzerodim}, +\prm{ifzerofloat} do a fast test for zero. The \prm {ifintervalnum}, \prm +{ifintervaldim} and \prm {ifintervalfloat} primitives take a delta and two values +and check if these values overlap within the ranges dedicated by the delta. + +\stopsubsection + +\stopsection + \startsection[title=Expressions] \startsubsection[title={Rounding and scaling}] diff --git a/doc/context/sources/general/manuals/luametatex/luametatex.tex b/doc/context/sources/general/manuals/luametatex/luametatex.tex index a86846628..834b73133 100644 --- a/doc/context/sources/general/manuals/luametatex/luametatex.tex +++ b/doc/context/sources/general/manuals/luametatex/luametatex.tex @@ -1,5 +1,7 @@ % language=us runpath=texruns:manuals/luametatex +% \pushoverloadmode \let\cdef\edef \let\cdefcsname\edefcsname \popoverloadmode + % \enabledirectives[backend.pdf.inmemory] % \setupalign[profile] @@ -110,7 +112,11 @@ % because the amount of output which is sensitive for refresh delays set. The new % target is now 50 pages per second for this manual but on this laptop that is % unlikely to happen any time soon. With tabulateusesize and tabulatesparseskips -% experiments enabled we needed 8.1 second and 44.3 pps. +% experiments enabled we needed 8.1 second and 44.3 pps.% 368 pages may/june 2023: +% +% no constant definitions : 8.55 +% constant \*!whatever : 8.47 +% also constant \current* : 8.36 % \enableexperiments [tabulateusesize] % \enableexperiments [tabulatesparseskips] diff --git a/doc/context/sources/general/manuals/ontarget/ontarget.tex b/doc/context/sources/general/manuals/ontarget/ontarget.tex index 888a73f41..20512f934 100644 --- a/doc/context/sources/general/manuals/ontarget/ontarget.tex +++ b/doc/context/sources/general/manuals/ontarget/ontarget.tex @@ -28,6 +28,7 @@ \component ontarget-registers \component ontarget-fairphone % \component ontarget-mathsizes + \component ontarget-constants \stopbodymatter \stopdocument diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 5eb37f378..13b1171e6 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -6583,7 +6583,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 46322, stripped down to: 24128 +-- original size: 46560, stripped down to: 24244 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6777,6 +6777,7 @@ local p_prune_intospace=Cs (noleading*(notrailing+intospace+1 )^0 ) local p_retain_normal=Cs ((normalline+normalempty )^0 ) local p_retain_collapse=Cs ((normalline+doubleempty )^0 ) local p_retain_noempty=Cs ((normalline+singleempty )^0 ) +local p_collapse_all=Cs (stripstart*(stripend+((whitespace+newline)^1/" ")+1)^0 ) local striplinepatterns={ ["prune"]=p_prune_normal, ["prune and collapse"]=p_prune_collapse, @@ -6785,6 +6786,7 @@ local striplinepatterns={ ["retain"]=p_retain_normal, ["retain and collapse"]=p_retain_collapse, ["retain and no empty"]=p_retain_noempty, + ["collapse all"]=p_collapse_all, ["collapse"]=patterns.collapser, } setmetatable(striplinepatterns,{ __index=function(t,k) return p_prune_collapse end }) @@ -26204,8 +26206,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1047054 --- stripped bytes : 416103 +-- original bytes : 1047292 +-- stripped bytes : 416225 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 5eb37f378..13b1171e6 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -6583,7 +6583,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 46322, stripped down to: 24128 +-- original size: 46560, stripped down to: 24244 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6777,6 +6777,7 @@ local p_prune_intospace=Cs (noleading*(notrailing+intospace+1 )^0 ) local p_retain_normal=Cs ((normalline+normalempty )^0 ) local p_retain_collapse=Cs ((normalline+doubleempty )^0 ) local p_retain_noempty=Cs ((normalline+singleempty )^0 ) +local p_collapse_all=Cs (stripstart*(stripend+((whitespace+newline)^1/" ")+1)^0 ) local striplinepatterns={ ["prune"]=p_prune_normal, ["prune and collapse"]=p_prune_collapse, @@ -6785,6 +6786,7 @@ local striplinepatterns={ ["retain"]=p_retain_normal, ["retain and collapse"]=p_retain_collapse, ["retain and no empty"]=p_retain_noempty, + ["collapse all"]=p_collapse_all, ["collapse"]=patterns.collapser, } setmetatable(striplinepatterns,{ __index=function(t,k) return p_prune_collapse end }) @@ -26204,8 +26206,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1047054 --- stripped bytes : 416103 +-- original bytes : 1047292 +-- stripped bytes : 416225 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 5eb37f378..13b1171e6 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -6583,7 +6583,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 46322, stripped down to: 24128 +-- original size: 46560, stripped down to: 24244 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6777,6 +6777,7 @@ local p_prune_intospace=Cs (noleading*(notrailing+intospace+1 )^0 ) local p_retain_normal=Cs ((normalline+normalempty )^0 ) local p_retain_collapse=Cs ((normalline+doubleempty )^0 ) local p_retain_noempty=Cs ((normalline+singleempty )^0 ) +local p_collapse_all=Cs (stripstart*(stripend+((whitespace+newline)^1/" ")+1)^0 ) local striplinepatterns={ ["prune"]=p_prune_normal, ["prune and collapse"]=p_prune_collapse, @@ -6785,6 +6786,7 @@ local striplinepatterns={ ["retain"]=p_retain_normal, ["retain and collapse"]=p_retain_collapse, ["retain and no empty"]=p_retain_noempty, + ["collapse all"]=p_collapse_all, ["collapse"]=patterns.collapser, } setmetatable(striplinepatterns,{ __index=function(t,k) return p_prune_collapse end }) @@ -26204,8 +26206,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1047054 --- stripped bytes : 416103 +-- original bytes : 1047292 +-- stripped bytes : 416225 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 5eb37f378..13b1171e6 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -6583,7 +6583,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-str"] = package.loaded["util-str"] or true --- original size: 46322, stripped down to: 24128 +-- original size: 46560, stripped down to: 24244 if not modules then modules={} end modules ['util-str']={ version=1.001, @@ -6777,6 +6777,7 @@ local p_prune_intospace=Cs (noleading*(notrailing+intospace+1 )^0 ) local p_retain_normal=Cs ((normalline+normalempty )^0 ) local p_retain_collapse=Cs ((normalline+doubleempty )^0 ) local p_retain_noempty=Cs ((normalline+singleempty )^0 ) +local p_collapse_all=Cs (stripstart*(stripend+((whitespace+newline)^1/" ")+1)^0 ) local striplinepatterns={ ["prune"]=p_prune_normal, ["prune and collapse"]=p_prune_collapse, @@ -6785,6 +6786,7 @@ local striplinepatterns={ ["retain"]=p_retain_normal, ["retain and collapse"]=p_retain_collapse, ["retain and no empty"]=p_retain_noempty, + ["collapse all"]=p_collapse_all, ["collapse"]=patterns.collapser, } setmetatable(striplinepatterns,{ __index=function(t,k) return p_prune_collapse end }) @@ -26204,8 +26206,8 @@ end -- of closure -- used libraries : l-bit32.lua l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-sha.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua util-soc-imp-reset.lua util-soc-imp-socket.lua util-soc-imp-copas.lua util-soc-imp-ltn12.lua util-soc-imp-mime.lua util-soc-imp-url.lua util-soc-imp-headers.lua util-soc-imp-tp.lua util-soc-imp-http.lua util-soc-imp-ftp.lua util-soc-imp-smtp.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua util-zip.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua libs-ini.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 1047054 --- stripped bytes : 416103 +-- original bytes : 1047292 +-- stripped bytes : 416225 -- end library merge diff --git a/source/luametatex/source/lua/lmtfontlib.c b/source/luametatex/source/lua/lmtfontlib.c index 042772b32..f8ca2a37a 100644 --- a/source/luametatex/source/lua/lmtfontlib.c +++ b/source/luametatex/source/lua/lmtfontlib.c @@ -825,7 +825,7 @@ static int fontlib_id(lua_State *L) if (lua_type(L, 1) == LUA_TSTRING) { size_t l; const char *s = lua_tolstring(L, 1, &l); - int cs = tex_string_locate(s, l, 0); + int cs = tex_string_locate_only(s, l); int f = -1; if (cs == undefined_control_sequence || cs == undefined_cs_cmd || eq_type(cs) != set_font_cmd) { lua_pushliteral(L, "not a valid font csname"); @@ -903,7 +903,7 @@ static int fontlib_getmathspec(lua_State *L) if (lua_type(L, 1) == LUA_TSTRING) { size_t lname = 0; const char *name = lua_tolstring(L, 1, &lname); - halfword cs = tex_string_locate(name, lname, 0); + halfword cs = tex_string_locate_only(name, lname); if (eq_type(cs) == mathspec_cmd) { halfword ms = eq_value(cs); if (ms) { @@ -923,7 +923,7 @@ static int fontlib_getfontspec(lua_State *L) if (lua_type(L, 1) == LUA_TSTRING) { size_t lname = 0; const char *name = lua_tolstring(L, 1, &lname); - halfword cs = tex_string_locate(name, lname, 0); + halfword cs = tex_string_locate_only(name, lname); if (eq_type(cs) == fontspec_cmd) { halfword fs = eq_value(cs); if (fs) { diff --git a/source/luametatex/source/lua/lmtinterface.h b/source/luametatex/source/lua/lmtinterface.h index ea6ead4ab..1dc47cf15 100644 --- a/source/luametatex/source/lua/lmtinterface.h +++ b/source/luametatex/source/lua/lmtinterface.h @@ -553,6 +553,7 @@ make_lua_key(L, conditional);\ make_lua_key(L, conditionalmathskip);\ make_lua_key(L, connectoroverlapmin);\ make_lua_key(L, constant);\ +make_lua_key(L, constant_call);\ make_lua_key(L, container);\ make_lua_key(L, contributehead);\ make_lua_key(L, convert);\ @@ -568,8 +569,9 @@ make_lua_key(L, cs_name);\ make_lua_key(L, csname);\ make_lua_key(L, current);\ make_lua_key(L, data);\ -make_lua_key(L, deep_frozen_cs_dont_expand);\ -make_lua_key(L, deep_frozen_cs_end_template);\ +make_lua_key(L, deep_frozen_dont_expand);\ +make_lua_key(L, deep_frozen_end_template);\ +make_lua_key(L, deep_frozen_keep_constant);\ make_lua_key(L, def);\ make_lua_key(L, deferred);\ make_lua_key(L, define_char_code);\ diff --git a/source/luametatex/source/lua/lmttexlib.c b/source/luametatex/source/lua/lmttexlib.c index 603454bfe..08809e198 100644 --- a/source/luametatex/source/lua/lmttexlib.c +++ b/source/luametatex/source/lua/lmttexlib.c @@ -557,7 +557,7 @@ static int texlib_mprint(lua_State *L) if (lua_type(L, 1) == LUA_TSTRING) { size_t lname = 0; const char *name = lua_tolstring(L, 1, &lname); - int cs = tex_string_locate(name, lname, 0); + int cs = tex_string_locate_only(name, lname); int cmd = eq_type(cs); if (is_call_cmd(cmd)) { texlib_aux_store_token(cs_token_flag + cs, partial_line_mode, default_catcode_table_preset); @@ -1185,7 +1185,7 @@ inline static int texlib_aux_valid_register_index(lua_State *L, int slot, int cm { size_t len; const char *str = lua_tolstring(L, 1, &len); - int cs = tex_string_locate(str, len, 0); + int cs = tex_string_locate_only(str, len); if (eq_type(cs) == cmd) { index = eq_value(cs) - base; } else if (eq_type(cs) == constant_cmd) { @@ -1213,7 +1213,7 @@ static int texlib_get_register_index(lua_State *L) { size_t len; const char *str = lua_tolstring(L, 1, &len); - int cs = tex_string_locate(str, len, 0); + int cs = tex_string_locate_only(str, len); int index = -1; switch (eq_type(cs)) { case register_toks_cmd : index = eq_value(cs) - register_toks_base; break; @@ -1348,7 +1348,7 @@ static int texlib_aux_check_for_index( { size_t len; const char *str = lua_tolstring(L, slot, &len); - int cs = tex_string_locate(str, len, 0); + int cs = tex_string_locate_only(str, len); if (eq_type(cs) == internal_cmd) { *index = eq_value(cs) - internal_base; return 1; @@ -1903,7 +1903,7 @@ int lmt_get_box_id(lua_State *L, int i, int report) { size_t len = 0; const char *str = lua_tolstring(L, i, &len); - int cs = tex_string_locate(str, len, 0); + int cs = tex_string_locate_only(str, len); int cmd = eq_type(cs); switch (cmd) { case char_given_cmd: @@ -2573,7 +2573,7 @@ static int texlib_set_item(lua_State* L, int index, int prefixes) size_t sl; const char *st = lua_tolstring(L, slot++, &sl); if (sl > 0) { - int cs = tex_string_locate(st, sl, 0); + int cs = tex_string_locate_only(st, sl); if (cs != undefined_control_sequence && has_eq_flag_bits(cs, primitive_flag_bit)) { int cmd = eq_type(cs); switch (cmd) { @@ -3173,7 +3173,7 @@ static int texlib_get_internal(lua_State *L, int index, int all) int cmd = get_prim_eq_type(cs); int code = get_prim_equiv(cs); */ - int cs = tex_string_locate(s, l, 0); + int cs = tex_string_locate_only(s, l); if (cs != undefined_control_sequence && has_eq_flag_bits(cs, primitive_flag_bit)) { int cmd = eq_type(cs); int code = eq_value(cs); @@ -4280,7 +4280,7 @@ static int texlib_runlocal(lua_State *L) { size_t lname = 0; const char *name = lua_tolstring(L, 1, &lname); - int cs = tex_string_locate(name, lname, 0); + int cs = tex_string_locate_only(name, lname); int cmd = eq_type(cs); if (cmd < call_cmd) { // is_call_cmd // todo: use the better register helpers and range checkers @@ -4850,7 +4850,7 @@ static int texlib_getintegervalue(lua_State *L) /* todo, now has duplicate in to size_t len; const char *str = lua_tolstring(L, 1, &len); if (len > 0) { - int cs = tex_string_locate(str, len, 0); + int cs = tex_string_locate_only(str, len); switch (eq_type(cs)) { case integer_cmd: lua_pushinteger(L, eq_value(cs)); @@ -4858,6 +4858,7 @@ static int texlib_getintegervalue(lua_State *L) /* todo, now has duplicate in to case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: return texlib_aux_getvalue(L, int_val_level, cs); default: /* twice a lookup but fast enough for now */ @@ -4875,7 +4876,7 @@ static int texlib_getfloatvalue(lua_State *L) /* todo, now has duplicate in toke size_t len; const char *str = lua_tolstring(L, 1, &len); if (len > 0) { - int cs = tex_string_locate(str, len, 0); + int cs = tex_string_locate_only(str, len); switch (eq_type(cs)) { case posit_cmd: lua_pushnumber(L, tex_posit_to_double(eq_value(cs))); @@ -4883,6 +4884,7 @@ static int texlib_getfloatvalue(lua_State *L) /* todo, now has duplicate in toke case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: return texlib_aux_getvalue(L, posit_val_level, cs); default: /* twice a lookup but fast enough for now */ @@ -4900,7 +4902,7 @@ static int texlib_getdimensionvalue(lua_State *L) /* todo, now has duplicate in size_t len; const char *str = lua_tolstring(L, 1, &len); if (len > 0) { - int cs = tex_string_locate(str, len, 0); + int cs = tex_string_locate_only(str, len); switch (eq_type(cs)) { case dimension_cmd: lua_pushinteger(L, eq_value(cs)); @@ -4911,6 +4913,7 @@ static int texlib_getdimensionvalue(lua_State *L) /* todo, now has duplicate in case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: return texlib_aux_getvalue(L, dimen_val_level, cs); default: /* twice a lookup but fast enough for now */ diff --git a/source/luametatex/source/lua/lmttokenlib.c b/source/luametatex/source/lua/lmttokenlib.c index fe82e7e40..e4ec867f0 100644 --- a/source/luametatex/source/lua/lmttokenlib.c +++ b/source/luametatex/source/lua/lmttokenlib.c @@ -215,12 +215,14 @@ void lmt_tokenlib_initialize(void) lmt_interface.command_names[get_mark_cmd] = (command_item) { .id = get_mark_cmd, .lua = lua_key_index(get_mark), .name = lua_key(get_mark), .kind = regular_command_item, .min = 0, .max = last_get_mark_code, .base = 0, .fixedvalue = 0 }; lmt_interface.command_names[call_cmd] = (command_item) { .id = call_cmd, .lua = lua_key_index(call), .name = lua_key(call), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; lmt_interface.command_names[protected_call_cmd] = (command_item) { .id = protected_call_cmd, .lua = lua_key_index(protected_call), .name = lua_key(protected_call), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; - lmt_interface.command_names[semi_protected_call_cmd] = (command_item) { .id = semi_protected_call_cmd, .lua = lua_key_index(semi_protected_call), .name = lua_key(protected_call), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; + lmt_interface.command_names[semi_protected_call_cmd] = (command_item) { .id = semi_protected_call_cmd, .lua = lua_key_index(semi_protected_call), .name = lua_key(semi_protected_call), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; + lmt_interface.command_names[constant_call_cmd] = (command_item) { .id = constant_call_cmd, .lua = lua_key_index(constant_call), .name = lua_key(constant_call), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; lmt_interface.command_names[tolerant_call_cmd] = (command_item) { .id = tolerant_call_cmd, .lua = lua_key_index(tolerant_call), .name = lua_key(tolerant_call), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; lmt_interface.command_names[tolerant_protected_call_cmd] = (command_item) { .id = tolerant_protected_call_cmd, .lua = lua_key_index(tolerant_protected_call), .name = lua_key(tolerant_protected_call), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; - lmt_interface.command_names[tolerant_semi_protected_call_cmd] = (command_item) { .id = tolerant_semi_protected_call_cmd, .lua = lua_key_index(tolerant_semi_protected_call), .name = lua_key(tolerant_protected_call), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; - lmt_interface.command_names[deep_frozen_end_template_cmd] = (command_item) { .id = deep_frozen_end_template_cmd, .lua = lua_key_index(deep_frozen_cs_end_template), .name = lua_key(deep_frozen_cs_end_template), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; - lmt_interface.command_names[deep_frozen_dont_expand_cmd] = (command_item) { .id = deep_frozen_dont_expand_cmd, .lua = lua_key_index(deep_frozen_cs_dont_expand), .name = lua_key(deep_frozen_cs_dont_expand), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; + lmt_interface.command_names[tolerant_semi_protected_call_cmd] = (command_item) { .id = tolerant_semi_protected_call_cmd, .lua = lua_key_index(tolerant_semi_protected_call), .name = lua_key(tolerant_semi_protected_call), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; + lmt_interface.command_names[deep_frozen_end_template_cmd] = (command_item) { .id = deep_frozen_end_template_cmd, .lua = lua_key_index(deep_frozen_end_template), .name = lua_key(deep_frozen_end_template), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; + lmt_interface.command_names[deep_frozen_dont_expand_cmd] = (command_item) { .id = deep_frozen_dont_expand_cmd, .lua = lua_key_index(deep_frozen_dont_expand), .name = lua_key(deep_frozen_dont_expand), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; + lmt_interface.command_names[deep_frozen_keep_constant_cmd] = (command_item) { .id = deep_frozen_keep_constant_cmd, .lua = lua_key_index(deep_frozen_keep_constant), .name = lua_key(deep_frozen_keep_constant), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; lmt_interface.command_names[internal_glue_reference_cmd] = (command_item) { .id = internal_glue_reference_cmd, .lua = lua_key_index(internal_glue_reference), .name = lua_key(internal_glue_reference), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; lmt_interface.command_names[register_glue_reference_cmd] = (command_item) { .id = register_glue_reference_cmd, .lua = lua_key_index(register_glue_reference), .name = lua_key(register_glue_reference), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; lmt_interface.command_names[internal_mu_glue_reference_cmd] = (command_item) { .id = internal_mu_glue_reference_cmd, .lua = lua_key_index(internal_mu_glue_reference), .name = lua_key(internal_mu_glue_reference), .kind = token_command_item, .min = ignore_entry, .max = ignore_entry, .base = ignore_entry, .fixedvalue = 0 }; @@ -1445,6 +1447,7 @@ static int tokenlib_scan_detokened(lua_State *L) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: @@ -1497,10 +1500,12 @@ static int tokenlib_scan_string(lua_State *L) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: { + /*tex It is pretty unlikely to end up here, because we expand. */ halfword t = token_link(cur_chr); lmt_token_list_to_luastring(L, t, 0, 0, 1); break; @@ -1550,24 +1555,41 @@ static int tokenlib_scan_argument(lua_State *L) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + // case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: - { - halfword result; - halfword defref = lmt_input_state.def_ref; - tex_back_input(right_brace_token + '}'); - if (lua_type(L, 1) == LUA_TBOOLEAN && ! lua_toboolean(L, 1)) { - tex_expand_current_token(); - result = tex_scan_toks_normal(1, NULL); - } else { - tex_back_input(cur_tok); - result = tex_scan_toks_expand(1, NULL, 0); - } - lmt_token_list_to_luastring(L, result, 0, 0, 1); - lmt_input_state.def_ref = defref; - break; - } + { + halfword result; + halfword defref = lmt_input_state.def_ref; + tex_back_input(right_brace_token + '}'); + if (lua_type(L, 1) == LUA_TBOOLEAN && ! lua_toboolean(L, 1)) { + tex_expand_current_token(); + result = tex_scan_toks_normal(1, NULL); + } else { + tex_back_input(cur_tok); + result = tex_scan_toks_expand(1, NULL, 0); + } + lmt_token_list_to_luastring(L, result, 0, 0, 1); + lmt_input_state.def_ref = defref; + break; + } + case constant_call_cmd: + { + halfword h = token_link(cur_chr); + if (h) { + luaL_Buffer b; + luaL_buffinit(L, &b); + while (h) { + tokenlib_aux_add_utf_char_to_buffer(&b, token_chr(token_info(h))); + h = token_link(h); + } + luaL_pushresult(&b); + } else { + lua_pushliteral(L, ""); + } + break; + } case letter_cmd: case other_char_cmd: { @@ -1694,6 +1716,7 @@ static int tokenlib_scan_delimited(lua_State *L) switch (cur_cmd) { case call_cmd: case tolerant_call_cmd: + case constant_call_cmd: tex_expand_current_token(); goto PICKUP; case protected_call_cmd: @@ -2112,6 +2135,7 @@ static int tokenlib_scan_value(lua_State *L) break; /* case call_cmd: + case constant_call_cmd: { halfword t = cur_cs ? cs_token_flag + cur_cs : token_val(cur_cmd, cur_chr); if (t >= cs_token_flag) { @@ -2154,6 +2178,7 @@ static int tokenlib_scan_value(lua_State *L) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: @@ -2307,7 +2332,7 @@ static int tokenlib_is_defined(lua_State *L) size_t l; const char *s = lua_tolstring(L, 1, &l); if (l > 0) { - int cs = tex_string_locate(s, l, 0); + int cs = tex_string_locate_only(s, l); b = (cs != undefined_control_sequence) && (eq_type(cs) != undefined_cs_cmd); } } @@ -2402,7 +2427,7 @@ static int tokenlib_get_cmdchrcs(lua_State* L) size_t l; const char *s = lua_tolstring(L, 1, &l); if (l > 0) { - int cs = tex_string_locate(s, l, 0); + int cs = tex_string_locate_only(s, l); int cmd = eq_type(cs); int chr = eq_value(cs); if (! lua_toboolean(L, 2)) { @@ -2457,7 +2482,7 @@ static int tokenlib_get_cstoken(lua_State* L) size_t l; const char *s = lua_tolstring(L, 1, &l); if (l > 0) { - lua_pushinteger(L, (lua_Integer) tex_string_locate(s, l, 0) + cs_token_flag); + lua_pushinteger(L, (lua_Integer) tex_string_locate_only(s, l) + cs_token_flag); return 1; } return 0; @@ -2774,12 +2799,7 @@ inline static int tokenlib_get_constant(lua_State *L) { lua_token *n = tokenlib_aux_check_istoken(L, 1); halfword tok = token_info(n->token); - int result = 0; - if (tok >= cs_token_flag && is_call_cmd(eq_type(tok - cs_token_flag))) { - halfword v = eq_value(tok - cs_token_flag); - result = v && get_token_reference(v) == max_token_reference; - } - lua_pushboolean(L, result); + lua_pushboolean(L, tok >= cs_token_flag && (eq_type(tok - cs_token_flag) == constant_call_cmd)); return 1; } @@ -2848,7 +2868,7 @@ static int tokenlib_get_fields(lua_State *L) if (l > 0) { halfword cs; lua_createtable(L, 0, onlyflags ? 0 : 5); - cs = tex_string_locate(str, l, 0); + cs = tex_string_locate_only(str, l); cmd = eq_type(cs); chr = eq_value(cs); flags = eq_flag(cs); @@ -3087,7 +3107,7 @@ static int tokenlib_get_meaning(lua_State *L) if (lua_type(L, 1) == LUA_TSTRING) { size_t lname = 0; const char *name = lua_tolstring(L, 1, &lname); - halfword cs = tex_string_locate(name, lname, 0); + halfword cs = tex_string_locate_only(name, lname); halfword cmd = eq_type(cs); if (is_call_cmd(cmd)) { int chr = eq_value(cs); @@ -3160,7 +3180,7 @@ static int tokenlib_get_macro(lua_State *L) if (lua_type(L, 1) == LUA_TSTRING) { size_t lname = 0; const char *name = lua_tolstring(L, 1, &lname); - halfword cs = tex_string_locate(name, lname, 0); + halfword cs = tex_string_locate_only(name, lname); halfword cmd = eq_type(cs); if (is_call_cmd(cmd)) { halfword chr = eq_value(cs); @@ -3198,7 +3218,7 @@ static int tokenlib_push_macro(lua_State *L) // todo: just store cmd and flag to size_t lname = 0; const char *name = lua_tolstring(L, 1, &lname); if (lname > 0) { - halfword cs = tex_string_locate(name, lname, 0); + halfword cs = tex_string_locate_only(name, lname); singleword cmd = eq_type(cs); halfword chr = eq_value(cs); quarterword global = lua_toboolean(L, 2) ? add_global_flag(0) : 0; /* how */ @@ -3355,9 +3375,6 @@ static int tokenlib_set_macro(lua_State *L) /* todo: protected */ h = get_reference_token(); /*tex Options: 1=create (will trigger an error), 2=ignore. */ tex_parse_str_to_tok(h, null, ct, str, lstr, lua_toboolean(L, slot++) ? 2 : 1); - if (is_constant(flags)) { - set_token_reference(h, max_token_reference); - } } else { h = lmt_token_state.empty; // tex_add_token_reference(h); @@ -3379,7 +3396,7 @@ halfword lmt_macro_to_tok(lua_State *L, int slot, halfword *tail) { size_t lname = 0; const char *name = lua_tolstring(L, slot, &lname); - int cs = tex_string_locate(name, lname, 0); + int cs = tex_string_locate_only(name, lname); int cmd = eq_type(cs); if (is_call_cmd(cmd)) { tok = cs_token_flag + cs; @@ -3542,7 +3559,7 @@ static int tokenlib_get_constant_value(lua_State *L, halfword cmd) size_t l; const char *s = lua_tolstring(L, 1, &l); if (l > 0) { - int cs = tex_string_locate(s, l, 0); + int cs = tex_string_locate_only(s, l); if (eq_type(cs) == cmd) { lua_pushinteger(L, eq_value(cs)); return 1; diff --git a/source/luametatex/source/luametatex.h b/source/luametatex/source/luametatex.h index 68820d24d..bb39d8517 100644 --- a/source/luametatex/source/luametatex.h +++ b/source/luametatex/source/luametatex.h @@ -92,7 +92,7 @@ # define luametatex_version 210 # define luametatex_revision 9 # define luametatex_version_string "2.10.09" -# define luametatex_development_id 20230531 +# define luametatex_development_id 20230604 # define luametatex_name_camelcase "LuaMetaTeX" # define luametatex_name_lowercase "luametatex" diff --git a/source/luametatex/source/tex/texalign.c b/source/luametatex/source/tex/texalign.c index 8de3adff9..3332d82f9 100644 --- a/source/luametatex/source/tex/texalign.c +++ b/source/luametatex/source/tex/texalign.c @@ -532,6 +532,7 @@ static void tex_aux_get_preamble_token(void) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: @@ -851,7 +852,7 @@ void tex_finish_no_alignment_group(void) static void tex_aux_align_peek(void) { RESTART: - lmt_input_state.align_state = 1000000; + lmt_input_state.align_state = busy_alignment_state; AGAIN: tex_get_x_or_protected(); switch (cur_cmd) { @@ -863,6 +864,7 @@ static void tex_aux_align_peek(void) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: @@ -907,7 +909,7 @@ void tex_run_alignment_initialize(void) { halfword saved_cs = cur_cs; tex_aux_push_alignment(); - lmt_input_state.align_state = -1000000; + lmt_input_state.align_state = initial_alignment_state; /*tex When |\halign| is used as a displayed formula, there should be no other pieces of mlists present. @@ -947,7 +949,7 @@ void tex_run_alignment_initialize(void) lmt_alignment_state.cur_loop = null; lmt_input_state.scanner_status = scanner_is_aligning; lmt_input_state.warning_index = saved_cs; - lmt_input_state.align_state = -1000000; + lmt_input_state.align_state = initial_alignment_state; /*tex At this point, |cur_cmd = left_brace|. */ while (1) { /*tex Append the current tabskip glue to the preamble list. */ @@ -973,7 +975,7 @@ void tex_run_alignment_initialize(void) tex_aux_get_preamble_token(); if ((cur_cmd == alignment_cmd && cur_chr == align_content_code) || cur_cmd == parameter_cmd) { break; - } else if ((cur_cmd == alignment_cmd || cur_cmd == alignment_tab_cmd) && (lmt_input_state.align_state == -1000000)) { + } else if ((cur_cmd == alignment_cmd || cur_cmd == alignment_tab_cmd) && (lmt_input_state.align_state == initial_alignment_state)) { if ((current == lmt_alignment_state.hold_token_head) && (! lmt_alignment_state.cur_loop) && (cur_cmd == alignment_tab_cmd)) { lmt_alignment_state.cur_loop = lmt_alignment_state.cur_align; } else { @@ -1002,7 +1004,7 @@ void tex_run_alignment_initialize(void) token_link(current) = null; while (1) { tex_aux_get_preamble_token(); - if ((cur_cmd == alignment_cmd || cur_cmd == alignment_tab_cmd) && (lmt_input_state.align_state == -1000000)) { + if ((cur_cmd == alignment_cmd || cur_cmd == alignment_tab_cmd) && (lmt_input_state.align_state == initial_alignment_state)) { break; } else if ((cur_cmd == alignment_cmd && cur_chr == align_content_code) || cur_cmd == parameter_cmd) { tex_handle_error( @@ -1157,7 +1159,7 @@ void tex_insert_alignment_template(void) align_record_cmd(lmt_alignment_state.cur_align) = cur_cmd; align_record_chr(lmt_alignment_state.cur_align) = cur_chr; tex_begin_token_list(tok, template_post_text); - lmt_input_state.align_state = 1000000; + lmt_input_state.align_state = busy_alignment_state; lmt_alignment_state.cell_source = alignment_cell_source_par; if (alignment_wrap_source_par) { lmt_alignment_state.wrap_source = alignment_wrap_source_par; @@ -1226,7 +1228,7 @@ static int tex_aux_finish_column(void) halfword q = node_next(lmt_alignment_state.cur_align); if (! q) { tex_confusion("end template, case 2"); - } else if (lmt_input_state.align_state < 500000) { + } else if (lmt_input_state.align_state < interwoven_alignment_threshold) { tex_alignment_interwoven_error(1); } else { /*tex A few state variables. */ @@ -1379,7 +1381,7 @@ static int tex_aux_finish_column(void) tex_aux_initialize_span(record); } } - lmt_input_state.align_state = 1000000; + lmt_input_state.align_state = busy_alignment_state; do { tex_get_x_or_protected(); } while (cur_cmd == spacer_cmd); diff --git a/source/luametatex/source/tex/texcommands.c b/source/luametatex/source/tex/texcommands.c index ae22f9794..71793cb73 100644 --- a/source/luametatex/source/tex/texcommands.c +++ b/source/luametatex/source/tex/texcommands.c @@ -1360,6 +1360,10 @@ void tex_initialize_commands(void) set_eq_type(deep_frozen_cs_dont_expand_code, deep_frozen_dont_expand_cmd); set_eq_flag(deep_frozen_cs_dont_expand_code, 0); + cs_text(deep_frozen_cs_keep_constant_code) = tex_maketexstring("keepconstant"); + set_eq_type(deep_frozen_cs_keep_constant_code, deep_frozen_keep_constant_cmd); + set_eq_flag(deep_frozen_cs_keep_constant_code, 0); + cs_text(deep_frozen_cs_protection_code) = tex_maketexstring("inaccessible"); cs_text(deep_frozen_cs_end_write_code) = tex_maketexstring("endwrite"); diff --git a/source/luametatex/source/tex/texcommands.h b/source/luametatex/source/tex/texcommands.h index 04f8fb606..16dc47520 100644 --- a/source/luametatex/source/tex/texcommands.h +++ b/source/luametatex/source/tex/texcommands.h @@ -279,6 +279,7 @@ typedef enum tex_command_code { call_cmd, /*tex regular control sequence */ protected_call_cmd, /*tex idem but doesn't expand in edef like situations */ semi_protected_call_cmd, + constant_call_cmd, tolerant_call_cmd, /*tex control sequence with tolerant arguments */ tolerant_protected_call_cmd, /*tex idem but doesn't expand in edef like situations */ tolerant_semi_protected_call_cmd, @@ -287,6 +288,7 @@ typedef enum tex_command_code { */ deep_frozen_end_template_cmd, /*tex end of an alignment template */ deep_frozen_dont_expand_cmd, /*tex the following token was marked by |\noexpand|) */ + deep_frozen_keep_constant_cmd, /*tex The next bunch is never seen directly as they are shortcuts to registers and special data strutures. They are the internal register (pseudo) commands and are also needed for diff --git a/source/luametatex/source/tex/texconditional.c b/source/luametatex/source/tex/texconditional.c index b4541f342..c4cf7f902 100644 --- a/source/luametatex/source/tex/texconditional.c +++ b/source/luametatex/source/tex/texconditional.c @@ -407,6 +407,7 @@ inline static halfword tex_aux_grab_toks(int expand, int expandlist, int *head) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: @@ -756,11 +757,15 @@ void tex_conditional_if(halfword code, int unless) p = cur_cmd; q = cur_chr; tex_get_next(); - if (cur_cmd != p) { + if ((p == constant_call_cmd && cur_cmd == call_cmd) || (p == call_cmd && cur_cmd == constant_call_cmd)) { + /*tex This is a somewhat special case. */ + goto SOMECALLCMD; + } else if (cur_cmd != p) { result = 0; } else if (cur_cmd < call_cmd) { result = cur_chr == q; } else { + SOMECALLCMD: /*tex Test if two macro texts match. Note also that |\ifx| decides that macros |\a| and |\b| are different in examples like this: @@ -769,6 +774,9 @@ void tex_conditional_if(halfword code, int unless) \def\a{\c} \def\c{} \def\b{\d} \def\d{} \stoptyping + + We acctually have commands beyond valid call commands but they are never + seen here. */ p = token_link(cur_chr); /*tex Omit reference counts. */ @@ -951,6 +959,7 @@ void tex_conditional_if(halfword code, int unless) EMPTY_CHECK_AGAIN: switch (cur_cmd) { case call_cmd: + case constant_call_cmd: result = ! token_link(cur_chr); break; case internal_toks_reference_cmd: @@ -1047,10 +1056,17 @@ void tex_conditional_if(halfword code, int unless) */ if (lmt_input_state.cur_input.loc) { halfword t = token_info(lmt_input_state.cur_input.loc); - lmt_input_state.cur_input.loc = token_link(lmt_input_state.cur_input.loc); if (t < cs_token_flag && token_cmd(t) == parameter_reference_cmd) { + lmt_input_state.cur_input.loc = token_link(lmt_input_state.cur_input.loc); result = lmt_input_state.parameter_stack[lmt_input_state.cur_input.parameter_start + token_chr(t) - 1] != null ? 1 : 2; - } + } else { + /*tex + We have a replacement text so we check and backtrack. This is somewhat + tricky because a parameter can be a condition but we assume sane usage. + */ + tex_get_token(); + result = cur_cmd == if_test_cmd ? 2 : 1; + } } goto CASE; } diff --git a/source/luametatex/source/tex/texdumpdata.h b/source/luametatex/source/tex/texdumpdata.h index 94a153374..cd6943d6c 100644 --- a/source/luametatex/source/tex/texdumpdata.h +++ b/source/luametatex/source/tex/texdumpdata.h @@ -55,7 +55,7 @@ */ -# define luametatex_format_fingerprint 692 +# define luametatex_format_fingerprint 693 /* These end up in the string pool. */ diff --git a/source/luametatex/source/tex/texequivalents.c b/source/luametatex/source/tex/texequivalents.c index 036a4a3d5..5c917afb2 100644 --- a/source/luametatex/source/tex/texequivalents.c +++ b/source/luametatex/source/tex/texequivalents.c @@ -851,6 +851,7 @@ static void tex_aux_eq_destroy(memoryword w) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: @@ -975,6 +976,7 @@ inline static int tex_aux_equal_eq(halfword p, singleword cmd, singleword flag, case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: diff --git a/source/luametatex/source/tex/texequivalents.h b/source/luametatex/source/tex/texequivalents.h index af3d98000..19c6959b7 100644 --- a/source/luametatex/source/tex/texequivalents.h +++ b/source/luametatex/source/tex/texequivalents.h @@ -240,13 +240,19 @@ n= 65496 cs=46426 indirect=14512 \stoptyping + We don't use the 85% prime (and we % the accumulated hash. Somehow this also performs better, + but of course I migbe be wrong. + */ -// # define hash_size 65536 -// # define hash_prime 65497 +//define hash_size 65536 +//define hash_prime 65497 # define hash_size 131072 /*tex 128K */ -# define hash_prime 131041 /*tex Plenty of room for the frozen. */ +# define hash_prime 131041 /*tex not the 85% prime */ + +//define hash_size 262144 /*tex 256K */ +//define hash_prime 262103 /*tex not the 85% prime */ # define null_cs 1 /*tex equivalent of |\csname\| |\endcsname| */ # define hash_base (null_cs + 1) /*tex beginning of region 2, for the hash table */ @@ -265,6 +271,7 @@ typedef enum deep_frozen_cs_codes { deep_frozen_cs_relax_code, /*tex permanent |\relax| */ deep_frozen_cs_end_write_code, /*tex permanent |\endwrite| */ deep_frozen_cs_dont_expand_code, /*tex permanent |\notexpanded:| */ + deep_frozen_cs_keep_constant_code, /*tex permanent |\notexpanded:| */ deep_frozen_cs_null_font_code, /*tex permanent |\nullfont| */ deep_frozen_cs_undefined_code, } deep_frozen_cs_codes; @@ -1282,7 +1289,9 @@ typedef enum flag_bit { inline static singleword tex_flags_to_cmd(int flags) { - if (is_tolerant(flags)) { + if (is_constant(flags)) { + return constant_call_cmd; + } else if (is_tolerant(flags)) { return is_protected (flags) ? tolerant_protected_call_cmd : (is_semiprotected(flags) ? tolerant_semi_protected_call_cmd : tolerant_call_cmd); } else { diff --git a/source/luametatex/source/tex/texexpand.c b/source/luametatex/source/tex/texexpand.c index d0de0c9f1..613fba0aa 100644 --- a/source/luametatex/source/tex/texexpand.c +++ b/source/luametatex/source/tex/texexpand.c @@ -393,10 +393,10 @@ void tex_expand_current_token(void) |scanner_status| temporarily. */ halfword t; - halfword save_scanner_status = lmt_input_state.scanner_status; - lmt_input_state.scanner_status = scanner_is_normal; +// halfword save_scanner_status = lmt_input_state.scanner_status; +// lmt_input_state.scanner_status = scanner_is_normal; t = tex_get_token(); - lmt_input_state.scanner_status = save_scanner_status; +// lmt_input_state.scanner_status = save_scanner_status; tex_back_input(t); /*tex Now |start| and |loc| point to the backed-up token |t|. */ if (t >= cs_token_flag) { @@ -637,16 +637,24 @@ static int tex_aux_collect_cs_tokens(halfword *p, int *n) /* break; */ case call_cmd: case tolerant_call_cmd: - if (get_token_reference(cur_chr) == max_token_reference) { // ! get_token_parameters(cur_chr)) { - /* we avoid the macro stack and expansion and we don't trace either */ - halfword h = token_link(cur_chr); - while (h) { - *p = tex_store_new_token(*p, token_info(h)); - *n += 1; - h = token_link(h); - } - } else { - tex_aux_macro_call(cur_cs, cur_cmd, cur_chr); + tex_aux_macro_call(cur_cs, cur_cmd, cur_chr); + break; + case constant_call_cmd: + { + halfword h = token_link(cur_chr); + if (h) { + if (token_link(h)) { + *p = tex_store_new_token(*p, token_val(deep_frozen_keep_constant_cmd, cur_chr)); + } else { + *p = tex_store_new_token(*p, token_info(h)); + } + *n += 1; + } + // while (h) { + // *p = tex_store_new_token(*p, token_info(h)); + // *n += 1; + // h = token_link(h); + // } } break; case end_cs_name_cmd: @@ -695,10 +703,18 @@ int tex_is_valid_csname(void) int m = f; halfword l = token_link(h); while (l) { - m = tex_aux_uni_to_buffer(lmt_fileio_state.io_buffer, m, token_chr(token_info(l))); + if (token_cmd(token_info(l)) == deep_frozen_keep_constant_cmd) { + halfword h = token_link(token_chr(token_info(l))); + while (h) { + m = tex_aux_uni_to_buffer(lmt_fileio_state.io_buffer, m, token_chr(token_info(h))); + h = token_link(h); + } + } else { + m = tex_aux_uni_to_buffer(lmt_fileio_state.io_buffer, m, token_chr(token_info(l))); + } l = token_link(l); } - cs = tex_id_locate(f, m - f, 0); /*tex Don't create a new cs! */ + cs = tex_id_locate_only(f, m - f); b = (cs != undefined_control_sequence) && (eq_type(cs) != undefined_cs_cmd); } } diff --git a/source/luametatex/source/tex/texinputstack.c b/source/luametatex/source/tex/texinputstack.c index 92a9c8a0c..4ef3307c3 100644 --- a/source/luametatex/source/tex/texinputstack.c +++ b/source/luametatex/source/tex/texinputstack.c @@ -789,7 +789,7 @@ void tex_end_token_list(void) case parameter_text: break; case template_pre_text: - if (lmt_input_state.align_state > 500000) { + if (lmt_input_state.align_state > interwoven_alignment_threshold) { lmt_input_state.align_state = 0; } else { tex_alignment_interwoven_error(7); @@ -840,7 +840,7 @@ void tex_cleanup_input_state(void) case parameter_text: break; case template_pre_text: - if (lmt_input_state.align_state > 500000) { + if (lmt_input_state.align_state > interwoven_alignment_threshold) { lmt_input_state.align_state = 0; } else { tex_alignment_interwoven_error(7); @@ -1083,7 +1083,7 @@ void tex_initialize_inputstack(void) lmt_token_state.luacstrings = 0; lmt_input_state.cur_input.cattable = default_catcode_table_preset; lmt_input_state.cur_input.partial = 0; - lmt_input_state.align_state = 1000000; + lmt_input_state.align_state = busy_alignment_state; } /*tex diff --git a/source/luametatex/source/tex/texmaincontrol.c b/source/luametatex/source/tex/texmaincontrol.c index 29b652ab7..2ee450375 100644 --- a/source/luametatex/source/tex/texmaincontrol.c +++ b/source/luametatex/source/tex/texmaincontrol.c @@ -2071,6 +2071,10 @@ static void tex_aux_run_glue(void) halfword v = tex_scan_glue(glue_val_level, 0); halfword g = tex_new_glue_node(v, user_skip_glue); /* glue_data(g) = glue_data_par; */ + if (cur_mode == mmode) { + /*tex This could be an option. */ + glue_options(g) |= glue_option_no_auto_break; + } tex_tail_append(g); tex_flush_node(v); break; @@ -4638,12 +4642,6 @@ static void tex_aux_set_def(int a, int force) if (force || tex_define_permitted(cur_cs, a)) { halfword p = cur_cs; halfword t = expand == 2 ? tex_scan_toks_expand(0, null, 1) : (expand ? tex_scan_macro_expand() : tex_scan_macro_normal()); - if (is_constant(a)) { - /* todo: check if already defined or just accept a leak */ - set_token_reference(t, max_token_reference); - // } else if (! token_link(t)) { - // t = lmt_token_state.empty; /* leaks */ - } tex_define(a, p, tex_flags_to_cmd(a), t); } } diff --git a/source/luametatex/source/tex/texmath.c b/source/luametatex/source/tex/texmath.c index e93714000..d849d4d52 100644 --- a/source/luametatex/source/tex/texmath.c +++ b/source/luametatex/source/tex/texmath.c @@ -4066,6 +4066,7 @@ void tex_run_math_fence(void) halfword leftclass = unset_noad_class; halfword rightclass = unset_noad_class; halfword source = 0; + halfword factor = scaling_factor; halfword attrlist = null; quarterword st = (quarterword) cur_chr; halfword style = cur_list.math_style; @@ -4090,7 +4091,7 @@ void tex_run_math_fence(void) } while (1) { /* todo: break down */ - switch (tex_scan_character("hdanlevpcrsutbHDANLEVPCRSUTB", 0, 1, 0)) { + switch (tex_scan_character("hdanlevpcrsutbfHDANLEVPCRSUTBF", 0, 1, 0)) { case 0: goto CHECK_PAIRING; case 'a': case 'A': @@ -4125,6 +4126,11 @@ void tex_run_math_fence(void) dp = tex_scan_dimen(0, 0, 0, 0, NULL); } break; + case 'f': case 'F': + if (tex_scan_mandate_keyword("factor", 1)) { + factor = tex_scan_int(0, NULL); + } + break; case 'h': case 'H': if (tex_scan_mandate_keyword("height", 1)) { ht = tex_scan_dimen(0, 0, 0, 0, NULL); @@ -4353,12 +4359,14 @@ void tex_run_math_fence(void) switch (st) { case left_fence_side: tex_aux_append_math_fence(fence, open_noad_subtype); + fence_nesting_factor(fence) = factor; break; case middle_fence_side: tex_aux_append_math_fence(fence, middle_noad_subtype); break; case right_fence_side: tex_aux_append_math_fence(fence, close_noad_subtype); + fence_nesting_factor(fence) = factor; break; case left_operator_side: { diff --git a/source/luametatex/source/tex/texmlist.c b/source/luametatex/source/tex/texmlist.c index 13085dca1..0ec6db249 100644 --- a/source/luametatex/source/tex/texmlist.c +++ b/source/luametatex/source/tex/texmlist.c @@ -7047,6 +7047,26 @@ static void tex_mlist_to_hlist_finalize_list(mliststate *state) /*tex Here we have a left, right, middle */ current_type = simple_noad; /*tex Same kind of fields. */ current_subtype = noad_analyzed(current); + if (fence_nesting_factor(current) && fence_nesting_factor(current) != scaling_factor) { + switch(current_subtype) { + case open_noad_subtype: + boundarylevel++; + boundaryfactor = fence_nesting_factor(current); + break; + case close_noad_subtype: + if (boundarylevel > 0) { + boundarylevel--; + if (boundarylevel == 0) { + boundaryfactor = scaling_factor; + } else { + boundaryfactor = fence_nesting_factor(current); + } + } else { + boundaryfactor = scaling_factor; + } + break; + } + } packedfence = current; break; case style_node: @@ -7089,7 +7109,9 @@ static void tex_mlist_to_hlist_finalize_list(mliststate *state) case 3: if (boundarylevel > 0) { boundarylevel--; - if (l == 2) { + if (boundarylevel == 0) { + boundaryfactor = scaling_factor; + } else if (l == 2) { boundaryfactor = boundary_reserved(current) ? boundary_reserved(current) : scaling_factor; } } else { diff --git a/source/luametatex/source/tex/texnodes.c b/source/luametatex/source/tex/texnodes.c index 48a1bd2db..52125cc7c 100644 --- a/source/luametatex/source/tex/texnodes.c +++ b/source/luametatex/source/tex/texnodes.c @@ -833,7 +833,7 @@ void lmt_nodelib_initialize(void) { inline static void lmt_properties_push(lua_State * L) { - lmt_node_memory_state.lua_properties_level++ ; + lmt_node_memory_state.lua_properties_level++; if (lmt_node_memory_state.lua_properties_level == 1) { lua_rawgeti(L, LUA_REGISTRYINDEX, lmt_node_memory_state.node_properties_id); } @@ -844,7 +844,7 @@ inline static void lmt_properties_pop(lua_State * L) if (lmt_node_memory_state.lua_properties_level == 1) { lua_pop(L, 1); } - lmt_node_memory_state.lua_properties_level-- ; + lmt_node_memory_state.lua_properties_level--; } /*tex Resetting boils down to nilling. */ @@ -1114,7 +1114,7 @@ halfword tex_copy_node_only(halfword p) # define copy_sub_node(target,source) do { \ if (source) { \ halfword copy_stub = tex_copy_node(source); \ - target = copy_stub ; \ + target = copy_stub; \ } else { \ target = null; \ } \ @@ -1181,7 +1181,7 @@ halfword tex_copy_node(halfword p) /* how about null */ } break; case insert_node: - copy_sub_list(insert_list(r), insert_list(p)) ; + copy_sub_list(insert_list(r), insert_list(p)); break; case mark_node: tex_add_token_reference(mark_ptr(p)); @@ -1190,53 +1190,53 @@ halfword tex_copy_node(halfword p) /* how about null */ copy_sub_list(adjust_list(r), adjust_list(p)); break; case choice_node: - copy_sub_list(choice_display_mlist(r), choice_display_mlist(p)) ; - copy_sub_list(choice_text_mlist(r), choice_text_mlist(p)) ; - copy_sub_list(choice_script_mlist(r), choice_script_mlist(p)) ; - copy_sub_list(choice_script_script_mlist(r), choice_script_script_mlist(p)) ; + copy_sub_list(choice_display_mlist(r), choice_display_mlist(p)); + copy_sub_list(choice_text_mlist(r), choice_text_mlist(p)); + copy_sub_list(choice_script_mlist(r), choice_script_mlist(p)); + copy_sub_list(choice_script_script_mlist(r), choice_script_script_mlist(p)); break; case simple_noad: case radical_noad: case fraction_noad: case accent_noad: - copy_sub_list(noad_nucleus(r), noad_nucleus(p)) ; - copy_sub_list(noad_subscr(r), noad_subscr(p)) ; - copy_sub_list(noad_supscr(r), noad_supscr(p)) ; - copy_sub_list(noad_subprescr(r), noad_subprescr(p)) ; - copy_sub_list(noad_supprescr(r), noad_supprescr(p)) ; - copy_sub_list(noad_prime(r), noad_prime(p)) ; - // copy_sub_list(noad_state(r), noad_state(p)) ; + copy_sub_list(noad_nucleus(r), noad_nucleus(p)); + copy_sub_list(noad_subscr(r), noad_subscr(p)); + copy_sub_list(noad_supscr(r), noad_supscr(p)); + copy_sub_list(noad_subprescr(r), noad_subprescr(p)); + copy_sub_list(noad_supprescr(r), noad_supprescr(p)); + copy_sub_list(noad_prime(r), noad_prime(p)); + // copy_sub_list(noad_state(r), noad_state(p)); switch (t) { case radical_noad: - copy_sub_node(radical_left_delimiter(r), radical_left_delimiter(p)) ; - copy_sub_node(radical_right_delimiter(r), radical_right_delimiter(p)) ; - copy_sub_node(radical_top_delimiter(r), radical_top_delimiter(p)) ; - copy_sub_node(radical_bottom_delimiter(r), radical_bottom_delimiter(p)) ; - copy_sub_list(radical_degree(r), radical_degree(p)) ; + copy_sub_node(radical_left_delimiter(r), radical_left_delimiter(p)); + copy_sub_node(radical_right_delimiter(r), radical_right_delimiter(p)); + copy_sub_node(radical_top_delimiter(r), radical_top_delimiter(p)); + copy_sub_node(radical_bottom_delimiter(r), radical_bottom_delimiter(p)); + copy_sub_list(radical_degree(r), radical_degree(p)); break; case fraction_noad: - // copy_sub_list(fraction_numerator(r), fraction_numerator(p)) ; - // copy_sub_list(fraction_denominator(r), fraction_denominator(p)) ; - copy_sub_node(fraction_left_delimiter(r), fraction_left_delimiter(p)) ; - copy_sub_node(fraction_right_delimiter(r), fraction_right_delimiter(p)) ; - copy_sub_node(fraction_middle_delimiter(r), fraction_middle_delimiter(p)) ; + // copy_sub_list(fraction_numerator(r), fraction_numerator(p)); + // copy_sub_list(fraction_denominator(r), fraction_denominator(p); + copy_sub_node(fraction_left_delimiter(r), fraction_left_delimiter(p)); + copy_sub_node(fraction_right_delimiter(r), fraction_right_delimiter(p)); + copy_sub_node(fraction_middle_delimiter(r), fraction_middle_delimiter(p)); break; case accent_noad: - copy_sub_list(accent_top_character(r), accent_top_character(p)) ; - copy_sub_list(accent_bottom_character(r), accent_bottom_character(p)) ; - copy_sub_list(accent_middle_character(r), accent_middle_character(p)) ; + copy_sub_list(accent_top_character(r), accent_top_character(p)); + copy_sub_list(accent_bottom_character(r), accent_bottom_character(p)); + copy_sub_list(accent_middle_character(r), accent_middle_character(p)); break; } break; case fence_noad: /* in principle also scripts */ - copy_sub_node(fence_delimiter_list(r), fence_delimiter_list(p)) ; - copy_sub_node(fence_delimiter_top(r), fence_delimiter_top(p)) ; - copy_sub_node(fence_delimiter_bottom(r), fence_delimiter_bottom(p)) ; + copy_sub_node(fence_delimiter_list(r), fence_delimiter_list(p)); + copy_sub_node(fence_delimiter_top(r), fence_delimiter_top(p)); + copy_sub_node(fence_delimiter_bottom(r), fence_delimiter_bottom(p)); break; case sub_box_node: case sub_mlist_node: - copy_sub_list(kernel_math_list(r), kernel_math_list(p)) ; + copy_sub_list(kernel_math_list(r), kernel_math_list(p)); break; case par_node: /* can also be copy_sub_node */ @@ -1960,7 +1960,7 @@ halfword tex_current_attribute_list(void) } return current_attribute_state; } else { - return null ; + return null; } } @@ -4417,7 +4417,7 @@ halfword tex_reversed_node_list(halfword list) halfword next = node_next(list); tex_couple_nodes(list, prev); if (node_type(list) == dir_node) { - node_subtype(list) = node_subtype(list) == cancel_dir_subtype ? normal_dir_subtype : cancel_dir_subtype ; + node_subtype(list) = node_subtype(list) == cancel_dir_subtype ? normal_dir_subtype : cancel_dir_subtype; } if (next) { prev = list; @@ -4569,7 +4569,7 @@ void tex_set_disc_field(halfword target, halfword location, halfword source) } node_prev(source) = null; /* don't expose this one! */ if (source) { - node_head(target) = source ; + node_head(target) = source; node_tail(target) = tex_tail_of_node_list(source); } else { node_head(target) = null; @@ -4627,7 +4627,7 @@ halfword tex_flatten_discretionaries(halfword head, int *count, int nest) } else { tex_try_couple_nodes(node_prev(current), h); } - disc_no_break_head(d) = null ; + disc_no_break_head(d) = null; } else if (current == head) { head = next; } else { diff --git a/source/luametatex/source/tex/texnodes.h b/source/luametatex/source/tex/texnodes.h index 492e220f2..f67667d2a 100644 --- a/source/luametatex/source/tex/texnodes.h +++ b/source/luametatex/source/tex/texnodes.h @@ -1987,6 +1987,7 @@ typedef enum math_accent_subtypes { # define fence_noad_size noad_size # define fence_delimiter_list noad_extra_1 // not really a list +# define fence_nesting_factor noad_extra_2 # define fence_delimiter_top noad_extra_3 # define fence_delimiter_bottom noad_extra_4 # define fence_top_overshoot noad_extra_5 diff --git a/source/luametatex/source/tex/texprimitive.c b/source/luametatex/source/tex/texprimitive.c index 54ef9b1b1..27239acf4 100644 --- a/source/luametatex/source/tex/texprimitive.c +++ b/source/luametatex/source/tex/texprimitive.c @@ -170,6 +170,7 @@ static int tex_aux_room_in_hash(void) 231--258.] https://en.wikipedia.org/wiki/Coalesced_hashing + https://programming.guide/coalesced-hashing.html Because we seldom use uppercase we get many misses, multiplying a chr j[k] by k actually gives a better spread. @@ -211,7 +212,7 @@ halfword tex_prim_lookup(strnumber s) /*tex We start searching here; note that |0 <= h < hash_prime|. */ halfword p = h + 1; while (1) { - /* When using |halfword text = prim_text(p)| no intelliugense warning for first test in: */ + /* When using |halfword text = prim_text(p)| no intellisense warning for first test in: */ if (prim_text(p) > 0 && str_length(prim_text(p)) == l && tex_str_eq_str(prim_text(p), s)) { return p; } else if (prim_next(p)) { @@ -506,15 +507,14 @@ static halfword tex_aux_insert_id(halfword p, const unsigned char *j, unsigned i halfword tex_id_locate(int j, int l, int create) { /*tex The index in |hash| array: */ - halfword h = tex_aux_compute_hash((char *) (lmt_fileio_state.io_buffer + j), (unsigned) l); + halfword p = tex_aux_compute_hash((char *) (lmt_fileio_state.io_buffer + j), (unsigned) l) + hash_base; /*tex We start searching here. Note that |0 <= h < hash_prime|: */ - halfword p = h + hash_base; - /*tex The next one in a list: */ while (1) { strnumber s = cs_text(p); if ((s > 0) && (str_length(s) == (unsigned) l) && tex_str_eq_buf(s, j, l)) { return p; } else { + /*tex The next one in a chain: */ halfword n = cs_next(p); if (n) { p = n; @@ -528,6 +528,20 @@ halfword tex_id_locate(int j, int l, int create) return undefined_control_sequence; } +halfword tex_id_locate_only(int j, int l) +{ + halfword p = tex_aux_compute_hash((char *) (lmt_fileio_state.io_buffer + j), (unsigned) l) + hash_base; + while (p) { + strnumber s = cs_text(p); + if ((s > 0) && (str_length(s) == (unsigned) l) && tex_str_eq_buf(s, j, l)) { + return p; + } else { + p = cs_next(p); + } + } + return undefined_control_sequence; +} + /*tex Here is a similar subroutine for finding a primitive in the hash. This one is based on a \CCODE\ @@ -558,10 +572,22 @@ halfword tex_string_locate(const char *s, size_t l, int create) return undefined_control_sequence; } +halfword tex_string_locate_only(const char *s, size_t l) +{ + halfword p = tex_aux_compute_hash(s, (unsigned) l) + hash_base; + while (p) { + if (cs_text(p) > 0 && tex_str_eq_cstr(cs_text(p), s, (int) l)) { + return p; + } else { + p = cs_next(p); + } + } + return undefined_control_sequence; +} + halfword tex_located_string(const char *s) { - size_t l = strlen(s); - return tex_string_locate(s, l, 0); + return tex_string_locate_only(s, strlen(s)); } /*tex @@ -704,6 +730,9 @@ void tex_print_cmd_flags(halfword cs, halfword cmd, int flags, int escaped) if (is_instance (flags)) { (escaped ? tex_print_str_esc : tex_print_str)("instance " ); } if (is_untraced (flags)) { (escaped ? tex_print_str_esc : tex_print_str)("untraced " ); } } + if (is_constant_cmd(cmd)) { + (escaped ? tex_print_str_esc : tex_print_str)("constant " ); + } if (is_tolerant_cmd(cmd)) { (escaped ? tex_print_str_esc : tex_print_str)("tolerant " ); } @@ -791,6 +820,7 @@ void tex_print_cmd_chr(singleword cmd, halfword chr) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: @@ -899,6 +929,10 @@ void tex_print_cmd_chr(singleword cmd, halfword chr) /*tex Kind of special. */ tex_print_str_esc("notexpanded"); break; + case deep_frozen_keep_constant_cmd: + /*tex Kind of special. */ + tex_print_str_esc("keepconstant"); + break; case internal_box_reference_cmd: tex_print_str_esc("hiddenlocalbox"); break; diff --git a/source/luametatex/source/tex/texprimitive.h b/source/luametatex/source/tex/texprimitive.h index 640a6b232..f4cf6dd97 100644 --- a/source/luametatex/source/tex/texprimitive.h +++ b/source/luametatex/source/tex/texprimitive.h @@ -36,14 +36,18 @@ extern hash_state_info lmt_hash_state; We use no defines as a |hash| macro will clash with lua hash. Most hash accessors are in a few places where it makes sense to be explicit anyway. + The only reason why we have a dedicated primitive hash is because we can selectively enable + them but at some point we might just always do that. There is never a runtiem lookup (asuming + a format). It also gives is access to some primitive metadata. + */ # define cs_next(a) lmt_hash_state.hash[(a)].half0 /*tex link for coalesced lists */ # define cs_text(a) lmt_hash_state.hash[(a)].half1 /*tex string number for control sequence name */ # define undefined_primitive 0 -# define prim_size 2100 /*tex (can be 1000) maximum number of primitives (quite a bit more than needed) */ -# define prim_prime 1777 /*tex (can be 853) about 85 percent of |primitive_size| */ +# define prim_size 2100 /*tex maximum number of primitives (quite a bit more than needed) */ +# define prim_prime 1777 /*tex about 85 percent of |primitive_size| */ typedef struct primitive_info { halfword subids; /*tex number of name entries */ @@ -87,9 +91,11 @@ extern void tex_dump_hashtable (dumpstream f); extern void tex_undump_hashtable (dumpstream f); /* halfword tex_string_lookup (const char *s, size_t l); */ extern halfword tex_string_locate (const char *s, size_t l, int create); +extern halfword tex_string_locate_only (const char *s, size_t l); extern halfword tex_located_string (const char *s); /* halfword tex_id_lookup (int j, int l); */ extern halfword tex_id_locate (int j, int l, int create); +extern halfword tex_id_locate_only (int j, int l); extern void tex_print_cmd_flags (halfword cs, halfword cmd, int flags, int escape); # endif diff --git a/source/luametatex/source/tex/texscanning.c b/source/luametatex/source/tex/texscanning.c index 9559a4040..83abd12a3 100644 --- a/source/luametatex/source/tex/texscanning.c +++ b/source/luametatex/source/tex/texscanning.c @@ -3703,8 +3703,18 @@ halfword tex_scan_toks_expand(int left_brace_found, halfword *tail, int expandco switch (cur_cmd) { case call_cmd: case tolerant_call_cmd: +// case constant_call_cmd: tex_expand_current_token(); goto PICKUP; + case constant_call_cmd: + { + halfword h = token_link(cur_chr); + while (h) { + p = tex_store_new_token(p, token_info(h)); + h = token_link(h); + } + goto PICKUP; + } case protected_call_cmd: case tolerant_protected_call_cmd: cur_tok = cs_token_flag + cur_cs; @@ -4020,8 +4030,18 @@ halfword tex_scan_macro_expand(void) switch (cur_cmd) { case call_cmd: case tolerant_call_cmd: + // case constant_call_cmd: tex_expand_current_token(); goto PICKUP; + case constant_call_cmd: + { + halfword h = token_link(cur_chr); + while (h) { + p = tex_store_new_token(p, token_info(h)); + h = token_link(h); + } + goto PICKUP; + } case protected_call_cmd: case semi_protected_call_cmd: case tolerant_protected_call_cmd: diff --git a/source/luametatex/source/tex/textoken.c b/source/luametatex/source/tex/textoken.c index 7580d72d3..7e5c10831 100644 --- a/source/luametatex/source/tex/textoken.c +++ b/source/luametatex/source/tex/textoken.c @@ -173,6 +173,7 @@ void tex_compact_tokens(void) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: @@ -463,6 +464,7 @@ void tex_print_meaning(halfword code) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: @@ -470,14 +472,10 @@ void tex_print_meaning(halfword code) tex_print_cs(cur_cs); return; } else { - int constant = (cur_chr && get_token_reference(cur_chr) == max_token_reference); switch (code) { case meaning_code: case meaning_full_code: case meaning_ful_code: - if (constant) { - tex_print_str("constant "); - } tex_print_str("macro"); if (code == meaning_ful_code) { return; @@ -485,9 +483,6 @@ void tex_print_meaning(halfword code) goto FOLLOWUP; } case meaning_asis_code: - if (constant) { - tex_print_str_esc("constant "); - } // tex_print_format("%e%C %S ", def_cmd, def_code, cur_cs); tex_print_cmd_chr(def_cmd, def_code); tex_print_char(' '); @@ -1382,18 +1377,18 @@ static int tex_aux_get_next_file(void) case skip_blanks_state + left_brace_cmd: case new_line_state + left_brace_cmd: lmt_input_state.cur_input.state = mid_line_state; - lmt_input_state.align_state++; + ++lmt_input_state.align_state; break; case mid_line_state + left_brace_cmd: - lmt_input_state.align_state++; + ++lmt_input_state.align_state; break; case skip_blanks_state + right_brace_cmd: case new_line_state + right_brace_cmd: lmt_input_state.cur_input.state = mid_line_state; - lmt_input_state.align_state--; + --lmt_input_state.align_state; break; case mid_line_state + right_brace_cmd: - lmt_input_state.align_state--; + --lmt_input_state.align_state; break; case mid_line_state + math_shift_cmd: case mid_line_state + alignment_tab_cmd: @@ -1557,7 +1552,7 @@ static int tex_aux_process_sup_mark(void) /*tex The single character case: */ { int c1 = lmt_fileio_state.io_buffer[lmt_input_state.cur_input.loc + 1]; - if (c1 < 0200) { + if (c1 < 0x80) { lmt_input_state.cur_input.loc = lmt_input_state.cur_input.loc + 2; // if (is_hex(c1) && (iloc <= ilimit)) { // int c2 = fileio_state.io_buffer[iloc]; @@ -1568,7 +1563,7 @@ static int tex_aux_process_sup_mark(void) // } // } // /*tex The somewhat odd cases, often special control characters: */ - cur_chr = (c1 < 0100 ? c1 + 0100 : c1 - 0100); + cur_chr = (c1 < 0x40 ? c1 + 0x40 : c1 - 0x40); return 1; } } @@ -1664,7 +1659,7 @@ static int tex_aux_check_expanded_code(int *kk, halfword *chr) } } else { int c1 = lmt_fileio_state.io_buffer[k + 1]; - if (c1 < 0200) { /* really ? */ + if (c1 < 0x80) { /* really ? */ d = 1; if (is_hex(c1) && (k + 2) <= lmt_input_state.cur_input.limit) { int c2 = lmt_fileio_state.io_buffer[k + 2]; @@ -1672,10 +1667,10 @@ static int tex_aux_check_expanded_code(int *kk, halfword *chr) d = 2; *chr = tex_aux_two_hex_to_cur_chr(c1, c2); } else { - *chr = (c1 < 0100 ? c1 + 0100 : c1 - 0100); + *chr = (c1 < 0x40 ? c1 + 0x40 : c1 - 0x40); } } else { - *chr = (c1 < 0100 ? c1 + 0100 : c1 - 0100); + *chr = (c1 < 0x40 ? c1 + 0x40 : c1 - 0x40); } } } @@ -2132,7 +2127,7 @@ void tex_get_next(void) /*tex Parameter needs to be expanded. */ continue; } - if ((lmt_input_state.align_state == 0) && (cur_cmd == alignment_tab_cmd || cur_cmd == alignment_cmd)) { + if ((! lmt_input_state.align_state) && (cur_cmd == alignment_tab_cmd || cur_cmd == alignment_cmd)) { /*tex If an alignment entry has just ended, take appropriate action. */ tex_insert_alignment_template(); continue; @@ -2166,12 +2161,12 @@ void tex_get_next_non_spacer(void) continue; case alignment_tab_cmd: case alignment_cmd: - if (lmt_input_state.align_state == 0) { - /*tex If an alignment entry has just ended, take appropriate action. */ + /*tex If an alignment entry has just ended, take appropriate action. */ + if (lmt_input_state.align_state) { + return; + } else { tex_insert_alignment_template(); continue; - } else { - return; } default: return; @@ -2392,8 +2387,6 @@ halfword tex_cur_str_toks(halfword *tail) */ -/*tex Change the string |str_pool[b..pool_ptr]| to a token list. */ - halfword tex_str_scan_toks(int ct, lstring ls) { /*tex index into string */ @@ -2417,7 +2410,7 @@ halfword tex_str_scan_toks(int ct, lstring ls) unsigned char *name = k ; while (k < l) { t = (halfword) aux_str2uni_len((const unsigned char *) k, &s); - c = tex_get_cat_code(ct,t); + c = tex_get_cat_code(ct, t); if (c == 11) { k += s ; lname += s ; @@ -2431,7 +2424,7 @@ halfword tex_str_scan_toks(int ct, lstring ls) } if (s > 0) { /*tex We have a potential |\cs|. */ - halfword cs = tex_string_locate((const char *) name, lname, 0); + halfword cs = tex_string_locate_only((const char *) name, lname); if (cs == undefined_control_sequence) { /*tex Let's play safe and backtrack. */ t += cc * (1<<21); @@ -2444,14 +2437,14 @@ halfword tex_str_scan_toks(int ct, lstring ls) Just a character with some meaning, so |\unknown| becomes effectively |\unknown| assuming that |\\| has some useful meaning of course. */ - t += cc * (1<<21); + t += cc * (1 << 21); k = name ; } } else { /*tex Whatever token, so for instance $x^2$ just works given a \TEX\ catcode regime. */ - t += cc * (1<<21); + t += cc * (1 << 21); } p = tex_store_new_token(p, t); if (! h) { @@ -2970,6 +2963,7 @@ void tex_run_convert_tokens(halfword code) case call_cmd: case protected_call_cmd: case semi_protected_call_cmd: + case constant_call_cmd: case tolerant_call_cmd: case tolerant_protected_call_cmd: case tolerant_semi_protected_call_cmd: @@ -3440,6 +3434,15 @@ char *tex_tokenlist_to_tstring(int pp, int inhibit_par, int *siz, int skippreamb tex_aux_append_esc_to_buffer("par"); } break; + case deep_frozen_keep_constant_cmd: + if (! skip) { + halfword h = token_link(chr); + while (h) { + tex_aux_append_uchar_to_buffer(token_chr(token_info(h))); + h = token_link(h); + } + } + break; default: tex_aux_append_str_to_buffer(tex_aux_special_cmd_string(cmd, chr, error_string_bad(33))); break; @@ -3492,7 +3495,7 @@ char *tex_tokenlist_to_tstring(int pp, int inhibit_par, int *siz, int skippreamb p = token_link(p); } } - EXIT: + EXIT: if (strip && lmt_token_state.bufloc > 1) { if (lmt_token_state.buffer[lmt_token_state.bufloc-1] == strip) { lmt_token_state.bufloc -= 1; diff --git a/source/luametatex/source/tex/textypes.h b/source/luametatex/source/tex/textypes.h index 5a4dce7e8..41c8b119b 100644 --- a/source/luametatex/source/tex/textypes.h +++ b/source/luametatex/source/tex/textypes.h @@ -228,6 +228,10 @@ extern halfword tex_badness( # define math_default_penalty (infinite_penalty+1) +# define initial_alignment_state -1000000 +# define busy_alignment_state 1000000 +# define interwoven_alignment_threshold 500000 + /*tex For practical reasons all these registers were max'd to 64K but that really makes no sense for diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 8a2516e33..636203902 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{2023.06.01 09:35} +\newcontextversion{2023.06.04 18:54} %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 c72b946a0..3ca3dfa66 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{2023.06.01 09:35} +\edef\contextversion{2023.06.04 18:54} %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 9057e3b91..165fc0b69 100644 --- a/tex/context/base/mkii/mult-de.mkii +++ b/tex/context/base/mkii/mult-de.mkii @@ -802,6 +802,7 @@ \setinterfaceconstant{direction}{richtung} \setinterfaceconstant{directory}{verzeichnis} \setinterfaceconstant{display}{bildschirm} +\setinterfaceconstant{displayfactor}{displayfactor} \setinterfaceconstant{displaythreshold}{displaythreshold} \setinterfaceconstant{distance}{abstand} \setinterfaceconstant{domain}{domain} @@ -922,6 +923,7 @@ \setinterfaceconstant{index}{index} \setinterfaceconstant{indicator}{indikator} \setinterfaceconstant{initialsep}{initialsep} +\setinterfaceconstant{inlinefactor}{inlinefactor} \setinterfaceconstant{inlinethreshold}{inlinethreshold} \setinterfaceconstant{inner}{innen} \setinterfaceconstant{innermargin}{innermargin} diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index a74ceb409..6a3c5d0af 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2023.06.01 09:35} +\newcontextversion{2023.06.04 18:54} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index 29963c6b7..10885f6d3 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -49,7 +49,7 @@ %D {YYYY.MM.DD HH:MM} format. \edef\contextformat {\jobname} -\edef\contextversion{2023.06.01 09:35} +\edef\contextversion{2023.06.04 18:54} %D Kind of special: diff --git a/tex/context/base/mkiv/mult-def.lua b/tex/context/base/mkiv/mult-def.lua index b0aba96d6..7e07324ad 100644 --- a/tex/context/base/mkiv/mult-def.lua +++ b/tex/context/base/mkiv/mult-def.lua @@ -8536,6 +8536,9 @@ return { ["en"]="displaythreshold", ["fr"]="seuilaffichage", }, + ["displayfactor"]={ + ["en"]="displayfactor", + }, ["distance"]={ ["cs"]="vzdalenost", ["de"]="abstand", @@ -9450,6 +9453,9 @@ return { ["en"]="inlinethreshold", ["fr"]="seuilenligne", }, + ["inlinefactor"]={ + ["en"]="inlinefactor", + }, ["inner"]={ ["cs"]="vnitrni", ["de"]="innen", diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf index e5cc011e5..2cc535a25 100644 Binary files a/tex/context/base/mkiv/status-files.pdf and b/tex/context/base/mkiv/status-files.pdf differ diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf index 617922f2d..7cbf4e9bc 100644 Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ diff --git a/tex/context/base/mkiv/util-str.lua b/tex/context/base/mkiv/util-str.lua index b5c721a41..a9150b886 100644 --- a/tex/context/base/mkiv/util-str.lua +++ b/tex/context/base/mkiv/util-str.lua @@ -269,6 +269,7 @@ local p_prune_intospace = Cs ( noleading * ( notrailing + intospace + 1 local p_retain_normal = Cs ( ( normalline + normalempty )^0 ) local p_retain_collapse = Cs ( ( normalline + doubleempty )^0 ) local p_retain_noempty = Cs ( ( normalline + singleempty )^0 ) +local p_collapse_all = Cs ( stripstart * ( stripend + ((whitespace+newline)^1/" ") + 1)^0 ) -- function striplines(str,prune,collapse,noempty) -- if prune then @@ -298,6 +299,7 @@ local striplinepatterns = { ["retain"] = p_retain_normal, ["retain and collapse"] = p_retain_collapse, ["retain and no empty"] = p_retain_noempty, + ["collapse all"] = p_collapse_all, ["collapse"] = patterns.collapser, } @@ -313,6 +315,9 @@ function strings.collapse(str) -- maybe also in strings return str and lpegmatch(p_prune_intospace,str) or str end +-- local s = "\naa\n\naa\na a\n\n" +-- print("["..strings.striplines(s,"collapse all").."]") + -- also see: string.collapsespaces strings.striplong = strings.striplines -- for old times sake diff --git a/tex/context/base/mkxl/anch-bar.mkxl b/tex/context/base/mkxl/anch-bar.mkxl index f99e61428..2ca4b4f5f 100644 --- a/tex/context/base/mkxl/anch-bar.mkxl +++ b/tex/context/base/mkxl/anch-bar.mkxl @@ -90,7 +90,7 @@ \global\advanceby\c_anch_sidebars_n\plusone \c_anch_sidebars_current\c_anch_sidebars_n\relax % relax needed \ifhastok={#1}% - \edef\currentsidebar{\the\c_anch_sidebars_level}% + \cdef\currentsidebar{\the\c_anch_sidebars_level}% \checksidebarparent \setupcurrentsidebar[#1]% \else diff --git a/tex/context/base/mkxl/anch-pgr.mkxl b/tex/context/base/mkxl/anch-pgr.mkxl index 10c66b665..824154f90 100644 --- a/tex/context/base/mkxl/anch-pgr.mkxl +++ b/tex/context/base/mkxl/anch-pgr.mkxl @@ -51,7 +51,7 @@ \aliased\let\doifpositionactionelse\doifelsepositionaction \permanent\protected\def\dopositionaction#1% - {\edef\currentpositionaction{#1}% + {\cdef\currentpositionaction{#1}% \ifcsname\??positionaction\currentpositionaction\endcsname \anch_positions_action_indeed \fi} @@ -102,7 +102,7 @@ \permanent\protected\def\handlepositionaction#1\with#2\on#3% ugly, will change {\begingroup - \edef\currentpositionanchor{\ifempty\currentpositionoverlay#3\else\currentpositionoverlay::\MPanchoridentifier\fi}% + \cdef\currentpositionanchor{\ifempty\currentpositionoverlay#3\else\currentpositionoverlay::\MPanchoridentifier\fi}% \normalexpanded{\anch_positions_set_action{\currentpositionanchor}{\noexpand\csname\??positioncleanup\currentpositionanchor\endcsname}}% \let#1\relax \ifcsname\??positioncleanup\currentpositionanchor\endcsname @@ -225,7 +225,7 @@ \def\anch_positions_overlay_indeed#1% {\begingroup - \edef\currentpositionoverlay{#1}% + \cdef\currentpositionoverlay{#1}% \ifcsname\??positionaction\currentpositionoverlay::\MPanchoridentifier\endcsname \anch_positions_overlay_compose \fi @@ -260,8 +260,8 @@ \def\anch_positions_region_overlay_indeed#1#2% {\begingroup - \edef\currentpositionregion {#1}% - \edef\currentpositionoverlay{#2}% + \cdef\currentpositionregion {#1}% + \cdef\currentpositionoverlay{#2}% \ifcsname\??positionaction\currentpositionoverlay::\MPanchoridentifier\endcsname \anch_positions_region_overlay_compose \fi @@ -298,7 +298,7 @@ \def\anch_positions_overlay_start_yes#1% {\checkpositionoverlays - \edef\currentpositionoverlay{#1}} + \cdef\currentpositionoverlay{#1}} \permanent\protected\def\stoppositionoverlay {\lettonothing\currentpositionoverlay} @@ -327,7 +327,7 @@ \def\anch_positions_meta_graphic_use#1#2#3% {\begingroup - \edef\currentmpcategory{#1}% + \cdef\currentmpcategory{#1}% \anch_positions_meta_graphic_prepare \startMPcode#3\stopMPcode \endgroup} @@ -346,7 +346,7 @@ \def\anch_positions_meta_graphic_direct#1#2#3% what tag setups {\begingroup - \edef\currentmpcategory{#2}% + \cdef\currentmpcategory{#2}% \setupcurrentmpcategory[#3]% \anch_positions_meta_graphic_prepare \obeyMPboxorigin % do we also set the size ? when needed this must be done in mp ... might change @@ -360,7 +360,7 @@ \def\anch_positions_meta_graphic_nested#1#2#3% nesting used in prikkels / pascal (might go away) {\begingroup - \edef\currentmpcategory{#2}% + \cdef\currentmpcategory{#2}% \setupcurrentmpcategory[#1,#3]% \anch_positions_meta_graphic_prepare \begincsname\??positiongraphic#2\endcsname diff --git a/tex/context/base/mkxl/anch-pos.mkxl b/tex/context/base/mkxl/anch-pos.mkxl index a1e0cc354..0472c1ee5 100644 --- a/tex/context/base/mkxl/anch-pos.mkxl +++ b/tex/context/base/mkxl/anch-pos.mkxl @@ -144,7 +144,7 @@ \def\anch_positions_set_only_indeed#1% {\anch_positions_initialize - \edef\currentposition{#1}% + \cdef\currentposition{#1}% \dosetposition\currentposition} \permanent\protected\def\setposition @@ -156,7 +156,7 @@ \def\anch_positions_set_indeed#1% {\anch_positions_initialize - \edef\currentposition{#1}% + \cdef\currentposition{#1}% \dosetposition\currentposition \anch_positions_trace_left \dopositionaction\currentposition} @@ -171,7 +171,7 @@ \def\anch_positions_set_data_indeed#1#2#3#4% {\anch_positions_initialize \hbox % \hpack - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionwhd\currentposition{#2}{#3}{#4}% \anch_positions_trace_left \dopositionaction\currentposition @@ -194,7 +194,7 @@ {\anch_positions_initialize %\hbox to \wd\nextbox \hpack to \wd\nextbox - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionbox\currentposition\nextbox \anch_positions_trace_left \setbox\b_anch_position\box\nextbox @@ -215,7 +215,7 @@ \def\anch_positions_set_strut_yes#1% {\anch_positions_initialize \hbox to \zeropoint % \hpack - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionstrut\currentposition \anch_positions_trace_left \dopositionaction\currentposition @@ -232,7 +232,7 @@ \def\anch_positions_set_strut_kind_yes#1#2% {\anch_positions_initialize \hbox to \zeropoint % \hpack - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionstrutkind\currentposition{#2}% \anch_positions_trace_left \dopositionaction\currentposition @@ -252,7 +252,7 @@ \def\anch_positions_set_plus_indeed#1#2#3#4#5% {\anch_positions_initialize \hbox % \hpack - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionplus\currentposition{#2}{#3}{#4}{#5}% \anch_positions_trace_right \dopositionaction\currentposition @@ -274,7 +274,7 @@ \def\anch_positions_set_plus_yes_finish#1#2% {\anch_positions_initialize \hbox to \nextboxwd % \hpack - {\edef\currentposition{#1}% + {\cdef\currentposition{#1}% \dosetpositionplus\currentposition{\wd\nextbox}{\ht\nextbox}{\dp\nextbox}{#2}% \anch_positions_trace_right \setbox\b_anch_position\flushnextbox diff --git a/tex/context/base/mkxl/buff-ini.mkxl b/tex/context/base/mkxl/buff-ini.mkxl index ce185d70f..dd2698501 100644 --- a/tex/context/base/mkxl/buff-ini.mkxl +++ b/tex/context/base/mkxl/buff-ini.mkxl @@ -127,7 +127,7 @@ \appendtoks \global\advanceby\c_buff_n_of_defined\plusone \setexpandedbufferparameter\c!number{\number\c_buff_n_of_defined}% - \edef\currentdefinedbuffer{def-\number\c_buff_n_of_defined}% + \cdef\currentdefinedbuffer{def-\number\c_buff_n_of_defined}% \ifcstok{\bufferparameter\c!define}\v!yes \frozen\instance\protected\edefcsname\e!start\currentbuffer\endcsname {\buff_start_defined{\currentbuffer}{\currentdefinedbuffer}{\e!start\currentbuffer}{\e!stop\currentbuffer}}% @@ -254,7 +254,7 @@ \to \everydefinesavebuffer \protected\def\buff_stop_save_buffer#1% - {\edef\currentsavebuffer{#1}% + {\cdef\currentsavebuffer{#1}% \global\advanceby\csname\??savebuffercounter\currentsavebuffer\endcsname\plusone \clf_savebuffer % will become key/value {\thedefinedbuffer{\currentsavebuffer}}% diff --git a/tex/context/base/mkxl/buff-par.mklx b/tex/context/base/mkxl/buff-par.mklx index 63e6f47bd..c72ea8658 100644 --- a/tex/context/base/mkxl/buff-par.mklx +++ b/tex/context/base/mkxl/buff-par.mklx @@ -102,7 +102,7 @@ \protected\def\buff_parallel_start#name% {\pushmacro\currentparallel - \edef\currentparallel{#name}% + \cdef\currentparallel{#name}% \clf_nextparallel{\currentparallel}} \protected\def\buff_parallel_stop @@ -117,7 +117,7 @@ \permanent\tolerant\protected\def\placeparallel[#name]#spacer[#instance]#spacer[#settings]% {\begingroup - \edef\currentparallel{#name}% + \cdef\currentparallel{#name}% \setupcurrentparallel[#settings]% \clf_placeparallel {\currentparallel}% diff --git a/tex/context/base/mkxl/buff-ver.lmt b/tex/context/base/mkxl/buff-ver.lmt index 25d92618e..aebea63fd 100644 --- a/tex/context/base/mkxl/buff-ver.lmt +++ b/tex/context/base/mkxl/buff-ver.lmt @@ -733,13 +733,17 @@ end local tablength = 7 local function dotabs(content,settings) - local tab = settings.tab - tab = tab and (tab == v_yes and tablength or tonumber(tab)) - if tab then - return tabtospace(content,tab) + local par = settings.par + if par == v_yes then + return utilities.strings.striplines(content,"collapse all") else - return content + local tab = settings.tab + tab = tab and (tab == v_yes and tablength or tonumber(tab)) + if tab then + return tabtospace(content,tab) + end end + return content end local function filter(lines,settings) -- todo: inline or display in settings @@ -857,6 +861,7 @@ implement { { "data" }, -- { "data", "detokened" }, { "tab" }, + { "par" }, { "method" }, { "compact" }, { "nature" }, @@ -917,6 +922,7 @@ implement { { "name" }, { "strip" }, { "tab" }, + { "par" }, { "method" }, { "nature" }, } @@ -933,6 +939,7 @@ implement { { "range" }, { "regime" }, { "tab" }, + { "par" }, { "method" }, { "escape" }, { "nature" }, diff --git a/tex/context/base/mkxl/buff-ver.mkxl b/tex/context/base/mkxl/buff-ver.mkxl index 145613877..3575ef2ca 100644 --- a/tex/context/base/mkxl/buff-ver.mkxl +++ b/tex/context/base/mkxl/buff-ver.mkxl @@ -83,10 +83,8 @@ {\spaceskip.5\emwidth\relax \enforced\let\obeyedspace\specialobeyedspace \enforced\let\controlspace\specialcontrolspace - \edef\p_buff_lines{\typeparameter\c!lines}% - \begincsname\??typinglines\p_buff_lines\endcsname - \edef\p_buff_space{\typeparameter\c!space}% - \begincsname\??typingspace\p_buff_space\endcsname + \begincsname\??typinglines\typeparameter\c!lines\endcsname + \begincsname\??typingspace\typeparameter\c!space\endcsname \relax\the\everyinitializeverbatim\relax} \permanent\protected\def\doinitializeverbatim % for use elsewhere .. temp hack (see lxml-ini) @@ -123,10 +121,8 @@ {\spaceskip.5\emwidth\relax \enforced\let\obeyedspace\specialobeyedspace \enforced\let\controlspace\specialcontrolspace - \edef\p_buff_lines{\typingparameter\c!lines}% - \begincsname\??typinglines\p_buff_lines\endcsname - \edef\p_buff_space{\typingparameter\c!space}% - \begincsname\??typingspace\p_buff_space\endcsname + \begincsname\??typinglines\typingparameter\c!lines\endcsname + \begincsname\??typingspace\typingparameter\c!space\endcsname \relax\the\everyinitializeverbatim\relax} %D \macros @@ -261,13 +257,13 @@ \protected\def\buff_verbatim_type#1% {\dontleavehmode \bgroup - \edef\currenttype{#1}% + \cdef\currenttype{#1}% \buff_verbatim_type_indeed} \def\buff_verbatim_typ#1% {\dontleavehmode \bgroup - \edef\currenttype{#1}% + \cdef\currenttype{#1}% \lettypeparameter\c!lines\v!hyphenated \enforced\let\specialobeyedspace\specialstretchedspace \buff_verbatim_type_indeed} @@ -445,7 +441,7 @@ \protected\def\buff_verbatim_typing_start#1#2% tricky non standard lookahead {\begingroup - \edef\currenttyping {#1}% + \cdef\currenttyping {#1}% \edef\currenttypingwrapper{#2}% \obeylines \futureexpandis[\buff_verbatim_typing_start_yes\buff_verbatim_typing_start_nop} @@ -617,7 +613,7 @@ \aliased\let\doiftypingfileelse\doifelsetypingfile \def\buff_verbatim_type_file_indeed#1#2% category name - {\edef\currenttyping{#1}% + {\cdef\currenttyping{#1}% \typingparameter\c!before\relax \startpacked[\v!blank] \buff_verbatim_setup_line_numbering @@ -794,7 +790,7 @@ \protected\def\buff_verbatim_type_buffer_class#1% {\begingroup - \edef\currenttyping{#1}% + \cdef\currenttyping{#1}% \buff_verbatim_type_buffer} \tolerant\protected\def\buff_verbatim_type_defined_buffer[#1]#*[#2]#*[#3]% category name settings @@ -808,7 +804,7 @@ \dorechecknextindentation} \protected\def\buff_verbatim_type_buffer_indeed#1#2% category name - {\edef\currenttyping{#1}% + {\cdef\currenttyping{#1}% \typingparameter\c!before\relax \startpacked[\v!blank] \buff_verbatim_setup_line_numbering @@ -823,6 +819,7 @@ range {\typingparameter\c!range}% regime {\currentregime}% tab {\typingparameter\c!tab}% + par {\typingparameter\c!paragraph}% method {\p_buff_option}% escape {\typingparameter\c!escape}% nature {display}% @@ -854,7 +851,7 @@ \endgroup} \protected\def\buff_verbatim_type_buffer_indeed_inline#1#2% category name - {\edef\currenttype{#1}% + {\cdef\currenttype{#1}% \buff_verbatim_initialize_type_one \dostarttaggedchained\t!verbatim\currenttype\??type \clf_typebuffer @@ -893,7 +890,7 @@ \endgroup} \def\buff_verbatim_process_indeed#1#2% - {\edef\currenttyping{#1}% + {\cdef\currenttyping{#1}% \clf_processbuffer name {#2}% strip {\typingparameter\c!strip}% diff --git a/tex/context/base/mkxl/chem-str.mkxl b/tex/context/base/mkxl/chem-str.mkxl index 227f98c4b..33a473b8f 100644 --- a/tex/context/base/mkxl/chem-str.mkxl +++ b/tex/context/base/mkxl/chem-str.mkxl @@ -89,7 +89,7 @@ \permanent\protected\tolerant\overloaded\def\definechemical[#1]#:#2% is global (so we don't use the commandhandler) {\startnointerference - \edef\currentdefinedchemical{#1}% + \cdef\currentdefinedchemical{#1}% \enforced\let\chemical\chem_chemical_nested \clf_undefinechemical{#1}% #2% flush @@ -146,14 +146,14 @@ \ifhastok={#1}% \setupcurrentchemical[#1]% same as \currentchemical \else - \edef\currentchemical{#1}% + \cdef\currentchemical{#1}% \setupcurrentchemical[#2]% \fi \orelse\ifparameter#1\or \ifhastok={#1}% \setupcurrentchemical[#1]% same as \currentchemical \else - \edef\currentchemical{#1}% + \cdef\currentchemical{#1}% \fi \fi \the\everystructurechemical diff --git a/tex/context/base/mkxl/colo-ini.mkxl b/tex/context/base/mkxl/colo-ini.mkxl index a7f483bc2..3c7f775a7 100644 --- a/tex/context/base/mkxl/colo-ini.mkxl +++ b/tex/context/base/mkxl/colo-ini.mkxl @@ -126,7 +126,7 @@ \permanent\protected\def\transparent[#1]% {\beginsimplegroup - \edef\scratchstringone{#1}% + \cdef\scratchstringone{#1}% % the \relax catches a non existent csname \ifx\scratchstringone\v!reset \c_attr_transparency\attributeunsetvalue @@ -137,7 +137,7 @@ \permanent\protected\def\starttransparent[#1]%$ {\begingroup - \edef\scratchstringone{#1}% + \cdef\scratchstringone{#1}% \ifx\scratchstringone\v!reset \c_attr_transparency\attributeunsetvalue \else @@ -151,7 +151,7 @@ \permanent\protected\def\coloronly[#1]% {\beginsimplegroup - \edef\currentcolorname{#1}% + \cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop_only \else @@ -161,7 +161,7 @@ \permanent\protected\def\startcoloronly[#1]%$ {\begingroup - \edef\currentcolorname{#1}% + \cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop_only \else @@ -175,7 +175,7 @@ \permanent\protected\def\color[#1]% {\beginsimplegroup - \edef\currentcolorname{#1}% + \cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop \else @@ -190,7 +190,7 @@ \permanent\protected\def\startcolor[#1]%$ {\begingroup - \edef\currentcolorname{#1}% + \cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop \else @@ -216,7 +216,7 @@ \permanent\protected\def\fastcolor[#1]#2% {\begingroup % is this command still needed? - \edef\currentcolorname{#1}% + \cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop \else @@ -226,7 +226,7 @@ \endgroup} \permanent\protected\def\directcolor[#1]% - {\edef\currentcolorname{#1}% + {\cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop \else @@ -586,13 +586,13 @@ % \newtoks\t_colo_prefix % used in mp interface \permanent\tolerant\protected\def\setuppalet[#1]% - {\edef\currentcolorpalet{#1}% + {\cdef\currentcolorpalet{#1}% \ifempty\currentcolorpalet % seems to be a reset \lettonothing\currentcolorprefix %\t_colo_prefix\emptytoks \orelse\ifcsname\??paletlist\currentcolorpalet\endcsname - \edef\currentcolorprefix{#1:}% + \cdef\currentcolorprefix{#1:}% %\t_colo_prefix\expandafter{\currentcolorprefix}% \else \colo_helpers_show_message\m!colors7\currentcolorpalet @@ -737,7 +737,7 @@ {\colo_helpers_set_model{#1}} % only for local usage \def\colo_helpers_set_model#1% direct - {\edef\currentcolormodel{#1}% + {\cdef\currentcolormodel{#1}% \clf_setcolormodel{\currentcolormodel}{\m_colo_weight_gray}} % sets attribute at lua end \colo_helpers_set_model\s!all @@ -813,7 +813,7 @@ % so far \permanent\protected\def\colo_helpers_activate#1% two-step is not that much faster but less tracing - {\edef\currentcolorname{#1}% + {\cdef\currentcolorname{#1}% \ifempty\currentcolorprefix \colo_helpers_activate_nop \else diff --git a/tex/context/base/mkxl/cont-new.mkxl b/tex/context/base/mkxl/cont-new.mkxl index ca65e70f3..38ea10492 100644 --- a/tex/context/base/mkxl/cont-new.mkxl +++ b/tex/context/base/mkxl/cont-new.mkxl @@ -13,7 +13,7 @@ % \normalend % uncomment this to get the real base runtime -\newcontextversion{2023.06.01 09:35} +\newcontextversion{2023.06.04 18:54} %D This file is loaded at runtime, thereby providing an excellent place for hacks, %D patches, extensions and new features. There can be local overloads in cont-loc diff --git a/tex/context/base/mkxl/context.mkxl b/tex/context/base/mkxl/context.mkxl index a3ace100b..aa69435d8 100644 --- a/tex/context/base/mkxl/context.mkxl +++ b/tex/context/base/mkxl/context.mkxl @@ -29,7 +29,7 @@ %D {YYYY.MM.DD HH:MM} format. \immutable\edef\contextformat {\jobname} -\immutable\edef\contextversion{2023.06.01 09:35} +\immutable\edef\contextversion{2023.06.04 18:54} %overloadmode 1 % check frozen / warning %overloadmode 2 % check frozen / error diff --git a/tex/context/base/mkxl/core-dat.mkxl b/tex/context/base/mkxl/core-dat.mkxl index 6d7d1bd14..18a1737e7 100644 --- a/tex/context/base/mkxl/core-dat.mkxl +++ b/tex/context/base/mkxl/core-dat.mkxl @@ -50,7 +50,7 @@ \permanent\tolerant\protected\def\setdataset[#1]#*[#2]#*[#3]% {\begingroup - \edef\currentdataset{#1}% + \cdef\currentdataset{#1}% \ifparameters\or\or \clf_setdataset name {\currentdataset}% @@ -58,7 +58,7 @@ data {#2}% \relax \or - \edef\currentdataset{#1}% + \cdef\currentdataset{#1}% \clf_setdataset name {\currentdataset}% tag {#2}% diff --git a/tex/context/base/mkxl/core-pag.mkxl b/tex/context/base/mkxl/core-pag.mkxl index 43b398b16..e4c4d8471 100644 --- a/tex/context/base/mkxl/core-pag.mkxl +++ b/tex/context/base/mkxl/core-pag.mkxl @@ -36,7 +36,7 @@ \permanent\tolerant\protected\def\setpagestate[#1]#*[#2]% {\begingroup - \edef\currentpagestate{#1}% + \cdef\currentpagestate{#1}% \ifcsname\??pagestatecounter\currentpagestate\endcsname \scratchcounter\lastnamedcs \advanceby\scratchcounter\plusone diff --git a/tex/context/base/mkxl/file-job.mklx b/tex/context/base/mkxl/file-job.mklx index b7883ddcd..1ad08b2e0 100644 --- a/tex/context/base/mkxl/file-job.mklx +++ b/tex/context/base/mkxl/file-job.mklx @@ -304,10 +304,10 @@ \lettonothing\currentdocument \setupcurrentdocument[#namespace]% \else - \edef\currentdocument{#namespace}% + \cdef\currentdocument{#namespace}% \fi \or - \edef\currentdocument{#namespace}% + \cdef\currentdocument{#namespace}% \setupcurrentdocument[#settings]% \fi \ifempty\currentdocument\else\setmode\currentdocument\fi @@ -340,7 +340,7 @@ \setupcurrentdocument[#namespace]% \fi \or - \edef\currentdocument{#namespace}% + \cdef\currentdocument{#namespace}% \setupcurrentdocument[#settings]% \fi \popmacro\currentdocument} diff --git a/tex/context/base/mkxl/file-mod.mklx b/tex/context/base/mkxl/file-mod.mklx index a64529dd6..9dc38f9f9 100644 --- a/tex/context/base/mkxl/file-mod.mklx +++ b/tex/context/base/mkxl/file-mod.mklx @@ -57,21 +57,21 @@ \lettonothing\currentmodule \or \lettonothing\currentmodulecategory - \edef\currentmodule{#category}% + \cdef\currentmodule{#category}% \lettonothing\currentmoduleparameters \or \ifhastok={#name}% \lettonothing\currentmodulecategory - \edef\currentmodule{#category}% + \cdef\currentmodule{#category}% \edef\currentmoduleparameters{#name}% \else \edef\currentmodulecategory{#category}% - \edef\currentmodule{#name}% + \cdef\currentmodule{#name}% \lettonothing\currentmoduleparameters \fi \or \edef\currentmodulecategory {#category}% - \edef\currentmodule {#name}% + \cdef\currentmodule {#name}% \def \currentmoduleparameters{#parameters}% \fi \processcommacommand[\currentmodule]{\strc_modules_use\currentmodulecategory}% diff --git a/tex/context/base/mkxl/font-fil.mklx b/tex/context/base/mkxl/font-fil.mklx index 89ec2f5c4..2fab7d581 100644 --- a/tex/context/base/mkxl/font-fil.mklx +++ b/tex/context/base/mkxl/font-fil.mklx @@ -45,7 +45,7 @@ {\push_macro_fontclass \doifelse{#class}\v!each {\lettonothing\fontclass} - {\doifsomething{#class}{\def\fontclass{#class}}}} + {\doifsomething{#class}{\cdef\fontclass{#class}}}} \permanent\protected\def\stopfontclass {\pop_macro_fontclass} diff --git a/tex/context/base/mkxl/font-ini.mklx b/tex/context/base/mkxl/font-ini.mklx index ff9e45243..5b59ba23d 100644 --- a/tex/context/base/mkxl/font-ini.mklx +++ b/tex/context/base/mkxl/font-ini.mklx @@ -1187,7 +1187,7 @@ \def\font_basics_define_font_without_parameters#identifier#2% {\relax % intercept lookahead, in case we scan for a number \c_font_feature_inheritance_mode\c_font_feature_inheritance_fontonly - \edef\lastfontidentifier{#identifier}% + \cdef\lastfontidentifier{#identifier}% \let\v_font_size_relative\v_font_rscale_default \let\v_font_size_absolute\fontbody \font_helpers_low_level_define{#2}\v_font_identifier_basic @@ -1198,7 +1198,7 @@ \let\v_font_identifier_basic\v_font_identifier_basic_saved} \protected\def\font_helpers_trigger#identifier% make a traced variant - {\edef\lastfontidentifier{#identifier}% + {\cdef\lastfontidentifier{#identifier}% \ifcsname\v_font_identifier_class\endcsname % \writestatus{fonts}{trigger: reusing \v_font_identifier_class}% \expandafter\font_helpers_trigger_reuse @@ -1488,7 +1488,7 @@ % environment and size already defined \orelse\ifproductionrun \push_macro_fontclass - \edef\fontclass{#class}% + \cdef\fontclass{#class}% \font_helpers_register_environment{#class}{#normalizedbody}% \settrue\c_font_defining_environment_state \font_helpers_define_unknown_font{#normalizedbody}% current class @@ -1618,7 +1618,7 @@ {\push_macro_fontclass \doifelse{#4}\s!default {\lettonothing\fontclass} - {\def\fontclass{#4}}% + {\cdef\fontclass{#4}}% \definebodyfont[#1][#2][#3]% \pop_macro_fontclass} @@ -1875,7 +1875,7 @@ \protected\def\font_basics_switch_style#style% {\ifcsname\??fontstyle#style\endcsname \lastnamedcs - \edef\fontstyle{#style}% + \cdef\fontstyle{#style}% \ifmmode\mr\fi % in order to be compatible with \rm in math mode % \the\everybodyfont % cleaner, in setting size as well as style \else @@ -1964,7 +1964,7 @@ \permanent\def\setcurrentfontclass#class% {\ifcsname\??fontclassyes#class\endcsname - \edef\fontclass{#class}% + \cdef\fontclass{#class}% \orelse\ifcsname\??fontclassnop#class\endcsname % already tried \else % too messy: \ifcase\currentgrouplevel % (unpredictable) @@ -1981,15 +1981,15 @@ %D So far for synchronisation. (We can inline the following macros.) \permanent\protected\def\setcurrentfont#body#style#alternative#size% not used - {\edef\fontbody {#body}% - \edef\fontstyle {#style}% - \edef\fontalternative{#alternative}% - \edef\fontsize {#size}% + {\cdef\fontbody {#body}% + \cdef\fontstyle {#style}% + \cdef\fontalternative{#alternative}% + \cdef\fontsize {#size}% \font_helpers_check_big_math_synchronization \font_helpers_synchronize_font} \permanent\protected\def\setcurrentfontbody#body% % not used - {\edef\fontbody{#body}% + {\cdef\fontbody{#body}% \font_helpers_synchronize_font} % For Taco: optional fall backs: @@ -1999,46 +1999,46 @@ \fi \protected\def\font_helpers_set_current_font_style#style% - {\edef\fontstyle{#style}% + {\cdef\fontstyle{#style}% \font_typescripts_inherit_check\fontstyle \ifmmode\mr\fi % otherwise \rm not downward compatible ... not adapted yet \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_xsize_alternative#xsize#alternative% - {\edef\fontface{#xsize}% - \edef\fontalternative{#alternative}% + {\cdef\fontface{#xsize}% + \cdef\fontalternative{#alternative}% \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_font_alternative#alternative% - {\edef\fontalternative{#alternative}% + {\cdef\fontalternative{#alternative}% \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_font_size#size% - {\edef\fontsize{#size}% + {\cdef\fontsize{#size}% \font_helpers_check_big_math_synchronization % double? better in everymath? \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_font_style_alternative#style#alternative% \rmsl - {\edef\fontstyle {#style}% - \edef\fontalternative{#alternative}% + {\cdef\fontstyle {#style}% + \cdef\fontalternative{#alternative}% \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_font_style_size#style#size% \rma - {\edef\fontstyle{#style}% - \edef\fontsize {#size}% + {\cdef\fontstyle{#style}% + \cdef\fontsize {#size}% \font_helpers_check_big_math_synchronization % double? better in everymath? \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_font_alternative_size#alternative#size% \sla - {\edef\fontalternative{#alternative}% - \edef\fontsize {#size}% + {\cdef\fontalternative{#alternative}% + \cdef\fontsize {#size}% \font_helpers_check_big_math_synchronization % double? better in everymath? \font_helpers_synchronize_font} \protected\def\font_helpers_set_current_font_style_alternative_size#style#alternative#size% \rmsla - {\edef\fontstyle {#style}% - \edef\fontalternative{#alternative}% - \edef\fontsize {#size}% + {\cdef\fontstyle {#style}% + \cdef\fontalternative{#alternative}% + \cdef\fontsize {#size}% \font_helpers_check_big_math_synchronization % double? better in everymath? \font_helpers_synchronize_font} diff --git a/tex/context/base/mkxl/font-sol.mklx b/tex/context/base/mkxl/font-sol.mklx index 064f39b9d..c27b9513b 100644 --- a/tex/context/base/mkxl/font-sol.mklx +++ b/tex/context/base/mkxl/font-sol.mklx @@ -97,7 +97,7 @@ \to \everydefinefontsolution \permanent\protected\def\setfontsolution[#solution]% just one - {\edef\currentfontsolution{#solution}% + {\cdef\currentfontsolution{#solution}% \clf_setfontsolution {\currentfontsolution}% {% diff --git a/tex/context/base/mkxl/font-sty.mklx b/tex/context/base/mkxl/font-sty.mklx index 49fa52d38..95d2944d1 100644 --- a/tex/context/base/mkxl/font-sty.mklx +++ b/tex/context/base/mkxl/font-sty.mklx @@ -183,7 +183,7 @@ \mutable\lettonothing\currentdetokenizedstyleparameter \permanent\protected\def\dousestyleparameter#value% - {\edef\currentstyleparameter{#value}% + {\cdef\currentstyleparameter{#value}% \ifempty\currentstyleparameter\else \expandafter\dousecurrentstyleparameter \fi} @@ -194,7 +194,7 @@ \fi} \permanent\protected\def\dousecurrentstyleparameter % empty check outside here - {\edef\currentdetokenizedstyleparameter{\detokenize\expandafter{\currentstyleparameter}}% + {\cdef\currentdetokenizedstyleparameter{\detokenize\expandafter{\currentstyleparameter}}% \settrue\fontattributeisset % reset is done elsewhere \ifcsname\??alternativestyle\currentdetokenizedstyleparameter\endcsname \lastnamedcs @@ -254,7 +254,7 @@ \let\nexttoken} \protected\def\font_styles_use_defined#name% - {\edef\currentstyle{#name}% + {\cdef\currentstyle{#name}% \usestylestyleandcolor\c!style\c!color} \protected\def\font_styles_use_generic#specification% diff --git a/tex/context/base/mkxl/grph-inc.mkxl b/tex/context/base/mkxl/grph-inc.mkxl index b8fd40a89..47b25d26b 100644 --- a/tex/context/base/mkxl/grph-inc.mkxl +++ b/tex/context/base/mkxl/grph-inc.mkxl @@ -211,7 +211,7 @@ \fi} \def\grph_include_use_indeed#1#2#3#4% - {\dodoglobal\defcsname\??externalfigureinstance#1\endcsname{\grph_include_setup{#2}{#3}{#4}}% + {\gdefcsname\??externalfigureinstance#1\endcsname{\grph_include_setup{#2}{#3}{#4}}% \grph_include_analyze_collection[#2][#4]} % inclusion @@ -226,8 +226,8 @@ % todo: chain them \def\grph_include_setup#1#2#3% name parent settings - {\edef\m_grph_include_name {#1}% - \edef\m_grph_include_parent{#2}% + {\cdef\m_grph_include_name {#1}% + \cdef\m_grph_include_parent{#2}% \ifempty\m_grph_include_name \else \let\p_grph_include_name\m_grph_include_name \fi @@ -275,7 +275,7 @@ \def\grph_include_place[#1][#2][#3]% [label][file][settings] | [file][settings] | [file][parent][settings] {\bgroup \advanceby\c_grph_include_nesting\plusone - \edef\currentexternalfigure{\the\c_grph_include_nesting}% + \cdef\currentexternalfigure{\the\c_grph_include_nesting}% \checkexternalfigureparent % each inherits from the root % \the\everyexternalfigureresets @@ -810,7 +810,7 @@ \permanent\protected\def\startexternalfigurecollection[#1]% {\begingroup - \def\currentexternalfigurecollection{#1}% + \cdef\currentexternalfigurecollection{#1}% \settrue\c_grph_include_in_collection \d_grph_include_collection_minwidth \maxdimen \d_grph_include_collection_maxwidth \zeropoint diff --git a/tex/context/base/mkxl/grph-trf.mkxl b/tex/context/base/mkxl/grph-trf.mkxl index 53080b6a1..0d3461c07 100644 --- a/tex/context/base/mkxl/grph-trf.mkxl +++ b/tex/context/base/mkxl/grph-trf.mkxl @@ -123,10 +123,10 @@ \lettonothing\currentscale \setupcurrentscale[#1]% \else - \edef\currentscale{#1}% + \cdef\currentscale{#1}% \fi \or - \edef\currentscale{#1}% + \cdef\currentscale{#1}% \setupcurrentscale[#2]% \fi % diff --git a/tex/context/base/mkxl/lang-ini.mkxl b/tex/context/base/mkxl/lang-ini.mkxl index 1f4b741c2..024fcad18 100644 --- a/tex/context/base/mkxl/lang-ini.mkxl +++ b/tex/context/base/mkxl/lang-ini.mkxl @@ -119,7 +119,7 @@ \fi} \permanent\protected\def\setusedlanguage#1% - {\edef\currentusedlanguage{\reallanguagetag{#1}}% + {\cdef\currentusedlanguage{\reallanguagetag{#1}}% \ifempty\currentusedlanguage \let\currentusedlanguage \currentlanguage \enforced\let\usedlanguageparameter\languageparameter @@ -200,7 +200,7 @@ {\defcsname\??languagelinked#1\endcsname{#1}% \getparameters[\??language#1][\c!state=\v!start,#2]% \lang_basics_install_indeed{#1}{#1}}% - \edef\currentsetuplanguage{#1}% + \cdef\currentsetuplanguage{#1}% \clf_definelanguage{#1}{\specificlanguageparameter{#1}\s!default}% \the\everysetuplanguage \else @@ -253,7 +253,7 @@ \the\everysetuplanguage \or \push_macro_currentlanguage % can be default - \edef\currentsetuplanguage{\reallanguagetag{#1}}% + \cdef\currentsetuplanguage{\reallanguagetag{#1}}% \getparameters[\??language\currentsetuplanguage][#2]% \the\everysetuplanguage \pop_macro_currentlanguage diff --git a/tex/context/base/mkxl/lang-lab.mkxl b/tex/context/base/mkxl/lang-lab.mkxl index c8dc33ccc..e2227f88a 100644 --- a/tex/context/base/mkxl/lang-lab.mkxl +++ b/tex/context/base/mkxl/lang-lab.mkxl @@ -182,11 +182,11 @@ \tolerant\def\lang_labels_text_prefix_start[#1]#*[#2]#*[#3]% class language name {\ifarguments\or\or - \edef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% - \edef\currenttextprefixname{#2}% + \cdef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% + \cdef\currenttextprefixname{#2}% \else - \edef\currenttextprefixtag{\reallanguagetag{#2}}% - \edef\currenttextprefixname{#3}% + \cdef\currenttextprefixtag{\reallanguagetag{#2}}% + \cdef\currenttextprefixname{#3}% \fi \grabuntil{stop#1text}\lang_labels_text_prefix_start_indeed} @@ -195,10 +195,10 @@ \tolerant\def\lang_labels_text_prefix_setup[#1]#*[#2]% {\ifarguments\or - \edef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% + \cdef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% \processcommalist[#1]\lang_labels_text_prefix_setup_indeed \else - \edef\currenttextprefixtag{\reallanguagetag{#1}}% + \cdef\currenttextprefixtag{\reallanguagetag{#1}}% \processcommalist[#2]\lang_labels_text_prefix_setup_indeed \fi} @@ -253,10 +253,10 @@ \tolerant\def\lang_labels_text_prefix_copy[#1]#*[#2]% {\ifarguments\or - \edef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% + \cdef\currenttextprefixtag{\reallanguagetag\currentmainlanguage}% \processcommalist[#1]\lang_labels_text_prefix_copy_indeed \else - \edef\currenttextprefixtag{\reallanguagetag{#1}}% + \cdef\currenttextprefixtag{\reallanguagetag{#1}}% \processcommalist[#2]\lang_labels_text_prefix_copy_indeed \fi} diff --git a/tex/context/base/mkxl/lang-tra.mkxl b/tex/context/base/mkxl/lang-tra.mkxl index 402251f36..637d5ef97 100644 --- a/tex/context/base/mkxl/lang-tra.mkxl +++ b/tex/context/base/mkxl/lang-tra.mkxl @@ -40,7 +40,7 @@ \the\everytransliterations} \permanent\tolerant\protected\def\settransliteration[#1]#;#2% - {\edef\currenttransliteration{#1#2}% + {\cdef\currenttransliteration{#1#2}% \lang_transliteration_common} \permanent\protected\def\transliterationexception[#1]#2#3% @@ -48,7 +48,7 @@ \permanent\tolerant\protected\def\starttransliteration[#1]#*[#2]% {\begingroup - \edef\currenttransliteration{#1}% + \cdef\currenttransliteration{#1}% \ifparameter#2\or \setupcurrenttransliteration[#2]% \fi @@ -61,7 +61,7 @@ \permanent\tolerant\protected\def\transliteration[#1]#;#2% {\groupedcommand - {\edef\currenttransliteration{#1#2}% + {\cdef\currenttransliteration{#1#2}% \lang_transliteration_common \transliterationparameter\c!left\relax} {\transliterationparameter\c!right\relax}} diff --git a/tex/context/base/mkxl/lxml-ini.mkxl b/tex/context/base/mkxl/lxml-ini.mkxl index a185efd12..a1fb4fc48 100644 --- a/tex/context/base/mkxl/lxml-ini.mkxl +++ b/tex/context/base/mkxl/lxml-ini.mkxl @@ -261,11 +261,11 @@ \permanent\tolerant\protected\def\startxmldisplayverbatim[#1]% {\startpacked - \edef\currenttyping{#1}% + \cdef\currenttyping{#1}% \ifempty\currenttyping \let\currenttyping\v!typing \else % maybe test for existence - \edef\currenttyping{xml:\currenttyping}% + \cdef\currenttyping{xml:\currenttyping}% \fi \enforced\protected\def\stopxmldisplayverbatim {\endofverbatimlines @@ -277,11 +277,11 @@ \permanent\tolerant\protected\def\startxmlinlineverbatim[#1]% {\begingroup - \edef\currenttype{#1}% + \cdef\currenttype{#1}% \ifempty\currenttype \let\currenttype\v!type \else % maybe test for existence - \edef\currenttype{xml:\currenttype}% + \cdef\currenttype{xml:\currenttype}% \fi \enforced\let\stopxmlinlineverbatim\endgroup \doinitializeverbatim} diff --git a/tex/context/base/mkxl/math-ali.mkxl b/tex/context/base/mkxl/math-ali.mkxl index 7fc95ac4b..790fb83b8 100644 --- a/tex/context/base/mkxl/math-ali.mkxl +++ b/tex/context/base/mkxl/math-ali.mkxl @@ -540,7 +540,7 @@ \permanent\tolerant\protected\def\math_alignment_start[#1]#*[#2]% {\begingroup - \edef\currentmathalignment{#1}% + \cdef\currentmathalignment{#1}% \ifarguments\or\or \setupmathalignment[#1][#2]% \fi @@ -913,7 +913,7 @@ \permanent\tolerant\protected\def\math_cases_simple[#1]#*[#2]#:#3% {\begingroup - \edef\currentmathcases{#1}% + \cdef\currentmathcases{#1}% \setupcurrentmathcases[#2]% \math_cases_start[\currentmathcases]% \clf_simplecases{\mathcasesparameter\c!action}{#3}% @@ -989,7 +989,7 @@ \permanent\tolerant\protected\def\math_cases_start[#1]#*[#2]% {\begingroup - \edef\currentmathcases{#1}% + \cdef\currentmathcases{#1}% \ifarguments\or\or \setupcurrentmathcases[#2]% \fi @@ -1788,7 +1788,7 @@ \c_math_eqalign_column_saved\c_math_eqalign_column \c_math_eqalign_row_saved\c_math_eqalign_row \globalpushmacro\c_math_eqalign_first - \edef\currentmathmatrix{#1}% + \cdef\currentmathmatrix{#1}% \setupcurrentmathmatrix[#2]% \math_matrix_check_settings \math_eqalign_set_defaults @@ -1994,7 +1994,7 @@ \permanent\tolerant\protected\def\startnamedmatrix[#1]#*[#2]% {\begingroup - \edef\currentmathmatrix{#1}% + \cdef\currentmathmatrix{#1}% \setupcurrentmathmatrix[#2]% \math_matrix_start[\currentmathmatrix]} @@ -2029,7 +2029,7 @@ \permanent\tolerant\protected\def\math_matrix_simple[#1]#*[#2]#:#3% {\begingroup - \edef\currentmathmatrix{#1}% + \cdef\currentmathmatrix{#1}% \setupcurrentmathmatrix[#2]% \math_matrix_start[\currentmathmatrix]% \clf_simplematrix{\mathmatrixparameter\c!action}{#3}% @@ -3015,7 +3015,7 @@ \permanent\tolerant\protected\def\math_simplealign_start[#1]#*[#2]% {\begingroup - \edef\currentmathsimplealign{#1}% + \cdef\currentmathsimplealign{#1}% \ifarguments\or\or \setupcurrentmathsimplealign[#2]% \fi @@ -3147,7 +3147,7 @@ \permanent\tolerant\protected\def\math_align_simple[#1]#*[#2]#:#3% {\begingroup - \edef\currentmathsimplealign{#1}% + \cdef\currentmathsimplealign{#1}% \setupcurrentmathsimplealign[#2]% \math_simplealign_start[\currentmathsimplealign]% \clf_simplealign{\mathsimplealignparameter\c!alternative}{\mathsimplealignparameter\c!action}{#3}% diff --git a/tex/context/base/mkxl/math-del.mkxl b/tex/context/base/mkxl/math-del.mkxl index 35d71460b..112a20629 100644 --- a/tex/context/base/mkxl/math-del.mkxl +++ b/tex/context/base/mkxl/math-del.mkxl @@ -92,7 +92,7 @@ \permanent\tolerant\protected\def\mathdelimiter[#1]#*[#2]% so not really used (for now) {\mathop - {\edef\currentmathdelimiter{#1}% + {\cdef\currentmathdelimiter{#1}% \iftok{#2}\emptytoks \edef\p_factor{\mathdelimiterparameter\c!factor}% \orelse\ifhastok={#2}% diff --git a/tex/context/base/mkxl/math-dld.mklx b/tex/context/base/mkxl/math-dld.mklx index 4f8cf8fb4..25433d65c 100644 --- a/tex/context/base/mkxl/math-dld.mklx +++ b/tex/context/base/mkxl/math-dld.mklx @@ -53,7 +53,7 @@ \tolerant\protected\def\math_delimited_handle#tag#*[#settings]#:#body% {\begingroup - \edef\currentmathdelimited{#tag}% + \cdef\currentmathdelimited{#tag}% \setupcurrentmathdelimited[#settings]% \math_delimited_alternative{% \begincsname\??mathwhateverstrut\mathdelimitedparameter\c!strut\endcsname diff --git a/tex/context/base/mkxl/math-fen.mkxl b/tex/context/base/mkxl/math-fen.mkxl index 53c34c567..a550e2dcb 100644 --- a/tex/context/base/mkxl/math-fen.mkxl +++ b/tex/context/base/mkxl/math-fen.mkxl @@ -151,6 +151,10 @@ \newconstant\c_math_fenced_class \newinteger \c_math_fence_check +\integerdef\c_math_factor_fenced\zerocount + +\installglobalmacrostack\c_math_factor_fenced + \protected\def\math_fenced_common#1#2#3#4% \Uwhatever class symbol source {\c_math_fenced_class\math_class_by_parameter\mathfenceparameter#2% \math_fenced_check_size_mismatch % we need to catch an unbalanced \F as we are sequential @@ -173,6 +177,15 @@ \edef\p_factor {\mathfenceparameter\c!factor}% \edef\p_size {\mathfenceparameter\c!size}% \edef\p_mathclass{\mathfenceparameter\c!mathclass}% +\edef\p_inline_factor{\ifconditional\indisplaymath\mathfenceparameter\c!displayfactor\else\mathfenceparameter\c!inlinefactor\fi}% +\ifempty\p_inline_factor + % nothing +\orelse\ifx#1\Uleft + \push_macro_c_math_factor_fenced + \integerdef\c_math_factor_fenced\p_inline_factor\relax +\orelse\ifx#1\Uright + \pop_macro_c_math_factor_fenced +\fi \ifnum\c_math_fenced_level>\zerocount \math_fenced_common_factor_fixed \orelse\ifconditional\c_math_fenced_sized @@ -219,6 +232,10 @@ \s!top \mathfenceparameter\c!topspace \s!bottom \mathfenceparameter\c!bottomspace % +\ifzero\c_math_factor_fenced\else + \s!factor \c_math_factor_fenced +\fi + % \math_fenced_trace \ifx\p_fence\v!none \Udelimiter\mathghostcode\fam\zerocount @@ -319,12 +336,12 @@ \protected\def\math_fenced_fenced_start#1% {\begingroup %{\beginmathgroup - \edef\currentmathfence{#1}% + \cdef\currentmathfence{#1}% \math_fenced_fenced_common \math_fenced_left} \protected\def\math_fenced_fenced_stop#1% - {\edef\currentmathfence{#1}% + {\cdef\currentmathfence{#1}% \math_fenced_right \stopusemathstyleparameter \endgroup} @@ -366,7 +383,7 @@ \tolerant\protected\def\math_fenced_horizontal#1#*[#2]#:#*#3#4% {% \csname math\mathfenceparameter\c!mathclass\endcsname \mathord \bgroup % class here - \setlocalmathfencecurrent{#1}% \edef\currentmathfence{#1}% + \setlocalmathfencecurrent{#1}% \cdef\currentmathfence{#1}% \setupcurrentmathfence[#2]% % \usemathstyleparameter\mathfenceparameter\c!mathstyle \setmathsmalltextbox\scratchboxone\hbox{\usemathfencestyleandcolor\c!leftstyle \c!leftcolor #3}% @@ -407,7 +424,7 @@ \tolerant\protected\def\math_fenced_vertical#1#*[#2]% {\begingroup %{\beginmathgroup - \setlocalmathfencecurrent{#1}% \edef\currentmathfence{#1}% + \setlocalmathfencecurrent{#1}% \cdef\currentmathfence{#1}% % under test: \setfalse\c_math_fenced_level_mode \c_attr_mathsize\attributeunsetvalue diff --git a/tex/context/base/mkxl/math-ini.mkxl b/tex/context/base/mkxl/math-ini.mkxl index e269ed535..b6f10f5c9 100644 --- a/tex/context/base/mkxl/math-ini.mkxl +++ b/tex/context/base/mkxl/math-ini.mkxl @@ -934,7 +934,7 @@ \permanent\protected\tolerant\def\startmathematics[#1]% no grouping, if ever then also an optional second {\push_macro_currentmathematics - \edef\currentmathematics{#1}% check for valid + \cdef\currentmathematics{#1}% check for valid \the\everyswitchmathematics} \permanent\protected\def\stopmathematics @@ -969,7 +969,7 @@ \ifcondition\validassignment{#1}% \setupcurrentmathematics[#1]% \else - \edef\currentmathematics{#1}% check for valid + \cdef\currentmathematics{#1}% check for valid \fi \edef\p_openup{\mathematicsparameter\c!openup}% \ifx\p_openup\v!yes @@ -2035,7 +2035,7 @@ \def\math_function_handle_normal#1#2#3% {\begingroup - \edef\currentmathfunction{#2}% + \cdef\currentmathfunction{#2}% \setupcurrentmathfunction[#3]% \edef\p_limits{\mathfunctionparameter\c!mathlimits}% \mathatom @@ -2079,7 +2079,7 @@ \endgroup} \def\math_function_handle_language_indeed#1#2#3% - {\edef\currentmathfunction{#2}% + {\cdef\currentmathfunction{#2}% \setupcurrentmathfunction[#3]% \edef\p_command{\mathfunctionparameter\c!command}% \ifempty\p_command @@ -3847,7 +3847,7 @@ \tolerant\protected\def\math_text_handle_indeed#1#*[#2]#:#3#% {\begingroup - \edef\currentmathtext{#1}% + \cdef\currentmathtext{#1}% \setupcurrentmathtext[#2]% \normalizebodyfontsize\m_math_text_choice_face{\mathstyleface\normalmathstyle}% \ifcstok{\mathtextparameter\c!alternative}\v!split @@ -4687,25 +4687,48 @@ \mathinlinepenaltyfactor = 1500 % a reasonable default \mathdisplaypenaltyfactor = 1000 -\permanent\tolerant\protected\def\definemathnesting[#1]#*[#2]#*[#3]% - {\frozen\protected\edefcsname#1\endcsname{\math_nesting{#2}{#3}}} +\setmathpostpenalty\mathpunctuationcode\plustenthousand -\protected\def\math_nesting#1#2% +\installcorenamespace{mathnesting} + +\installcommandhandler \??mathnesting {mathnesting} \??mathnesting + +\appendtoks + \frozen\protected\instance\edefcsname\currentmathnesting\endcsname{\math_nesting[\currentmathnesting]}% +\to \everydefinemathnesting + +\newconstant\c_math_boundary_old +\newconstant\c_math_boundary_new + +\protected\tolerant\def\math_nesting[#1]#*[#2]% {\groupedcommand - {\mathboundary\plustwo + {\cdef\currentmathnesting{#1}% + \setupcurrentmathnesting[#2]% \ifparameter#2\or...\fi can't work here due to nesting + \mathnestingparameter\c!left + \c_math_boundary_old\c_math_boundary_new + \c_math_boundary_new \ifconditional\indisplaymath - \ifchknum#2\or#2\else\mathdisplaypenaltyfactor\fi + \ifchknum\mathnestingparameter\c!displayfactor\or\lastnamedcs\else\mathdisplaypenaltyfactor\fi \else - \ifchknum#1\or#1\else\mathinlinepenaltyfactor\fi + \ifchknum\mathnestingparameter\c!inlinefactor \or\lastnamedcs\else\mathinlinepenaltyfactor \fi \fi - \relax}% - {\mathboundary\plusone}} + \relax + \mathboundary\plustwo \c_math_boundary_new}% + {\mathboundary\plusthree\c_math_boundary_old + \mathnestingparameter\c!right}} + +\permanent\tolerant\protected\def\mathnesting[#1]% + {\groupedcommand + {\c_math_boundary_old\c_math_boundary_new + \c_math_boundary_new\ifchknum#1\or#1\orelse\ifconditional\indisplaymath\mathdisplaypenaltyfactor\else\mathinlinepenaltyfactor\fi\relax + \mathboundary\plustwo \c_math_boundary_new}% + {\mathboundary\plusthree\c_math_boundary_old}} -\permanent\tolerant\protected\def\mathnesting[#1]#*[#2]% - {\math_nesting{#1}{#2}} +% \definemathnesting[triplet][left=(,right=),inlinefactor=500] +% $ (a,b,c) + \triplet{1,2,3} + (p,q,r) $ -\definemathnesting[mathtogether][1500][1000] -\definemathnesting[mathloose] [500][1000] +\definemathnesting[mathtogether][\c!inlinefactor=1500] +\definemathnesting[mathloose] [\c!inlinefactor=0500] \protect \endinput diff --git a/tex/context/base/mkxl/math-rad.mklx b/tex/context/base/mkxl/math-rad.mklx index ee91243e0..ca02005fa 100644 --- a/tex/context/base/mkxl/math-rad.mklx +++ b/tex/context/base/mkxl/math-rad.mklx @@ -130,7 +130,7 @@ \tolerant\protected\def\math_radical_handle#tag#*[#settings]#*[#degree]#:#body% {\begingroup - \edef\currentmathradical{#tag}% + \cdef\currentmathradical{#tag}% \ifhastok={#settings}% \lettonothing\currentmathradicaldegree \setupcurrentmathradical[#settings]% @@ -313,7 +313,7 @@ \protected\def\math_ornament_handle#tag#body% {\begingroup - \edef\currentmathornament{#tag}% + \cdef\currentmathornament{#tag}% \csname\??mathornamentalternative\mathornamentparameter\c!alternative\endcsname{#body}% \endgroup} diff --git a/tex/context/base/mkxl/math-stc.mklx b/tex/context/base/mkxl/math-stc.mklx index 1e488af2c..4faca1933 100644 --- a/tex/context/base/mkxl/math-stc.mklx +++ b/tex/context/base/mkxl/math-stc.mklx @@ -339,7 +339,7 @@ \protected\def\math_stackers_triplet#method#category#codepoint#toptext#bottomtext% {\begingroup - \edef\currentmathstackers{#category}% + \cdef\currentmathstackers{#category}% \mathstackersparameter\c!left\relax \dostarttagged\t!mstacker\currentmathstackers \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi @@ -498,7 +498,7 @@ \tolerant\protected\def\math_stackers_auto_normal#1#2#*[#3]#:#=#*#=% {\begingroup \scratchcounter#2\relax - \edef\currentmathstackers{\ifparameter#3\or#3\else#1\fi}% + \cdef\currentmathstackers{\ifparameter#3\or#3\else#1\fi}% \math_stackers_triplet\zerocount\currentmathstackers\scratchcounter{#4}{#5}% \endgroup} @@ -526,7 +526,7 @@ \protected\def\math_stackers_start_group#category% {\begingroup - \edef\currentmathstackers{#category}% + \cdef\currentmathstackers{#category}% \edef\p_limits{\mathstackersparameter\c!mathlimits}% \ifx\p_limits\v!yes \def\math_stackers_stop_group{\egroup\endgroup\ordlimits}% @@ -697,7 +697,7 @@ \permanent\tolerant\protected\def\mathover[#category]#spacer[#settings]#:#topcode#text% {\begingroup - \edef\currentmathstackers{\ifparameter#category\or#category\else\v!top\fi}% + \cdef\currentmathstackers{\ifparameter#category\or#category\else\v!top\fi}% \ifparameter#settings\or \setupcurrentmathstackers[#settings]% \fi @@ -710,7 +710,7 @@ \permanent\tolerant\protected\def\mathunder[#category]#spacer[#settings]#:#bottomcode#text% {\begingroup - \edef\currentmathstackers{\ifparameter#category\or#category\else\v!bottom\fi}% + \cdef\currentmathstackers{\ifparameter#category\or#category\else\v!bottom\fi}% \ifparameter#settings\or \setupcurrentmathstackers[#settings]% \fi @@ -723,7 +723,7 @@ \permanent\tolerant\protected\def\mathdouble[#category]#spacer[#settings]#:#topcode#bottomcode#text% {\begingroup - \edef\currentmathstackers{\ifparameter#category\or#category\else\v!both\fi}% + \cdef\currentmathstackers{\ifparameter#category\or#category\else\v!both\fi}% \ifparameter#settings\or \setupcurrentmathstackers[#settings]% \fi @@ -746,7 +746,7 @@ \mathstackersparameter\c!left\relax \dostarttagged\t!mstacker\currentmathstackers \ifmmode\math_atom_by_parameter\mathstackersparameter\else\dontleavehmode\fi - {\edef\currentmathstackers{#category}% + {\cdef\currentmathstackers{#category}% % \edef\p_offset {\mathstackersparameter\c!offset}% \edef\p_location {\mathstackersparameter\c!location}% @@ -913,16 +913,16 @@ \tolerant\protected\def\math_stackers_auto_triplet_yes[#1][#2]#*[#3]#:#=#*#=% [#2]% #2 gobble spaces {\begingroup - \edef\currentmathstackers{#1}% + \cdef\currentmathstackers{#1}% \def \m_math_stackers_text_middle{#2}% - \ifarguments#3\or\edef\currentmathstackers{#3}\fi + \ifarguments#3\or\cdef\currentmathstackers{#3}\fi \math_stackers_triplet\plusone\currentmathstackers\m_math_stackers_text_middle{#4}{#5}% \endgroup} \tolerant\protected\def\math_stackers_auto_triplet_nop[#1]#*[#2]#:#=#*#=#*#=% [#2]% #2 gobble spaces% {\begingroup - \edef\currentmathstackers{#1}% - \ifarguments#2\or\edef\currentmathstackers{#2}\fi + \cdef\currentmathstackers{#1}% + \ifarguments#2\or\cdef\currentmathstackers{#2}\fi \math_stackers_triplet\plusone\currentmathstackers{#3}{#4}{#5}% \endgroup} @@ -1332,7 +1332,7 @@ \protected\def\math_stackers_unstacked_normal#category#codepoint% {\begingroup - \edef\currentmathstackers{#category}% + \cdef\currentmathstackers{#category}% \edef\p_moffset{\mathstackersparameter\c!moffset}% \ifconditional\indisplaymath \ifempty\p_moffset \else diff --git a/tex/context/base/mkxl/meta-ini.mkxl b/tex/context/base/mkxl/meta-ini.mkxl index c5d86e2af..ad3399433 100644 --- a/tex/context/base/mkxl/meta-ini.mkxl +++ b/tex/context/base/mkxl/meta-ini.mkxl @@ -95,7 +95,7 @@ \permanent\tolerant\protected\def\startMPdefinitions#=#:#2\stopMPdefinitions {\let\m_meta_saved_instance\currentMPinstance - \edef\currentMPinstance{#1}% + \cdef\currentMPinstance{#1}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi @@ -116,7 +116,7 @@ \permanent\tolerant\protected\def\startMPinclusions[#1]#*#=#:#3\stopMPinclusions {\let\m_meta_saved_instance\currentMPinstance % \pushmacro - \edef\currentMPinstance{#2}% + \cdef\currentMPinstance{#2}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi @@ -136,7 +136,7 @@ \global\t_meta_inclusions\emptytoks \fi \ifparameter#3\or - \edef\currentMPinstance{#2}% + \cdef\currentMPinstance{#2}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi @@ -187,16 +187,16 @@ {\let\meta_show_properties\donothing} \protected\def\meta_analyze_graphicname_indeed[#1::#2::#3]% instance :: - {\edef\currentMPgraphicname{#2}% + {\cdef\currentMPgraphicname{#2}% \ifempty\currentMPgraphicname - \edef\currentMPgraphicname{#1}% + \cdef\currentMPgraphicname{#1}% \let\currentMPinstance\defaultMPinstance \orelse\ifcsname\??mpdefinitions#1\endcsname - \edef\currentMPinstance{#1}% + \cdef\currentMPinstance{#1}% \else \let\currentMPinstance\defaultMPinstance \fi - \edef\currentMPformat{\MPinstanceparameter\s!format}% + \cdef\currentMPformat{\MPinstanceparameter\s!format}% \meta_show_properties} \mutable\def\currentMPgraphicname{\s!unknown} @@ -285,12 +285,12 @@ \popMPboundingbox} \protected\def\meta_process_graphic_instance#1#2% used in startMPpage - {\edef\currentMPinstance{#1}% + {\cdef\currentMPinstance{#1}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi \setmpcategoryparameter\c!stacking{#2}% - \edef\currentMPformat{\MPinstanceparameter\s!format}% + \cdef\currentMPformat{\MPinstanceparameter\s!format}% \meta_process_graphic} \protected\def\meta_process_graphic#1% todo: extensions and inclusions outside beginfig @@ -424,7 +424,7 @@ \d_overlay_height#3\relax \edef\width {\the\d_overlay_width \space}% obsolete \edef\height{\the\d_overlay_height\space}% obsolete - \edef\currentMPclip{#1}% + \cdef\currentMPclip{#1}% \ifcsname\??mpclip\currentMPclip\endcsname \meta_grab_clip_path_yes \else @@ -684,7 +684,7 @@ {% ugly code but we run on top of older code \resetdummyparameter\c!instance \getdummyparameters[#1]% - \edef\currentMPinstance{\dummyparameter\c!instance}% + \cdef\currentMPinstance{\dummyparameter\c!instance}% % here we feed the instance into the analyzer \meta_begin_graphic_group{\ifempty\currentMPinstance\else\currentMPinstance::\fi#1}% \checkmpcategoryparent @@ -754,7 +754,7 @@ % \permanent\tolerant\protected\def\useMPgraphic#=#*#=% % {\meta_begin_graphic_group{#1}% % \ifcsname\??mpgraphic#1\endcsname -% \edef\currentmpcategory{#1}% +% \cdef\currentmpcategory{#1}% % \orelse\ifcsname\??mpgraphic\currentMPgraphicname\endcsname % \let\currentmpcategory\currentMPgraphicname % \else @@ -776,11 +776,11 @@ {% ugly code but we run on top of older code \resetdummyparameter\c!instance \getdummyparameters[#1]% - \edef\currentMPinstance{\dummyparameter\c!instance}% + \cdef\currentMPinstance{\dummyparameter\c!instance}% % here we feed the instance into the analyzer \meta_begin_graphic_group{\ifempty\currentMPinstance\else\currentMPinstance::\fi#2}% \ifcsname\??mpgraphic#2\endcsname - \edef\currentmpcategory{#2}% + \cdef\currentmpcategory{#2}% \orelse\ifcsname\??mpgraphic\currentMPgraphicname\endcsname \let\currentmpcategory\currentMPgraphicname \else @@ -798,7 +798,7 @@ \tolerant\def\meta_usempgraphic_nop#=#*#=% {\meta_begin_graphic_group{#1}% \ifcsname\??mpgraphic#1\endcsname - \edef\currentmpcategory{#1}% + \cdef\currentmpcategory{#1}% \orelse\ifcsname\??mpgraphic\currentMPgraphicname\endcsname \let\currentmpcategory\currentMPgraphicname \else @@ -834,7 +834,7 @@ \def\meta_handle_overlay_graphic#1#2#3% {\begingroup - \edef\currentmpcategory{#1}% + \cdef\currentmpcategory{#1}% \meta_process_graphic{#3;BoundToOverlayBox;}% \endgroup} @@ -970,12 +970,12 @@ % \permanent\tolerant\protected\def\startMPcode#=#:#2\stopMPcode % {\begingroup -% \edef\currentMPinstance{#1}% +% \cdef\currentMPinstance{#1}% % \ifempty\currentMPinstance % \let\currentMPinstance\defaultMPinstance % \fi % \lettonothing\currentMPgraphicname -% \edef\currentMPformat{\MPinstanceparameter\s!format}% +% \cdef\currentMPformat{\MPinstanceparameter\s!format}% % \meta_enable_include % \meta_process_graphic{#2}% % \endgroup} @@ -985,12 +985,12 @@ \tolerant\def\meta_start_mpcode_nop#:#=#:#2\stopMPcode {\begingroup - \edef\currentMPinstance{#1}% + \cdef\currentMPinstance{#1}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi \lettonothing\currentMPgraphicname - \edef\currentMPformat{\MPinstanceparameter\s!format}% + \cdef\currentMPformat{\MPinstanceparameter\s!format}% \meta_enable_include \meta_process_graphic{#2}% \endgroup} @@ -1000,13 +1000,13 @@ \resetdummyparameter\c!instance \resetdummyparameter\c!stacking \getdummyparameters[#1]% - \edef\currentMPinstance{\dummyparameter\c!instance}% + \cdef\currentMPinstance{\dummyparameter\c!instance}% \setmpcategoryparameter\c!stacking{\dummyparameter\c!stacking}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi \lettonothing\currentMPgraphicname - \edef\currentMPformat{\MPinstanceparameter\s!format}% + \cdef\currentMPformat{\MPinstanceparameter\s!format}% \meta_enable_include \meta_process_graphic{#2}% \endgroup} @@ -1364,12 +1364,12 @@ \permanent\tolerant\protected\def\startMPcalculation#=#:#2\stopMPcalculation {\begingroup \setbox\nextbox\hpack\bgroup - \edef\currentMPinstance{#1}% + \cdef\currentMPinstance{#1}% \ifempty\currentMPinstance \let\currentMPinstance\defaultMPinstance \fi \lettonothing\currentMPgraphicname - \edef\currentMPformat{\MPinstanceparameter\s!format}% + \cdef\currentMPformat{\MPinstanceparameter\s!format}% \meta_enable_include \meta_process_graphic{#2;draw origin}% \egroup diff --git a/tex/context/base/mkxl/mult-aux.mkxl b/tex/context/base/mkxl/mult-aux.mkxl index 4940aaa04..3df8c8309 100644 --- a/tex/context/base/mkxl/mult-aux.mkxl +++ b/tex/context/base/mkxl/mult-aux.mkxl @@ -284,7 +284,7 @@ \frozen\def#9##1##2{\expandafter\let\expandafter##1\csname\ifcsname#1#2:##2\endcsname#1#2:##2\else\expandafter#5\csname#1#2:\s!parent\endcsname{##2}\fi\endcsname}} \permanent\protected\def\installparameterhandler#1#2% - {\mutable\letcsname current#2\endcsname\empty + {\mutable\constant\letcsname current#2\endcsname\empty \normalexpanded {\mult_interfaces_install_parameter_handler {\noexpand#1}% \??aa @@ -366,15 +366,15 @@ \protected\def\mult_interfaces_install_style_and_color_handler#1#2#3#4% {\frozen\protected\def#2##1##2% style color - {\edef\currentstyleparameter{#1{##1}}% this name is public (can also set color e.g. in underline) + {\cdef\currentstyleparameter{#1{##1}}% this name is public (can also set color e.g. in underline) \ifempty\currentstyleparameter\else\dousecurrentstyleparameter\fi - \edef\currentcolorparameter{#1{##2}}% this name is public (so we do this after the style switch) + \cdef\currentcolorparameter{#1{##2}}% this name is public (so we do this after the style switch) \ifempty\currentcolorparameter\else\dousecurrentcolorparameter\fi}% \frozen\protected\def#3##1% style - {\edef\currentstyleparameter{#1{##1}}% this name is public + {\cdef\currentstyleparameter{#1{##1}}% this name is public \ifempty\currentstyleparameter\else\dousecurrentstyleparameter\fi}% \frozen\protected\def#4##1% color - {\edef\currentcolorparameter{#1{##1}}% this name is public + {\cdef\currentcolorparameter{#1{##1}}% this name is public \ifempty\currentcolorparameter\else\dousecurrentcolorparameter\fi}} \permanent\protected\def\installstyleandcolorhandler#1#2% @@ -388,7 +388,7 @@ \def\mult_check_for_parent#1#2#3#4% {\ifcsname#1#4:\s!parent\endcsname\orelse\ifx#4\empty\else \writestatus\m!system{error: invalid parent #4 for #3, #4 defined too (best check it)}% - \edefcsname#1#4:\s!parent\endcsname{#2}% + \cdefcsname#1#4:\s!parent\endcsname{#2}% \fi} \def\mult_interfaces_chain#1#2{\ifcsname#1#2:\s!chain\endcsname\lastnamedcs\space\fi} @@ -412,13 +412,13 @@ \letcsname#1#4:\s!chain\endcsname\empty \cdefcsname#1#4:\s!parent\endcsname{#3}% \or - \edef#4{##1}% + \cdef#4{##1}% \the#5% predefine \lettonothing#7% \cdefcsname#1#4:\s!chain\endcsname{##1}% \cdefcsname#1#4:\s!parent\endcsname{#3}% \or - \edef#4{##1}% + \cdef#4{##1}% \the#5% predefine \relax \ifhastok={##2}% @@ -427,7 +427,7 @@ \cdefcsname#1#4:\s!parent\endcsname{#3}% \mult_interfaces_get_parameters{#1#4:}[##2]% \else - \edef#7{##2}% + \cdef#7{##2}% \ifempty#7% \cdefcsname#1#4:\s!chain\endcsname{##1}% \cdefcsname#1#4:\s!parent\endcsname{#3}% @@ -438,9 +438,9 @@ \fi \fi \or - \edef#4{##1}% + \cdef#4{##1}% \the#5% predefine - \edef#7{##2}% + \cdef#7{##2}% \mult_check_for_parent{#1}{#3}#4#7% \cdefcsname#1#4:\s!chain\endcsname{\mult_interfaces_chain#1{##2}##1}% \cdefcsname#1#4:\s!parent\endcsname{#1##2}% @@ -471,7 +471,7 @@ {\let#6#3% \ifnum\lastarguments=\plustwo \def#8####1% we will have a simple one as well - {\edef#3{####1}% + {\cdef#3{####1}% \mult_interfaces_get_parameters{#1#3:}[##2]% \the#4}% \processcommalist[##1]#8% @@ -501,10 +501,83 @@ \aliased\let\doingrootsetnamed \plusthree % \setuplayout[name] \aliased\let\doingrootsetroot \plusfour % \setuplayout -\protected\def\mult_interfaces_install_switch_setup_handler_a#1#2#3% - {\frozen\protected\def#3{\mult_interfaces_get_parameters{#1#2:}}} - -\protected\def\mult_interfaces_install_switch_setup_handler_b#1#2#3#4#5#6#7#8#9% +% \protected\def\mult_interfaces_install_switch_setup_handler_a#1#2#3% +% {\frozen\protected\def#3{\mult_interfaces_get_parameters{#1#2:}}} + +% \protected\def\mult_interfaces_install_switch_setup_handler_b#1#2#3#4#5#6#7#8#9% +% {\newtoks#5% +% \newconstant#2% +% \newtoks#8% +% \newtoks#9% +% \frozen\tolerant\protected\def#4[##1]##*[##2]% maybe helper +% {\ifarguments +% % \setuplayout +% \let#6#3% % previous becomes current +% \lettonothing#3% % current becomes empty +% #2\doingrootsetroot +% \the#5% +% \the#8% switchsetups +% \or +% \ifhastok={##1}% +% % \setuplayout[key=value] +% \let#7#3% +% \let#6#3% +% \lettonothing#3% +% #2\doingrootsetuproot +% \mult_interfaces_get_parameters{#1:}[##1]% +% \the#5% +% \the#8% switchsetups +% \let#3#7% +% \else +% % \setuplayout[whatever] +% \let#6#3% % previous becomes current +% \cdef#3{##1}% this will catch reset so one needs to test for it +% \ifempty#3% +% \let#7#6% +% #2\doingrootsetuproot +% \the#5% +% \the#8% switchsetups +% \let#3#7% +% \else +% #2\doingrootsetnamed +% \the#5% % we can check for previous vs current +% \the#8% switchsetups +% \fi +% \fi +% \or +% % \setuplayout[whatever][key=value] +% \let#7#3% +% \let#6#3% +% \cdef#3{##1}% +% #2\doingrootsetupnamed +% \mult_interfaces_get_parameters{#1#3:}[##2]% +% \the#5% +% \ifx#3#6\the#8\fi % only switchsetups if previous == current +% \let#3#7% +% \fi +% #2\zerocount % mode is always zero at the end +% \the#9}} + +% \permanent\protected\def\installswitchsetuphandler#1#2% +% {\mutable\letcsname current#2\endcsname\empty +% \mutable\letcsname previous#2\endcsname\empty +% \normalexpanded +% {\mult_interfaces_install_switch_setup_handler_a +% {\noexpand#1}% \??aa +% \expandafter\noexpand\csname current#2\endcsname +% \expandafter\noexpand\csname setupcurrent#2\endcsname +% \mult_interfaces_install_switch_setup_handler_b +% {\noexpand#1}% \??aa +% \expandafter\noexpand\csname #2setupmode\endcsname +% \expandafter\noexpand\csname current#2\endcsname +% \expandafter\noexpand\csname setup#2\endcsname +% \expandafter\noexpand\csname everysetup#2\endcsname +% \expandafter\noexpand\csname previous#2\endcsname +% \expandafter\noexpand\csname saved_setup_current#2\endcsname +% \expandafter\noexpand\csname everyswitch#2\endcsname +% \expandafter\noexpand\csname everysetup#2root\endcsname}} + +\protected\def\mult_interfaces_install_switch_setup_handler#1#2#3#4#5#6#7#8#9#A% {\newtoks#5% \newconstant#2% \newtoks#8% @@ -531,7 +604,7 @@ \else % \setuplayout[whatever] \let#6#3% % previous becomes current - \edef#3{##1}% this will catch reset so one needs to test for it + \cdef#3{##1}% this will catch reset so one needs to test for it \ifempty#3% \let#7#6% #2\doingrootsetuproot @@ -548,7 +621,7 @@ % \setuplayout[whatever][key=value] \let#7#3% \let#6#3% - \edef#3{##1}% + \cdef#3{##1}% #2\doingrootsetupnamed \mult_interfaces_get_parameters{#1#3:}[##2]% \the#5% @@ -556,17 +629,14 @@ \let#3#7% \fi #2\zerocount % mode is always zero at the end - \the#9}} + \the#9}% + \frozen\protected\def#A{\mult_interfaces_get_parameters{#1#3:}}} \permanent\protected\def\installswitchsetuphandler#1#2% {\mutable\letcsname current#2\endcsname\empty \mutable\letcsname previous#2\endcsname\empty \normalexpanded - {\mult_interfaces_install_switch_setup_handler_a - {\noexpand#1}% \??aa - \expandafter\noexpand\csname current#2\endcsname - \expandafter\noexpand\csname setupcurrent#2\endcsname - \mult_interfaces_install_switch_setup_handler_b + {\mult_interfaces_install_switch_setup_handler {\noexpand#1}% \??aa \expandafter\noexpand\csname #2setupmode\endcsname \expandafter\noexpand\csname current#2\endcsname @@ -575,7 +645,9 @@ \expandafter\noexpand\csname previous#2\endcsname \expandafter\noexpand\csname saved_setup_current#2\endcsname \expandafter\noexpand\csname everyswitch#2\endcsname - \expandafter\noexpand\csname everysetup#2root\endcsname}} + \expandafter\noexpand\csname everysetup#2root\endcsname + \expandafter\noexpand\csname setupcurrent#2\endcsname}} + \protected\def\mult_interfaces_install_auto_setup_handler#1#2#3#4#5#6#7#8% {\newtoks#4% @@ -591,15 +663,15 @@ \the#4% \or \def#8####1% - {\edef#3{####1}% + {\cdef#3{####1}% #6% checks parent and sets if needed \mult_interfaces_get_parameters{#1#3:}[##2]% \the#4}% \processcommalist[##1]#8% \or \def#8####1% - {\edef#3{####1}% - \defcsname#1#3:\s!parent\endcsname{#1##2}% + {\cdef#3{####1}% + \cdefcsname#1#3:\s!parent\endcsname{#1##2}% \mult_interfaces_get_parameters{#1#3:}[##3]% always sets parent \the#4}% \processcommalist[##1]#8% @@ -754,7 +826,7 @@ {\immutable\edefcsname\csname#1namespace\endcsname#2:\s!parent\endcsname{\csname#3namespace\endcsname#4}} \permanent\protected\def\relateparameterhandlersbyns#1#2#3#4% {from} {instance} {to} {instance} - {\edefcsname#1#2:\s!parent\endcsname{#3#4}} + {\cdefcsname#1#2:\s!parent\endcsname{#3#4}} %D Here is another experiment: @@ -766,7 +838,7 @@ \or %\ifcondition\expandafter\mult_check_for_assignment_indeed_begin_\detokenize{##1}=^^^^0003^^^^0003^^^^0004% % \ifcondition\mult_aux_no_assignment_indeed##1\ignorearguments - % \edef#2{##1}% + % \cdef#2{##1}% % \else % \lettonothing#2% % #3[##1]% @@ -775,10 +847,10 @@ \lettonothing#2% #3[##1]% \else - \edef#2{##1}% + \cdef#2{##1}% \fi \or - \edef#2{##1}% + \cdef#2{##1}% #3[##2]% \fi \directsetup{handler:action:#1}% @@ -1022,14 +1094,14 @@ \frozen\protected\def#4##1% {\pushmacro#6% \advanceby#3\plusone - \edef#6{##1}% + \cdef#6{##1}% \unprotect}% \frozen\protected\def#5% {\protect \advanceby#3\minusone \popmacro#6}% \frozen\protected\def#7##1% - {\edef#6{##1}% + {\cdef#6{##1}% #2% \the\c_mult_set\relax}} @@ -1072,7 +1144,7 @@ \protected\def\mult_interfaces_install_parent_injector#1#2#3#4% {\frozen\protected\def#4##1% {\ifempty#3% - \defcsname#1#2:\s!parent\endcsname{#1##1}% + \cdefcsname#1#2:\s!parent\endcsname{#1##1}% was def \fi}} \permanent\protected\def\installparentinjector#1#2% @@ -1087,8 +1159,8 @@ \permanent\protected\def\mult_interfaces_install_local_current_injector#1#2#3#4% {\protected\def#4##1% {\advanceby#2\plusone - \edef#3{##1:\the#2}% \currentXXX - \edefcsname#1#3:\s!parent\endcsname{#1##1}}} + \cdef#3{##1:\the#2}% \currentXXX + \cdefcsname#1#3:\s!parent\endcsname{#1##1}}} \permanent\protected\def\installlocalcurrenthandler#1#2% \??XXX {XXX} {\expandafter\newinteger\csname#1:\s!counter\endcsname @@ -1178,7 +1250,7 @@ \csname\??commalistprocessornext#1\endcsname}} \permanent\protected\def\installcommalistprocessorcommand#1#2% \processor \action - {\edef\p_name{\csstring#2}% + {\cdef\p_name{\csstring#2}% \installcommalistprocessor\p_name{#2}% \expandafter\let\expandafter#1\csname\??commalistprocessor\p_name\endcsname} @@ -1213,7 +1285,7 @@ \the#4% \or \def#8####1% - {\edef#3{####1}% + {\cdef#3{####1}% #6% checks parent and sets if needed \let\mult_interfaces_adef\mult_interfaces_adef_nop \mult_interfaces_get_parameters{#1#3:}[##2]% @@ -1222,8 +1294,8 @@ \processcommalist[##1]#8% \or \def#8####1% - {\edef#3{####1}% - \defcsname#1#3:\s!parent\endcsname{#1##2}% + {\cdef#3{####1}% + \cdefcsname#1#3:\s!parent\endcsname{#1##2}% \let\mult_interfaces_adef\mult_interfaces_adef_nop \mult_interfaces_get_parameters{#1#3:}[##3]% always sets parent \let\mult_interfaces_adef\mult_interfaces_adef_yes diff --git a/tex/context/base/mkxl/mult-sys.mkxl b/tex/context/base/mkxl/mult-sys.mkxl index f40282cbd..cbc644739 100644 --- a/tex/context/base/mkxl/mult-sys.mkxl +++ b/tex/context/base/mkxl/mult-sys.mkxl @@ -209,6 +209,7 @@ \definesystemconstant {external} \definesystemconstant {ex} \definesystemconstant {e} +\definesystemconstant {factor} \definesystemconstant {fallbacks} \definesystemconstant {fallback} \definesystemconstant {false} diff --git a/tex/context/base/mkxl/node-rul.mkxl b/tex/context/base/mkxl/node-rul.mkxl index 04c0e0dc3..70b62b8b0 100644 --- a/tex/context/base/mkxl/node-rul.mkxl +++ b/tex/context/base/mkxl/node-rul.mkxl @@ -135,7 +135,7 @@ \newinteger\c_node_rules_down \permanent\protected\def\node_rules_set#1% - {\edef\currentbar{#1}% + {\cdef\currentbar{#1}% \advanceby\c_node_rules_level\plusone \usebarstyleandcolor\c!foregroundstyle\c!foregroundcolor \edef\p_node_color {\barparameter\c!color}% todo diff --git a/tex/context/base/mkxl/pack-box.mkxl b/tex/context/base/mkxl/pack-box.mkxl index ea270f88b..07b4c7950 100644 --- a/tex/context/base/mkxl/pack-box.mkxl +++ b/tex/context/base/mkxl/pack-box.mkxl @@ -1170,7 +1170,7 @@ \permanent\tolerant\protected\def\setanchorbox[#1]#*[#2]% {\begingroup \dowithnextbox - {\def\currentanchorbox{#1}% + {\cdef\currentanchorbox{#1}% \setupboxanchor[#2]% \scratchcounterone\csname\??boxanchorbox#1\endcsname\relax \scratchxoffset\boxanchorparameter\c!xoffset\relax @@ -1296,7 +1296,7 @@ {\ifhastok={#2}% \setupcurrentboxanchorcontent[#2]% \else - \def\currentboxanchorcontent{#2}% + \cdef\currentboxanchorcontent{#2}% \setupcurrentboxanchorcontent[#3]% \fi \scratchxoffset\boxanchorcontentparameter\c!xoffset diff --git a/tex/context/base/mkxl/pack-com.mkxl b/tex/context/base/mkxl/pack-com.mkxl index e07e0ff8d..5277d13fa 100644 --- a/tex/context/base/mkxl/pack-com.mkxl +++ b/tex/context/base/mkxl/pack-com.mkxl @@ -230,7 +230,7 @@ % \permanent\tolerant\protected\def\startcombination[#1]#*[#2]% can be simplified % {\bgroup % so we can grab a group % \pack_combinations_push -% \edef\currentcombination{#1}% +% \cdef\currentcombination{#1}% % \edef\p_nx_ny{#2}% % % % \ifempty\p_nx_ny @@ -322,7 +322,7 @@ \permanent\tolerant\protected\def\startcombination[#1]#*[#2]% can be simplified {\bgroup % so we can grab a group \pack_combinations_push - \edef\currentcombination{#1}% + \cdef\currentcombination{#1}% \edef\p_nx_ny{#2}% % \ifempty\p_nx_ny @@ -832,7 +832,7 @@ \permanent\tolerant\protected\def\startplacepairedbox[#1]#*[#2]% {\bgroup - \edef\currentpairedbox{#1}% + \cdef\currentpairedbox{#1}% \setupcurrentpairedbox[#2]% \pairedboxparameter\c!before \bgroup diff --git a/tex/context/base/mkxl/pack-lyr.mkxl b/tex/context/base/mkxl/pack-lyr.mkxl index cc4a7381f..6c6058dab 100644 --- a/tex/context/base/mkxl/pack-lyr.mkxl +++ b/tex/context/base/mkxl/pack-lyr.mkxl @@ -210,7 +210,7 @@ {\bgroup \nofarguments\lastarguments \checkpositionoverlays % otherwise funny regions - \edef\currentlayer{#1}% + \cdef\currentlayer{#1}% \edef\p_pack_layers_state{\layerparameter\c!state}% \ifx\p_pack_layers_state\v!stop \dowithnextboxcs\egroup\hbox % no pack ? @@ -509,7 +509,7 @@ \permanent\protected\def\flushlayer[#1]% quite core, so optimized (todo: check for void) {\begingroup \forgetall - \edef\currentlayer{#1}% + \cdef\currentlayer{#1}% \edef\p_pack_layers_state{\layerparameter\c!state}% \ifx\p_pack_layers_state\v!stop % nothing @@ -660,7 +660,7 @@ \box\nextbox % \pack_layers_bottom_fill}% - % \edef\currentlayer{#2}% :\the\realpageno}% local .. check \anchor + % \cdef\currentlayer{#2}% :\the\realpageno}% local .. check \anchor \edef\p_pack_layers_position{\layerparameter\c!position}% local \ifx\p_pack_layers_position\v!yes \edef\p_pack_layers_region{\layerparameter\c!region}% diff --git a/tex/context/base/mkxl/pack-mat.mkxl b/tex/context/base/mkxl/pack-mat.mkxl index a810c8a47..3b9883082 100644 --- a/tex/context/base/mkxl/pack-mat.mkxl +++ b/tex/context/base/mkxl/pack-mat.mkxl @@ -105,7 +105,7 @@ % \scratchdimen\Umathaxis\Ustyle\mathstyle % - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \setbox\scratchbox\hbox{\localframedwithsettings[#1][#2]% {\strut\global\dimensiondef\d_math_framed_offset\dimexpr \framedoffset/2 @@ -297,7 +297,7 @@ \tolerant\protected\def\pack_framed_mathframed[#1]#*[#2]#:#3% needs testing ! {\begingroup - \edef\currentmathframed{#1}% + \cdef\currentmathframed{#1}% \setupcurrentmathframed[#2]% \c_framed_mstyle\normalmathstyle \edef\m_framed_location{\mathframedparameter\c!location}% diff --git a/tex/context/base/mkxl/pack-mis.mklx b/tex/context/base/mkxl/pack-mis.mklx index 5c63f533c..425e79917 100644 --- a/tex/context/base/mkxl/pack-mis.mklx +++ b/tex/context/base/mkxl/pack-mis.mklx @@ -45,7 +45,7 @@ \protected\def\pack_placement#tag% {\bgroup - \edef\currentplacement{#tag}% + \cdef\currentplacement{#tag}% \doifelsenextoptionalcs\pack_placement_yes\pack_placement_nop} \def\pack_placement_yes[#settings]% diff --git a/tex/context/base/mkxl/pack-pos.mkxl b/tex/context/base/mkxl/pack-pos.mkxl index 74ec38629..218570f84 100644 --- a/tex/context/base/mkxl/pack-pos.mkxl +++ b/tex/context/base/mkxl/pack-pos.mkxl @@ -62,10 +62,10 @@ \lettonothing\currentpositioning \setupcurrentpositioning[#1]% \else - \edef\currentpositioning{#1}% + \cdef\currentpositioning{#1}% \fi \or - \edef\currentpositioning{#1}% + \cdef\currentpositioning{#1}% \setupcurrentpositioning[#2]% \fi \d_pack_positioning_x_position \zeropoint diff --git a/tex/context/base/mkxl/pack-rul.mkxl b/tex/context/base/mkxl/pack-rul.mkxl index 7ce169f42..afee1a8f6 100644 --- a/tex/context/base/mkxl/pack-rul.mkxl +++ b/tex/context/base/mkxl/pack-rul.mkxl @@ -908,7 +908,7 @@ {\bgroup \advanceby\c_pack_framed_nesting\plusone \letcsname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed - \edef\currentframed{>\the\c_pack_framed_nesting}% + \cdef\currentframed{>\the\c_pack_framed_nesting}% \pack_framed_initialize \bgroup \setupcurrentframed[#1]% here !, seldom no argument so no need to optimize @@ -923,17 +923,17 @@ \ifhastok={#1}% \advanceby\c_pack_framed_nesting\plusone \letcsname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed - \edef\currentframed{>\the\c_pack_framed_nesting}% + \cdef\currentframed{>\the\c_pack_framed_nesting}% \pack_framed_initialize \bgroup \setupcurrentframed[#1]% here ! \else - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \bgroup \fi \else - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \bgroup \setupcurrentframed[#2]% here ! @@ -953,7 +953,7 @@ \advanceby\c_pack_framed_nesting\plusone \letcsname\??framed>\the\c_pack_framed_nesting:\s!parent\endcsname\??framed \bgroup - \edef\currentframed{>\the\c_pack_framed_nesting}% + \cdef\currentframed{>\the\c_pack_framed_nesting}% \pack_framed_initialize \setupcurrentframed[#1]% \pack_framed_process_indeed} @@ -992,7 +992,7 @@ \permanent\protected\def\fastlocalframed[#1]#*[#2]#3% {\bgroup - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \setbox\b_framed_normal\hbox{#3}% \iftrialtypesetting \else @@ -1075,7 +1075,7 @@ \permanent\protected\def\localbackgroundframed#1% namespace component box {\bgroup - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \pack_framed_process_box_indeed} % group ends here @@ -1141,7 +1141,7 @@ \permanent\tolerant\protected\def\localframed[#1]#*[#2]% {\bgroup \bgroup - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \setupcurrentframed[#2]% here ! \pack_framed_process_indeed} @@ -1149,7 +1149,7 @@ \permanent\protected\def\directlocalframed[#1]% no optional {\bgroup \bgroup - \edef\currentframed{#1}% + \cdef\currentframed{#1}% \pack_framed_initialize \pack_framed_process_indeed} @@ -2756,7 +2756,7 @@ \tolerant\protected\def\pack_framed_text_start[#1]#*[#2]#*[#3]% or #1#*[#2]#*[#3]% and pass {#1} {\bgroup - \edef\currentframedtext{#1}% + \cdef\currentframedtext{#1}% \doifelseassignment{#2} {\pack_framed_text_start_indeed\empty{#2}} {\pack_framed_text_start_indeed{#2}{#3}}} @@ -2889,7 +2889,7 @@ \tolerant\protected\def\pack_framed_text_direct[#1]#*[#2]% {\bgroup - \edef\currentframedtext{#1}% + \cdef\currentframedtext{#1}% \usebodyfontparameter\framedtextparameter \setupcurrentframedtext[#2]% \edef\p_framed_text_strut{\framedtextparameter\c!strut}% @@ -2956,7 +2956,7 @@ % \advanceby\c_pack_framed_temp\plusone % \defcsname\??framed#1>\the\c_pack_framed_temp:\s!parent\endcsname{\??framed#1}% \inheritlocalframed % \bgroup -% \edef\currentframed{#1>\the\c_pack_framed_temp}% +% \cdef\currentframed{#1>\the\c_pack_framed_temp}% % \pack_framed_initialize % \setupcurrentframed[#2]% here ! % \pack_framed_process_indeed} @@ -2972,7 +2972,7 @@ \advanceby\scratchcounter\plusone \defcsname\??framed#1>\the\scratchcounter:\s!parent\endcsname{\??framed#1}% \inheritlocalframed \bgroup - \edef\currentframed{#1>\the\scratchcounter}% + \cdef\currentframed{#1>\the\scratchcounter}% \pack_framed_initialize \setupcurrentframed[#2]% here ! \pack_framed_process_indeed} @@ -3044,7 +3044,7 @@ \permanent\tolerant\protected\def\startframedcontent[#1]% {\bgroup - \edef\currentframedcontent{#1}% + \cdef\currentframedcontent{#1}% \ifx\currentframedcontent\v!off \enforced\let\stopframedcontent\egroup \else diff --git a/tex/context/base/mkxl/page-bck.mkxl b/tex/context/base/mkxl/page-bck.mkxl index bdea7b2fe..2843b98b8 100644 --- a/tex/context/base/mkxl/page-bck.mkxl +++ b/tex/context/base/mkxl/page-bck.mkxl @@ -145,7 +145,7 @@ \def\page_backgrounds_set_nop{\letcsname\currentotrbackground\endcsname\undefined} \protected\def\page_backgrounds_check#1% - {\edef\currentotrbackground{\??layoutbackgrounds#1}% + {\cdef\currentotrbackground{\??layoutbackgrounds#1}% \page_backgrounds_check_background} \permanent\def\doifelsesomebackground#1% @@ -532,7 +532,7 @@ \the\everybackgroundssetup} \protected\def\page_backgrounds_setup_and_check#1#2% tag settings - {\edef\currentotrbackground{\??layoutbackgrounds#1}% + {\cdef\currentotrbackground{\??layoutbackgrounds#1}% \setupframed[\currentotrbackground][#2]% \page_backgrounds_check_background} @@ -648,7 +648,7 @@ \permanent\protected\def\pushbackground[#1]% {\pushmacro\popbackground - \edef\currentotrbackground{\??layoutbackgrounds#1}% + \cdef\currentotrbackground{\??layoutbackgrounds#1}% \enforced\permanent\protected\edef\popbackground {\setupframed [\currentotrbackground] diff --git a/tex/context/base/mkxl/page-brk.mkxl b/tex/context/base/mkxl/page-brk.mkxl index 8c92148fc..54ec22e9b 100644 --- a/tex/context/base/mkxl/page-brk.mkxl +++ b/tex/context/base/mkxl/page-brk.mkxl @@ -376,7 +376,7 @@ \relax \ifconditional\c_page_breaks_enabled \begingroup - \edef\currentpagechecker{#1}% + \cdef\currentpagechecker{#1}% \setupcurrentpagechecker[#2]% \csname\??pagecheckermethod\pagecheckerparameter\c!method\endcsname \endgroup diff --git a/tex/context/base/mkxl/page-cst.mkxl b/tex/context/base/mkxl/page-cst.mkxl index 6e5ed2168..393d25480 100644 --- a/tex/context/base/mkxl/page-cst.mkxl +++ b/tex/context/base/mkxl/page-cst.mkxl @@ -137,7 +137,7 @@ \def\currentpagegrid{#1}% \fi \or - \edef\currentpagegrid{#1}% + \cdef\currentpagegrid{#1}% \setupcurrentpagegrid[#2]% \fi \usepageparameter\pagegridparameter @@ -309,7 +309,7 @@ \page_lines_add_numbers_to_box\b_page_grd_column\privatescratchcounter\c_page_grd_n_of_left\plustwo \fi \begingroup - \edef\currentpagegrid{\currentpagegrid:#1}% + \cdef\currentpagegrid{\currentpagegrid:#1}% \inheritedpagegridframedbox\box\b_page_grd_column \endgroup} @@ -641,7 +641,7 @@ \synchronizepagegrid \bgroup \forgetall - \edef\currentpagegridspan{#1}% + \cdef\currentpagegridspan{#1}% \clf_sethsizecolumnspan{\currentpagegrid}\pagegridspanparameter\c!n\relax \setbox\scratchbox\hbox\bgroup\inheritedpagegridspanframed\bgroup \def\page_grd_span_stop{\page_grd_span_stop_indeed{#2}}% @@ -718,7 +718,7 @@ \to \everydefinepagegridarea \permanent\tolerant\protected\def\setuppagegridareatext[#1]#*[#2]% - {\edef\currentpagegridarea{#1}% + {\cdef\currentpagegridarea{#1}% \setpagegridareaparameter\c!text{#2}} % maybe move the left/right correction to the tex end or the offset to lua @@ -727,7 +727,7 @@ \permanent\protected\def\setpagegridarea#1#2#3#4#5#6#7#8% can be optimized {\begingroup - \edef\currentpagegridarea{#2}% + \cdef\currentpagegridarea{#2}% \setpagegridareaparameter\c!width {#5\scaledpoint}% \setpagegridareaparameter\c!height{#6\scaledpoint}% \setbox\nextbox\hpack\bgroup\inheritedpagegridareaframed\bgroup diff --git a/tex/context/base/mkxl/page-ffl.mkxl b/tex/context/base/mkxl/page-ffl.mkxl index 02c56e2e9..71c91d810 100644 --- a/tex/context/base/mkxl/page-ffl.mkxl +++ b/tex/context/base/mkxl/page-ffl.mkxl @@ -192,7 +192,7 @@ \def\strc_floats_facing_flush_indeed#1% {\begingroup - \edef\currentfacingfloat{#1}% + \cdef\currentfacingfloat{#1}% \glet\page_check_weird_page\page_check_weird_page_indeed % for now only when facing floats \scratchcounterone \realpageno \scratchcounterthree\getboxcountfromcache{\currentfacingfloat:\v!left }\relax @@ -251,7 +251,7 @@ {\processcommalist[#1]\strc_floats_facing_flush_indeed} \protected\def\strc_floats_facing_setup - {\edef\currentfacingfloat{\currentfacingfloat:\m_strc_floats_state}% + {\cdef\currentfacingfloat{\currentfacingfloat:\m_strc_floats_state}% \usefacingfloatstyleandcolor\c!style\v!color} \protected\def\strc_floats_facing_collect @@ -298,7 +298,7 @@ \permanent\protected\def\startfacingfloat[#1]% {\begingroup - \edef\currentfacingfloat{#1}% + \cdef\currentfacingfloat{#1}% \edef\p_width{\facingfloatparameter\c!width}% \letfacingfloatparameter\c!width\v!fit \ifx\p_width\v!frame @@ -345,7 +345,7 @@ \else \begingroup \setbox\scratchboxone\hpack\bgroup - \edef\currentfacingfloat{\currentfacingfloat:#2}% + \cdef\currentfacingfloat{\currentfacingfloat:#2}% \inheritedfacingfloatframed{\strut}% \egroup \scratchdimenone\dimexpr\textheight-\htdp\scratchboxone+\lineheight\relax @@ -354,7 +354,7 @@ \setbox\scratchbox\vsplit#1 upto \scratchdimenone \setsplitlisthtdp\scratchbox\strutht\strutdp \setbox\scratchbox\hpack\bgroup - \edef\currentfacingfloat{\currentfacingfloat:#2}% + \cdef\currentfacingfloat{\currentfacingfloat:#2}% \inheritedfacingfloatframed{\box\scratchbox}% \egroup \setbox\scratchbox\vbox diff --git a/tex/context/base/mkxl/page-flt.mkxl b/tex/context/base/mkxl/page-flt.mkxl index fb6996264..f9d0d41f6 100644 --- a/tex/context/base/mkxl/page-flt.mkxl +++ b/tex/context/base/mkxl/page-flt.mkxl @@ -329,7 +329,7 @@ {\doifnotinset\v!high\floatspecification\vfill \box\floatbox \doifnotinset\v!low\floatspecification\vfill}% - % \page_otr_fill_and_eject_page + \page_otr_fill_and_eject_page % needed \global\settrue\c_page_floats_flushed} \protected\def\page_floats_flush_page_floats % used in postpone diff --git a/tex/context/base/mkxl/page-flw.mkxl b/tex/context/base/mkxl/page-flw.mkxl index c1d480e98..f453f490b 100644 --- a/tex/context/base/mkxl/page-flw.mkxl +++ b/tex/context/base/mkxl/page-flw.mkxl @@ -100,7 +100,7 @@ \permanent\protected\def\starttextflow[#1]% {\begingroup - \edef\currenttextflow{#1}% + \cdef\currenttextflow{#1}% \ifcsname\??textflowbox\currenttextflow\endcsname \b_page_textflow_box\csname\??textflowbox\currenttextflow\endcsname \global\setbox\b_page_textflow_box\vbox @@ -120,7 +120,7 @@ \permanent\protected\def\flushtextflow#1% {\begingroup - \edef\currenttextflow{#1}% + \cdef\currenttextflow{#1}% \ifcsname\??textflowbox\currenttextflow\endcsname \b_page_textflow_box\csname\??textflowbox\currenttextflow\endcsname \ifvoid\b_page_textflow_box diff --git a/tex/context/base/mkxl/page-inj.mklx b/tex/context/base/mkxl/page-inj.mklx index 2e245fd8b..b15be11ba 100644 --- a/tex/context/base/mkxl/page-inj.mklx +++ b/tex/context/base/mkxl/page-inj.mklx @@ -51,7 +51,7 @@ \def\page_injections_flush_saved#name#parameters% {\begingroup - \edef\currentpageinjection{#name}% + \cdef\currentpageinjection{#name}% \getdummyparameters[#parameters]% \edef\currentpageinjectionalternative {\pageinjectionparameter \c!alternative }% \edef\p_page_injectionalternative_rederingsetup{\pageinjectionalternativeparameter\c!renderingsetup}% @@ -87,12 +87,12 @@ \page_injections_direct_indeed} \def\page_injections_direct_name_parameters#name% #parameters% - {\edef\currentpageinjection{#name}% + {\cdef\currentpageinjection{#name}% \checkpageinjectionparent \page_injections_direct_indeed} \def\page_injections_direct_name#name% - {\edef\currentpageinjection{#name}% + {\cdef\currentpageinjection{#name}% \checkpageinjectionparent \page_injections_direct_indeed{}} diff --git a/tex/context/base/mkxl/page-ins.mkxl b/tex/context/base/mkxl/page-ins.mkxl index 8d2dfe846..854680a32 100644 --- a/tex/context/base/mkxl/page-ins.mkxl +++ b/tex/context/base/mkxl/page-ins.mkxl @@ -65,7 +65,7 @@ %D Maybe some day we will move settings here. \permanent\protected\def\setcurrentinsertion#1% - {\edef\currentinsertion{#1}% + {\cdef\currentinsertion{#1}% \currentinsertionnumber\csname\??insertionnumber\currentinsertion\endcsname} \permanent\def\namedinsertionnumber#1{\csname\??insertionnumber#1\endcsname} @@ -80,7 +80,7 @@ \to \everysetupinsertion \protected\def\page_inserts_process#1% beware, this adapts currentinsertion ! - {\edef\currentinsertion{#1}% + {\cdef\currentinsertion{#1}% \currentinsertionnumber\csname\??insertionnumber\currentinsertion\endcsname \doprocessinsert\currentinsertionnumber} % old method diff --git a/tex/context/base/mkxl/page-lay.mkxl b/tex/context/base/mkxl/page-lay.mkxl index 5e2281a2f..cac9b87a7 100644 --- a/tex/context/base/mkxl/page-lay.mkxl +++ b/tex/context/base/mkxl/page-lay.mkxl @@ -387,7 +387,7 @@ % \definepapersize[name][settings] \permanent\tolerant\protected\def\definepapersize[#1]#*[#2]#*[#3]% - {\edef\currentlayouttarget{#1}% + {\cdef\currentlayouttarget{#1}% \ifempty\currentlayouttarget % invalid target \orelse\ifhastok={#2}% @@ -558,7 +558,7 @@ \protected\def\page_paper_identify_target#1% {\ifcsname\??layoutcurrent#1\endcsname - \edef\currentlayouttarget{#1}% + \cdef\currentlayouttarget{#1}% \fi} \newdimension\d_page_minimum_paper_size \d_page_minimum_paper_size\luaexpr{math.pi}\onebasepoint diff --git a/tex/context/base/mkxl/page-lin.mklx b/tex/context/base/mkxl/page-lin.mklx index 71a0e0c6e..039254e78 100644 --- a/tex/context/base/mkxl/page-lin.mklx +++ b/tex/context/base/mkxl/page-lin.mklx @@ -247,7 +247,7 @@ \page_lines_start_followup} \def\page_lines_start_two[#1][#2]% [tag][continue||settings] - {\edef\currentlinenumbering{#1}% + {\cdef\currentlinenumbering{#1}% \edef\m_argument{#2}% \ifx\m_argument\v!continue \c_page_lines_mode\zerocount @@ -364,7 +364,7 @@ \def\page_lines_make_number#tag#linenumber#width#dir% with hang and parindent and skips we have to compensate for \hsize {\setbox\scratchbox\naturalhbox to \zeropoint \bgroup - \edef\currentlinenumbering{#tag}% + \cdef\currentlinenumbering{#tag}% \def\linenumber{#linenumber}% unsafe \d_page_lines_line_width#width\scaledpoint\relax \d_page_lines_distance\linenumberingparameter\c!distance\relax diff --git a/tex/context/base/mkxl/page-mak.mklx b/tex/context/base/mkxl/page-mak.mklx index f0d01cc36..e7b5ba563 100644 --- a/tex/context/base/mkxl/page-mak.mklx +++ b/tex/context/base/mkxl/page-mak.mklx @@ -42,8 +42,8 @@ \installcommandhandler \??makeup {makeup} \??makeup \appendtoks - \frozen\instance\setuevalue{\e!start\currentmakeup\e!makeup}{\startmakeup[\currentmakeup]}% - \frozen\instance\setuevalue{\e!stop \currentmakeup\e!makeup}{\stopmakeup}% + \frozen\protected\instance\edefcsname\e!start\currentmakeup\e!makeup\endcsname{\startmakeup[\currentmakeup]}% + \frozen\protected\instance\edefcsname\e!stop \currentmakeup\e!makeup\endcsname{\stopmakeup}% \doifelselayoutdefined\currentmakeup\donothing{\definelayout[\currentmakeup]}% new \to \everydefinemakeup @@ -108,7 +108,7 @@ {% the next grouping hack is somewhat messy: \begingroup % we need to figure out the current layout - \xdef\m_page_makeup_name{#name}% + \global\cdef\m_page_makeup_name{#name}% \let\currentmakeup\m_page_makeup_name \let\currentlayout\m_page_makeup_name \xdef\m_page_makeup_layout_parent{\layoutparameter\s!parent}% diff --git a/tex/context/base/mkxl/page-mbk.mklx b/tex/context/base/mkxl/page-mbk.mklx index 3dc1c4e7c..bbf6635db 100644 --- a/tex/context/base/mkxl/page-mbk.mklx +++ b/tex/context/base/mkxl/page-mbk.mklx @@ -79,7 +79,7 @@ \permanent\tolerant\protected\def\startmarginblock[#tag]% {\begingroup - \edef\currentmarginblock{#tag}% + \cdef\currentmarginblock{#tag}% \ifcstok{\marginblockparameter\c!state}\v!start \expandafter\page_margin_blocks_start_block_yes \else diff --git a/tex/context/base/mkxl/page-mix.mkxl b/tex/context/base/mkxl/page-mix.mkxl index 3da317956..41259ebf4 100644 --- a/tex/context/base/mkxl/page-mix.mkxl +++ b/tex/context/base/mkxl/page-mix.mkxl @@ -428,7 +428,7 @@ \fi} \def\page_mix_start_columns_a[#1]% [#2]% - {\edef\currentmixedcolumns{#1}% + {\cdef\currentmixedcolumns{#1}% \page_mix_start_columns_checked \page_mix_start_columns_a_yes \page_mix_start_columns_a_nop} @@ -452,7 +452,7 @@ \page_mix_error_b \page_mix_start_columns_checked\page_mix_start_columns_b_yes\page_mix_start_columns_b_nop[#1]% \else - \edef\currentmixedcolumns{#1}% + \cdef\currentmixedcolumns{#1}% \page_mix_start_columns_checked\page_mix_start_columns_b_yes\page_mix_start_columns_b_nop[#2]% \fi} @@ -493,7 +493,7 @@ \protected\def\page_mix_fast_columns_start#1% {\push_macro_currentmixedcolumns \push_macro_currentmixedcolumnsmethod - \edef\currentmixedcolumns{#1}% + \cdef\currentmixedcolumns{#1}% \edef\currentmixedcolumnsmethod{\mixedcolumnsparameter\c!method}% \mixedcolumnsparameter\c!before\relax % so, it doesn't listen to local settings ! \begincsname\??mixedcolumnsbefore\currentmixedcolumnsmethod\endcsname\relax diff --git a/tex/context/base/mkxl/page-pcl.mkxl b/tex/context/base/mkxl/page-pcl.mkxl index 040cdb2ec..f30d39c02 100644 --- a/tex/context/base/mkxl/page-pcl.mkxl +++ b/tex/context/base/mkxl/page-pcl.mkxl @@ -790,7 +790,7 @@ \doifelseassignment{#1}% {\lettonothing\currentpagecolumns \setuppagecolumns[#1]}% - {\edef\currentpagecolumns{#1}}% + {\cdef\currentpagecolumns{#1}}% \edef\p_page{\pagecolumnsparameter\c!page}% \ifempty\p_page \setfalse\c_page_col_page diff --git a/tex/context/base/mkxl/page-txt.mklx b/tex/context/base/mkxl/page-txt.mklx index 67ca325b2..15ab3f59e 100644 --- a/tex/context/base/mkxl/page-txt.mklx +++ b/tex/context/base/mkxl/page-txt.mklx @@ -1,4 +1,5 @@ % macros=mkvi +% macros=mkvi %D \module %D [ file=page-txt, % copied from main-001, @@ -103,7 +104,7 @@ \def\page_layouts_synchronize_element#vertical% {\xdef\previoustextstate{\csname\??layouttextssynchronize#vertical\endcsname}% can be a let - \edef\currenttextstate {\namedlayoutelementparameter{#vertical}\c!state}% + \cdef\currenttextstate {\namedlayoutelementparameter{#vertical}\c!state}% %\writestatus{>>}{[#vertical:\currenttextstate/\previoustextstate]}% \ifx\currenttextstate\previoustextstate \else \page_layouts_synchronize_element_indeed{#vertical}% @@ -181,37 +182,37 @@ {\ifarguments % there is always one \or - \edef\currentlayoutelement{#vertical:\v!text}% + \cdef\currentlayoutelement{#vertical:\v!text}% \resetlayoutelementparameter\c!lefttext \resetlayoutelementparameter\c!righttext \resetlayoutelementparameter\c!middletext - \edef\currentlayoutelement{#vertical:\v!margin}% + \cdef\currentlayoutelement{#vertical:\v!margin}% \resetlayoutelementparameter\c!lefttext \resetlayoutelementparameter\c!righttext \resetlayoutelementparameter\c!middletext - \edef\currentlayoutelement{#vertical:\v!edge}% + \cdef\currentlayoutelement{#vertical:\v!edge}% \resetlayoutelementparameter\c!lefttext \resetlayoutelementparameter\c!righttext \resetlayoutelementparameter\c!middletext \or - \edef\currentlayoutelement{#vertical:\v!text}% + \cdef\currentlayoutelement{#vertical:\v!text}% \resetlayoutelementparameter\c!lefttext \resetlayoutelementparameter\c!righttext \setlayoutelementparameter \c!middletext{\page_layouts_process_element_single{#horizontal}}% \or - \edef\currentlayoutelement{#vertical:\v!text}% + \cdef\currentlayoutelement{#vertical:\v!text}% \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_single{#horizontal}}% \setlayoutelementparameter\c!righttext{\page_layouts_process_element_single{#a}}% \or - \edef\currentlayoutelement{#vertical:#horizontal}% + \cdef\currentlayoutelement{#vertical:#horizontal}% \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_single{#a}}% \setlayoutelementparameter\c!righttext{\page_layouts_process_element_single{#b}}% \or - \edef\currentlayoutelement{#vertical:\v!text}% + \cdef\currentlayoutelement{#vertical:\v!text}% \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_double{#horizontal}{#c}}% \setlayoutelementparameter\c!righttext{\page_layouts_process_element_double{#a}{#b}}% \or - \edef\currentlayoutelement{#vertical:#horizontal}% + \cdef\currentlayoutelement{#vertical:#horizontal}% \setlayoutelementparameter\c!lefttext {\page_layouts_process_element_double{#a}{#d}}% \setlayoutelementparameter\c!righttext{\page_layouts_process_element_double{#b}{#c}}% \fi} @@ -297,7 +298,7 @@ \fi#vertical} \permanent\protected\def\doifelselayouttextline#vertical% shown or not - {\edef\currentlayoutelementstate{\namedlayoutelementparameter{#vertical}\c!state}% + {\cdef\currentlayoutelementstate{\namedlayoutelementparameter{#vertical}\c!state}% \ifx\currentlayoutelementstate\v!normal \expandafter\firstoftwoarguments \orelse\ifx\currentlayoutelementstate\v!start @@ -307,7 +308,7 @@ \fi} \permanent\protected\def\doifelselayoutsomeline#vertical% present or not - {\edef\currentlayoutelementstate{\namedlayoutelementparameter{#vertical}\c!state}% + {\cdef\currentlayoutelementstate{\namedlayoutelementparameter{#vertical}\c!state}% \ifx\currentlayoutelementstate\v!none \expandafter\secondoftwoarguments \orelse\ifx\currentlayoutelementstate\v!high @@ -406,12 +407,12 @@ \permanent\tolerant\protected\def\resettextcontent[#vertical]#spacer[#horizontal]#spacer[#tag]% header text middle {\ifarguments\or\or % 2 - \edef\currentlayoutelement{#vertical:#horizontal}% + \cdef\currentlayoutelement{#vertical:#horizontal}% \resetlayoutelementparameter\c!lefttext \resetlayoutelementparameter\c!middletext \resetlayoutelementparameter\c!righttext \or % 3 -% \edef\currentlayoutelement{#vertical:#horizontal}% +% \cdef\currentlayoutelement{#vertical:#horizontal}% % \letcsname\layoutelementhash\begincsname\??layouttextcontent\v!text:#tag\endcsname\c!middletext\endcsname\empty \letcsname\namedlayoutelementhash{#vertical:#horizontal}\begincsname\??layouttextcontent\v!text:#tag\endcsname\c!middletext\endcsname\empty \fi} @@ -502,7 +503,7 @@ \fi} \def\page_layouts_left_edge_element#text#style#color#width% - {\edef\currentlayoutelement{\currentlayouttextline:\v!edge}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!edge}% \page_layouts_place_element_indeed\leftedgewidth {\page_layouts_left_edge_element_indeed#text#style#color#width}% \kern\leftedgedistance} @@ -519,7 +520,7 @@ \fi} \def\page_layouts_right_edge_element#text#style#color#width% - {\edef\currentlayoutelement{\currentlayouttextline:\v!edge}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!edge}% \kern\rightedgedistance \page_layouts_place_element_indeed\rightedgewidth {\page_layouts_right_edge_element_indeed#text#style#color#width}} @@ -551,7 +552,7 @@ \fi} \def\page_layouts_left_margin_element#text#style#color#width#margintoo% - {\edef\currentlayoutelement{\currentlayouttextline:\v!margin}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!margin}% \page_layouts_place_element_indeed\leftmarginwidth {\page_layouts_left_margin_element_indeed#text#style#color#width#margintoo}% \kern\leftmargindistance} @@ -578,7 +579,7 @@ \fi} \def\page_layouts_right_margin_element#text#style#color#width#margintoo% - {\edef\currentlayoutelement{\currentlayouttextline:\v!margin}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!margin}% \kern\rightmargindistance \page_layouts_place_element_indeed\rightmarginwidth {\page_layouts_right_margin_element_indeed#text#style#color#width#margintoo}} @@ -657,11 +658,11 @@ \fi} \def\page_layouts_text_body_element_l_m_r_e - {\edef\currentlayoutelement{\currentlayouttextline:\v!text}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!text}% \page_layouts_place_element_indeed\makeupwidth\page_layouts_text_body_element_indeed_l_m_r_e} \def\page_layouts_text_body_element_e_r_m_l - {\edef\currentlayoutelement{\currentlayouttextline:\v!text}% + {\cdef\currentlayoutelement{\currentlayouttextline:\v!text}% \page_layouts_place_element_indeed\makeupwidth\page_layouts_text_body_element_indeed_e_r_m_l} \def\page_layouts_place_element_indeed#width#content% @@ -780,14 +781,14 @@ \def\page_layouts_reset_page_number_location {\ifrelax\m_page_layouts_page_number_location_v\else % this can be done better now, no meaning hackery needed - \edef\currentlayoutelement{\m_page_layouts_page_number_location_v:\m_page_layouts_page_number_location_h}% + \cdef\currentlayoutelement{\m_page_layouts_page_number_location_v:\m_page_layouts_page_number_location_h}% \edef\tempstring{\detokenizedlayoutelementparameter\m_page_layouts_page_number_location_x}% \doif{\normalmeaningless\tempstring}{\normalmeaningless\page_layouts_place_page_number} {\resetlayoutelementparameter\m_page_layouts_page_number_location_x}% \fi} \def\page_layouts_set_page_number_location - {\edef\currentlayoutelement{\m_page_layouts_page_number_location_v:\m_page_layouts_page_number_location_h}% + {\cdef\currentlayoutelement{\m_page_layouts_page_number_location_v:\m_page_layouts_page_number_location_h}% \letlayoutelementparameter\m_page_layouts_page_number_location_x\page_layouts_place_page_number \ifx\m_page_layouts_page_number_location_x\c!marginedgetext \let\page_layouts_place_extra_text_left \page_layouts_place_page_number_left diff --git a/tex/context/base/mkxl/phys-dim.mkxl b/tex/context/base/mkxl/phys-dim.mkxl index e085ba844..2b9d2dc5f 100644 --- a/tex/context/base/mkxl/phys-dim.mkxl +++ b/tex/context/base/mkxl/phys-dim.mkxl @@ -442,10 +442,10 @@ \settrue\c_phys_units_dospace \removelastskip \fi - \edef\currentunit{#1}% + \cdef\currentunit{#1}% \c_phys_digits_method\unitparameter\c!method\relax \ifmmode\else\dontleavehmode\fi -% \edef\currentunit{#1}% +% \cdef\currentunit{#1}% \enforced\edef\unitlanguage{\unitparameter\s!language}% \enforced\let\prefixlanguage\unitlanguage \enforced\let\operatorlanguage\unitlanguage diff --git a/tex/context/base/mkxl/scrn-bar.mklx b/tex/context/base/mkxl/scrn-bar.mklx index 5fbd47d6c..135552a67 100644 --- a/tex/context/base/mkxl/scrn-bar.mklx +++ b/tex/context/base/mkxl/scrn-bar.mklx @@ -66,9 +66,9 @@ \ifhastok={#tag}% \lettonothing\currentinteractionbar \setupcurrentinteractionbar[#tag]% - \edef\currentinteractionbar{\interactionbarparameter\c!alternative}% + \cdef\currentinteractionbar{\interactionbarparameter\c!alternative}% \else - \edef\currentinteractionbar{#tag}% + \cdef\currentinteractionbar{#tag}% \setupcurrentinteractionbar[#settings]% \fi \doif{\interactionbarparameter\c!state}\v!start diff --git a/tex/context/base/mkxl/scrn-but.mklx b/tex/context/base/mkxl/scrn-but.mklx index e22751618..1f4617acb 100644 --- a/tex/context/base/mkxl/scrn-but.mklx +++ b/tex/context/base/mkxl/scrn-but.mklx @@ -50,12 +50,12 @@ \aliased\let\setupbuttons\setupbutton \appendtoks - \frozen\instance\setuevalue\currentbutton{\scrn_button_direct{\currentbutton}}% + \frozen\protected\instance\edefcsname\currentbutton\endcsname{\scrn_button_direct{\currentbutton}}% \to \everydefinebutton \protected\def\scrn_button_direct#tag% {\begingroup - \edef\currentbutton{#tag}% + \cdef\currentbutton{#tag}% \iflocation \expandafter\scrn_button_direct_status \else @@ -542,7 +542,7 @@ \protected\def\scrn_menu_package_indeed#tag% one menu {\begingroup - \edef\currentinteractionmenu{#tag}% + \cdef\currentinteractionmenu{#tag}% \edef\currentinteractionmenustate{\interactionmenuparameter\c!state}% \ifx\currentinteractionmenustate\v!start \scrn_menu_packager @@ -799,7 +799,7 @@ \permanent\protected\def\includemenu[#tag]% {\begingroup - \edef\currentinteractionmenu{#tag}% + \cdef\currentinteractionmenu{#tag}% \doif{\interactionmenuparameter\c!state}\v!local {\letinteractionmenuparameter\c!state\v!start \directinteractionmenuparameter\c!menu}% @@ -809,7 +809,7 @@ \permanent\tolerant\protected\def\interactionmenu[#tag]#spacer[#settings]% {\begingroup - \edef\currentinteractionmenu{#tag}% + \cdef\currentinteractionmenu{#tag}% \setupcurrentinteractionmenu[#settings]% \scrn_menu_insert{#tag}% \endgroup} @@ -992,7 +992,7 @@ \def\scrn_menu_menu_button_a#tag#settings#text#action% {\dontleavehmode \begingroup - \edef\currentinteractionmenu{#tag}% + \cdef\currentinteractionmenu{#tag}% \setupcurrentinteractionmenu[#settings]% \scrn_button_make \interactionmenuparameter @@ -1018,7 +1018,7 @@ \def\scrn_menu_menu_button_c#tag#dummy#text#action% {\dontleavehmode \begingroup - \edef\currentinteractionmenu{#tag}% + \cdef\currentinteractionmenu{#tag}% \scrn_button_make \interactionmenuparameter \inheritedinteractionmenuframed diff --git a/tex/context/base/mkxl/scrn-hlp.mklx b/tex/context/base/mkxl/scrn-hlp.mklx index 9f0c5dbdd..5284c5cee 100644 --- a/tex/context/base/mkxl/scrn-hlp.mklx +++ b/tex/context/base/mkxl/scrn-hlp.mklx @@ -78,7 +78,7 @@ \mutable\lettonothing\currenthelpname \protected\def\scrn_help_argument#category% - {\def\currenthelp{#category}% + {\cdef\currenthelp{#category}% \global\advanceby\c_scrn_help_n\plusone \edef\currenthelpname{help:\number\c_scrn_help_n}% \doifelselocation\scrn_help_argument_indeed\scrn_help_argument_ignore} @@ -99,7 +99,7 @@ \tolerant\protected\def\scrn_help_start#category#spacer[#reference]% {\global\advanceby\c_scrn_help_n\plusone - \edef\currenthelp{#category}% + \cdef\currenthelp{#category}% \edef\currenthelpreference{#reference}% \edef\currenthelpname{help:\number\c_scrn_help_n}% \grabbufferdatadirect\currenthelp{\e!start\currenthelp}{\e!stop\currenthelp}} diff --git a/tex/context/base/mkxl/scrn-ini.mklx b/tex/context/base/mkxl/scrn-ini.mklx index 1308ff6ec..7d6c96d9b 100644 --- a/tex/context/base/mkxl/scrn-ini.mklx +++ b/tex/context/base/mkxl/scrn-ini.mklx @@ -77,11 +77,11 @@ % \to \everydefineinteraction % % \protected\def\scrn_interaction_direct#1% -% {\edef\currentinteraction{#1}} +% {\cdef\currentinteraction{#1}} % % \protected\def\scrn_interaction_start#1% % {\pushmacro\currentinteraction -% \edef\currentinteraction{#1}} +% \cdef\currentinteraction{#1}} % % \protected\def\scrn_interaction_stop % {\popmacro\currentinteraction} @@ -93,7 +93,7 @@ \permanent\protected\def\startinteraction[#1]% {\pushmacro\currentinteraction - \edef\currentinteraction{#1}} + \cdef\currentinteraction{#1}} \permanent\protected\def\stopinteraction {\popmacro\currentinteraction} diff --git a/tex/context/base/mkxl/scrn-wid.mklx b/tex/context/base/mkxl/scrn-wid.mklx index 382635882..55968d57d 100644 --- a/tex/context/base/mkxl/scrn-wid.mklx +++ b/tex/context/base/mkxl/scrn-wid.mklx @@ -128,7 +128,7 @@ \permanent\tolerant\protected\def\scrn_attachment_direct[#tag]#spacer[#registered]#spacer[#settings]% {\iflocation \bgroup - \edef\currentattachment{#tag}% + \cdef\currentattachment{#tag}% \ifcstok{\attachmentparameter\c!state}\v!start \iftok{#registered}\emptytoks \scrn_attachment_inject[\v!auto][]% @@ -142,7 +142,7 @@ \fi} \tolerant\protected\def\scrn_attachment_start[#tag]#spacer[#registered]#spacer[#settings]% - {\edef\currentattachment{#tag}% + {\cdef\currentattachment{#tag}% \unless\iflocation \expandafter\scrn_attachment_start_ignore \orelse\ifcstok{\attachmentparameter\c!state}\v!start @@ -416,7 +416,7 @@ \tolerant\protected\def\scrn_comment_argument[#category]#spacer[#title]#spacer[#settings]#:#text%% {\iflocation - \def\currentcomment{#category}% + \cdef\currentcomment{#category}% \ifcstok{\commentparameter\c!state}\v!start \ifhastok={#title} \setupcurrentcomment[#title]% @@ -430,7 +430,7 @@ \ignorespaces} \tolerant\protected\def\scrn_comment_start[#category]#spacer[#title]#spacer[#settings]% - {\def\currentcomment{#category}% + {\cdef\currentcomment{#category}% \unless\iflocation \expandafter\scrn_comment_start_ignore \orelse\ifcstok{\commentparameter\c!state}\v!start diff --git a/tex/context/base/mkxl/scrp-ini.mkxl b/tex/context/base/mkxl/scrp-ini.mkxl index 99f064acc..13e3e3edd 100644 --- a/tex/context/base/mkxl/scrp-ini.mkxl +++ b/tex/context/base/mkxl/scrp-ini.mkxl @@ -62,7 +62,7 @@ % \to \everydefinescript \permanent\protected\def\setlocalscript[#1]% - {\edef\currentscript{#1}% + {\cdef\currentscript{#1}% \clf_setscript{\currentscript}{\scriptparameter\c!method}{\scriptparameter\c!preset}} \permanent\protected\def\setglobalscript[#1]% diff --git a/tex/context/base/mkxl/spac-flr.mkxl b/tex/context/base/mkxl/spac-flr.mkxl index e6147facd..770ab51f2 100644 --- a/tex/context/base/mkxl/spac-flr.mkxl +++ b/tex/context/base/mkxl/spac-flr.mkxl @@ -40,7 +40,7 @@ \permanent\tolerant\protected\def\filler[#1]% {\removeunwantedspaces \begingroup - \edef\currentfiller{#1}% + \cdef\currentfiller{#1}% \usefillerstyleandcolor\c!style\c!color \scratchdimen\fillerparameter\c!leftmargin\relax \ifzeropt\scratchdimen\else @@ -71,7 +71,7 @@ \permanent\tolerant\protected\def\fillupto[#1]#:#2% {\removeunwantedspaces \begingroup - \edef\currentfiller{#1}% + \cdef\currentfiller{#1}% \scratchdimen\dimexpr\fillerparameter\c!rightmargindistance\relax \ifzeropt\scratchdimen\else \parfillskip \scratchdimen\s!plus \plusone\s!fil\relax diff --git a/tex/context/base/mkxl/spac-hor.mkxl b/tex/context/base/mkxl/spac-hor.mkxl index 853f4c902..a647999f4 100644 --- a/tex/context/base/mkxl/spac-hor.mkxl +++ b/tex/context/base/mkxl/spac-hor.mkxl @@ -176,7 +176,7 @@ \aliased\let\checkindentation\relax -\installmacrostack\checkindentation +\installmacrostack\checkindentation % used? %D Actually we can forget about indent and let everypar insert a kern or so, %D but on the other hand it's kind of consistent to keep it and make the @@ -737,7 +737,7 @@ \permanent\overloaded\tolerant\protected\def\spac_narrower_start[#1]#*[#2]% {\begingroup - \edef\currentnarrower{#1}% + \cdef\currentnarrower{#1}% \ifparameter#2\or \spac_narrower_start_apply{#2}% \else @@ -811,7 +811,7 @@ \spac_narrower_start_apply{\narrowerparameter\v!default}} \def\spac_narrower_start_named_one_nop[#1][#2]% [tag] [] - {\edef\currentnarrower{#1}% + {\cdef\currentnarrower{#1}% \spac_narrower_start_apply{\narrowerparameter\v!default}} \def\spac_narrower_start_named_two[#1]% @@ -825,12 +825,12 @@ {\doifelseassignment{#2}\spac_narrower_start_named_tag_settings\spac_narrower_start_named_tag_how[#1][#2]} \def\spac_narrower_start_named_tag_settings[#1][#2]% [tag] [settings] - {\edef\currentnarrower{#1}% + {\cdef\currentnarrower{#1}% \setupcurrentnarrower[#2]% \spac_narrower_start_apply{\narrowerparameter\v!default}} \def\spac_narrower_start_named_tag_how[#1][#2]% [tag] [how] - {\edef\currentnarrower{#1}% + {\cdef\currentnarrower{#1}% \spac_narrower_start_apply{#2}} \aliased\let\stopnarrow\spac_narrower_stop diff --git a/tex/context/base/mkxl/spac-lin.mkxl b/tex/context/base/mkxl/spac-lin.mkxl index d462caeaa..8c85d6d76 100644 --- a/tex/context/base/mkxl/spac-lin.mkxl +++ b/tex/context/base/mkxl/spac-lin.mkxl @@ -107,7 +107,7 @@ \permanent\tolerant\protected\def\spac_lines_start[#1]% {\bgroup - \edef\currentlines{#1}% + \cdef\currentlines{#1}% \obeylines \spac_lines_start_indeed} diff --git a/tex/context/base/mkxl/spac-prf.mklx b/tex/context/base/mkxl/spac-prf.mklx index 06038d867..297f0d281 100644 --- a/tex/context/base/mkxl/spac-prf.mklx +++ b/tex/context/base/mkxl/spac-prf.mklx @@ -73,13 +73,13 @@ \tolerant\protected\def\spac_profile_start#profile#spacer[#settings]% {\begingroup \ifparameter#settings\or - \edef\currentprofile{#profile}% + \cdef\currentprofile{#profile}% \setupcurrentprofile[#settings]% \orelse\ifhastok={#profile}% \let\currentprofile\v!none \setupcurrentprofile[#profile]% \else - \edef\currentprofile{#profile}% + \cdef\currentprofile{#profile}% \fi \spac_profile_set \profileparameter\c!before} @@ -96,7 +96,7 @@ {\spac_profile_stop} \permanent\protected\def\setprofile[#profile]% - {\edef\currentprofile{#profile}% + {\cdef\currentprofile{#profile}% \spac_profile_set} \permanent\protected\def\resetprofile @@ -113,13 +113,13 @@ \permanent\tolerant\protected\def\profiledbox[#profile]#spacer[#settings]% {\vbox\bgroup \ifparameter#settings\or - \edef\currentprofile{#profile}% + \cdef\currentprofile{#profile}% \setupcurrentprofile[#settings]% \orelse\ifhastok={#profile}% \let\currentprofile\v!none \setupcurrentprofile[#profile]% \else - \edef\currentprofile{#profile}% + \cdef\currentprofile{#profile}% \fi \dowithnextbox {\profilegivenbox\currentprofile\nextbox @@ -129,7 +129,7 @@ \permanent\protected\def\profilegivenbox#profile#box% {\begingroup - \edef\currentprofile{#profile}% + \cdef\currentprofile{#profile}% \clf_profilebox box \numexpr#box\relax height \dimexpr\profileparameter\c!height\relax @@ -169,7 +169,7 @@ \relax} \permanent\tolerant\protected\def\setlineprofile[#profile]% - {\edef\currentlineprofile{#profile}% + {\cdef\currentlineprofile{#profile}% \spac_line_profile_set} \permanent\protected\def\resetlineprofile diff --git a/tex/context/base/mkxl/spac-ver.mkxl b/tex/context/base/mkxl/spac-ver.mkxl index 52c580f97..388f13a0c 100644 --- a/tex/context/base/mkxl/spac-ver.mkxl +++ b/tex/context/base/mkxl/spac-ver.mkxl @@ -190,7 +190,7 @@ \else \settrue\interlinespaceisset \ifcsname\namedinterlinespacehash{#1}\s!parent\endcsname - \edef\currentinterlinespace{#1}% + \cdef\currentinterlinespace{#1}% \spac_linespacing_setup_specified_interline_space %\dosetupspecifiedinterlinespaceindeed \else diff --git a/tex/context/base/mkxl/strc-blk.mkxl b/tex/context/base/mkxl/strc-blk.mkxl index c81739530..f0b57a744 100644 --- a/tex/context/base/mkxl/strc-blk.mkxl +++ b/tex/context/base/mkxl/strc-blk.mkxl @@ -123,7 +123,7 @@ \endgroup} \def\strc_start_block#1#2% - {\edef\currentblock{#2}% + {\cdef\currentblock{#2}% \c_strc_blocks_index#1\relax \strc_blocks_setup \let\strc_blocks_setup\relax diff --git a/tex/context/base/mkxl/strc-con.mklx b/tex/context/base/mkxl/strc-con.mklx index 0f7750bfe..bc2058b74 100644 --- a/tex/context/base/mkxl/strc-con.mklx +++ b/tex/context/base/mkxl/strc-con.mklx @@ -179,7 +179,7 @@ \installcorenamespace{constructionnotehandler} \protected\def\strc_constructions_initialize#1% class instance - {\edef\currentconstruction{#1}% + {\cdef\currentconstruction{#1}% \enforced\let\currentconstructionhash\??construction \let\currentconstructionlistentry\!!zerocount \enforced\expandafter\let\expandafter\currentconstructionmain \csname\??constructionmain \currentconstruction\endcsname diff --git a/tex/context/base/mkxl/strc-flt.mklx b/tex/context/base/mkxl/strc-flt.mklx index b3f33734e..03e6edf1f 100644 --- a/tex/context/base/mkxl/strc-flt.mklx +++ b/tex/context/base/mkxl/strc-flt.mklx @@ -370,7 +370,7 @@ % we need at least a category and title \dontleavehmode \bgroup - \edef\currentfloat{#category}% + \cdef\currentfloat{#category}% \let\currentfloatcaption\currentfloat \resetfloatcaptionparameter\c!reference \resetfloatcaptionparameter\c!title @@ -640,7 +640,7 @@ \aliased\lettonothing\lastplacedfloat \def\strc_floats_set_current_tag#tag% - {\edef\currentfloat{#tag}% + {\cdef\currentfloat{#tag}% \ifempty\currentfloat \let\currentfloat\v!figure % a bit of a hack \fi diff --git a/tex/context/base/mkxl/strc-ind.mkxl b/tex/context/base/mkxl/strc-ind.mkxl index 10bd7f468..aa0d3d18e 100644 --- a/tex/context/base/mkxl/strc-ind.mkxl +++ b/tex/context/base/mkxl/strc-ind.mkxl @@ -60,18 +60,18 @@ \newdimension\d_strc_indentedtexts_distance \appendtoks - \frozen\instance\setuevalue {\e!start\currentindentedtext}{\strc_indentedtexts_start{\currentindentedtext}\c_strc_indentedtexts_nesting}% - \frozen\instance\setuevalue {\e!stop \currentindentedtext}{\strc_indentedtexts_stop}% + \frozen\instance\protected\edefcsname\e!start\currentindentedtext\endcsname{\strc_indentedtexts_start{\currentindentedtext}\c_strc_indentedtexts_nesting}% + \frozen\instance\protected\edefcsname\e!stop \currentindentedtext\endcsname{\strc_indentedtexts_stop}% % to be avoided ... might go away - \frozen\instance\setuevalue {\currentindentedtext}{\strc_indentedtexts_direct{\currentindentedtext}{0}}% - \frozen\instance\setuevalue {\v!sub\currentindentedtext}{\strc_indentedtexts_direct{\currentindentedtext}{1}}% - \frozen\instance\setuevalue{\v!sub\v!sub\currentindentedtext}{\strc_indentedtexts_direct{\currentindentedtext}{2}}% + \frozen\instance\protected\edefcsname \currentindentedtext\endcsname{\strc_indentedtexts_direct{\currentindentedtext}{0}}% + \frozen\instance\protected\edefcsname \v!sub\currentindentedtext\endcsname{\strc_indentedtexts_direct{\currentindentedtext}{1}}% + \frozen\instance\protected\edefcsname\v!sub\v!sub\currentindentedtext\endcsname{\strc_indentedtexts_direct{\currentindentedtext}{2}}% \to \everydefineindentedtext \protected\def\strc_indentedtexts_start#1#2% we need to get rid of \spr {\par \begingroup - \edef\currentindentedtext{#1}% + \cdef\currentindentedtext{#1}% \c_strc_indentedtexts_nesting#2\relax \indentedtextparameter\c!before \d_strc_indentedtexts_distance\indentedtextparameter\c!distance\relax diff --git a/tex/context/base/mkxl/strc-itm.mklx b/tex/context/base/mkxl/strc-itm.mklx index a7dda8fdd..6117495cd 100644 --- a/tex/context/base/mkxl/strc-itm.mklx +++ b/tex/context/base/mkxl/strc-itm.mklx @@ -874,7 +874,7 @@ \def\strc_itemgroups_calculate_list_width#level% {\let\m_strc_itemgroups_saved\currentitemgroup - \edef\currentitemgroup{\currentparentitemgroup:\number#level}% + \cdef\currentitemgroup{\currentparentitemgroup:\number#level}% \ifdim\d_strc_itemgroups_max_width>\zeropoint \d_strc_itemgroups_list_width\d_strc_itemgroups_max_width \orelse\ifnum\itemgroupparameter\c!factor>\zerocount @@ -899,7 +899,7 @@ \global\advanceby\c_strc_itemgroups_nesting\plusone \def\currentitemlevel{\number\c_strc_itemgroups_nesting}% \normalexpanded{\chaintocurrentitemgroup{\currentparentitemgroup:\currentitemlevel}}% - \edef\currentitemgroup{\currentparentitemgroup:\currentitemlevel}% + \cdef\currentitemgroup{\currentparentitemgroup:\currentitemlevel}% % \edef\p_itemgroups_options{\itemgroupparameter\c!option}% \lettonothing\p_itemgroups_extra_options diff --git a/tex/context/base/mkxl/strc-lnt.mklx b/tex/context/base/mkxl/strc-lnt.mklx index 331be8737..7bb85738b 100644 --- a/tex/context/base/mkxl/strc-lnt.mklx +++ b/tex/context/base/mkxl/strc-lnt.mklx @@ -45,7 +45,7 @@ \definenote[#1][#2][#3]% \fi \pushmacro\currentnote - \edef\currentnote{#1} + \cdef\currentnote{#1} \letcsname\??linenote\currentnote\expandafter\endcsname\csname\currentnote\endcsname % use copy command \frozen\instance\setuevalue {\currentnote}{\strc_linenotes_direct{\currentnote}}% \frozen\instance\setuevalue{\e!start\currentnote}{\strc_linenotes_start {\currentnote}}% @@ -143,7 +143,7 @@ \protected\def\strc_linenotes_indeed#1#2#3% {\begingroup % we keep things local so we can use it as regular note too - \edef\currentnotation{#1}% + \cdef\currentnotation{#1}% \edef\currentlinenotereference{#2}% \xdef\m_page_lines_previous_from{\begincsname\??linenotespreviousfrom\currentnotation\endcsname}% \xdef\m_page_lines_previous_to {\begincsname\??linenotespreviousto \currentnotation\endcsname}% diff --git a/tex/context/base/mkxl/strc-lst.mklx b/tex/context/base/mkxl/strc-lst.mklx index 3fd0e979e..3dc9eb3e9 100644 --- a/tex/context/base/mkxl/strc-lst.mklx +++ b/tex/context/base/mkxl/strc-lst.mklx @@ -136,7 +136,7 @@ \permanent\protected\def\structurelistinject[#tag]% {\begingroup - \edef\currentlist{#tag}% + \cdef\currentlist{#tag}% \doifelse{\listparameter\c!state}\v!start\strc_lists_inject_yes\strc_lists_inject_nop} \tolerant\protected\def\strc_lists_inject_nop[#settings]#spacer[#userdata]% @@ -185,12 +185,12 @@ \protected\def\strc_lists_inject_direct[#tag]% [#settings][#userdata] {\begingroup - \edef\currentlist{#tag}% + \cdef\currentlist{#tag}% \strc_lists_inject_yes} % [#settings][#userdata] \permanent\protected\def\writebetweenlist[#tag]% {\begingroup - \edef\currentlist{#tag}% + \cdef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start \strc_lists_write_between_yes \strc_lists_write_between_nop} @@ -203,7 +203,7 @@ \permanent\protected\def\writedatatolist[#tag]% {\begingroup - \edef\currentlist{#tag}% + \cdef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start \strc_lists_write_data_to_yes \strc_lists_write_data_to_nop} @@ -220,7 +220,7 @@ \permanent\protected\def\writetolist[#tag]% {\begingroup - \edef\currentlist{#tag}% + \cdef\currentlist{#tag}% \doifelse{\namedlistparameter{#tag}\c!state}\v!start \strc_lists_write_to_yes \strc_lists_write_to_nop} @@ -278,7 +278,7 @@ \def\strc_lists_place_indeed#tag#list#settings% {\begingroup \the\t_lists_every_renderingcleanup % \lettonothing\currentlistentrylocation - \edef\currentlist{#tag}% + \cdef\currentlist{#tag}% \setupcurrentlist[#settings]% \the\everystructurelist % \doif{\listparameter\c!coupling}\v!on{\startlistreferences{#tag}}% @@ -343,7 +343,7 @@ \permanent\tolerant\protected\def\placecombinedlist[#tag]#spacer[#settings]% i.e. no list set in settings {\begingroup - \edef\currentlist{#tag}% + \cdef\currentlist{#tag}% \setupcurrentlist[#settings]% \edef\m_strc_list_alternative{\listparameter\c!alternative}% we only inherit alternative \strc_lists_place_indeed{#tag}{\listparameter\c!list}{#settings}% @@ -533,7 +533,7 @@ \permanent\protected\def\strclistsentryprocess#tag#method#index#extra% This one is called at the lua end! {\clf_pushlist#index\relax %\lettonothing\currentlistentrylocation - \edef\currentlist {#tag}% + \cdef\currentlist {#tag}% \edef\currentlistmethod{#method}% \edef\currentlistindex {#index}% \edef\currentlistextra {#extra}% @@ -578,7 +578,7 @@ \permanent\protected\def\listsymbol[#tag]#number% {\begingroup - \edef\currentlist{#tag}% + \cdef\currentlist{#tag}% \def\currentlistentrynumber{#number}% no edef else tag problems \currentlistsymbol \endgroup} @@ -1621,7 +1621,7 @@ \permanent\tolerant\protected\def\determinelistcharacteristics[#list]#spacer[#settings]% {\begingroup - \edef\currentlist{\firststructureelementinlist{#list}}% + \cdef\currentlist{\firststructureelementinlist{#list}}% \ifempty\currentlist \endgroup \let\listlength\!!zerocount diff --git a/tex/context/base/mkxl/strc-mat.mkxl b/tex/context/base/mkxl/strc-mat.mkxl index b8d05fb33..4073e1d66 100644 --- a/tex/context/base/mkxl/strc-mat.mkxl +++ b/tex/context/base/mkxl/strc-mat.mkxl @@ -1502,7 +1502,7 @@ \iftrialtypesetting\else \global\advanceby\c_strc_formulas_n\plusone \fi - \edef\currentformula{#1}% + \cdef\currentformula{#1}% \usesetupsparameter\formulaparameter % new \dostarttaggedchained\t!formula\currentformula\??formula \strc_math_set_options{#2}% diff --git a/tex/context/base/mkxl/strc-not.mklx b/tex/context/base/mkxl/strc-not.mklx index 29440f582..79629b18a 100644 --- a/tex/context/base/mkxl/strc-not.mklx +++ b/tex/context/base/mkxl/strc-not.mklx @@ -249,7 +249,7 @@ \tolerant\protected\def\strc_notations_command[#1]#*[#2]% {\begingroup - \edef\currentnote{#1}% + \cdef\currentnote{#1}% \strc_constructions_initialize{#1}% \strc_notes_synchronize \edef\p_next{\noteparameter\c!anchor}% @@ -295,7 +295,7 @@ \tolerant\protected\def\strc_notations_start_indeed#1#*[#2]#*[#3]% {\begingroup - \edef\currentnote{#2}% + \cdef\currentnote{#2}% \strc_constructions_initialize{#2}% \strc_notes_synchronize \ifnotesenabled @@ -842,7 +842,7 @@ \let\strc_notes_process_list\gobbleoneargument \protected\def\strc_notes_process#action% argument is a \macro that uses \currentnote - {\def\strc_notes_process_list##1{\edef\currentnote{##1}\let\currentdescription\currentnote#action}% + {\def\strc_notes_process_list##1{\cdef\currentnote{##1}\let\currentdescription\currentnote#action}% \the\t_strc_notes} \newtoks\everychecknote % just before a note is typeset @@ -1260,7 +1260,7 @@ \permanent\protected\def\handlenoteinsert#tag#id% {\begingroup - \edef\currentnote{#tag}% + \cdef\currentnote{#tag}% \strc_constructions_initialize{#tag}% \strc_notes_synchronize \the\everybeforenoteinsert @@ -1282,12 +1282,12 @@ \endgroup} \permanent\protected\def\betweennoteitself#tag% used ? - {\edef\currentnote{#tag}% + {\cdef\currentnote{#tag}% \doif{\noteparameter\c!paragraph}\v!yes{\noteparameter\c!inbetween}} \permanent\protected\def\handlenoteitself#tag#id% {\edef\currentnotenumber{#id}% - \edef\currentnote{#tag}% + \cdef\currentnote{#tag}% \strc_constructions_initialize{#tag}% \strc_notes_synchronize \edef\currentconstructionlistentry{\clf_notelistindex{\currentnote}#id}% index in list cache @@ -1662,7 +1662,7 @@ \def\strc_notes_local_place_indeed#settings#tag% {\begingroup - \edef\currentnote{#tag}% is already set? + \cdef\currentnote{#tag}% is already set? \the\everyplacelocalnotes % beware, we cannot trust setting \currentnote here \setupcurrentnote[#settings]% later we set height etc for framed @@ -1712,7 +1712,7 @@ {\processcommalist[#list]{\strc_notes_place_indeed{#settings}}} \def\strc_notes_place_indeed#settings#tag% settings note - {\edef\currentnote{#tag}% grouping ? + {\cdef\currentnote{#tag}% grouping ? \doifelse{\clf_getnotestate{#tag}}{store} \strc_notes_local_place_indeed \strc_notes_global_place_indeed @@ -1979,7 +1979,7 @@ {\ifnotesenabled \dontleavehmode \begingroup - \edef\currentnote{#tag}% + \cdef\currentnote{#tag}% \usenotestyleandcolor\c!textstyle\c!textcolor \iftok{#reference}\emptytoks \noteparameter\c!textcommand\lastnotesymbol % check if command double diff --git a/tex/context/base/mkxl/strc-num.mkxl b/tex/context/base/mkxl/strc-num.mkxl index 3f3bd2143..bc8298c4a 100644 --- a/tex/context/base/mkxl/strc-num.mkxl +++ b/tex/context/base/mkxl/strc-num.mkxl @@ -269,7 +269,7 @@ \permanent\tolerant\protected\def\convertedcounter[#1]#*[#2]% {\begingroup - \edef\currentcounter{#1}% + \cdef\currentcounter{#1}% \ifparameter#2\or\setupcurrentcounter[#2]\fi \clf_prefixedconverted {\counterparameter\s!name} @@ -399,7 +399,7 @@ \ifempty\currentname \edef\currentname{#1}% \fi - \edef\currentcounter{#3\s!counter}% + \cdef\currentcounter{#3\s!counter}% \ifempty\currentcounter \let\currentcounter\currentname \fi @@ -599,7 +599,7 @@ \c!numbersegments =#2\c!numbersegments]} \protected\def\strc_counter_setup_using_parameter#1#2% name \someparameter - {\edef\currentcounter{#1}% + {\cdef\currentcounter{#1}% % \setcounterparameter \c!start{#2\c!start}% \setcounterparameter \c!state{#2\c!state}% % beware, "" == start diff --git a/tex/context/base/mkxl/strc-reg.mkxl b/tex/context/base/mkxl/strc-reg.mkxl index 7dd07b2e2..0a778f8bb 100644 --- a/tex/context/base/mkxl/strc-reg.mkxl +++ b/tex/context/base/mkxl/strc-reg.mkxl @@ -268,7 +268,7 @@ \def\strc_registers_register_page_entry_indeed#1#2#3% register data userdata {\begingroup - \edef\currentregister{#1}% + \cdef\currentregister{#1}% %\setupcurrentregister[\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]% \setupcurrentregister[#2]% \edef\currentregisterlabel {\registerparameter\c!label}% @@ -380,7 +380,7 @@ \permanent\protected\def\dosetfastregisterentry#1#2#3#4#5% register entry key processor processor {\begingroup - \edef\currentregister{#1}% + \cdef\currentregister{#1}% \setnextinternalreference \glet\currentregistername\currentregister \xdef\currentregisternumber{\clf_storeregister @@ -485,7 +485,7 @@ \def\strc_registers_finish_entry_indeed#1#2#3% register data userdata {\begingroup - \edef\currentregister{#1}% + \cdef\currentregister{#1}% %\setupcurrentregister[\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]% todo: fast setter \resetregisterparameter\c!entries \resetregisterparameter\c!label @@ -577,7 +577,7 @@ \def\strc_registers_insert_see_indeed#1#2#3#4% register key entry seeword {\begingroup - \edef\currentregister{#1}% + \cdef\currentregister{#1}% \edef\currentregisterexpansion{\registerparameter\c!expansion}% \ifx\currentregisterexpansion\s!xml \xmlstartraw @@ -635,7 +635,7 @@ \permanent\tolerant\protected\def\determineregistercharacteristics[#1]#*[#2]% {\begingroup \setupregister[#1][#2]% - \edef\currentregister{\firstinset{#1}}% + \cdef\currentregister{\firstinset{#1}}% \normalexpanded{\endgroup\noexpand\xdef\noexpand\listlength{\clf_analyzeregister {\currentregister}% {% @@ -667,7 +667,7 @@ \begingroup %\forgetall \setupregister[#1][#2]% can be a list - \edef\currentregister{\firstinset{#1}}% + \cdef\currentregister{\firstinset{#1}}% \the\everyplaceregister \ifnum\namedmixedcolumnsparameter\currentregister\c!n>\plusone \startmixedcolumns[\currentregister]% @@ -731,7 +731,7 @@ \permanent\tolerant\protected\def\completeregister[#1]#*[#2]% {\ifarguments\or \begingroup - \edef\currentregister{\firstinset{#1}}% + \cdef\currentregister{\firstinset{#1}}% \normalexpanded{\startnamedsection[\v!chapter][\c!title={\headtext{\currentregister}},reference=\currentregister]}% \placeregister[#1][#2]% \page[\v!yes]% @@ -950,7 +950,7 @@ % \dostarttagged\t!registerentries\empty % % \let\savedcurrentregister\currentregister % \pushmacro\currentregister -% \edef\currentregister{\currentregister:\number\c_strc_register_level}% +% \cdef\currentregister{\currentregister:\number\c_strc_register_level}% % \usenestedregisterstyleandcolor\c!textstyle\c!textcolor % \ifnum\c_strc_register_level>\plusone % \advanceby\leftskip\d_strc_registers_distance\relax @@ -1015,7 +1015,7 @@ \c_strc_register_level\ifnum#1>\c_strc_registers_maxlevel\c_strc_registers_maxlevel\else#1\fi\relax \dostarttagged\t!registerentries\empty \pushmacro\currentregister % bah - \edef\currentregister{\currentregister:\number\c_strc_register_level}% + \cdef\currentregister{\currentregister:\number\c_strc_register_level}% \let\currentnestedregister\currentregister \usenestedregisterstyleandcolor\c!textstyle\c!textcolor \ifnum\c_strc_register_level>\plusone @@ -1174,7 +1174,7 @@ \permanent\protected\def\pushcurrentregister#1% {\let\m_current_register\currentregister - \edef\currentregister{#1}} + \cdef\currentregister{#1}} \permanent\protected\def\popcurrentregister {\let\currentregister\m_current_register} @@ -1598,7 +1598,7 @@ % % \def\strc_registers_register_page_entry_indeed#1#2#3% register data userdata % {\begingroup -% \edef\currentregister{#1}% +% \cdef\currentregister{#1}% % %\setupcurrentregister[\c!entries=,\c!label=,\c!keys=,\c!alternative=,#2]% % \setupcurrentregister[#2]% % \edef\currentregisterlabel {\registerparameter\c!label}% diff --git a/tex/context/base/mkxl/strc-sbe.mkxl b/tex/context/base/mkxl/strc-sbe.mkxl index ade59da0b..f2bc80659 100644 --- a/tex/context/base/mkxl/strc-sbe.mkxl +++ b/tex/context/base/mkxl/strc-sbe.mkxl @@ -73,7 +73,7 @@ \to \everyaftersectionblock \permanent\tolerant\protected\def\setsectionblock[#1]#*[#2]% used to set the default - {\edef\currentsectionblock{#1}% from now on we assume a value + {\cdef\currentsectionblock{#1}% from now on we assume a value \setupcurrentsectionblock[#2]% \clf_setsectionblock{#1} bookmark {\sectionblockparameter\c!bookmark}% @@ -84,7 +84,7 @@ \permanent\tolerant\protected\def\startsectionblock[#1]#*[#2]% {%\ctxlua{structures.counters.check(0)}% we assume sane usage of \page, as this is the only workable place (in push) \begingroup - \edef\currentsectionblock{#1}% from now on we assume a value + \cdef\currentsectionblock{#1}% from now on we assume a value \setupcurrentsectionblock[#2]% \clf_pushsectionblock{#1} bookmark {\sectionblockparameter\c!bookmark}% diff --git a/tex/context/base/mkxl/strc-sec.mkxl b/tex/context/base/mkxl/strc-sec.mkxl index 09d742e56..62da581a1 100644 --- a/tex/context/base/mkxl/strc-sec.mkxl +++ b/tex/context/base/mkxl/strc-sec.mkxl @@ -506,7 +506,7 @@ \permanent\protected\def\doredefinehead#1#2% called at lua end {\push_macro_currenthead \push_macro_currentheadparent - \edef\currenthead{#1}% + \cdef\currenthead{#1}% \edef\currentheadparent{#2}% \the\everyredefinehead\relax \pop_macro_currentheadparent @@ -568,7 +568,7 @@ \permanent\protected\def\definesection[#1]% {\ifcsname\??headlevel#1\endcsname \else - \edef\currenthead{#1}% + \cdef\currenthead{#1}% \let\currentsection\currenthead % just an alias \global\advanceby\maxstructuredepth\plusone \edefcsname\??headlevel#1\endcsname{\the\maxstructuredepth}% @@ -589,9 +589,9 @@ \permanent\tolerant\protected\def\setupsection[#1]#*[#2]#*[#3]% {\ifparameter#1\else \push_macro_currenthead - \edef\currenthead{\ifcsname\??headlevel#1\endcsname#1\else\sectionheadsection{#1}\fi}% + \cdef\currenthead{\ifcsname\??headlevel#1\endcsname#1\else\sectionheadsection{#1}\fi}% \ifparameter#3\or - \edef\currenthead{\currenthead#2}% not used at any more in mkiv (sets now) + \cdef\currenthead{\currenthead#2}% not used at any more in mkiv (sets now) \setupcurrenthead[#3]% \else \setupcurrenthead[#2]% @@ -867,7 +867,7 @@ \begingroup \enforced\permanent\protected\def\\{\space}% messy here, but the default (and needs to be grouped) \global\settrue\headisdisplay % triggers interlinespace checking - \edef\currenthead{#1}% maybe only when #1 is given + \cdef\currenthead{#1}% maybe only when #1 is given \strc_rendering_initialize_style_and_color\c!textstyle\c!textcolor \relax \getspecificstructuretitle{\thenamedheadlevel{#1}}% @@ -878,7 +878,7 @@ {\dontleavehmode \begingroup \global\settrue\headisdisplay % triggers interlinespace checking - \edef\currenthead{#1}% maybe only when #1 is given + \cdef\currenthead{#1}% maybe only when #1 is given \strc_rendering_initialize_style_and_color\c!numberstyle\c!numbercolor \relax \getfullstructurenumber{\thenamedheadlevel{#1}}% @@ -1318,7 +1318,7 @@ \permanent\tolerant\protected\def\someheadnumber[#1]#*[#2]% {\dontleavehmode \begingroup - \edef\currenthead{#1}% + \cdef\currenthead{#1}% \getsomefullstructurenumber{\thenamedheadlevel{#1}}{#2}% \endgroup} diff --git a/tex/context/base/mkxl/strc-syn.mkxl b/tex/context/base/mkxl/strc-syn.mkxl index 9b4d410e1..6b6d928c0 100644 --- a/tex/context/base/mkxl/strc-syn.mkxl +++ b/tex/context/base/mkxl/strc-syn.mkxl @@ -278,7 +278,7 @@ \ifparameter#3\or \frozen\instance\protected\def#3##1{\strc_synonyms_insert_meaning{#1}{##1}}% \meaning \fi - \edef\currentsynonym{#1}% + \cdef\currentsynonym{#1}% % %\checksynonymparent %\setupcurrentsynonym[\s!single={#1},\s!multi={#2}]% @@ -305,7 +305,7 @@ \permanent\tolerant\protected\def\definesynonym[#1]#*[#2]#*[#3]#*[#4]% [yes][abbreviation][FOO]{foo}{foo me} {\begingroup \edef\currentsynonymoption{#1}% - \edef\currentsynonym{#2}% + \cdef\currentsynonym{#2}% \edef\currentsynonymtag{#3}% \edef\currentsynonymsortkey{#4}% \strc_synonyms_define_entry} @@ -317,7 +317,7 @@ % \permanent\tolerant\protected\def\setsynonym[#1]#*[#2]% % {\begingroup % \setupsynonymentry[#2]% -% \edef\currentsynonym {#1}% +% \cdef\currentsynonym {#1}% % \edef\currentsynonymoption {\synonymentryparameter\c!option}% % \edef\currentsynonymtag {\synonymentryparameter\c!tag}% % \edef\currentsynonymsortkey{\synonymentryparameter\c!sortkey}% @@ -399,7 +399,7 @@ \protected\def\strc_synonyms_insert_meaning#1#2% name tag {\dontleavehmode % otherwise we don't get it right at the beginning of a par \begingroup - \def\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \def\currentsynonymtag{#2}% \fastsetup{\??simplelistrenderings::\v!text}% \endgroup} @@ -407,7 +407,7 @@ \protected\def\strc_synonyms_insert#1#2% name tag {\dontleavehmode % otherwise we don't get it right at the beginning of a par \begingroup - \edef\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \let\currentsynonym\currentsimplelist % for a while \def\currentsynonymtag{#2}% \edef\currentsimplelistalternative{\simplelistparameter\c!alternative}% @@ -482,7 +482,7 @@ \permanent\tolerant\protected\def\placelistofsynonyms[#1]#*[#2]% {\begingroup - \edef\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \doifelsecommandhandler\??simplelist\currentsimplelist {\strc_constructions_initialize{#1}% \setupcurrentsimplelist[#2]% @@ -504,7 +504,7 @@ \permanent\tolerant\protected\def\completelistofsynonyms[#1]#*[#2]% {\begingroup - \edef\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \doifelsecommandhandler\??simplelist\currentsimplelist {\normalexpanded{\startnamedsection[\v!chapter][\c!title={\headtext{\simplelistparameter\s!multi}},\c!reference=#1]}% \placelistofsynonyms[#1][#2]% @@ -561,7 +561,7 @@ \else \frozen\instance\protected\defcsname#1\endcsname{\definesort[\v!yes][#1]}% \fi - \edef\currentsorting{#1}% + \cdef\currentsorting{#1}% \setfalse\c_strc_constructions_define_commands \definesimplelist [\currentsorting]% @@ -586,12 +586,12 @@ \permanent\tolerant\protected\def\definesort[#1]#*[#2]#*[#3]% {\begingroup \edef\currentsortingoption{#1}% - \edef\currentsorting{#2}% + \cdef\currentsorting{#2}% \edef\currentsortingtag{#3}% \strc_sorting_define_entry} \def\strc_sorting_define_entry#1% - {\let\currentsimplelist\currentsimplelist + {%\let\currentsimplelist\currentsimplelist \ifempty\currentsortingtag \edef\currentsortingtag{#1}% \fi @@ -644,7 +644,7 @@ {\dontleavehmode % otherwise we don't get it right at the beginning of a par \begingroup % no kap currently, of .. we need to map cap onto WORD - \edef\currentsorting{#1}% + \cdef\currentsorting{#1}% \edef\currentsortingtag{#2}% \let\currentsimplelist\currentsorting \edef\currentsimplelistalternative{\simplelistparameter\c!alternative}% @@ -686,7 +686,7 @@ \permanent\tolerant\protected\def\placelistofsorts[#1]#*[#2]% {\begingroup - \edef\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \strc_constructions_initialize{#1}% \setupcurrentsimplelist[#2]% \edef\p_simplelist_command{\simplelistparameter\c!command}% @@ -710,7 +710,7 @@ \permanent\tolerant\protected\def\completelistofsorts[#1]#*[#2]% {\begingroup - \edef\currentsimplelist{#1}% + \cdef\currentsimplelist{#1}% \normalexpanded{\startnamedsection[\v!chapter][\c!title={\headtext{\simplelistparameter\s!multi}},\c!reference=#1]}% \placelistofsorts[#1][#2]% \page diff --git a/tex/context/base/mkxl/strc-tag.mkxl b/tex/context/base/mkxl/strc-tag.mkxl index 3c00acb65..8fac6b950 100644 --- a/tex/context/base/mkxl/strc-tag.mkxl +++ b/tex/context/base/mkxl/strc-tag.mkxl @@ -394,10 +394,10 @@ \lettonothing\currentparagraph \setupcurrentparagraph[#1] \else - \edef\currentparagraph{#1}% + \cdef\currentparagraph{#1}% \fi \or - \edef\currentparagraph{#1}% + \cdef\currentparagraph{#1}% \setupcurrentparagraph[#2]% \fi \useparagraphstyleandcolor\c!style\c!color diff --git a/tex/context/base/mkxl/strc-usr.mkxl b/tex/context/base/mkxl/strc-usr.mkxl index cd1f97dec..746503972 100644 --- a/tex/context/base/mkxl/strc-usr.mkxl +++ b/tex/context/base/mkxl/strc-usr.mkxl @@ -112,13 +112,13 @@ \userdata_start_indeed} \def\userdata_start_delayed_name[#1]% - {\edef\currentuserdata{#1}% + {\cdef\currentuserdata{#1}% \checkuserdataparent \doifelsenextoptionalcs\userdata_start_delayed_parameters\userdata_start_indeed} \protected\tolerant\def\userdata_start_instance#1#*[#2]% {\begingroup - \edef\currentuserdata{#1}% + \cdef\currentuserdata{#1}% \setupcurrentuserdata[#2]% \grabbufferdatadirect % {\s!userdata:\currentuserdata}% diff --git a/tex/context/base/mkxl/symb-ini.mkxl b/tex/context/base/mkxl/symb-ini.mkxl index cf61ddb1f..01e2fe30a 100644 --- a/tex/context/base/mkxl/symb-ini.mkxl +++ b/tex/context/base/mkxl/symb-ini.mkxl @@ -304,7 +304,7 @@ {\popmacro\m_symb_current_set} \permanent\protected\def\setupsymbolset[#1]% - {\edef\currentsymbolset{#1}% + {\cdef\currentsymbolset{#1}% \ifcsname\??symbolsets\currentsymbolset\endcsname \else \symb_setup_symbol_set \fi} diff --git a/tex/context/base/mkxl/syst-aux.lmt b/tex/context/base/mkxl/syst-aux.lmt index 39ceae376..b28aeb39d 100644 --- a/tex/context/base/mkxl/syst-aux.lmt +++ b/tex/context/base/mkxl/syst-aux.lmt @@ -1,4 +1,4 @@ - if not modules then modules = { } end modules ['syst-aux'] = { +if not modules then modules = { } end modules ['syst-aux'] = { version = 1.001, comment = "companion to syst-aux.mkiv", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", diff --git a/tex/context/base/mkxl/tabl-frm.mkxl b/tex/context/base/mkxl/tabl-frm.mkxl index e19ea34fe..379ce2a7c 100644 --- a/tex/context/base/mkxl/tabl-frm.mkxl +++ b/tex/context/base/mkxl/tabl-frm.mkxl @@ -111,10 +111,10 @@ \lettonothing\currentframedtable \setupframed[\??framedtable][#1]% \else - \edef\currentframedtable{#1}% + \cdef\currentframedtable{#1}% \setupframed[\??framedtable][#2]% \fi - \edef\currentframed{\??framedtable\currentframedtable}% + \cdef\currentframed{\??framedtable\currentframedtable}% \pack_framed_initialize \c_tabl_framed_r\zerocount \d_tabl_framed_d\framedparameter\c!distance @@ -139,8 +139,8 @@ % \c_tabl_framed_c\zerocount % \d_tabl_framed_h\zeropoint % \bgroup -% \edef\currentframed{\number\c_tabl_framed_r}% -% \edef\currentframed +% \cdef\currentframed{\number\c_tabl_framed_r}% +% \cdef\currentframed % {\??framedtablerow\currentframedtable % \ifcsname\??framedtablerow\currentframedtable:\currentframed\endcsname % :\currentframed @@ -183,8 +183,8 @@ {\bgroup \c_tabl_framed_c\zerocount \c_tabl_framed_pass\plustwo - \edef\currentframed{\number\c_tabl_framed_r}% - \edef\currentframed + \cdef\currentframed{\number\c_tabl_framed_r}% + \cdef\currentframed {\??framedtablerow\currentframedtable \ifcsname\??framedtablerow\currentframedtable:\currentframed\endcsname :\currentframed @@ -208,8 +208,8 @@ {\advanceby\c_tabl_framed_c\plusone \setbox\b_tabl_framed\hpack\bgroup %\bgroup - \edef\currentframed{\number\c_tabl_framed_c}% - \edef\currentframed + \cdef\currentframed{\number\c_tabl_framed_c}% + \cdef\currentframed {\??framedtablecolumn\currentframedtable \ifcsname\??framedtablecolumn\currentframedtable:\currentframed\endcsname :\currentframed diff --git a/tex/context/base/mkxl/tabl-mis.mkxl b/tex/context/base/mkxl/tabl-mis.mkxl index e65c97e0d..383ff22dd 100644 --- a/tex/context/base/mkxl/tabl-mis.mkxl +++ b/tex/context/base/mkxl/tabl-mis.mkxl @@ -143,10 +143,10 @@ \fi} \appendtoks - \frozen\instance\letcsname\e!next \currentparagraphs\endcsname\nextparagraphs + \frozen\instance\letcsname\e!next\currentparagraphs\endcsname\nextparagraphs \frozen\instance\letcsname\currentparagraphs\endcsname\nextparagraphs \frozen\instance\protected\edefcsname\e!start\currentparagraphs\endcsname{\startparagraphs[\currentparagraphs]}% - \frozen\instance\letcsname\e!stop \currentparagraphs\endcsname\stopparagraphs + \frozen\instance\letcsname\e!stop\currentparagraphs\endcsname\stopparagraphs %frozen\instance\setuevalue{\e!setup\currentparagraph\e!endsetup}{\typo_paragraphs_setup_saved[\currentparagraphs]}% \dorecurse{\paragraphsparameter\c!n}% {\normalexpanded{\typo_paragraphs_setup_saved[\currentparagraphs:\recurselevel][\c!width=,\s!parent=\??paragraphs\currentparagraphs]}}% @@ -163,7 +163,7 @@ \permanent\protected\def\startparagraphs[#1]% quite slow {\bgroup % (1) - \edef\currentparagraphs{#1}% + \cdef\currentparagraphs{#1}% % \paragraphsparameter\c!before \edef\p_width{\paragraphsparameter\c!width}% \ifempty\p_width @@ -241,7 +241,7 @@ {\begingroup \let\typo_paragraphs_start_cell\relax \let\typo_paragraphs_stop_cell\typo_paragraphs_stop_cell_indeed - \edef\currentparagraphs{\currentparagraphs:\the\c_typo_paragraphs_n}% + \cdef\currentparagraphs{\currentparagraphs:\the\c_typo_paragraphs_n}% \ifnum\c_typo_paragraphs_n>\plusone \typo_paragraphs_separator \fi diff --git a/tex/context/base/mkxl/tabl-tbl.mkxl b/tex/context/base/mkxl/tabl-tbl.mkxl index b2e4f5090..b67d0ce50 100644 --- a/tex/context/base/mkxl/tabl-tbl.mkxl +++ b/tex/context/base/mkxl/tabl-tbl.mkxl @@ -1238,7 +1238,7 @@ \protected\def\tabl_start_defined[#1]% {\bgroup - \edef\currenttabulationparent{#1}% + \cdef\currenttabulationparent{#1}% \let\currenttabulation\currenttabulationparent \ifcstok{\tabulationparameter\c!format}\v!none % this is special case: we need to define the generic english @@ -1254,10 +1254,10 @@ \ifhastok={#1}% \setuptabulation[\currenttabulation][#1]% \else - \edef\currenttabulation{\currenttabulation:#1}% + \cdef\currenttabulation{\currenttabulation:#1}% \fi \else - \edef\currenttabulation{\currenttabulation:#1}% + \cdef\currenttabulation{\currenttabulation:#1}% \setuptabulation[\currenttabulation][#2]% \fi \tabl_tabulate_start_building} @@ -2006,7 +2006,7 @@ \ifhastok={#1}% \setupcurrenttabulatemove[#1]% \else - \edef\currenttabulatemove{#1}% + \cdef\currenttabulatemove{#1}% \setupcurrenttabulatemove[#2]% \fi \edef\p_orientation{\theorientation{\tabulatemoveparameter\c!orientation}}% @@ -2459,7 +2459,7 @@ \def\tabl_tabulate_anchor_setup % a bit of a cheat but good enough for a lightweight experiment {\edef\p_synchronize{\tabulationparameter\c!synchronize}% \ifx\p_synchronize\v!background - \edef\currentframedcontent{\tabulationparameter\c!frame}% + \cdef\currentframedcontent{\tabulationparameter\c!frame}% \ifx\currentframedcontent\v!off \resettabulationparameter\c!frame \lettonothing\currentframedcontent diff --git a/tex/context/base/mkxl/tabl-xtb.mklx b/tex/context/base/mkxl/tabl-xtb.mklx index f7121dc58..446296d1a 100644 --- a/tex/context/base/mkxl/tabl-xtb.mklx +++ b/tex/context/base/mkxl/tabl-xtb.mklx @@ -219,7 +219,7 @@ \protected\def\tabl_x_start_named[#tag]#spacer[#settings]% {\bgroup - \edef\currentxtable{#tag}% + \cdef\currentxtable{#tag}% \advanceby\c_tabl_x_nesting\plusone \dostarttaggedchained\t!table\empty\??xtable \setupcurrentxtable[#settings]% @@ -707,7 +707,7 @@ \protected\def\tabl_x_set_checked#settings% {\ifcsname\namedxtablehash{#settings}\s!parent\endcsname - \edef\currentxtable{#settings}% + \cdef\currentxtable{#settings}% \else \setupcurrentxtable[#settings]% \fi} @@ -796,7 +796,7 @@ {\ifempty\currentxtable \else \chaintocurrentxtable{#tag}% \fi - \edef\currentxtable{#tag}% + \cdef\currentxtable{#tag}% \doifelsenextoptionalcs\setupcurrentxtable\relax} \aliased\let\startxrowgroup \startxgroup @@ -821,7 +821,7 @@ {\ifempty\currentxtable \else \chaintocurrentxtable{#tag}% \fi - \edef\currentxtable{#tag}% + \cdef\currentxtable{#tag}% \doifelsenextoptionalcs\tabl_x_start_cell_yes\tabl_x_start_cell_nop} \permanent\protected\def\stopxcell @@ -845,7 +845,7 @@ {\ifempty\currentxtable \else \chaintocurrentxtable{#tag}% \fi - \edef\currentxtable{#tag}% + \cdef\currentxtable{#tag}% \doifelsenextoptionalcs\tabl_x_start_row_yes\tabl_x_start_row_nop} \permanent\protected\def\stopxrow diff --git a/tex/context/base/mkxl/toks-ini.lmt b/tex/context/base/mkxl/toks-ini.lmt index e232fae0d..b204694ec 100644 --- a/tex/context/base/mkxl/toks-ini.lmt +++ b/tex/context/base/mkxl/toks-ini.lmt @@ -18,8 +18,8 @@ local printtable = table.print local concat = table.concat local format = string.format -local commands = token.getcommandvalues() -local values = token.getfunctionvalues() +local commands = token.getcommandvalues() -- tex.functioncode +local values = token.getfunctionvalues() -- tex.functioncode values.dimen = values.dimension values.count = values.integer tokens.values = utilities.storage.allocate(table.swapped(values, values)) diff --git a/tex/context/base/mkxl/trac-tex.lmt b/tex/context/base/mkxl/trac-tex.lmt index df125cb12..58dfb0316 100644 --- a/tex/context/base/mkxl/trac-tex.lmt +++ b/tex/context/base/mkxl/trac-tex.lmt @@ -105,8 +105,15 @@ interfaces.implement { public = true, protected = true, actions = function(cs) + local n = 0 + local m = 0 for k, v in table.sortedhash(profiled) do logs.report("profiled", "%s : %i",k,v) + n = n + v + m = m + 1 + end + if m > 0 and n > 0 then + logs.report("profiled", "%i profiled : %i",m,n) end end, } diff --git a/tex/context/base/mkxl/type-ini.mklx b/tex/context/base/mkxl/type-ini.mklx index 4842451e7..ba73add48 100644 --- a/tex/context/base/mkxl/type-ini.mklx +++ b/tex/context/base/mkxl/type-ini.mklx @@ -421,13 +421,13 @@ {\ifconditional\autotypescripts \usetypescript[#typeface]% \ifcsname\??fontclassyes#typeface\endcsname - \edef\fontclass{#typeface}% + \cdef\fontclass{#typeface}% \else \iftracetypescripts\writestatus\m!fonts{auto load typescript file 1: [#typeface]}\fi \usetypescriptfile[#typeface]% \usetypescript[#typeface]% \ifcsname\??fontclassyes#typeface\endcsname - \edef\fontclass{#typeface}% + \cdef\fontclass{#typeface}% \else % todo: message \letcsname\??fontclassnop#typeface\endcsname\empty diff --git a/tex/context/base/mkxl/typo-ada.mkxl b/tex/context/base/mkxl/typo-ada.mkxl index d6eae4249..30214956e 100644 --- a/tex/context/base/mkxl/typo-ada.mkxl +++ b/tex/context/base/mkxl/typo-ada.mkxl @@ -80,7 +80,7 @@ \lettonothing\currentadaptive \setupcurrentadaptive[#2]% \else - \edef\currentadaptive{#2}% + \cdef\currentadaptive{#2}% \setupcurrentadaptive[#3]% \fi \edef\p_setups{\adaptiveparameter\c!setups}% diff --git a/tex/context/base/mkxl/typo-cap.mkxl b/tex/context/base/mkxl/typo-cap.mkxl index 0a6867a43..f64b1a913 100644 --- a/tex/context/base/mkxl/typo-cap.mkxl +++ b/tex/context/base/mkxl/typo-cap.mkxl @@ -159,12 +159,12 @@ % here we keep the \groupedcommand \def\typo_capitals_set_fake#1% - {\edef\currentcapitals{#1}% + {\cdef\currentcapitals{#1}% \clf_setcharactercasing\currentcapitals \usecapitalsstyleparameter\c!style} \def\typo_capitals_set_real#1% - {\edef\currentcapitals{#1}% + {\cdef\currentcapitals{#1}% \sc % \smallcaps \clf_setcharactercasing\currentcapitals} diff --git a/tex/context/base/mkxl/typo-del.mkxl b/tex/context/base/mkxl/typo-del.mkxl index 025d6ffcf..7b6e01e6b 100644 --- a/tex/context/base/mkxl/typo-del.mkxl +++ b/tex/context/base/mkxl/typo-del.mkxl @@ -353,7 +353,7 @@ \def\typo_delimited_push#1#2% {\push_macro_currentdelimitedtext % can we combine these two \push_macro_currentdelimitedlanguage % the language used for hyphenation - \edef\currentdelimitedtext{#1}% + \cdef\currentdelimitedtext{#1}% \edef\m_delimited_argument{#2}% \ifempty\m_delimited_argument \typo_delimited_set_language_nop @@ -364,7 +364,7 @@ \global\advanceby\c_typo_delimited_nesting\plusone \edef\delimitedtextlevel{\number\c_typo_delimited_nesting}% \normalexpanded{\chaintocurrentdelimitedtext{\currentparentdelimitedtext:\delimitedtextlevel}}% - \edef\currentdelimitedtext{\currentparentdelimitedtext:\delimitedtextlevel}} + \cdef\currentdelimitedtext{\currentparentdelimitedtext:\delimitedtextlevel}} \def\typo_delimited_pop {\global\advanceby\c_typo_delimited_nesting\minusone diff --git a/tex/context/base/mkxl/typo-drp.mkxl b/tex/context/base/mkxl/typo-drp.mkxl index 0a128b0d6..167a56fa5 100644 --- a/tex/context/base/mkxl/typo-drp.mkxl +++ b/tex/context/base/mkxl/typo-drp.mkxl @@ -102,7 +102,7 @@ \protected\def\typo_initial_handle_indeed#1#2% {\dontleavehmode \begingroup - \edef\currentinitial{#1}% + \cdef\currentinitial{#1}% \setupcurrentinitial[#2]% \resetfontfeature % might be needed in more places \doifelsenothing{\initialparameter\c!style} diff --git a/tex/context/base/mkxl/typo-fln.mkxl b/tex/context/base/mkxl/typo-fln.mkxl index a62646fff..e614fc10f 100644 --- a/tex/context/base/mkxl/typo-fln.mkxl +++ b/tex/context/base/mkxl/typo-fln.mkxl @@ -74,7 +74,7 @@ \protected\def\typo_firstline_handle_indeed#1% {\dontleavehmode \begingroup - \edef\currentfirstline{#1}% + \cdef\currentfirstline{#1}% \usefirstlinestyleandcolor\c!style\c!color \clf_setfirstline alternative {\firstlineparameter\c!alternative}% diff --git a/tex/context/base/mkxl/typo-krn.mkxl b/tex/context/base/mkxl/typo-krn.mkxl index 4c6aea256..07e66e046 100644 --- a/tex/context/base/mkxl/typo-krn.mkxl +++ b/tex/context/base/mkxl/typo-krn.mkxl @@ -28,7 +28,7 @@ \installcommandhandler \??characterkerning {characterkerning} \??characterkerning \permanent\protected\def\setcharacterkerning[#1]% - {\edef\currentcharacterkerning{#1}% + {\cdef\currentcharacterkerning{#1}% \ifx\currentcharacterkerning\s!reset \resetcharacterkerning \else @@ -75,12 +75,12 @@ {\groupedcommand{\typo_kerning_apply_nop_indeed{#1}}\donothing} \def\typo_kerning_apply_yes_indeed#1#2% - {\edef\currentcharacterkerning{#1}% + {\cdef\currentcharacterkerning{#1}% \setupcurrentcharacterkerning[\c!factor=#2]% \typo_kerning_set} \def\typo_kerning_apply_nop_indeed#1% - {\edef\currentcharacterkerning{#1}% + {\cdef\currentcharacterkerning{#1}% \typo_kerning_set} \definecharacterkerning [\v!kerncharacters] [\c!factor=.125] diff --git a/tex/context/base/mkxl/typo-lbx.mkxl b/tex/context/base/mkxl/typo-lbx.mkxl index 57186856f..5d85f4266 100644 --- a/tex/context/base/mkxl/typo-lbx.mkxl +++ b/tex/context/base/mkxl/typo-lbx.mkxl @@ -89,7 +89,7 @@ \permanent\protected\def\localboxcommand {\ifcsname\??localboxesnamespace\number\localboxindex\endcsname - %\edef\currentlocalboxes{\lastnamedcs}% + %\cdef\currentlocalboxes{\lastnamedcs}% \expandafter\let\expandafter\currentlocalboxes\lastnamedcs \setbox\localboxcontentbox\hbox {\uselocalboxesstyleandcolor\c!style\c!color % sometimes redundant @@ -114,7 +114,7 @@ \def\typo_localboxes_zero#1#2#3% {\ifcsname\??localboxesattribute#2\endcsname \c_typo_localboxes_index\lastnamedcs - \edef\currentlocalboxes{#2}% + \cdef\currentlocalboxes{#2}% \edef\currentlocalboxeslocation{#1}% \typo_localboxes_localbox index \c_typo_localboxes_index @@ -135,7 +135,7 @@ \def\typo_localboxes_asis#1#2#3% {\ifcsname\??localboxesattribute#2\endcsname \c_typo_localboxes_index\lastnamedcs - \edef\currentlocalboxes{#2}% + \cdef\currentlocalboxes{#2}% \edef\currentlocalboxeslocation{#1}% \typo_localboxes_localbox index \c_typo_localboxes_index @@ -167,7 +167,7 @@ \permanent\tolerant\protected\def\resetlocalbox[#1]% {\ifcsname\??localboxesattribute#1\endcsname \c_typo_localboxes_index\lastnamedcs - \edef\currentlocalboxes{#1}% + \cdef\currentlocalboxes{#1}% \ifcsname\??localboxesresetters\localboxesparameter\c!location\endcsname \edef\currentlocalboxeslocation{\lastnamedcs}% \typo_localboxes_localbox index \c_typo_localboxes_index {}% @@ -176,7 +176,7 @@ \def\typo_localboxes_box#1% {\dowithnextboxcontent - {\edef\currentlocalboxes{#1}% + {\cdef\currentlocalboxes{#1}% \uselocalboxesstyleandcolor\c!style\c!color} {\ifcsname\??localboxeslocations\namedlocalboxesparameter{#1}\c!location\endcsname \expandafter\lastnamedcs @@ -196,7 +196,7 @@ \csname\??localboxeslocations\v!left\expandafter\endcsname \fi{#1}{\unhbox\nextbox}}% \hbox\bgroup - \edef\currentlocalboxes{#1}% + \cdef\currentlocalboxes{#1}% \uselocalboxesstyleandcolor\c!style\c!color \enforced\def\stoplocalbox{\removeunwantedspaces\egroup}% \ignorespaces} @@ -267,7 +267,7 @@ {\dontleavehmode \ifcsname\??localboxesattribute#1\endcsname \c_typo_localboxes_index\lastnamedcs - \edef\currentlocalboxes{#1}% + \cdef\currentlocalboxes{#1}% \edef\currentlocalboxeslocation{\localboxesparameter\c!location}% \ifx\currentlocalboxeslocation\v!right\localrightbox\orelse\ifx\currentlocalboxeslocation\v!left\localleftbox\else\localmiddlebox\fi index \c_typo_localboxes_index diff --git a/tex/context/base/mkxl/typo-plc.mkxl b/tex/context/base/mkxl/typo-plc.mkxl index e6e90db73..521a341a6 100644 --- a/tex/context/base/mkxl/typo-plc.mkxl +++ b/tex/context/base/mkxl/typo-plc.mkxl @@ -21,7 +21,7 @@ \permanent\protected\def\placeholder[#1]% {\begingroup - \edef\currentplaceholder{#1}% + \cdef\currentplaceholder{#1}% \placeholderparameter\c!before \useplaceholderstyleandcolor\c!style\c!color \placeholderparameter\c!text diff --git a/tex/context/base/mkxl/typo-pnc.mkxl b/tex/context/base/mkxl/typo-pnc.mkxl index aceab2685..686740c5c 100644 --- a/tex/context/base/mkxl/typo-pnc.mkxl +++ b/tex/context/base/mkxl/typo-pnc.mkxl @@ -28,7 +28,7 @@ \installcommandhandler \??periodkerning {periodkerning} \??periodkerning \permanent\protected\def\setperiodkerning[#1]% - {\edef\currentperiodkerning{#1}% + {\cdef\currentperiodkerning{#1}% \ifx\currentperiodkerning\s!reset \resetperiodkerning \else diff --git a/tex/context/base/mkxl/typo-rub.mkxl b/tex/context/base/mkxl/typo-rub.mkxl index 79760c328..8e5d12e7f 100644 --- a/tex/context/base/mkxl/typo-rub.mkxl +++ b/tex/context/base/mkxl/typo-rub.mkxl @@ -43,7 +43,7 @@ {\dontleavehmode \begingroup \enforced\let\ruby\noruby - \edef\currentruby{#1}% + \cdef\currentruby{#1}% \edef\p_location{\rubyparameter\c!location}% % \enforced\let|\relax \enforced\letcharcode\barasciicode\relax @@ -111,7 +111,7 @@ {\dontleavehmode \begingroup \enforced\aliased\startruby\begingroup - \edef\currentruby{#1}% + \cdef\currentruby{#1}% \clf_startruby align {\rubyparameter\c!align}% stretch {\rubyparameter\c!stretch}% diff --git a/tex/context/base/mkxl/typo-scr.mkxl b/tex/context/base/mkxl/typo-scr.mkxl index 159b0be6b..74abe5a45 100644 --- a/tex/context/base/mkxl/typo-scr.mkxl +++ b/tex/context/base/mkxl/typo-scr.mkxl @@ -76,7 +76,7 @@ \protected\def\typo_scripts_low[#1]#2% {\dontleavehmode \begingroup - \edef\currentlow{#1}% + \cdef\currentlow{#1}% \typo_scripts_distance\lowparameter \setbox\scratchbox\runninghbox\bgroup \lower\lowparameter\c!down\hbox\bgroup @@ -102,7 +102,7 @@ \protected\def\typo_scripts_high[#1]#2% {\dontleavehmode \begingroup - \edef\currenthigh{#1}% + \cdef\currenthigh{#1}% \typo_scripts_distance\highparameter \setbox\scratchbox\runninghbox\bgroup \raise\highparameter\c!up\hbox\bgroup @@ -162,7 +162,7 @@ \tolerant\protected\def\typo_scripts_lowhigh[#1]#*[#2]#:#3#4% todo: align .. [#1] is compatible hack {\dontleavehmode \runninghbox\bgroup - \edef\currentlowhigh{#1}% + \cdef\currentlowhigh{#1}% \typo_scripts_distance\lowhighparameter \dostarttagged\t!subsup\currentlowhigh \setbox\plusfour\hpack{\typo_scripts_lowhigh_low_high\lower\c!down\t!sub{#3}}% @@ -251,7 +251,7 @@ \protected\def\typo_scripts_lowmidhigh[#1]#2#3#4% {\dontleavehmode \runninghbox\bgroup - \edef\currentlowmidhigh{#1}% + \cdef\currentlowmidhigh{#1}% \dostarttagged\t!subsup\currentlowmidhigh \uselowmidhighstyleandcolor\c!style\c!color \setstrut diff --git a/tex/context/interface/mkii/keys-de.xml b/tex/context/interface/mkii/keys-de.xml index 13762dd50..80665a471 100644 --- a/tex/context/interface/mkii/keys-de.xml +++ b/tex/context/interface/mkii/keys-de.xml @@ -808,6 +808,7 @@ + @@ -928,6 +929,7 @@ + diff --git a/tex/context/interface/mkiv/context-en.xml b/tex/context/interface/mkiv/context-en.xml index 7062012f5..1c20b3a7c 100644 --- a/tex/context/interface/mkiv/context-en.xml +++ b/tex/context/interface/mkiv/context-en.xml @@ -48181,6 +48181,10 @@ + + + + diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf index 0a88e801a..989f3e3b8 100644 Binary files a/tex/context/interface/mkiv/i-context.pdf and b/tex/context/interface/mkiv/i-context.pdf differ diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf index 788e6ace3..8f7ce94bf 100644 Binary files a/tex/context/interface/mkiv/i-readme.pdf and b/tex/context/interface/mkiv/i-readme.pdf differ diff --git a/tex/context/interface/mkiv/i-verbatim.xml b/tex/context/interface/mkiv/i-verbatim.xml index 20f1bb873..6ac7d1a57 100644 --- a/tex/context/interface/mkiv/i-verbatim.xml +++ b/tex/context/interface/mkiv/i-verbatim.xml @@ -201,6 +201,10 @@ + + + + diff --git a/tex/context/modules/third/mtx-install-imp-tikz.lua b/tex/context/modules/third/mtx-install-imp-tikz.lua index 77b4d903f..33929bddb 100644 --- a/tex/context/modules/third/mtx-install-imp-tikz.lua +++ b/tex/context/modules/third/mtx-install-imp-tikz.lua @@ -22,7 +22,7 @@ local defaults = { "source/latex/**", "source/plain/**", - "source/generic/**", + -- "source/generic/**", } return { diff --git a/tex/context/sample/common/knuth-gpt.tex b/tex/context/sample/common/knuth-gpt.tex new file mode 100644 index 000000000..79cdca07a --- /dev/null +++ b/tex/context/sample/common/knuth-gpt.tex @@ -0,0 +1,4 @@ +It's amazing how the confident tone lends credibility to all of that +made-up nonsense. Almost impossible for anybody without knowledge +of the book to believe that those \quotation {facts} aren't authorititative +and well researched. diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index b6b76bd5b..a599128a5 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 : 2023-06-01 09:35 +-- merge date : 2023-06-04 18:54 do -- begin closure to overcome local limits and interference @@ -3331,6 +3331,7 @@ local p_prune_intospace=Cs (noleading*(notrailing+intospace+1 )^0 ) local p_retain_normal=Cs ((normalline+normalempty )^0 ) local p_retain_collapse=Cs ((normalline+doubleempty )^0 ) local p_retain_noempty=Cs ((normalline+singleempty )^0 ) +local p_collapse_all=Cs (stripstart*(stripend+((whitespace+newline)^1/" ")+1)^0 ) local striplinepatterns={ ["prune"]=p_prune_normal, ["prune and collapse"]=p_prune_collapse, @@ -3339,6 +3340,7 @@ local striplinepatterns={ ["retain"]=p_retain_normal, ["retain and collapse"]=p_retain_collapse, ["retain and no empty"]=p_retain_noempty, + ["collapse all"]=p_collapse_all, ["collapse"]=patterns.collapser, } setmetatable(striplinepatterns,{ __index=function(t,k) return p_prune_collapse end }) -- cgit v1.2.3