From f56f0054360a9bdfb57de9abcf0d81a2766c22b9 Mon Sep 17 00:00:00 2001 From: Marius Date: Fri, 22 Oct 2010 18:00:11 +0300 Subject: beta 2010.10.22 16:46 --- tex/context/base/bibl-tra.lua | 6 ++ tex/context/base/bibl-tra.mkiv | 18 ++++-- tex/context/base/cont-new.tex | 2 +- tex/context/base/context.tex | 2 +- tex/context/base/lxml-ini.mkiv | 2 + tex/context/base/lxml-tex.lua | 16 +++++ tex/context/base/m-steps.mkii | 83 ------------------------ tex/context/base/m-steps.mkiv | 20 ------ tex/context/base/mult-chk.lua | 4 +- tex/context/base/strc-des.mkiv | 9 ++- tex/context/base/util-prs.lua | 4 ++ tex/context/base/x-steps.mkii | 85 +++++++++++++++++++++++++ tex/context/base/x-steps.mkiv | 99 +++++++++++++++++++++++++++++ tex/generic/context/luatex-fonts-merged.lua | 2 +- 14 files changed, 235 insertions(+), 117 deletions(-) delete mode 100644 tex/context/base/m-steps.mkii delete mode 100644 tex/context/base/m-steps.mkiv create mode 100644 tex/context/base/x-steps.mkii create mode 100644 tex/context/base/x-steps.mkiv (limited to 'tex') diff --git a/tex/context/base/bibl-tra.lua b/tex/context/base/bibl-tra.lua index f901b1f0a..afc42a610 100644 --- a/tex/context/base/bibl-tra.lua +++ b/tex/context/base/bibl-tra.lua @@ -100,6 +100,12 @@ function hacks.flush(sortvariant) end end +function hacks.filterall() + for i=1,#registered do + list[i] = { registered[i], i } + end +end + function hacks.registerplaced(str) used[str] = true end diff --git a/tex/context/base/bibl-tra.mkiv b/tex/context/base/bibl-tra.mkiv index a0ef32c82..fba750d82 100644 --- a/tex/context/base/bibl-tra.mkiv +++ b/tex/context/base/bibl-tra.mkiv @@ -816,16 +816,20 @@ \def\doprocessbibtexentry#1{\typesetapublication{#1}} \def\typesetpubslist - {\dobeginoflist + {\preloadbiblist + \dobeginoflist % \the\initializebibdefinitions % COMMENTED \edef\currentlist{pubs}% - \doif{\listparameter\c!criterium}\v!cite{\setuplist[pubs][\c!criterium=\v!here]}% \ctxlua{bibtex.hacks.reset(\number\bibtexoncemode)}% - \placestructurelist - {pubs}% - {\listparameter\c!criterium}% - {\listparameter\c!number}% - {\listparameter\c!extras}% + \doifelse{\listparameter\c!criterium}\v!all + {\ctxlua{bibtex.hacks.filterall()}} + {\doif{\listparameter\c!criterium}\v!cite + {\setuplist[pubs][\c!criterium=\v!here]}% + \placestructurelist + {pubs}% + {\listparameter\c!criterium}% + {\listparameter\c!number}% + {\listparameter\c!extras}}% \ctxlua{bibtex.hacks.flush("\@@pbsorttype")}% \doendoflist} diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index c56403015..f429b372f 100644 --- a/tex/context/base/cont-new.tex +++ b/tex/context/base/cont-new.tex @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2010.10.22 10:10} +\newcontextversion{2010.10.22 16:46} %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/context.tex b/tex/context/base/context.tex index ffa707bd2..3ec7d4bc8 100644 --- a/tex/context/base/context.tex +++ b/tex/context/base/context.tex @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2010.10.22 10:10} +\edef\contextversion{2010.10.22 16:46} %D For those who want to use this: diff --git a/tex/context/base/lxml-ini.mkiv b/tex/context/base/lxml-ini.mkiv index fc6381b3a..041a2017e 100644 --- a/tex/context/base/lxml-ini.mkiv +++ b/tex/context/base/lxml-ini.mkiv @@ -91,6 +91,8 @@ \def\xmlloaddirectives #1{\ctxlua{lxml.directives.load("any:///#1")}} \def\xmlpos #1{\ctxlua{lxml.pos("#1")}} +\def\xmltoparameters #1{\ctxlua{lxml.toparameters("#1")}} + % kind of special: \def\xmlstartraw{\ctxlua{lxml.startraw()}} diff --git a/tex/context/base/lxml-tex.lua b/tex/context/base/lxml-tex.lua index 407d5eda8..0bf488342 100644 --- a/tex/context/base/lxml-tex.lua +++ b/tex/context/base/lxml-tex.lua @@ -1444,3 +1444,19 @@ end --~ end --~ end --~ end + +function lxml.toparameters(id) + local e = getid(id) + if e then + local a = e.at + if a and next(a) then + local setups = { } + for k, v in next, a do + setups[#setups+1] = k .. "=" .. v + end + setups = concat(setups,",") + -- tracing + context(setups) + end + end +end diff --git a/tex/context/base/m-steps.mkii b/tex/context/base/m-steps.mkii deleted file mode 100644 index 3e1f86312..000000000 --- a/tex/context/base/m-steps.mkii +++ /dev/null @@ -1,83 +0,0 @@ -%D \module -%D [ file=m-steps, -%D version=2001.05.28, -%D title=\CONTEXT\ Modules, -%D subtitle=Step Charts \& Tables, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D The \XML\ interface: - -\unprotect - -\defineXMLdirective [stepchart] [charts] \setupSTEPcharts -\defineXMLdirective [stepchart] [cells] \setupSTEPcells -\defineXMLdirective [stepchart] [texts] \setupSTEPtexts -\defineXMLdirective [stepchart] [lines] \setupSTEPlines - -\defineXMLdirective [steptable] [tables] \setupSTEPtables -\defineXMLdirective [steptable] [cells] \setupSTEPcells -\defineXMLdirective [steptable] [texts] \setupSTEPtexts -\defineXMLdirective [steptable] [lines] \setupSTEPlines - -\defineXMLpickup[stepchart][@@STPC] - {\bgroup - \defineXMLpush[top]% - \defineXMLpush[bot]% - \defineXMLenvironment[lines][@@STEL] - {\expanded{\startlines[\theXMLarguments{@@STEL}]}} - {\stoplines}% - \defineXMLenvironment[cells][@@STEC] - {\XMLerase{top}\XMLerase{bot}} - {\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{top}}{\XMLpop{bot}}}}% - \defineXMLenvironment[texts][@@STET] - {\XMLerase{top}\XMLerase{bot}} - {\expanded{\texts[\theXMLarguments{@@STET}]{\XMLpop{top}}{\XMLpop{bot}}}}% - \defineXMLenvironmentpush[cell][@@STEC] - {\XMLerase{cell}} - {\expanded{\cell [\theXMLarguments{@@STEC}]{\XMLpop{cell}}}}% - \defineXMLenvironmentpush [text] [@@STET] - {\XMLerase{text}} - {\expanded{\text [\theXMLarguments{@@STET}]{\XMLpop{text}}}}% - \expanded{\startSTEPchart[\theXMLarguments{@@STPC}]}} - {\stopSTEPchart - \egroup} - -\defineXMLpickup[steptable][@@STPT] - {\bgroup - \defineXMLenvironment[lines][@@STEL] - {\expanded{\startlines[\theXMLarguments{@@STEL}]}} - {\stoplines}% - \defineXMLargument[cell][@@STEC] - {\expanded{\cell[\theXMLarguments{@@STEC}]}}% - \defineXMLargument[text][@@STET] - {\expanded{\text[\theXMLarguments{@@STET}]}}% - \defineXMLargument[prep] - {\prep}% - \expanded{\startSTEPtable[\theXMLarguments{@@STPT}]}} - {\stopSTEPtable - \egroup} - -\defineXMLpickup[stepaligntable][@@STPT] - {\bgroup - \defineXMLenvironment[lines][@@STEL] - {\expanded{\setupSTEPlines[\theXMLarguments{@@STEL}]}} - {}% - \defineXMLpush[c1]\defineXMLpush[c2]\defineXMLpush[c3]% - \defineXMLenvironment[cells][@@STEC] - {\XMLerase{c1}\XMLerase{c1}\XMLerase{c3}} - {\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{c1}}{\XMLpop{c2}}{\XMLpop{c3}}}}% - \defineXMLargument[text][@@STET] - {\expanded{\text[\theXMLarguments{@@STET}]}}% - \defineXMLargument[prep] - {\prep}% - \expanded{\startSTEPaligntable[\theXMLarguments{@@STPT}]}} - {\stopSTEPaligntable - \egroup} - -\protect \endinput diff --git a/tex/context/base/m-steps.mkiv b/tex/context/base/m-steps.mkiv deleted file mode 100644 index 9bb56c532..000000000 --- a/tex/context/base/m-steps.mkiv +++ /dev/null @@ -1,20 +0,0 @@ -%D \module -%D [ file=m-steps, -%D version=2001.05.28, -%D title=\CONTEXT\ Modules, -%D subtitle=Step Charts \& Tables, -%D author=Hans Hagen, -%D date=\currentdate, -%D copyright={PRAGMA ADE / Hans Hagen \& Ton Otten}] -%C -%C This module is part of the \CONTEXT\ macro||package and is -%C therefore copyrighted by \PRAGMA. See mreadme.pdf for -%C details. - -%D The \XML\ interface: - -\unprotect - -\writestatus\m!systems{The steps mkiv xml interface is not yet defined!} - -\protect \endinput diff --git a/tex/context/base/mult-chk.lua b/tex/context/base/mult-chk.lua index 5df2efd79..2d20aa16b 100644 --- a/tex/context/base/mult-chk.lua +++ b/tex/context/base/mult-chk.lua @@ -46,13 +46,15 @@ function interfaces.addvalidkeys(kind,list) end end +-- weird code, looks incomplete ... probbably an experiment + local prefix, kind, keys local function set(key,value) if keys and not keys[key] then interfaces.invalidkey(kind,key) else - texsprint(ctxcatcodes,format("\\setsomevalue{%s}{%s}{%s}",prefix,key,value)) + context.setsomevalue(prefix,key,value) end end diff --git a/tex/context/base/strc-des.mkiv b/tex/context/base/strc-des.mkiv index 5f25ac60d..06e4c2534 100644 --- a/tex/context/base/strc-des.mkiv +++ b/tex/context/base/strc-des.mkiv @@ -615,9 +615,12 @@ \def\dodefineenumerationcommands#1#2#3#4% since we use \currentdescription, we need an edef {\setevalue{\??dd#3#1\s!parent}{#4}% - \setuevalue {#3#1}{\noexpand\doenumerationcommand{#1}{#2}{#3}}% - \setuevalue{\e!start#3#1}{\noexpand\doenumerationstart {#1}{#2}{#3}}% - \setuevalue{\e!stop #3#1}{\noexpand\doenumerationstop {#1}{#2}{#3}}} + \setuevalue {#3#1}{\noexpand\doenumerationcommand {#1}{#2}{#3}}% + \setuevalue{\c!reset#3#1}{\noexpand\doresetenumerationnumber{#1}{#2}{#3}}% + %setuevalue{\c!set #3#1}{\noexpand\dosetenumerationnumber {#1}{#2}{#3}}% + \setuevalue{\e!next #3#1}{\noexpand\donextenumerationnumber {#1}{#2}{#3}}% + \setuevalue{\e!start#3#1}{\noexpand\doenumerationstart {#1}{#2}{#3}}% + \setuevalue{\e!stop #3#1}{\noexpand\doenumerationstop {#1}{#2}{#3}}} % handle enumeration diff --git a/tex/context/base/util-prs.lua b/tex/context/base/util-prs.lua index a42715d0d..e1a2ebbed 100644 --- a/tex/context/base/util-prs.lua +++ b/tex/context/base/util-prs.lua @@ -50,6 +50,10 @@ local function set(key,value) -- using Carg is slower here hash[key] = value end +local function set(key,value) -- using Carg is slower here + hash[key] = value +end + local pattern_a_s = (pattern_a/set)^1 local pattern_b_s = (pattern_b/set)^1 local pattern_c_s = (pattern_c/set)^1 diff --git a/tex/context/base/x-steps.mkii b/tex/context/base/x-steps.mkii new file mode 100644 index 000000000..408a7e191 --- /dev/null +++ b/tex/context/base/x-steps.mkii @@ -0,0 +1,85 @@ +%D \module +%D [ file=m-steps, +%D version=2001.05.28, +%D title=\CONTEXT\ Modules, +%D subtitle=Step Charts \& Tables, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D The \XML\ interface: + +\usemodule[m][steps] + +\unprotect + +\defineXMLdirective [stepchart] [charts] \setupSTEPcharts +\defineXMLdirective [stepchart] [cells] \setupSTEPcells +\defineXMLdirective [stepchart] [texts] \setupSTEPtexts +\defineXMLdirective [stepchart] [lines] \setupSTEPlines + +\defineXMLdirective [steptable] [tables] \setupSTEPtables +\defineXMLdirective [steptable] [cells] \setupSTEPcells +\defineXMLdirective [steptable] [texts] \setupSTEPtexts +\defineXMLdirective [steptable] [lines] \setupSTEPlines + +\defineXMLpickup[stepchart][@@STPC] + {\bgroup + \defineXMLpush[top]% + \defineXMLpush[bot]% + \defineXMLenvironment[lines][@@STEL] + {\expanded{\startlines[\theXMLarguments{@@STEL}]}} + {\stoplines}% + \defineXMLenvironment[cells][@@STEC] + {\XMLerase{top}\XMLerase{bot}} + {\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{top}}{\XMLpop{bot}}}}% + \defineXMLenvironment[texts][@@STET] + {\XMLerase{top}\XMLerase{bot}} + {\expanded{\texts[\theXMLarguments{@@STET}]{\XMLpop{top}}{\XMLpop{bot}}}}% + \defineXMLenvironmentpush[cell][@@STEC] + {\XMLerase{cell}} + {\expanded{\cell [\theXMLarguments{@@STEC}]{\XMLpop{cell}}}}% + \defineXMLenvironmentpush [text] [@@STET] + {\XMLerase{text}} + {\expanded{\text [\theXMLarguments{@@STET}]{\XMLpop{text}}}}% + \expanded{\startSTEPchart[\theXMLarguments{@@STPC}]}} + {\stopSTEPchart + \egroup} + +\defineXMLpickup[steptable][@@STPT] + {\bgroup + \defineXMLenvironment[lines][@@STEL] + {\expanded{\startlines[\theXMLarguments{@@STEL}]}} + {\stoplines}% + \defineXMLargument[cell][@@STEC] + {\expanded{\cell[\theXMLarguments{@@STEC}]}}% + \defineXMLargument[text][@@STET] + {\expanded{\text[\theXMLarguments{@@STET}]}}% + \defineXMLargument[prep] + {\prep}% + \expanded{\startSTEPtable[\theXMLarguments{@@STPT}]}} + {\stopSTEPtable + \egroup} + +\defineXMLpickup[stepaligntable][@@STPT] + {\bgroup + \defineXMLenvironment[lines][@@STEL] + {\expanded{\setupSTEPlines[\theXMLarguments{@@STEL}]}} + {}% + \defineXMLpush[c1]\defineXMLpush[c2]\defineXMLpush[c3]% + \defineXMLenvironment[cells][@@STEC] + {\XMLerase{c1}\XMLerase{c1}\XMLerase{c3}} + {\expanded{\cells[\theXMLarguments{@@STEC}]{\XMLpop{c1}}{\XMLpop{c2}}{\XMLpop{c3}}}}% + \defineXMLargument[text][@@STET] + {\expanded{\text[\theXMLarguments{@@STET}]}}% + \defineXMLargument[prep] + {\prep}% + \expanded{\startSTEPaligntable[\theXMLarguments{@@STPT}]}} + {\stopSTEPaligntable + \egroup} + +\protect \endinput diff --git a/tex/context/base/x-steps.mkiv b/tex/context/base/x-steps.mkiv new file mode 100644 index 000000000..616818809 --- /dev/null +++ b/tex/context/base/x-steps.mkiv @@ -0,0 +1,99 @@ +%D \module +%D [ file=m-steps, +%D version=2001.05.28, +%D title=\CONTEXT\ Modules, +%D subtitle=Step Charts \& Tables, +%D author=Hans Hagen, +%D date=\currentdate, +%D copyright={PRAGMA ADE / Hans Hagen \& Ton Otten}] +%C +%C This module is part of the \CONTEXT\ macro||package and is +%C therefore copyrighted by \PRAGMA. See mreadme.pdf for +%C details. + +%D The \XML\ interface. This module can be made way more efficient +%D in \MKIV\ using textext but it makes only sense to do this when +%D I really need it in a demanding application. Probably half of the +%D code in m-steps.tex can go. + +\usemodule[m][steps] + +\unprotect + +\def\xmlstepchartdirective#1{\executeifdefined{@@stepchart@@#1}\gobbletwoarguments} % {#2}{#3} +\def\xmlsteptabledirective#1{\executeifdefined{@@steptable@@#1}\gobbletwoarguments} % {#2}{#3} + +\setvalue{@@stepchart@@charts}{\setsomevalue\@@STPC} +\setvalue{@@stepchart@@cells}{\setsomevalue\@@STEC} +\setvalue{@@stepchart@@texts}{\setsomevalue\@@STET} +\setvalue{@@stepchart@@lines}{\setsomevalue\@@STEL} + +\setvalue{@@steptable@@tables}{\setsomevalue\@@STPT} +\setvalue{@@steptable@@cells}{\setsomevalue\@@STEC} +\setvalue{@@steptable@@texts}{\setsomevalue\@@STET} +\setvalue{@@steptable@@lines}{\setsomevalue\@@STEL} + +\startxmlsetups xml:ct:define + \xmlsetsetup {#1} {ct:*} {xml:ct:*} + \xmlsetsetup {#1} {ct:stepaligntable/cells} {xml:ct:stepaligntable:cells} + \xmlsetsetup {#1} {ct:stepaligntable/lines} {xml:ct:stepaligntable:lines} +\stopxmlsetups + +\xmlregisterns{ct}{stepcharts} + +\xmlregistersetup{xml:ct:define} + +\startxmlsetups xml:ct:prep + \expanded{\prep[\xmltoparameters{#1}]}{\xmlflush{#1}} +\stopxmlsetups + +\startxmlsetups xml:ct:text + \expanded{\text[\xmltoparameters{#1}]}{\xmlflush{#1}} +\stopxmlsetups + +\startxmlsetups xml:ct:texts + \expanded{\texts[\xmltoparameters{#1}]}{\xmltext{#1}{/top}} {\xmltext{#1}{/bot}} +\stopxmlsetups + +\startxmlsetups xml:ct:cell + \expanded{\cell[\xmltoparameters{#1}]}{\xmlflush{#1}} +\stopxmlsetups + +\startxmlsetups xml:ct:cells + \expanded{\cells[\xmltoparameters{#1}]}{\xmltext{#1}{/top}} {\xmltext{#1}{/bot}} +\stopxmlsetups + +\startxmlsetups xml:ct:lines + \expanded{\startlines[\xmltoparameters{#1}]} + \xmlflush{#1} + \stoplines +\stopxmlsetups + +\startxmlsetups xml:ct:steptable + \expanded{\startSTEPtable[\xmltoparameters{#1}]} + \xmlflush{#1} + \stopSTEPtable +\stopxmlsetups + +\startxmlsetups xml:ct:stepchart + \expanded{\startSTEPchart[\xmltoparameters{#1}]} + \xmlflush{#1} + \stopSTEPchart +\stopxmlsetups + +\startxmlsetups xml:ct:stepaligntable + \expanded{\startSTEPaligntable[\xmltoparameters{#1}]} + \xmlflush{#1} + \stopSTEPaligntable +\stopxmlsetups + +\startxmlsetups xml:ct:stepaligntable:cells + \expanded{\cells[\xmltoparameters{#1}]} {\xmltext{#1}{/ct:c1}} {\xmltext{#1}{/ct:c2}} {\xmltext{#1}{/ct:c3}} +\stopxmlsetups + +\startxmlsetups xml:ct:stepaligntable:lines + \expanded{\setupSTEPlines[\xmltoparameters{#1}]} + \xmlflush{#1} +\stopxmlsetups + +\protect \endinput diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua index 45d048876..fdf07d31c 100644 --- a/tex/generic/context/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 10/22/10 10:10:20 +-- merge date : 10/22/10 16:46:39 do -- begin closure to overcome local limits and interference -- cgit v1.2.3