diff options
Diffstat (limited to 'tex/context/base/mkiv/mlib-lua.lua')
-rw-r--r-- | tex/context/base/mkiv/mlib-lua.lua | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tex/context/base/mkiv/mlib-lua.lua b/tex/context/base/mkiv/mlib-lua.lua index d348981e7..7b2c67220 100644 --- a/tex/context/base/mkiv/mlib-lua.lua +++ b/tex/context/base/mkiv/mlib-lua.lua @@ -87,7 +87,20 @@ end mp.print = mpprint -table.setmetatablecall(mp,function(t,k) mpprint(k) end) +-- We had this: +-- +-- table.setmetatablecall(mp,function(t,k) mpprint(k) end) +-- +-- but the next one is more interesting because we cannot use calls like: +-- +-- lua.mp.somedefdname("foo") +-- +-- which is due to expansion of somedefdname during suffix creation. So: +-- +-- lua.mp("somedefdname","foo") + + +table.setmetatablecall(mp,function(t,k,...) return t[k](...) end) function mp.boolean(n) n = n + 1 @@ -156,6 +169,12 @@ function mp.size(t) buffer[n] = type(t) == "table" and f_numeric(#t) or "0" end +local mpnamedcolor = attributes.colors.mpnamedcolor + +mp.NamedColor = function(str) + mpprint(mpnamedcolor(str)) +end + -- experiment: names can change local datasets = { } |