summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-06-26 14:15:03 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-06-26 14:15:03 +0200
commit6d09de5c379629ea7259803ae28185949cda27c8 (patch)
tree705f3f761841c59f625699fcff2cbecc62b67506 /tex
parent04b79dbcabe74877cbd50ca1f3a99dd6052ffc6f (diff)
downloadcontext-6d09de5c379629ea7259803ae28185949cda27c8.tar.gz
2014-06-26 12:10:00
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/buff-ini.mkiv5
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context-version.pdfbin4353 -> 4348 bytes
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/core-env.mkiv31
-rw-r--r--tex/context/base/lxml-aux.lua32
-rw-r--r--tex/context/base/lxml-ini.mkiv4
-rw-r--r--tex/context/base/lxml-lpt.lua3
-rw-r--r--tex/context/base/lxml-tex.lua19
-rw-r--r--tex/context/base/mult-low.lua2
-rw-r--r--tex/context/base/status-files.pdfbin24843 -> 24873 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin248280 -> 248293 bytes
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
13 files changed, 84 insertions, 18 deletions
diff --git a/tex/context/base/buff-ini.mkiv b/tex/context/base/buff-ini.mkiv
index 6582e3587..abee6c7c6 100644
--- a/tex/context/base/buff-ini.mkiv
+++ b/tex/context/base/buff-ini.mkiv
@@ -39,7 +39,10 @@
\def\buff_start[#1][#2]%
{\buff_start_indeed{}{#1}{\e!start\v!buffer}{\e!stop\v!buffer}}
-\def\buff_start_indeed#1#2#3#4#5% \donothing needed ! #5=undent)
+% \def\buff_start_indeed#1#2#3#4#5% \donothing needed ! #5=undent)
+% {\normalexpanded{\buff_pickup{#2}{#3}{#4}{}{\buff_stop{#4}}\plusone}}
+
+\def\buff_start_indeed#1#2#3#4%
{\normalexpanded{\buff_pickup{#2}{#3}{#4}{}{\buff_stop{#4}}\plusone}}
\unexpanded\def\grabbufferdata % was: \dostartbuffer
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 39a532338..0d7fa9a0b 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{2014.06.25 19:46}
+\newcontextversion{2014.06.26 12:08}
%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/context-version.pdf b/tex/context/base/context-version.pdf
index 4af7b644d..ba240100d 100644
--- a/tex/context/base/context-version.pdf
+++ b/tex/context/base/context-version.pdf
Binary files differ
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index 72c8e2dc6..735023acf 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -28,7 +28,7 @@
%D up and the dependencies are more consistent.
\edef\contextformat {\jobname}
-\edef\contextversion{2014.06.25 19:46}
+\edef\contextversion{2014.06.26 12:08}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/core-env.mkiv b/tex/context/base/core-env.mkiv
index fb91ba4e6..9207d9f4a 100644
--- a/tex/context/base/core-env.mkiv
+++ b/tex/context/base/core-env.mkiv
@@ -59,7 +59,7 @@
\def\syst_modes_new#1%
{\expandafter\newcount\csname\??mode#1\endcsname}
-\unexpanded\def\newmode#1%
+\unexpanded\def\newmode#1% so, no change of already set modes !
{\ifcsname\??mode#1\endcsname\else\syst_modes_new{#1}\fi}
\unexpanded\def\setmode#1%
@@ -113,8 +113,6 @@
\unexpanded\def\globalenablemode {\let\syst_mode_prefix\global\unprotect\syst_modes_enable }
\unexpanded\def\globaldisablemode{\let\syst_mode_prefix\global\unprotect\syst_modes_disable}
-\let\definemode\disablemode % nicer
-
\def\syst_modes_prevent[#1]{\protect\rawprocesscommacommand[#1]\syst_modes_prevent_indeed\let\syst_mode_prefix\relax}
\def\syst_modes_enable [#1]{\protect\rawprocesscommacommand[#1]\syst_modes_enable_indeed \let\syst_mode_prefix\relax}
\def\syst_modes_disable[#1]{\protect\rawprocesscommacommand[#1]\syst_modes_disable_indeed\let\syst_mode_prefix\relax}
@@ -135,6 +133,29 @@
\syst_mode_prefix\csname\??mode#1\endcsname\disabledmode
\fi}
+%D If you do a lot of mode testing, it makes sense to define modes (or disable them
+%D explicitly if unset. This makes testing twice as fast. Often one enables modes
+%D beforehand, in which case \type {\definemode} would reset the mode. The optional
+%D second argument \type {keep} will prevent changing the already set mode but defines
+%D it when undefined.
+
+\unexpanded\def\definemode
+ {\unprotect
+ \dodoubleempty\syst_modes_define}
+
+\def\syst_modes_define[#1][#2]%
+ {\protect
+ \edef\m_modes_asked{#2}%
+ \rawprocesscommacommand[#1]\syst_modes_define_indeed}
+
+\def\syst_modes_define_indeed#1%
+ {\syst_modes_new{#1}%
+ \ifx\m_modes_asked\v!keep
+ % not changes, disabled when undefined
+ \else
+ \csname\??mode#1\endcsname\ifx\m_modes_asked\v!yes\enabledmode\else\disabledmode\fi
+ \fi}
+
% handy for mp
\def\booleanmodevalue#1%
@@ -539,14 +560,14 @@
\def\systemsetups#1{\syst_setups{\systemsetupsprefix#1}}
-\def\resetsetups[#1]% see x-fo for usage
+\unexpanded\def\resetsetups[#1]% see x-fo for usage
{\ifcsname\??setup\ifgridsnapping\v!grid\fi:#1\endcsname
\dodoglobal\letbeundefined{\??setup\ifgridsnapping\v!grid\fi:#1}%
\else
\dodoglobal\letbeundefined{\??setup:#1}%
\fi}
-\def\showsetupsdefinition[#1]%
+\unexpanded\def\showsetupsdefinition[#1]%
{\showvalue{\??setup:#1}} % temp hack for debugging
%D \macros
diff --git a/tex/context/base/lxml-aux.lua b/tex/context/base/lxml-aux.lua
index 70364b657..b3f1684e7 100644
--- a/tex/context/base/lxml-aux.lua
+++ b/tex/context/base/lxml-aux.lua
@@ -421,6 +421,38 @@ end
xml.include = include
+function xml.inclusion(e,default)
+ while e do
+ local f = e.__f__
+ if f then
+ return f
+ else
+ e = e.__p__
+ end
+ end
+ return default
+end
+
+function xml.inclusions(e,sorted)
+ while e do
+ local settings = e.settings
+ if settings then
+ local inclusions = settings.inclusions
+ if inclusions then
+ inclusions = table.unique(inclusions) -- a copy
+ if sorted then
+ table.sort(inclusions) -- so we sort the copy
+ end
+ return inclusions -- and return the copy
+ else
+ e = e.__p__
+ end
+ else
+ e = e.__p__
+ end
+ end
+end
+
local function stripelement(e,nolines,anywhere)
local edt = e.dt
if edt then
diff --git a/tex/context/base/lxml-ini.mkiv b/tex/context/base/lxml-ini.mkiv
index 3935b9516..759fda78a 100644
--- a/tex/context/base/lxml-ini.mkiv
+++ b/tex/context/base/lxml-ini.mkiv
@@ -12,6 +12,7 @@
%C details.
%D Todo: auto apply setups (manage at lua end)
+%D Todo: manuak: \xmlinclusion \xmlinclusions
\writestatus{loading}{ConTeXt XML Support / Initialization}
@@ -59,7 +60,8 @@
\def\xmlidx #1#2#3{\ctxlxml{idx("#1","#2",\number#3)}}
\def\xmlinclude #1#2#3{\ctxlxml{include("#1","#2","#3",true)}}
\def\xmlincludeoptions#1#2#3#4{\ctxlxml{include("#1","#2","#3","#4")}}
-\def\xmlincludedfrom #1{\ctxlxml{includedfrom("#1")}}
+\def\xmlinclusion #1{\ctxlxml{inclusion("#1")}}
+\def\xmlinclusions #1{\ctxlxml{inclusions("#1")}}
\def\xmlsave #1#2{\ctxlxml{save("#1","#2")}}
\def\xmlindex #1#2#3{\ctxlxml{index("#1","#2",\number#3)}}
\def\xmlinfo #1{\hbox{\ttxx[\ctxlxml{info("#1")}]}}
diff --git a/tex/context/base/lxml-lpt.lua b/tex/context/base/lxml-lpt.lua
index 8567f2623..d99688b8b 100644
--- a/tex/context/base/lxml-lpt.lua
+++ b/tex/context/base/lxml-lpt.lua
@@ -505,6 +505,9 @@ local function apply_expression(list,expression,order)
return collected
end
+-- this one can be made faster but there are not that many conversions so it doesn't
+-- really pay of
+
local P, V, C, Cs, Cc, Ct, R, S, Cg, Cb = lpeg.P, lpeg.V, lpeg.C, lpeg.Cs, lpeg.Cc, lpeg.Ct, lpeg.R, lpeg.S, lpeg.Cg, lpeg.Cb
local spaces = S(" \n\r\t\f")^0
diff --git a/tex/context/base/lxml-tex.lua b/tex/context/base/lxml-tex.lua
index c1aea3853..98f154b13 100644
--- a/tex/context/base/lxml-tex.lua
+++ b/tex/context/base/lxml-tex.lua
@@ -37,6 +37,7 @@ local xmlserialize, xmlcollect, xmltext, xmltostring = xml.serialize, xml.collec
local xmlapplylpath = xml.applylpath
local xmlunprivatized, xmlprivatetoken, xmlprivatecodes = xml.unprivatized, xml.privatetoken, xml.privatecodes
local xmlstripelement = xml.stripelement
+local xmlinclusion, xmlinclusions = xml.inclusion, xml.inclusions
local variables = interfaces and interfaces.variables or { }
@@ -518,13 +519,17 @@ function lxml.include(id,pattern,attribute,options)
stoptiming(xml)
end
-function lxml.includedfrom(id)
- local x = getid(id)
- local f = x and x.__f__
- if f then
- context(f)
- else
- -- maybe some message
+function lxml.inclusion(id,default)
+ local inclusion = xmlinclusion(getid(id),default)
+ if inclusion then
+ context(inclusion)
+ end
+end
+
+function lxml.inclusions(id,sorted)
+ local inclusions = xmlinclusions(getid(id),sorted)
+ if inclusions then
+ context(table.concat(inclusions,","))
end
end
diff --git a/tex/context/base/mult-low.lua b/tex/context/base/mult-low.lua
index faa1302a9..d9cc167d8 100644
--- a/tex/context/base/mult-low.lua
+++ b/tex/context/base/mult-low.lua
@@ -103,7 +103,7 @@ return {
"startTEXpage", "stopTEXpage",
-- "startMPpage", "stopMPpage", -- already catched by nested lexer
--
- "enablemode", "disablemode", "preventmode",
+ "enablemode", "disablemode", "preventmode", "definemode",
"globalenablemode", "globaldisablemode", "globalpreventmode",
"pushmode", "popmode",
--
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 55e076014..8f4df1cf6 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 92d86086a..775d7b49d 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 8f57859c1..6e0870dfe 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 : 06/25/14 19:46:20
+-- merge date : 06/26/14 12:08:01
do -- begin closure to overcome local limits and interference