summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scripts/context/lua/luatools.lua3
-rw-r--r--scripts/context/ruby/fcd_start.rb2
-rw-r--r--scripts/context/stubs/mswin/luatools.lua3
-rwxr-xr-xscripts/context/stubs/unix/luatools3
-rw-r--r--tex/context/base/anch-pos.lua2
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/data-res.lua2
-rw-r--r--tex/context/base/l-os.lua3
-rw-r--r--tex/context/base/luat-cbk.lua24
-rw-r--r--tex/context/base/meta-txt.tex18
11 files changed, 37 insertions, 27 deletions
diff --git a/scripts/context/lua/luatools.lua b/scripts/context/lua/luatools.lua
index afff8a535..2a6e904fe 100644
--- a/scripts/context/lua/luatools.lua
+++ b/scripts/context/lua/luatools.lua
@@ -5280,7 +5280,8 @@ resolvers.ownbin = gsub(resolvers.ownbin,"\\","/")
function resolvers.getownpath()
local ownpath = resolvers.ownpath or os.selfdir
- if not ownpath or ownpath == "" then
+print(ownpath,os.selfdir)
+ 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/scripts/context/ruby/fcd_start.rb b/scripts/context/ruby/fcd_start.rb
index 28f407c76..b1fa42a2a 100644
--- a/scripts/context/ruby/fcd_start.rb
+++ b/scripts/context/ruby/fcd_start.rb
@@ -38,6 +38,8 @@
# fcd [--find] whatever . (last choice with this pattern)
# fcd --list
+# todo: HOMEDRIVE\HOMEPATH
+
require 'rbconfig'
class FastCD
diff --git a/scripts/context/stubs/mswin/luatools.lua b/scripts/context/stubs/mswin/luatools.lua
index afff8a535..2a6e904fe 100644
--- a/scripts/context/stubs/mswin/luatools.lua
+++ b/scripts/context/stubs/mswin/luatools.lua
@@ -5280,7 +5280,8 @@ resolvers.ownbin = gsub(resolvers.ownbin,"\\","/")
function resolvers.getownpath()
local ownpath = resolvers.ownpath or os.selfdir
- if not ownpath or ownpath == "" then
+print(ownpath,os.selfdir)
+ 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/scripts/context/stubs/unix/luatools b/scripts/context/stubs/unix/luatools
index afff8a535..2a6e904fe 100755
--- a/scripts/context/stubs/unix/luatools
+++ b/scripts/context/stubs/unix/luatools
@@ -5280,7 +5280,8 @@ resolvers.ownbin = gsub(resolvers.ownbin,"\\","/")
function resolvers.getownpath()
local ownpath = resolvers.ownpath or os.selfdir
- if not ownpath or ownpath == "" then
+print(ownpath,os.selfdir)
+ 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/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