summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tex/context/base/grph-inc.lua20
-rw-r--r--tex/context/base/lang-ini.lua22
-rw-r--r--tex/context/base/lang-ini.mkiv2
-rw-r--r--tex/context/base/node-tra.lua11
-rw-r--r--tex/context/base/spac-ali.mkiv2
-rw-r--r--tex/context/base/status-files.pdfbin23514 -> 23528 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin154243 -> 154267 bytes
7 files changed, 37 insertions, 20 deletions
diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua
index b37fe0766..87fbd549e 100644
--- a/tex/context/base/grph-inc.lua
+++ b/tex/context/base/grph-inc.lua
@@ -255,9 +255,6 @@ end
-- interfacing to tex
-local figuredata = nil -- will be topofstack or last so no { } (else problems with getfiguredimensions)
-local callstack = { }
-
local function new() -- we could use metatables status -> used -> request but it needs testing
local request = {
name = false,
@@ -306,10 +303,12 @@ end
-- use table.insert|remove
+local lastfiguredata = nil -- will be topofstack or last so no { } (else problems with getfiguredimensions)
+local callstack = { }
+
function figures.push(request)
statistics.starttiming(figures)
- insert(callstack,figuredata)
- figuredata = new()
+ local figuredata = new()
if request then
-- request.width/height are strings and are only used when no natural dimensions
-- can be determined; at some point the handlers might set them to numbers instead
@@ -326,21 +325,22 @@ function figures.push(request)
-- request.height = (h and h > 0) or false
table.merge(figuredata.request,request)
end
+ insert(callstack,figuredata)
+ lastfiguredata = figuredata
return figuredata
end
function figures.pop()
- figuredata = remove(callstack) or figuredata
+ lastfiguredata = remove(callstack) or lastfiguredata
statistics.stoptiming(figures)
- return figuredata
end
function figures.current()
- return figuredata -- callstack[#callstack]
+ return callstack[#callstack] or lastfiguredata
end
function figures.get(category,tag,default)
- local value = figuredata and figuredata[category]
+ local value = lastfiguredata and lastfiguredata[category]
value = value and value[tag]
if not value or value == "" or value == true then
return default or ""
@@ -349,6 +349,8 @@ function figures.get(category,tag,default)
end
end
+--
+
function figures.tprint(category,tag,default)
context(figures.get(category,tag,default))
end
diff --git a/tex/context/base/lang-ini.lua b/tex/context/base/lang-ini.lua
index 305b429e1..da6802974 100644
--- a/tex/context/base/lang-ini.lua
+++ b/tex/context/base/lang-ini.lua
@@ -209,13 +209,17 @@ end
if environment.initex then
- function languages.getnumber(current,default)
+ function languages.getnumber()
+ return 0
+ end
+
+ function commands.languagenumber()
texwrite(0)
end
else
- function languages.getnumber(tag,default,patterns)
+ local function getnumber(tag,default,patterns)
local l = registered[tag]
if l then
if l.dirty then
@@ -223,7 +227,7 @@ else
report_initialization("checking patterns for %s (%s)",tag,default)
end
-- patterns is already resolved to parent patterns if applicable
- if patterns ~= "" then
+ if patterns and patterns ~= "" then
if l.patterns ~= patterns then
l.patterns = patterns
if trace_patterns then
@@ -240,7 +244,7 @@ else
end
local ok = loaddefinitions(tag,l)
if not ok and tag ~= default then
- l.patterns = defaukt
+ l.patterns = default
if trace_patterns then
report_initialization("loading patterns for '%s' using default",tag)
end
@@ -250,12 +254,18 @@ else
l.loaded = true
l.dirty = false
end
- texwrite(l.number)
+ return l.number
else
- texwrite(0)
+ return 0
end
end
+ languages.getnumber = getnumber
+
+ function commands.languagenumber(tag,default,patterns)
+ texwrite(getnumber(tag,default,patterns))
+ end
+
end
-- not that usefull, global values
diff --git a/tex/context/base/lang-ini.mkiv b/tex/context/base/lang-ini.mkiv
index fe8aee917..5dccab4dc 100644
--- a/tex/context/base/lang-ini.mkiv
+++ b/tex/context/base/lang-ini.mkiv
@@ -347,7 +347,7 @@
\newtoks \everylanguage
\def\docomplexlanguage% assumes that \currentlanguage is set % % % use different name as complex
- {\normallanguage\ctxlua{languages.getnumber(%
+ {\normallanguage\ctxlua{commands.languagenumber(%
"\currentlanguage",%
"\defaultlanguage\currentlanguage",%
"\languageparameter\s!patterns"%
diff --git a/tex/context/base/node-tra.lua b/tex/context/base/node-tra.lua
index f86ab791a..38855f659 100644
--- a/tex/context/base/node-tra.lua
+++ b/tex/context/base/node-tra.lua
@@ -664,17 +664,22 @@ number.basepoints = basepoints
local colors = { }
tracers.colors = colors
+local get_attribute = node.has_attribute
local set_attribute = node.set_attribute
local unset_attribute = node.unset_attribute
-local attribute = attributes.private('color')
-local mapping = attributes.list[attribute] or { }
+local attribute = attributes.private('color')
+local colormodel = attributes.private('colormodel')
+local mapping = attributes.list[attribute] or { }
-function colors.set(n,c)
+function colors.set(n,c,s)
local mc = mapping[c]
if not mc then
unset_attribute(n,attribute)
else
+ if not get_attribute(n,colormodel) then
+ set_attribute(n,colormodel,s or 1)
+ end
set_attribute(n,attribute,mc)
end
end
diff --git a/tex/context/base/spac-ali.mkiv b/tex/context/base/spac-ali.mkiv
index 6050ef7dd..0cf22f470 100644
--- a/tex/context/base/spac-ali.mkiv
+++ b/tex/context/base/spac-ali.mkiv
@@ -290,7 +290,7 @@
%D More hyphenation control, will be combined with align
%D setup.
-\def\nohyphens
+\def\nohyphens % % % % % not clever, we still hyphenate but supress application
{\ifx\dohyphens\relax
\edef\dohyphens
{\hyphenpenalty\the\hyphenpenalty
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 366bf950d..74c250bce 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 3868be7a2..d761a95a6 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ