summaryrefslogtreecommitdiff
path: root/tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex')
-rw-r--r--tex/context/base/anch-pos.mkiv16
-rw-r--r--tex/context/base/attr-ini.mkiv1
-rw-r--r--tex/context/base/cont-new.tex2
-rw-r--r--tex/context/base/context.tex2
-rw-r--r--tex/context/base/core-uti.lua5
-rw-r--r--tex/context/base/lang-url.lua7
-rw-r--r--tex/context/base/math-pln.mkii2
-rw-r--r--tex/context/base/node-tra.lua25
-rw-r--r--tex/context/base/page-sid.tex4
-rw-r--r--tex/context/base/strc-des.mkiv2
-rw-r--r--tex/context/base/strc-ref.lua32
-rw-r--r--tex/context/base/strc-ref.mkiv60
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua2
13 files changed, 83 insertions, 77 deletions
diff --git a/tex/context/base/anch-pos.mkiv b/tex/context/base/anch-pos.mkiv
index 5f5af63a3..f58f68302 100644
--- a/tex/context/base/anch-pos.mkiv
+++ b/tex/context/base/anch-pos.mkiv
@@ -216,18 +216,20 @@
\localpositioningfalse
\to \everypagebody
-\def\checkpositions
- {\startnointerference
- \protectlabels
- \doutilities{positions}\jobname\empty\relax\relax
- \global\let\checkpositions\relax
- \stopnointerference}
+% \def\checkpositions
+% {\startnointerference
+% \protectlabels
+% \doutilities{positions}\jobname\empty\relax\relax
+% \global\let\checkpositions\relax
+% \stopnointerference}
+
+\let\checkpositions\relax
%D Since the positional values are to be fully expandable, we
%D need to preload them as soon as possible, which is why we
%D load the data when we start a text.
-\appendtoks \checkpositions \to \everystarttext
+% \appendtoks \checkpositions \to \everystarttext
%D \macros
%D {MPp, MPx, MPy, MPw, MPh, MPd,
diff --git a/tex/context/base/attr-ini.mkiv b/tex/context/base/attr-ini.mkiv
index 43cb66d35..a44a16be6 100644
--- a/tex/context/base/attr-ini.mkiv
+++ b/tex/context/base/attr-ini.mkiv
@@ -31,6 +31,7 @@
\definesystemattribute[negative]
\definesystemattribute[effect]
\definesystemattribute[viewerlayer]
+\definesystemattribute[reference]
% \definesystemattribute[ignore]
%
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 3c495173a..378eed523 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{2009.06.11 00:07}
+\newcontextversion{2009.06.13 14:03}
%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 a57ccc0a2..6316c6156 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{2009.06.11 00:07}
+\edef\contextversion{2009.06.13 14:03}
%D For those who want to use this:
diff --git a/tex/context/base/core-uti.lua b/tex/context/base/core-uti.lua
index 20c63efd1..98e60be2e 100644
--- a/tex/context/base/core-uti.lua
+++ b/tex/context/base/core-uti.lua
@@ -239,7 +239,10 @@ function job.load(filename)
if version ~= jobs.version then
logs.report("job","version mismatch with jobfile: %s <> %s", version or "?", jobs.version)
else
- loadstring(data)()
+ local data = loadstring(data)
+ if data then
+ data()
+ end
for l=1,#savelist do
local list = savelist[l]
local target, initializer = list[1], list[3]
diff --git a/tex/context/base/lang-url.lua b/tex/context/base/lang-url.lua
index 1524878cf..6d909641c 100644
--- a/tex/context/base/lang-url.lua
+++ b/tex/context/base/lang-url.lua
@@ -66,7 +66,7 @@ do
local chars = commands.hyphenatedurl.characters
- function commands.hyphenatedurl.action(str, left, right)
+ function commands.hyphenatedurl.convert(str, left, right)
local n = 0
local b = math.max(left or commands.hyphenatedurl.lefthyphenmin,2)
local e = math.min(#str-(right or commands.hyphenatedurl.righthyphenmin)+2,#str)
@@ -82,7 +82,10 @@ do
return "\\a{" .. u(s) .. "}"
end
end )
- tex.sprint(ctxcatcodes,str)
+ return str
+ end
+ function commands.hyphenatedurl.action(str, left, right)
+ tex.sprint(ctxcatcodes,commands.hyphenatedurl.convert(str, left, right))
end
-- todo, no interface in mkiv yet
diff --git a/tex/context/base/math-pln.mkii b/tex/context/base/math-pln.mkii
index 0bacc40a2..f2f3ff183 100644
--- a/tex/context/base/math-pln.mkii
+++ b/tex/context/base/math-pln.mkii
@@ -203,7 +203,7 @@
$#1\leftharpoondown$}}}}
\def\buildrel#1\over#2%
- {\mathrel{\mathop{\kern\zerocount#2}\limits^{#1}}}
+ {\mathrel{\mathop{\kern\zeropoint#2}\limits^{#1}}}
\def\doteq
{\buildrel\textstyle.\over=}
diff --git a/tex/context/base/node-tra.lua b/tex/context/base/node-tra.lua
index 3decfd07c..50f8287ee 100644
--- a/tex/context/base/node-tra.lua
+++ b/tex/context/base/node-tra.lua
@@ -326,14 +326,27 @@ function nodes.check_glyphs(head,message)
return false
end
-function nodes.tosequence(start,stop)
+function nodes.tosequence(start,stop,compact)
if start then
local t = { }
while start do
if start.id == glyph then
- t[#t+1] = format("U+%04X:%s",start.char,utfchar(start.char))
+ local c = start.char
+ if compact then
+ if start.components then
+ t[#t+1] = nodes.tosequence(start.components,nil,compact)
+ else
+ t[#t+1] = format("%s",utfchar(c))
+ end
+ else
+ t[#t+1] = format("U+%04X:%s",c,utfchar(c))
+ end
else
- t[#t+1] = match(tostring(start),": (%S+)")
+ if compact then
+ t[#t+1] = "[]"
+ else
+ t[#t+1] = match(tostring(start),": (%S+)")
+ end
end
if start == stop then
break
@@ -341,7 +354,11 @@ function nodes.tosequence(start,stop)
start = start.next
end
end
- return concat(t," ")
+ if compact then
+ return concat(t)
+ else
+ return concat(t," ")
+ end
else
return "<empty>"
end
diff --git a/tex/context/base/page-sid.tex b/tex/context/base/page-sid.tex
index 90d6ec1a7..0848c9d8c 100644
--- a/tex/context/base/page-sid.tex
+++ b/tex/context/base/page-sid.tex
@@ -453,7 +453,7 @@
\ifdim\wd\floatbottom<\sidefloathsize
\parskip\zeropoint
%\noindent
- \vadjust{\penalty\minusone}%
+ \ifinner\else\vadjust{\penalty\minusone}\fi
\iffloatlefteqo
\global\floatlefteqofalse
\else
@@ -488,7 +488,7 @@
\parskip\zeropoint % here ?
\ifdim\sidefloatwidth>\zeropoint % new, see prikkels
\noindent
- \vadjust{\penalty\minusone}%
+ \ifinner\else\vadjust{\penalty\minusone}\fi
\hskip\sidefloatwidth
%\else
% we have a margin or edge float
diff --git a/tex/context/base/strc-des.mkiv b/tex/context/base/strc-des.mkiv
index eb7d7a6bc..f2fbe2329 100644
--- a/tex/context/base/strc-des.mkiv
+++ b/tex/context/base/strc-des.mkiv
@@ -531,7 +531,7 @@
\getparameters[\??dd#1][\s!counter=#2,#3]%
\let\@@subslevel\empty
\dorecurse{\descriptionparameter\c!levels}
- {\noemalexpanded{\noexpand\dodefineenumerationcommands{#1}{\recurselevel}{\@@subslevel}{\??dd\@@subslevel#2}}%
+ {\normalexpanded{\noexpand\dodefineenumerationcommands{#1}{\recurselevel}{\@@subslevel}{\??dd\@@subslevel#2}}%
\edef\@@subslevel{\@@subslevel\v!sub}}%
\fi
\edef\currentdescriptioncounter{\descriptionparameter\c!number}%
diff --git a/tex/context/base/strc-ref.lua b/tex/context/base/strc-ref.lua
index 92cc15df3..f18bb9407 100644
--- a/tex/context/base/strc-ref.lua
+++ b/tex/context/base/strc-ref.lua
@@ -9,6 +9,8 @@ if not modules then modules = { } end modules ['strc-ref'] = {
local format, gmatch, texsprint, texwrite, count = string.format, string.gmatch, tex.sprint, tex.write, tex.count
local ctxcatcodes = tex.ctxcatcodes
+local variables = interfaces.variables
+local constants = interfaces.constants
-- beware, this is a first step in the rewrite (just getting rid of
-- the tuo file); later all access and parsing will also move to lua
@@ -30,6 +32,13 @@ local defined, derived, specials, runners = jobreferences.defined, jobreferences
local currentreference = nil
+local gotoinner = "\\gotoinner{%s}{%s}{%s}{%s}" -- prefix inner page data
+local gotoouterfilelocation = "\\gotoouterfilelocation{%s}{%s}{%s}{%s}" -- file location page data
+local gotoouterfilepage = "\\gotoouterfilepage{%s}{%s}{%s}" -- file page data
+local gotoouterurl = "\\gotoouterurl{%s}{%s}{%s}" -- url args data
+local gotoinnerpage = "\\gotoinnerpage{%s}{%s}" -- page data
+local gotospecial = "\\gotospecial{%s}{%s}{%s}{%s}{%s}" -- action, special, operation, arguments, data
+
jobreferences.initializers = jobreferences.initializers or { }
function jobreferences.registerinitializer(func) -- we could use a token register instead
@@ -240,26 +249,32 @@ end
-- shared by urls and files
+function jobreferences.whatfrom(name)
+ texsprint(ctxcatcodes,(urls[name] and variables.url) or (files[name] and variables.file) or variables.unknown)
+end
+
function jobreferences.from(name,method,space)
local u = urls[name]
if u then
local url, file, description = u[1], u[2], u[3]
if description ~= "" then
- texsprint(ctxcatcodes,description)
+ -- ok
elseif file and file ~= "" then
- texsprint(ctxcatcodes,url,"/",file)
+ description = url .. "/" .. file
else
- texsprint(ctxcatcodes,url)
+ description = url
end
+ texsprint(ctxcatcodes,description)
else
local f = files[name]
if f then
local description, file = f[1], f[2]
if description ~= "" then
- texsprint(ctxcatcodes,description)
+ --
else
- texsprint(ctxcatcodes,file)
+ description = file
end
+ texsprint(ctxcatcodes,description)
end
end
end
@@ -707,13 +722,6 @@ end
-- each method gets its own call, so that we can later move completely to lua
-local gotoinner = "\\gotoinner{%s}{%s}{%s}{%s}" -- prefix inner page data
-local gotoouterfilelocation = "\\gotoouterfilelocation{%s}{%s}{%s}{%s}" -- file location page data
-local gotoouterfilepage = "\\gotoouterfilepage{%s}{%s}{%s}" -- file page data
-local gotoouterurl = "\\gotoouterurl{%s}{%s}{%s}" -- url args data
-local gotoinnerpage = "\\gotoinnerpage{%s}{%s}" -- page data
-local gotospecial = "\\gotospecial{%s}{%s}{%s}{%s}{%s}" -- action, special, operation, arguments, data
-
runners["inner"] = function(var,content)
-- inner
currentreference = var
diff --git a/tex/context/base/strc-ref.mkiv b/tex/context/base/strc-ref.mkiv
index ec88fe725..61436ef77 100644
--- a/tex/context/base/strc-ref.mkiv
+++ b/tex/context/base/strc-ref.mkiv
@@ -561,15 +561,15 @@
{#5}%
\fi}
- \def\gotorealpage#1#2#3#4% url file page data
- {\iflocation
- \dohandlegoto
- {#4}%
- {\dostartgotorealpage\buttonwidth\buttonheight{#1}{#2}{\number#3}}%
- {\dostopgotorealpage}%
- \else
- {#4}%
- \fi}
+\def\gotorealpage#1#2#3#4% url file page data
+ {\iflocation
+ \dohandlegoto
+ {#4}%
+ {\dostartgotorealpage\buttonwidth\buttonheight{#1}{#2}{\number#3}}%
+ {\dostopgotorealpage}%
+ \else
+ {#4}%
+ \fi}
\def\gotoinnerpage#1#2% page data
{\iflocation
@@ -1200,7 +1200,6 @@
\referenceinfo<{#3}%
\endgroup}
-
%D In interactive documents going to a specific location is not
%D bound to cross references. The \type{\goto} commands can be
%D used to let users access another part of the document. In
@@ -1228,43 +1227,12 @@
\bgroup
\postponenotes
% todo: handle empty #1
- \doifelsenothing{#1}
- {\dosymbolreference{}{}[#2]}
- {\dogotospace{#1}[#2]}%
+ \doifelsenothing{#1}{\dosymbolreference{}{}}{\dogotospace{#1}}[#2]%
\egroup
\referenceinfo{<}{#2}}
% inefficient, we need to save the shared one (just reuse last command in lua)
-% \def\dogotospace#1[#2]%
-% {\iflocationsplit
-% \ifsecondaryreference
-% \setbox\scratchbox\hbox % will change anyway
-% \fi % due to space insertion
-% {\let\dogotospace\dogotofixed
-% \iflocation
-% \def\processisolatedword##1%
-% {\ifisolatedwords\ifsharesimilarreferences
-% \global\advance\similarreference \plusone
-% \fi\fi
-% \hbox\bgroup
-% \doprocessreferenceelse{#2}{##1\presetgoto}{\unknownreference{#2}##1\relax}%
-% \egroup}%
-% \dosetfontattribute \??ia\c!style
-% \dosetcolorattribute\??ia\c!color
-% \processisolatedwords{#1}\processisolatedword
-% \else
-% #1\relax % \relax prevents #1's next macros from gobbling \fi
-% \fi}%
-% \else
-% \iflocation
-% \hbox{\doattributes\??ia\c!style\c!color{\doprocessreferenceelse{#2}{#1\presetgoto}{\unknownreference{#2}#1\relax}}}%
-% \else
-% #1\relax % \relax prevents #1's next macros from gobbling \fi
-% \fi
-% \fi
-% \global\similarreference\zerocount}
-
\def\dogotoprocessisolatedword#1#2%
{\ifisolatedwords\ifsharesimilarreferences
\global\advance\similarreference \plusone
@@ -1301,7 +1269,11 @@
\def\dogotofixed#1[#2]%
{{\iflocation
- \hbox{\doattributes\??ia\c!style\c!color{\doprocessreferenceelse{#2}{#1\presetgoto}{\unknownreference{#2}#1\relax}}}%
+ \hbox\bgroup
+ \dosetfontattribute \??ia\c!style
+ \dosetcolorattribute\??ia\c!color
+ \doprocessreferenceelse{#2}{#1\presetgoto}{\unknownreference{#2}#1\relax}%
+ \egroup
\else
#1%
\fi}}
@@ -1453,7 +1425,7 @@
{\dosingleempty\dodospecialfrom}
\def\dodospecialfrom[#1]%
- {\dontleavehmode\ctxlua{jobreferences.from("#1","","")}}
+ {\dontleavehmode\goto{\ctxlua{jobreferences.from("#1")}}[#1]}
%D We also support:
%D
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index d1a4c8772..1726750f1 100644
--- a/tex/generic/context/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/texmf/tex/generic/context/luatex-fonts.lua
--- merge date : 06/11/09 00:09:35
+-- merge date : 06/13/09 14:05:57
do -- begin closure to overcome local limits and interference