summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/mlib-lua.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-07-02 12:19:51 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-07-02 12:19:51 +0200
commitda9149010f4d34eef23a504682d82cdcf4fac8f5 (patch)
treea213e0a93e1e4ac2b8a6a724e32db3e8d6dc1fc5 /tex/context/base/mkiv/mlib-lua.lua
parentc6fcaaa08d694397e9db4d1f9497926c193a5d95 (diff)
downloadcontext-da9149010f4d34eef23a504682d82cdcf4fac8f5.tar.gz
2016-07-01 16:31:00
Diffstat (limited to 'tex/context/base/mkiv/mlib-lua.lua')
-rw-r--r--tex/context/base/mkiv/mlib-lua.lua21
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 = { }