diff options
author | Hans Hagen <pragma@wxs.nl> | 2013-05-31 21:57:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2013-05-31 21:57:00 +0200 |
commit | f7eaca8dd3301d6526d1610e523d6538404dc95b (patch) | |
tree | d621802ad0b715387788654f2b581443ea2c2ccd /tex | |
parent | 5b7c7a51f408dbcce2a0926948c47e5bf045ed3d (diff) | |
download | context-f7eaca8dd3301d6526d1610e523d6538404dc95b.tar.gz |
beta 2013.05.31 21:57
Diffstat (limited to 'tex')
29 files changed, 172 insertions, 660 deletions
diff --git a/tex/context/base/anch-pos.lua b/tex/context/base/anch-pos.lua index 2697cecf4..5f46ee5dd 100644 --- a/tex/context/base/anch-pos.lua +++ b/tex/context/base/anch-pos.lua @@ -291,7 +291,7 @@ function jobpositions.e_col(tag) column = columns[#columns] end -function commands.bcolumn(tag,register) +function commands.bcolumn(tag,register) -- name will change insert(columns,tag) column = tag if register then @@ -299,7 +299,7 @@ function commands.bcolumn(tag,register) end end -function commands.ecolumn(register) +function commands.ecolumn(register) -- name will change if register then context(new_latelua(f_e_column())) end diff --git a/tex/context/base/attr-lay.mkiv b/tex/context/base/attr-lay.mkiv index 9c9c3318e..d4aae3060 100644 --- a/tex/context/base/attr-lay.mkiv +++ b/tex/context/base/attr-lay.mkiv @@ -98,8 +98,11 @@ \let\setlayoutcomponentattribute \attr_layoutcomponent_set \let\resetlayoutcomponentattribute\attr_layoutcomponent_reset} +\unexpanded\def\attr_layoutcomponent_cleanup + {\ctxcommand{cleanuplayers()}} + \appendtoks - \ctxcommand{cleanuplayers()}% + \attr_layoutcomponent_cleanup \to \everyshipout \protect \endinput diff --git a/tex/context/base/cldf-ini.lua b/tex/context/base/cldf-ini.lua index 4a7d9f025..2272c05ea 100644 --- a/tex/context/base/cldf-ini.lua +++ b/tex/context/base/cldf-ini.lua @@ -903,28 +903,36 @@ setmetatable(nested, { __index = indexer, __call = caller } ) -- verbatim -local verbatim = { } context.verbatim = verbatim +function context.newindexer(catcodes) + local handler = { } + + local function indexer(parent,k) + local command = context[k] + local f = function(...) + local savedcatcodes = contentcatcodes + contentcatcodes = catcodes + command(...) + contentcatcodes = savedcatcodes + end + parent[k] = f + return f + end -local function indexer(parent,k) - local command = context[k] - local f = function(...) + local function caller(parent,...) local savedcatcodes = contentcatcodes - contentcatcodes = vrbcatcodes - command(...) + contentcatcodes = catcodes + defaultcaller(parent,...) contentcatcodes = savedcatcodes end - parent[k] = f - return f -end -local function caller(parent,...) - local savedcatcodes = contentcatcodes - contentcatcodes = vrbcatcodes - defaultcaller(parent,...) - contentcatcodes = savedcatcodes + setmetatable(handler, { __index = indexer, __call = caller } ) + + return handler end -setmetatable(verbatim, { __index = indexer, __call = caller } ) +context.verbatim = context.newindexer(vrbcatcodes) +context.puretext = context.newindexer(txtcatcodes) +-------.protected = context.newindexer(prtcatcodes) -- formatted diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 7f241e357..24b56997e 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.05.28 00:36} +\newcontextversion{2013.05.31 21:57} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/cont-new.tmp b/tex/context/base/cont-new.tmp deleted file mode 100644 index 5d4fcd60a..000000000 --- a/tex/context/base/cont-new.tmp +++ /dev/null @@ -1,83 +0,0 @@ -%D \module -%D [ file=cont-new, -%D version=1995.10.10, -%D title=\CONTEXT\ Miscellaneous Macros, -%D subtitle=New Macros, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\newcontextversion{2013.05.28 00:34} - -%D This file is loaded at runtime, thereby providing an excellent place for -%D hacks, patches, extensions and new features. - -\unprotect - -% \writestatus\m!system{beware: some patches loaded from cont-new.mkiv} - -% \attribute152\zerocount : marks ... lots of sweeps so best early in list - -%D Maybe: - -\unexpanded\def\tightvbox{\dowithnextbox{\dp\nextbox\zeropoint\box\nextbox}\vbox} -\unexpanded\def\tightvtop{\dowithnextbox{\ht\nextbox\zeropoint\box\nextbox}\vtop} - -%D Maybe: - -% \startluacode -% function context.loadfile(filename) -% context(string.strip(io.loaddata(resolvers.findfile(filename)))) -% end -% \stopluacode -% -% \edef\tufte{\cldcommand{loadfile("tufte.tex")}} - -%D Needs some work: - -\unexpanded\def\startgridcorrection - {\dosingleempty\spac_grid_correction_start} - -\def\spac_grid_correction_start[#1]% - {\ifgridsnapping - \snaptogrid[#1]\vbox\bgroup - \else - \startbaselinecorrection - \fi} - -\unexpanded\def\stopgridcorrection - {\ifgridsnapping - \egroup - \else - \stopbaselinecorrection - \fi} - -\unexpanded\def\checkgridsnapping - {\lineskip\ifgridsnapping\zeropoint\else\normallineskip\fi} - -%D Probably obsolete: - -\unexpanded\def\startcolumnmakeup % don't change - {\bgroup - \getrawnoflines\textheight % raw as we cna have topskip - \setbox\scratchbox\vbox to \dimexpr\noflines\lineheight-\lineheight+\topskip\relax - \bgroup - \forgetall} - -\unexpanded\def\stopcolumnmakeup - {\egroup - \dp\scratchbox\zeropoint - \wd\scratchbox\textwidth - \box\scratchbox - \egroup - \page_otr_command_synchronize_hsize} - -%D Till we fixed all styles: - -\let\\=\crlf - -\protect \endinput diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 1c70a39fc..f5dd71f5f 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index eaa431122..168179f8a 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,8 +25,8 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.05.28 00:36} -\edef\contextkind {current} +\edef\contextversion{2013.05.31 21:57} +\edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/context.tmp b/tex/context/base/context.tmp deleted file mode 100644 index 7976b4641..000000000 --- a/tex/context/base/context.tmp +++ /dev/null @@ -1,513 +0,0 @@ -%D \module -%D [ file=context, -%D version=2008.28.10, % 1995.10.10, -%D title=\CONTEXT, -%D subtitle=\CONTEXT\ Format Generation, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -\catcode`\{=1 \catcode`\}=2 \catcode`\#=6 - -%D From the next string (which is set by the script that assembles the -%D distribution) later on we will calculate a number that can be used -%D by use modules to identify the feature level. Starting with version -%D 2004.8.30 the low level interface is english. Watch out and adapt -%D your styles an modules. - -% \everypar{\writestatus{!!!!}{some spurious input in line \the\inputlineno}\wait} - -%D The order of loading will change when all modules have been cleaned -%D up and the dependencies are more consistent. - -\edef\contextformat {\jobname} -\edef\contextversion{2013.05.28 00:34} -\edef\contextkind {beta} - -%D For those who want to use this: - -\let\fmtname \contextformat -\let\fmtversion\contextversion - -%D Loading: - -\edef\mksuffix {mkiv} -\edef\contextmark{MKIV} - -\ifx\normalinput\undefined \let\normalinput\input \fi - -\def\loadcorefile#1{\normalinput#1\relax} -\def\loadmarkfile#1{\normalinput#1.\mksuffix\relax} -\def\loadmkiifile#1{} -\def\loadmkivfile#1{\normalinput#1.mkiv\relax} -\def\loadmkvifile#1{\normalinput#1.mkvi\relax} - -%D First we load the system modules. These implement a lot of -%D manipulation macros. We start with setting up some basic \TEX\ -%D machinery. - -\loadmarkfile{syst-ini} - -%D Some checking (more primitives are now defined): - -\ifdefined\defaultinterface \else \def\defaultinterface {english} \fi -%ifdefined\messageinterface \else \let\messageinterface \defaultinterface \fi -\ifdefined\defaultlanguagetag \else \def\defaultlanguagetag{en} \fi - -%D We just quit if new functionality is expected. - -\ifnum\luatexversion<70 % also change message - \writestatus{!!!!}{Your luatex binary is too old, you need at least version 0.70!} - \expandafter\end -\fi - -%D There is only this way to pass the version info to \LUA\ (currently). Hm, we could -%D now put it into the environment. - -\newtoks\contextversiontoks \contextversiontoks\expandafter{\contextversion} -\newtoks\contextkindtoks \contextkindtoks \expandafter{\contextkind} - -% \normaleverypar{\wait} % uncomment for test of funny injections - -%D Now the more fundamental code gets defined. - -\loadmarkfile{norm-ctx} -\loadmarkfile{syst-pln} -\loadmarkfile{syst-mes} - -\loadmarkfile{luat-cod} -\loadmarkfile{luat-bas} -\loadmarkfile{luat-lib} - -\loadmarkfile{catc-ini} -\loadmarkfile{catc-act} -\loadmarkfile{catc-def} -\loadmarkfile{catc-ctx} -\loadmarkfile{catc-sym} - -\loadmarkfile{cldf-ini} - -% From here on we have \unexpanded being \normalprotected, as we already had -% \unexpanded long before etex came around. - -\loadmarkfile{syst-aux} -\loadmarkfile{syst-lua} -\loadmarkfile{syst-con} - -\loadmarkfile{syst-fnt} -\loadmarkfile{syst-rtp} - -\loadmkvifile{file-ini} -\loadmkvifile{file-res} -\loadmkvifile{file-lib} - -\loadmarkfile{supp-dir} - -\loadmarkfile{char-ini} -\loadmarkfile{char-utf} -\loadmarkfile{char-act} - -\loadmarkfile{mult-ini} -\loadmarkfile{mult-sys} -\loadmarkfile{mult-aux} -\loadmarkfile{mult-def} -\loadmarkfile{mult-chk} -%loadmarkfile{mult-aux} % moved up -\loadmkvifile{mult-dim} - -\loadmarkfile{cldf-int} % interface - -\loadmarkfile{luat-ini} - -\loadmarkfile{toks-ini} - -\loadmarkfile{attr-ini} - -\loadmarkfile{core-ini} -\loadmarkfile{core-env} - -\loadmarkfile{layo-ini} - -\loadmarkfile{node-ini} - -\loadmarkfile{cldf-bas} % basics / depends on nodes - -\loadmarkfile{node-fin} -\loadmarkfile{node-mig} -\loadmarkfile{typo-bld} % par builders -%loadmarkfile{node-pag} - -\loadmarkfile{back-ini} - -\loadmarkfile{attr-col} -\loadmarkfile{attr-lay} -\loadmarkfile{attr-neg} -\loadmarkfile{attr-eff} -\loadmarkfile{attr-mkr} - -\loadmarkfile{trac-tex} -\loadmarkfile{trac-deb} % will move up -\loadmarkfile{trac-ctx} % maybe move up - -%loadmarkfile{blob-ini} % not to be used, we only use a helper - -\loadmarkfile{supp-box} - -%loadmarkfile{supp-vis} % replaced by trac-vis -%loadmarkfile{supp-fun} % mostly replaced - -\loadmarkfile{supp-ran} -\loadmarkfile{supp-mat} -\loadmarkfile{spac-cha} -%loadmarkfile{supp-num} % obsolete - -\loadmarkfile{typo-ini} - -\loadmkvifile{file-syn} -\loadmkvifile{file-mod} - -\loadmarkfile{core-con} - -\loadmarkfile{cont-fil} - -\loadmarkfile{regi-ini} -\loadmarkfile{enco-ini} -\loadmarkfile{hand-ini} - -\loadmarkfile{lang-ini} -\loadmarkfile{lang-lab} - -\loadmarkfile{unic-ini} - -\loadmarkfile{core-uti} -\loadmarkfile{core-two} -\loadmarkfile{core-dat} - -\loadmarkfile{colo-ini} -\loadmarkfile{colo-grp} % optional -\loadmarkfile{colo-ext} - -\loadmarkfile{node-bck} % overloads anch-pgr (experimental and undocumented) - -\loadmarkfile{pack-cut} % leftovers from trac-vis - -\loadmarkfile{lang-mis} -\loadmarkfile{lang-url} -\loadmarkfile{lang-def} - -\loadmkvifile{file-job} % why so late? - -\loadmarkfile{symb-ini} % brrr depends on fonts - -\loadmarkfile{sort-ini} - -\loadmkvifile{pack-mis} -\loadmarkfile{pack-rul} -\loadmarkfile{pack-mrl} -\loadmkvifile{pack-bck} -\loadmarkfile{pack-fen} - -\loadmarkfile{lxml-ini} -\loadmarkfile{lxml-sor} - -\loadmkvifile{typo-prc} - -\loadmkvifile{strc-ini} -\loadmarkfile{strc-tag} -\loadmarkfile{strc-doc} -\loadmarkfile{strc-num} -\loadmarkfile{strc-mar} -\loadmarkfile{strc-sbe} -\loadmkvifile{strc-lst} -\loadmarkfile{strc-sec} -\loadmarkfile{strc-pag} % hm, depends on core-num -\loadmarkfile{strc-ren} -\loadmarkfile{strc-xml} -\loadmarkfile{strc-def} % might happen later -\loadmkvifile{strc-ref} -\loadmarkfile{strc-reg} -\loadmkvifile{strc-lev} % experiment - -\loadmarkfile{spac-ali} -\loadmarkfile{spac-hor} -\loadmarkfile{spac-flr} -\loadmarkfile{spac-ver} -\loadmarkfile{spac-lin} -\loadmarkfile{spac-pag} -\loadmarkfile{spac-par} -%loadmarkfile{spac-adj} % no longer needed -\loadmarkfile{spac-def} -\loadmarkfile{spac-grd} - -\loadmarkfile{anch-pos} - -\loadmkvifile{scrn-ini} -\loadmkvifile{scrn-ref} - -\loadmarkfile{pack-obj} - -\loadmkvifile{strc-itm} - -\loadmkvifile{strc-con} -\loadmkvifile{strc-des} -\loadmkvifile{strc-enu} - -\loadmarkfile{strc-ind} -\loadmarkfile{strc-lab} -\loadmarkfile{strc-syn} - -\loadmarkfile{core-sys} - -\loadmarkfile{page-var} -\loadmkvifile{page-otr} -\loadmarkfile{page-ini} -\loadmarkfile{page-ins} -\loadmarkfile{page-fac} -\loadmarkfile{page-brk} -\loadmarkfile{page-col} -\loadmarkfile{page-inf} -\loadmarkfile{page-grd} -\loadmarkfile{page-flt} -\loadmarkfile{page-bck} -\loadmarkfile{page-not} -\loadmarkfile{page-one} -\loadmarkfile{page-lay} -\loadmkvifile{page-box} -\loadmkvifile{page-txt} -\loadmarkfile{page-sid} % when - -\loadmkvifile{strc-flt} - -\loadmarkfile{page-pst} -\loadmkvifile{page-mbk} -\loadmarkfile{page-mul} % partly overloaded -\loadmarkfile{page-mix} % new -\loadmarkfile{page-set} -\loadmarkfile{pack-lyr} -\loadmarkfile{pack-pos} -\loadmkvifile{page-mak} - -\loadmarkfile{page-lin} -\loadmarkfile{page-par} -\loadmarkfile{typo-pag} -\loadmarkfile{typo-mar} -\loadmarkfile{typo-itm} - -\loadmarkfile{buff-ini} -\loadmarkfile{buff-ver} -\loadmkvifile{buff-par} - -\loadmarkfile{buff-imp-tex} % optional as also runtime if not loaded -\loadmarkfile{buff-imp-mp} % optional as also runtime if not loaded -\loadmarkfile{buff-imp-lua} % optional as also runtime if not loaded -\loadmarkfile{buff-imp-xml} % optional as also runtime if not loaded - -\loadmarkfile{buff-imp-parsed-xml} % optional -%loadmarkfile{buff-imp-parsed-lua} % optional - -\loadmarkfile{strc-blk} - -\loadmarkfile{page-imp} -\loadmkvifile{page-sel} % optional -\loadmkvifile{page-inj} % optional - -\loadmkvifile{scrn-pag} -\loadmkvifile{scrn-wid} -\loadmkvifile{scrn-but} -\loadmkvifile{scrn-bar} - -\loadmarkfile{page-com} % optional (after scrn-pag) - -\loadmarkfile{strc-bkm} % bookmarks - -\loadmarkfile{tabl-com} -\loadmarkfile{tabl-pln} - -\loadmarkfile{tabl-tab} % thrd-tab stripped and merged - -\loadmarkfile{tabl-tbl} -\loadmarkfile{tabl-ntb} -\loadmarkfile{tabl-nte} -\loadmarkfile{tabl-ltb} -\loadmarkfile{tabl-tsp} -\loadmkvifile{tabl-xtb} -\loadmarkfile{tabl-mis} - -\loadmarkfile{java-ini} - -\loadmkvifile{scrn-fld} -\loadmkvifile{scrn-hlp} - -\loadmarkfile{char-enc} % will move up - -\loadmkvifile{font-lib} % way too late -\loadmkvifile{font-fil} -\loadmkvifile{font-var} -\loadmkvifile{font-fea} -\loadmkvifile{font-mat} -\loadmkvifile{font-ini} -\loadmkvifile{font-sym} -\loadmkvifile{font-sty} -\loadmkvifile{font-set} -\loadmkvifile{font-emp} -\loadmarkfile{font-pre} -\loadmarkfile{font-unk} -\loadmarkfile{font-tra} -\loadmarkfile{font-chk} -\loadmarkfile{font-uni} -\loadmkvifile{font-col} -\loadmkvifile{font-gds} -\loadmkvifile{font-aux} - -\loadmarkfile{typo-lan} - -\loadmarkfile{lxml-css} - -\loadmarkfile{spac-chr} % depends on fonts - -\loadmarkfile{blob-ini} % not to be used, we only use a helper - -\loadmarkfile{trac-vis} -\loadmarkfile{trac-jus} - -\loadmarkfile{typo-cln} -\loadmarkfile{typo-spa} -\loadmarkfile{typo-krn} -\loadmkvifile{typo-itc} -\loadmarkfile{typo-dir} -\loadmarkfile{typo-brk} -\loadmarkfile{typo-cap} -\loadmarkfile{typo-dig} -\loadmarkfile{typo-rep} -\loadmkvifile{typo-txt} -\loadmarkfile{typo-par} - -\loadmkvifile{type-ini} -\loadmarkfile{type-set} - -\loadmarkfile{scrp-ini} - -\loadmarkfile{lang-wrd} % can be optional (discussion with mm sideeffect) -%loadmarkfile{lang-rep} % can be optional (bt 2013 side effect) - -\loadmarkfile{prop-ini} % only for downward compatibility - -\loadmarkfile{mlib-ctx} - -\loadmarkfile{meta-ini} -\loadmarkfile{meta-tex} -\loadmarkfile{meta-fun} -\loadmarkfile{meta-pag} -\loadmarkfile{meta-grd} - -\loadmarkfile{page-mrk} % depends on mp - -\loadmarkfile{page-flw} -\loadmarkfile{page-spr} -\loadmarkfile{page-plg} -\loadmarkfile{page-str} - -\loadmarkfile{anch-pgr} % can be moved up (nicer for dependencies) -\loadmkvifile{anch-bck} -\loadmarkfile{anch-tab} % overloads tabl-tbl -\loadmarkfile{anch-bar} -%loadmarkfile{anch-snc} % when needed this one will be redone - -\loadmarkfile{math-ini} -\loadmarkfile{math-pln} -\loadmarkfile{math-for} -\loadmarkfile{math-def} -\loadmarkfile{math-ali} -%loadmarkfile{math-arr} -\loadmkvifile{math-stc} -\loadmarkfile{math-frc} -\loadmarkfile{math-mis} -\loadmarkfile{math-scr} -\loadmarkfile{math-int} -\loadmarkfile{math-del} -\loadmarkfile{math-fen} -\loadmarkfile{math-inl} -\loadmarkfile{math-dis} -%loadmarkfile{math-lan} - -\loadmarkfile{phys-dim} - -\loadmarkfile{strc-mat} - -\loadmarkfile{chem-ini} -\loadmarkfile{chem-str} - -\loadmarkfile{typo-scr} - -\loadmarkfile{node-rul} -\loadmkvifile{font-sol} % font solutions - -\loadmkvifile{strc-not} -\loadmkvifile{strc-lnt} - -\loadmarkfile{pack-com} -\loadmarkfile{typo-del} - -\loadmarkfile{grph-trf} -\loadmarkfile{grph-inc} -\loadmarkfile{grph-fig} -\loadmarkfile{grph-raw} - -\loadmarkfile{pack-box} -\loadmarkfile{pack-bar} -\loadmarkfile{page-app} -\loadmarkfile{meta-fig} - -\loadmarkfile{lang-spa} % will become obsolete - -\loadmarkfile{bibl-bib} -\loadmarkfile{bibl-tra} - -%loadmarkfile{x-xtag} % no longer preloaded - -\loadmarkfile{meta-xml} - -\loadmarkfile{cont-log} - -\loadmarkfile{task-ini} - -\loadmarkfile{cldf-ver} % verbatim, this can come late -\loadmarkfile{cldf-com} % commands, this can come late - -\loadmarkfile{core-ctx} % this order might change but we need to check depedencies / move to another namespace - -\loadmarkfile{core-def} - -%usemodule[x][res-04] % xml resource libraries -%usemodule[x][res-08] % rlx runtime conversion -%usemodule[x][res-12] % rli external indentification - -% now we hook in backend code (needs checking) - -\loadmarkfile{back-pdf} % actually, this one should load the next three using document.arguments.backend -\loadmarkfile{mlib-pdf} -\loadmarkfile{mlib-pps} -\loadmarkfile{meta-pdf} -\loadmarkfile{grph-epd} - -\loadmarkfile{back-exp} - -\setupcurrentlanguage[\defaultlanguagetag] - -\prependtoks - \ctxlua{statistics.starttiming(statistics)}% -\to \everyjob - -\appendtoks - \ctxlua{statistics.stoptiming(statistics)}% -\to \everyjob - -\appendtoks - \ctxlua{statistics.savefmtstatus("\jobname","\contextversion","context.mkiv","\contextkind")}% can become automatic -\to \everydump - -\errorstopmode \dump \endinput diff --git a/tex/context/base/font-ctx.lua b/tex/context/base/font-ctx.lua index 2583c6520..63d10d007 100644 --- a/tex/context/base/font-ctx.lua +++ b/tex/context/base/font-ctx.lua @@ -1646,13 +1646,13 @@ local hows = { ["="] = "replace", } -function commands.feature(how,parent,name,font) - if not how then +function commands.feature(how,parent,name,font) -- 0/1 test temporary for testing + if not how or how == 0 then if trace_features and texattribute[0] ~= 0 then report_cummulative("font %!font:name!, reset",fontdata[font or true]) end texattribute[0] = 0 - elseif how == true then + elseif how == true or how == 1 then local hash = "feature > " .. parent local done = cache[hash] if trace_features and done then diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index c1f2f14fc..401de4bda 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -1934,8 +1934,9 @@ local function copytotfm(data,cache_id) local units = metadata.units_per_em or 1000 -- if units == 0 then -- catch bugs in fonts - units = 1000 + units = 1000 -- maybe 2000 when ttf metadata.units_per_em = 1000 + report_otf("changing %a units to %a",0,units) end -- parameters.slant = 0 diff --git a/tex/context/base/font-pre.mkiv b/tex/context/base/font-pre.mkiv index b03abed7d..ef3694c2b 100644 --- a/tex/context/base/font-pre.mkiv +++ b/tex/context/base/font-pre.mkiv @@ -523,7 +523,7 @@ %D %D For tracing purposes we define: -\definefont[tinyfont][Mono at 1ex] +\definefont[tinyfont][dejavusansmono at 1ex] %D \macros %D {infofont} @@ -535,7 +535,7 @@ \let\infofont\relax % satisfy dep checker -\definefont [infofont] [Mono at 6pt] % todo \the\everybodyfont +\definefont[infofont][dejavusansmono at 6pt] % todo \the\everybodyfont \protect \endinput diff --git a/tex/context/base/lxml-tab.lua b/tex/context/base/lxml-tab.lua index 2bb5844fc..9d2266886 100644 --- a/tex/context/base/lxml-tab.lua +++ b/tex/context/base/lxml-tab.lua @@ -34,6 +34,8 @@ as the current variant was written when <l n='lpeg'/> showed up and it's easier build tables in one go.</p> --ldx]]-- +lpeg.setmaxstack(1000) -- deeply nested xml files + xml = xml or { } local xml = xml @@ -627,7 +629,6 @@ local publicdoctype = doctypename * somespace * P("PUBLIC") * somespace * val local systemdoctype = doctypename * somespace * P("SYSTEM") * somespace * value * somespace * doctypeset local simpledoctype = (1-close)^1 -- * balanced^0 local somedoctype = C((somespace * (publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0) -local somedoctype = C((somespace * (publicdoctype + systemdoctype + definitiondoctype + simpledoctype) * optionalspace)^0) local instruction = (spacing * begininstruction * someinstruction * endinstruction) / function(...) add_special("@pi@",...) end local comment = (spacing * begincomment * somecomment * endcomment ) / function(...) add_special("@cm@",...) end diff --git a/tex/context/base/m-graph.mkiv b/tex/context/base/m-graph.mkiv index c15262cac..e99921c43 100644 --- a/tex/context/base/m-graph.mkiv +++ b/tex/context/base/m-graph.mkiv @@ -64,14 +64,7 @@ \c!method=\s!double] \startMPdefinitions{graph} - if unknown context_grap: input "mp-grap.mpiv" ; fi ; -\stopMPdefinitions - -% For backwards compatibility (for the moment), also load the graph macros in -% the standard MP instance (scaled integer): - -\startMPdefinitions - if unknown context_grap: input "mp-grap.mpiv" ; fi ; + if unknown context_grap : input mp-grap.mpiv ; fi ; \stopMPdefinitions \protect diff --git a/tex/context/base/mtx-context-xml.tex b/tex/context/base/mtx-context-xml.tex new file mode 100644 index 000000000..63b1d6e9e --- /dev/null +++ b/tex/context/base/mtx-context-xml.tex @@ -0,0 +1,75 @@ +%D \module +%D [ file=mtx-context-xml, +%D version=2013.05.30, +%D title=\CONTEXT\ Extra Trickry, +%D subtitle=Analyzing XML files, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +% This module replaces mkii analyzers. + +% begin help +% +% usage: context --extra=xml [options] list-of-files +% +% --analyze : show elements and characters +% --topspace=dimension : distance above first line +% --backspace=dimension : distance before left margin +% --bodyfont=list : additional bodyfont settings +% --paperformat=spec : paper*print or paperxprint +% +% end help + +\input mtx-context-common.tex + +\setupbodyfont + [dejavu,11pt,tt,\getdocumentargument{bodyfont}] + +\setuptyping + [lines=yes] + +\setuplayout + [header=0cm, + footer=1.5cm, + topspace=\getdocumentargumentdefault{topspace}{1.5cm}, + backspace=\getdocumentargumentdefault{backspace}{1.5cm}, + width=middle, + height=middle] + +\setuppapersize + [\getdocumentargument{paperformat_paper}] + [\getdocumentargument{paperformat_print}] + +\usemodule[xml-analyzers] + +\starttext + +\startluacode + local pattern = document.arguments.pattern + local files = document.files + + if pattern then + files = dir.glob(pattern) + context.setupfootertexts( { pattern }, { "pagenumber" }) + else + context.setupfootertexts( { table.concat(files," ") }, { "pagenumber" }) + end + + if #files > 0 then + if document.arguments.analyze then + moduledata.xml.analyzers.structure (files) + moduledata.xml.analyzers.characters(files) + else + context("no action given") + end + else + context("no files given") + end +\stopluacode + +\stoptext diff --git a/tex/context/base/page-mix.lua b/tex/context/base/page-mix.lua index cf0094787..f265ac8f9 100644 --- a/tex/context/base/page-mix.lua +++ b/tex/context/base/page-mix.lua @@ -282,7 +282,6 @@ local function setsplit(specification) -- a rather large function if column == nofcolumns then column = 0 -- nicer in trace rest = head - -- lasthead = head return false, 0 else local skipped @@ -290,7 +289,6 @@ local function setsplit(specification) -- a rather large function result = results[column] current, skipped = discardtopglue(current,discarded) head = current - -- lasthead = head return true, skipped end end @@ -324,7 +322,7 @@ local function setsplit(specification) -- a rather large function while current do local id = current.id local nxt = current.next -local lastcolumn = column + local lastcolumn = column if id == hlist_code or id == vlist_code then line = line + 1 local nxtid = nxt and nxt.id @@ -417,9 +415,9 @@ local lastcolumn = column -- club and widow and such i.e. resulting penalties (if we care) end end -if lastcolumn == column then - nxt = current.next -- can have changed -end + if current then -- lastcolumn == column then + nxt = current.next -- can have changed + end if nxt then current = nxt elseif head == lasthead then diff --git a/tex/context/base/s-fonts-features.mkiv b/tex/context/base/s-fonts-features.mkiv index 8982f7347..b81b53a71 100644 --- a/tex/context/base/s-fonts-features.mkiv +++ b/tex/context/base/s-fonts-features.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\startmodule[s-fonts-features] +\startmodule[fonts-features] \registerctxluafile{s-fonts-features}{} diff --git a/tex/context/base/s-fonts-goodies.mkiv b/tex/context/base/s-fonts-goodies.mkiv index f07081825..e596507af 100644 --- a/tex/context/base/s-fonts-goodies.mkiv +++ b/tex/context/base/s-fonts-goodies.mkiv @@ -13,7 +13,7 @@ %D More tables will follow here as we have many more goodies by now. -\startmodule[s-fonts-goodies] +\startmodule[fonts-goodies] \registerctxluafile{s-fonts-goodies}{} diff --git a/tex/context/base/s-fonts-missing.lua b/tex/context/base/s-fonts-missing.lua index 829fed45f..9a75676a9 100644 --- a/tex/context/base/s-fonts-missing.lua +++ b/tex/context/base/s-fonts-missing.lua @@ -14,17 +14,12 @@ local function legend(id) local privates = c.properties.privates if privates then local categories = table.swapped(fonts.loggers.category_to_placeholder) - -- context.starttabulate { "|l|c|c|l|" } - context.starttabulate { "|l|c|l|" } + context.starttabulate { "|c|l|" } context.HL() context.NC() - context.bold("name") - context.NC() context.bold("symbol") context.NC() - -- context.bold("node") - -- context.NC() - context.bold("category") + context.bold("name") context.NC() context.NR() context.HL() @@ -32,15 +27,10 @@ local function legend(id) local tag = characters.categorytags[categories[k]] if tag and tag ~= "" then context.NC() - context(k) - context.NC() context.dontleavehmode() context.char(v) context.NC() - -- context.dontleavehmode() - -- commands.getprivatechar(k) - -- context.NC() - context(string.lower(tag)) + context(k) context.NC() context.NR() end diff --git a/tex/context/base/s-fonts-missing.mkiv b/tex/context/base/s-fonts-missing.mkiv index 6acef819e..c566f4995 100644 --- a/tex/context/base/s-fonts-missing.mkiv +++ b/tex/context/base/s-fonts-missing.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\startmodule[s-fonts-missing] +\startmodule[fonts-missing] \registerctxluafile{s-fonts-missing}{} diff --git a/tex/context/base/s-fonts-shapes.mkiv b/tex/context/base/s-fonts-shapes.mkiv index 56e3d80a7..f8eb8ffdd 100644 --- a/tex/context/base/s-fonts-shapes.mkiv +++ b/tex/context/base/s-fonts-shapes.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\startmodule[s-fonts-shapes] +\startmodule[fonts-shapes] \registerctxluafile{s-fonts-shapes}{} diff --git a/tex/context/base/s-fonts-tables.mkiv b/tex/context/base/s-fonts-tables.mkiv index 98f9052ca..e962f952d 100644 --- a/tex/context/base/s-fonts-tables.mkiv +++ b/tex/context/base/s-fonts-tables.mkiv @@ -13,7 +13,7 @@ % todo: make a mtxrun --script font <name> option -\startmodule[s-fonts-tables] +\startmodule[fonts-tables] \registerctxluafile{s-fonts-tables}{} diff --git a/tex/context/base/s-fonts-vectors.mkiv b/tex/context/base/s-fonts-vectors.mkiv index 371a30cc5..2605fe964 100644 --- a/tex/context/base/s-fonts-vectors.mkiv +++ b/tex/context/base/s-fonts-vectors.mkiv @@ -13,7 +13,7 @@ %D This code is used in the \MKIV\ fonts manual. -\startmodule[s-fonts-vectors] +\startmodule[fonts-vectors] \registerctxluafile{s-fonts-vectors}{} diff --git a/tex/context/base/s-sql-tables.mkiv b/tex/context/base/s-sql-tables.mkiv index 6f507e8b5..122570874 100644 --- a/tex/context/base/s-sql-tables.mkiv +++ b/tex/context/base/s-sql-tables.mkiv @@ -13,7 +13,7 @@ % for the moment no helpers -\startmodule[s-sql-tables] +\startmodule[sql-tables] \registerctxluafile{s-sql-tables}{} diff --git a/tex/context/base/spac-ali.mkiv b/tex/context/base/spac-ali.mkiv index 0f9b21186..65792e966 100644 --- a/tex/context/base/spac-ali.mkiv +++ b/tex/context/base/spac-ali.mkiv @@ -553,6 +553,20 @@ \fi \raggedcommand} +% experiment + +\unexpanded\def\spac_align_use_later#1% + {\begingroup + \edef\m_spac_align_asked{#1}% + \expandafter\let\expandafter\raggedcommand\csname\??alignmentnormalcache\m_spac_align_asked\endcsname + \ifx\raggedcommand\relax + \spac_align_add_to_cache + \fi + \endgroup} + +\unexpanded\def\spac_align_use_now#1% + {\csname\??alignmentnormalcache#1\endcsname} + % The keywords: \unexpanded\def\installalign#1#2% beware: commands must be unexpandable! diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 097fe5a2d..996b7ae13 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex f727ca843..6a18ef05b 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/tabl-tbl.mkiv b/tex/context/base/tabl-tbl.mkiv index 2fa8c4805..8bc0624e6 100644 --- a/tex/context/base/tabl-tbl.mkiv +++ b/tex/context/base/tabl-tbl.mkiv @@ -48,6 +48,7 @@ % p p(dimen) of automatisch als alleen p % w column width % f font#1 +% A {alignmentoptions} % B bold % I italic % S slanted @@ -458,6 +459,9 @@ \bgroup % we cannot combine the if because a cell may have only one ## \tabl_tabulate_hook_b \c_tabl_tabulate_align\constantnumber\c_tabl_tabulate_align % needed in tag passing + \ifx\m_tabl_tabulate_alignment\empty \else + \spac_align_use_now{\m_tabl_tabulate_alignment}% + \fi \noexpand\dostarttagged\noexpand\t!tabulatecell\noexpand\empty \noexpand\dotagtabulatecell \noexpand#1% @@ -554,6 +558,7 @@ \installtabulatepreambleoption{d}{\t_tabl_tabulate_settings\expandafter{\the\t_tabl_tabulate_settings\fixedspaces}% \tabl_tabulate_set_preamble} \installtabulatepreambleoption{ }{\tabl_tabulate_set_preamble} +\installtabulatepreambleoption{A}{\tabl_tabulate_set_alignment} % We no longer deal with '~' here but map it onto 'd' instead. Of course % we could prefix a key with \type {\meaning} instead, which works ok (and @@ -643,6 +648,11 @@ \c_tabl_tabulate_modus\zerocount \tabl_tabulate_pickup_width} +\def\tabl_tabulate_set_alignment#1% + {\edef\m_tabl_tabulate_alignment{#1}% + \spac_align_use_later\m_tabl_tabulate_alignment + \tabl_tabulate_set_preamble} + \def\tabl_tabulate_set_paragraph {\doifnextparenthesiselse {\c_tabl_tabulate_modus\plusone @@ -743,6 +753,7 @@ \t_tabl_tabulate_emath\emptytoks \t_tabl_tabulate_font\emptytoks \t_tabl_tabulate_settings\emptytoks + \global\let\m_tabl_tabulate_alignment\empty \global\let\m_tabl_tabulate_color\empty \global\let\m_tabl_tabulate_text_color\empty \global\let\m_tabl_tabulate_vrule_color\empty diff --git a/tex/context/base/x-set-12.mkiv b/tex/context/base/x-set-12.mkiv index bfeb0ab54..6590bfe9e 100644 --- a/tex/context/base/x-set-12.mkiv +++ b/tex/context/base/x-set-12.mkiv @@ -12,6 +12,19 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. +% included loading overhead +% +% 2.55 / 2.40 (luatex) +% 1.90 / 1.80 (luajittex) + +% \newif\ifcachedcommand +% \newif\ifcalledcommand +% +% \cachedcommandtrue +% \calledcommandtrue +% +% \usemodule[speedtest] + \usemodule[set-11] \unprotect diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index cf5862ca9..aa3b3958b 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 : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 05/28/13 00:34:00 +-- merge date : 05/31/13 21:57:24 do -- begin closure to overcome local limits and interference @@ -6718,8 +6718,9 @@ local function copytotfm(data,cache_id) local fullname=metadata.fullname or fontname local units=metadata.units_per_em or 1000 if units==0 then - units=1000 + units=1000 metadata.units_per_em=1000 + report_otf("changing %a units to %a",0,units) end parameters.slant=0 parameters.space=spaceunits |