diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-04-10 13:44:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-04-10 13:44:00 +0200 |
commit | c39ede4f171de15fc77addefe788b0ed3bff4484 (patch) | |
tree | ed2af1623059550f8e0056e71c690a8eba2fdb70 /tex | |
parent | a5d3707be9e544069a94b3c8d7b51c7b31e506e5 (diff) | |
download | context-c39ede4f171de15fc77addefe788b0ed3bff4484.tar.gz |
beta 2010.04.10 13:44
Diffstat (limited to 'tex')
-rw-r--r-- | tex/context/base/anch-pos.lua | 2 | ||||
-rw-r--r-- | tex/context/base/cont-new.tex | 2 | ||||
-rw-r--r-- | tex/context/base/context.tex | 2 | ||||
-rw-r--r-- | tex/context/base/data-res.lua | 2 | ||||
-rw-r--r-- | tex/context/base/l-os.lua | 3 | ||||
-rw-r--r-- | tex/context/base/luat-cbk.lua | 24 | ||||
-rw-r--r-- | tex/context/base/meta-txt.tex | 18 |
7 files changed, 29 insertions, 24 deletions
diff --git a/tex/context/base/anch-pos.lua b/tex/context/base/anch-pos.lua index dc10f8f1e..8066af4ce 100644 --- a/tex/context/base/anch-pos.lua +++ b/tex/context/base/anch-pos.lua @@ -143,7 +143,7 @@ function jobpositions.MPpos(id) end end -local splitter = lpeg.splitat(",") +local splitter = lpeg.Ct(lpeg.splitat(",")) function jobpositions.MPplus(id,n,default) local jpi = pcol[id] or ptbs[id] diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex index b5700b4f9..5ecae9c44 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.04.09 11:49} +\newcontextversion{2010.04.10 13:44} %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 0e9520600..7d0a30568 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.04.09 11:49} +\edef\contextversion{2010.04.10 13:44} %D For those who want to use this: diff --git a/tex/context/base/data-res.lua b/tex/context/base/data-res.lua index 60c6eb32d..19566a68a 100644 --- a/tex/context/base/data-res.lua +++ b/tex/context/base/data-res.lua @@ -476,7 +476,7 @@ resolvers.ownbin = gsub(resolvers.ownbin,"\\","/") function resolvers.getownpath() local ownpath = resolvers.ownpath or os.selfdir - if not ownpath or ownpath == "" then + if not ownpath or ownpath == "" or ownpath == "unset" then ownpath = args[-1] or arg[-1] ownpath = ownpath and file.dirname(gsub(ownpath,"\\","/")) if not ownpath or ownpath == "" then diff --git a/tex/context/base/l-os.lua b/tex/context/base/l-os.lua index 4f0c0c176..fba2cd317 100644 --- a/tex/context/base/l-os.lua +++ b/tex/context/base/l-os.lua @@ -87,12 +87,13 @@ end --~ print(os.date("%H:%M:%S",os.time())) -- no need for function anymore as we have more clever code and helpers now +-- this metatable trickery might as well disappear os.resolvers = os.resolvers or { } local resolvers = os.resolvers -local osmt = getmetatable(os) or { __index = function(t,k) t[k] = "unset" return "unset" end } +local osmt = getmetatable(os) or { __index = function(t,k) t[k] = "unset" return "unset" end } -- maybe nil local osix = osmt.__index osmt.__index = function(t,k) diff --git a/tex/context/base/luat-cbk.lua b/tex/context/base/luat-cbk.lua index 47dd94a05..81a09a54b 100644 --- a/tex/context/base/luat-cbk.lua +++ b/tex/context/base/luat-cbk.lua @@ -31,10 +31,14 @@ local frozen, stack = { }, { } callback.original_register_callback = register_callback -local function frozenmessage(what,name) +local function frozen_message(what,name) logs.report("callbacks","not %s frozen '%s' (%s)",what,name,frozen[name]) end +local function frozen_callback(name) + return nil, format("callback '%s' is frozen (%s)",name,frozen[name]) +end + local function state(name) local f = find_callback(name) if f == false then @@ -51,9 +55,9 @@ function callbacks.report() for name, func in table.sortedpairs(list) do local str = frozen[name] if str then - logs.report("callbacks","%s: %s -> %s",state(func),name,str) + logs.report("callbacks","%s: %s -> %s",state(name),name,str) else - logs.report("callbacks","%s: %s",state(func),name) + logs.report("callbacks","%s: %s",state(name),name) end end end @@ -92,22 +96,22 @@ end function callbacks.register(name,func,freeze) if frozen[name] then if trace_callbacks then - frozenmessage("registering",name) + frozen_message("registering",name) end + return frozen_callback(name) elseif freeze then frozen[name] = (type(freeze) == "string" and freeze) or "registered" - register_callback(name,func) - else - register_callback(name,func) end + return register_callback(name,func) end function callback.register(name,func) -- original if not frozen[name] then - register_callback(name,func) + return register_callback(name,func) elseif trace_callbacks then - frozenmessage("registering",name) + frozen_message("registering",name) end + return frozen_callback(name) end function callbacks.push(name, func) @@ -120,7 +124,7 @@ function callbacks.push(name, func) insert(sn,find_callback(name)) register_callback(name, func) elseif trace_callbacks then - frozenmessage("pushing",name) + frozen_message("pushing",name) end end diff --git a/tex/context/base/meta-txt.tex b/tex/context/base/meta-txt.tex index 9a16a5bce..b784d7dda 100644 --- a/tex/context/base/meta-txt.tex +++ b/tex/context/base/meta-txt.tex @@ -37,15 +37,15 @@ \ifdefined\MPtoks \else \newtoks\MPtoks \fi \ifdefined\MPnox \else \newbox \MPbox \fi -\ifdefined\newdimen \else \newdimen\parwidth \fi -\ifdefined\newdimen \else \newdimen\parheight \fi -\ifdefined\newdimen \else \newdimen\parvoffset \fi -\ifdefined\newdimen \else \newdimen\parhoffset \fi -\ifdefined\newcount \else \newcount\parlines \fi -\ifdefined\newtoks \else \newtoks \partoks \fi -\ifdefined\newbox \else \newbox \shapetextbox \fi -\ifdefined\newif \else \newif \ifparseries \fi -\ifdefined\chardef \else \chardef \parfirst=0 \fi +\ifdefined\parwidth \else \newdimen\parwidth \fi +\ifdefined\parheight \else \newdimen\parheight \fi +\ifdefined\parvoffset \else \newdimen\parvoffset \fi +\ifdefined\parhoffset \else \newdimen\parhoffset \fi +\ifdefined\parlines \else \newcount\parlines \fi +\ifdefined\partoks \else \newtoks \partoks \fi +\ifdefined\shapetextbox \else \newbox \shapetextbox \fi +\ifdefined\ifparseries \else \newif \ifparseries \fi +\ifdefined\parfirst \else \chardef \parfirst=0 \fi \def\startshapetext[#1]% {\global\newcounter\currentshapetext |