summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2011-07-14 16:09:00 +0200
committerHans Hagen <pragma@wxs.nl>2011-07-14 16:09:00 +0200
commit38d8d7ef427e171ef459f9e7e49fb8f051ab56a6 (patch)
tree8a33bf7083942f25bbf963af6ed0f19532f7397e
parent15b10d973290abaf01211aa5c68b6026ba1b02ac (diff)
downloadcontext-38d8d7ef427e171ef459f9e7e49fb8f051ab56a6.tar.gz
beta 2011.07.14 16:09
-rw-r--r--scripts/context/lua/mtx-update.lua4
-rw-r--r--tex/context/base/cont-new.mkii2
-rw-r--r--tex/context/base/cont-new.mkiv2
-rw-r--r--tex/context/base/context.mkii2
-rw-r--r--tex/context/base/context.mkiv2
-rw-r--r--tex/context/base/l-pdfview.lua6
-rw-r--r--tex/context/base/mult-sys.mkiv3
-rw-r--r--tex/context/base/status-files.pdfbin23753 -> 23774 bytes
-rw-r--r--tex/context/base/status-lua.pdfbin162055 -> 162103 bytes
-rw-r--r--tex/context/base/strc-ref.lua40
-rw-r--r--tex/context/base/strc-ref.mkiv102
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua2
12 files changed, 97 insertions, 68 deletions
diff --git a/scripts/context/lua/mtx-update.lua b/scripts/context/lua/mtx-update.lua
index 937fed21b..2b8c06f0a 100644
--- a/scripts/context/lua/mtx-update.lua
+++ b/scripts/context/lua/mtx-update.lua
@@ -508,8 +508,10 @@ function scripts.update.make()
if not force then
report("make, use --force to really make formats")
end
- scripts.update.run(format('mtxrun --tree="%s" --direct --resolve mktexlsr',texroot))
+
+ scripts.update.run(format('mtxrun --tree="%s" --direct --resolve mktexlsr',texroot)) -- needed for mpost
scripts.update.run(format('mtxrun --tree="%s" --generate',texroot))
+
report("make, done")
end
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index 9380be7a6..9914003b9 100644
--- a/tex/context/base/cont-new.mkii
+++ b/tex/context/base/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2011.07.14 12:19}
+\newcontextversion{2011.07.14 16:09}
%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/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index 2c8d13f13..924780826 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2011.07.14 12:19}
+\newcontextversion{2011.07.14 16:09}
%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.mkii b/tex/context/base/context.mkii
index cef1fdf70..cceae9e16 100644
--- a/tex/context/base/context.mkii
+++ b/tex/context/base/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2011.07.14 12:19}
+\edef\contextversion{2011.07.14 16:09}
%D For those who want to use this:
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index dd3001f8f..f1dddaccc 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2011.07.14 12:19}
+\edef\contextversion{2011.07.14 16:09}
%D For those who want to use this:
diff --git a/tex/context/base/l-pdfview.lua b/tex/context/base/l-pdfview.lua
index 6fd3ac246..c8cfa1229 100644
--- a/tex/context/base/l-pdfview.lua
+++ b/tex/context/base/l-pdfview.lua
@@ -69,7 +69,7 @@ function pdfview.open(...)
for i=1,#t do
local name = fullname(t[i])
if io.exists(name) then
- os.execute(format('%s "%s" 2>&1', opencall, name))
+ os.execute(format('%s "%s"', opencall, name)) -- no 2>&1 any more, needs checking on windows
openedfiles[name] = true
end
end
@@ -83,7 +83,7 @@ function pdfview.close(...)
for i=1,#t do
local name = fullname(t[i])
if openedfiles[name] then
- os.execute(format('%s "%s" 2>&1', closecall, name))
+ os.execute(format('%s "%s"', closecall, name)) -- no 2>&1 any more, needs checking on windows
openedfiles[name] = nil
else
pdfview.closeall()
@@ -96,7 +96,7 @@ end
function pdfview.closeall()
local allcall = allcalls[pdfview.method]
if allcall then
- os.execute(format('%s 2>&1', allcall))
+ os.execute(format('%s', allcall)) -- no 2>&1 any more, needs checking on windows
end
openedfiles = { }
end
diff --git a/tex/context/base/mult-sys.mkiv b/tex/context/base/mult-sys.mkiv
index fb331ed0e..60b8c5f3c 100644
--- a/tex/context/base/mult-sys.mkiv
+++ b/tex/context/base/mult-sys.mkiv
@@ -656,7 +656,8 @@
\definesystemvariable {pv} % PublicationVariable
\definesystemvariable {ra} % RAise
\definesystemvariable {rd} % RenDering
-\definesystemvariable {rf} % ReFereren
+\definesystemvariable {re} % REferenceformat
+\definesystemvariable {rf} % ReFerencing
\definesystemvariable {rg} % ReGel
\definesystemvariable {rl} % ReferentieLijst
\definesystemvariable {rn} % RegelNummer
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 8acece70b..0b0ce8617 100644
--- a/tex/context/base/status-files.pdf
+++ b/tex/context/base/status-files.pdf
Binary files differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 640402f1d..4509a0268 100644
--- a/tex/context/base/status-lua.pdf
+++ b/tex/context/base/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/strc-ref.lua b/tex/context/base/strc-ref.lua
index e8f2e89e3..d3c3f7ff7 100644
--- a/tex/context/base/strc-ref.lua
+++ b/tex/context/base/strc-ref.lua
@@ -1325,22 +1325,26 @@ function references.getcurrentprefixspec(default) -- todo: message
end
function references.filter(name,...) -- number page title ...
- local data = currentreference and currentreference.i
+ local data = currentreference and currentreference.i -- maybe we should take realpage from here
if data then
- local kind = data.metadata and data.metadata.kind
- if kind then
- local filter = filters[kind] or filters.generic
- filter = filter and (filter[name] or filter.unknown or filters.generic[name] or filters.generic.unknown)
- if filter then
- if trace_referencing then
- report_references("name '%s', kind '%s', using dedicated filter",name,kind)
+ if name == "realpage" then
+ references.realpage() -- special case, does an analysis (maybe we have more)
+ else
+ local kind = data.metadata and data.metadata.kind
+ if kind then
+ local filter = filters[kind] or filters.generic
+ filter = filter and (filter[name] or filter.unknown or filters.generic[name] or filters.generic.unknown)
+ if filter then
+ if trace_referencing then
+ report_references("name '%s', kind '%s', using dedicated filter",name,kind)
+ end
+ filter(data,name,...)
+ elseif trace_referencing then
+ report_references("name '%s', kind '%s', using generic filter",name,kind)
end
- filter(data,name,...)
elseif trace_referencing then
- report_references("name '%s', kind '%s', using generic filter",name,kind)
+ report_references("name '%s', unknown kind",name)
end
- elseif trace_referencing then
- report_references("name '%s', unknown kind",name)
end
elseif trace_referencing then
report_references("name '%s', no reference",name)
@@ -1495,7 +1499,7 @@ local function checkedpagestate(n,page)
end
end
-function references.analyze(actions)
+local function analyze(actions)
actions = actions or references.currentset
if not actions then
actions = { realpage = 0 }
@@ -1524,8 +1528,10 @@ function references.analyze(actions)
return actions
end
-function references.realpage() -- special case, we always want result
- local cs = references.analyze()
+references.analyze = analyze
+
+function references.realpage() -- special case, we always want result (also does test ... still needed?)
+ local cs = analyze()
context(cs.realpage or 0)
end
@@ -1635,3 +1641,7 @@ function specials.section(var,actions)
specials.internal(var,actions)
end
end
+
+-- needs a better split ^^^
+
+commands.filterreference = references.filter
diff --git a/tex/context/base/strc-ref.mkiv b/tex/context/base/strc-ref.mkiv
index 71de715ba..02174496e 100644
--- a/tex/context/base/strc-ref.mkiv
+++ b/tex/context/base/strc-ref.mkiv
@@ -833,14 +833,15 @@
% \definecommand from {\dospecialfrom}
% \definecommand over {\dospecialabout} % needed here, else math problems
-\def\currentreferencenumber {\ctxlua{structures.references.filter("number")}}
-\def\currentreferencepage {\ctxlua{structures.references.filter("page")}}
-\def\currentreferencetitle {\ctxlua{structures.references.filter("title")}}
-\def\currentreferencetext {\ctxlua{structures.references.filter("text")}}
-\def\currentreferencedefault {\ctxlua{structures.references.filter("default")}}
-\def\currentreferencerealpage{\ctxlua{structures.references.realpage()}}
+ \def\filterreference #1{\ctxcommand{filterreference("#1")}}
+\unexpanded\def\getreferenceentry#1{\ctxcommand{filterreference("#1")}}
-\def\getreferenceentry#1{\ctxlua{structures.references.filter("#1")}} % user entry
+\def\currentreferencenumber {\filterreference{number}}
+\def\currentreferencepage {\filterreference{page}}
+\def\currentreferencetitle {\filterreference{title}}
+\def\currentreferencetext {\filterreference{text}}
+\def\currentreferencedefault {\filterreference{default}}
+\def\currentreferencerealpage{\filterreference{realpage}}
\unexpanded\def\dospecialabout[#1]%
{\dontleavehmode
@@ -1032,7 +1033,6 @@
%D Instead of a text, one can specify a label, which should
%D be defined with \type {\setuplabeltext}.
%D
-%D
%D Watch out: the second argument is somewhat special and mostly
%D meant for a suffix to a number:
%D
@@ -1051,45 +1051,48 @@
%D
%D \typebuffer \getbuffer
-% todo: inherit
-
-\let\currentreferenceformat\empty
-
-\def\referenceformatparameter#1% some day we will add inheritance
- {\ifcsname\??rf\currentreferenceformat#1\endcsname\csname\??rf\currentreferenceformat#1\expandafter\endcsname\fi}
+% to be done: interfaced
-\unexpanded\def\definereferenceformat
- {\dodoubleargument\dodefinereferenceformat}
+\installcommandhandler \??re {referenceformat} \??re
-% left right text label
-
-\def\dodefinereferenceformat[#1][#2]%
- {\iffirstargument
- \getparameters[\??rf#1][\c!left=,\c!right=,\c!text=,\c!label=,\c!autocase=v!no,#2]%
- \setuvalue{#1}{\doexecutereferenceformat{#1}}%
- \fi}
+\appendtoks
+ \setuevalue\currentreferenceformat{\doexecutereferenceformat{\currentreferenceformat}}%
+\to \everydefinereferenceformat
+
+\setupreferenceformat
+ [\c!left=,
+ \c!right=,
+ \c!text=,
+ \c!label=,
+ \c!autocase=\v!no,
+ \c!style=,
+ \c!type=default, % to be done: interfaced
+ \c!setups=,
+ \c!color=]
-\def\doexecutereferenceformat#1% quite slow due to all assignments but we will speed it up
- {\dostartgotoreference % once it's stable
+\unexpanded\def\doexecutereferenceformat#1%
+ {\dostartgotoreference
\edef\currentreferenceformat{#1}%
- \gdef\leftofreference {\referenceformatparameter\c!left }%
- \gdef\rightofreference{\referenceformatparameter\c!right}%
- % we can make a helper for this .. we will use the new parameter handler anyway
- % but at least aditya can play with it now
- \doifsomething{\referenceformatparameter\c!style}
- {\dosetfontattribute{\??rf\currentreferenceformat}\c!style
- \resetinteractionparameter\c!style}%
- \doifsomething{\referenceformatparameter\c!color}
- {\dosetcolorattribute{\??rf\currentreferenceformat}\c!color
- \resetinteractionparameter\c!contrastcolor
- \resetinteractionparameter\c!color}%
- %
- \edef\currentreferenceformatlabel{\referenceformatparameter\c!label}%
+ \gdef\leftofreference {\referenceformatparameter\c!left }%
+ \gdef\rightofreference {\referenceformatparameter\c!right }%
+ \edef\currentreferenceformatlabel {\referenceformatparameter\c!label }%
+ \edef\currentreferenceformattype {\referenceformatparameter\c!type }%
+ \edef\currentreferenceformatsetups {\referenceformatparameter\c!setups }%
+ \edef\currentreferenceformatautocase{\referenceformatparameter\c!autocase}%
+ \dosetreferenceformatattributes \c!style \c!color
+ \ifx\fontattributehash\empty \else
+ \resetinteractionparameter\c!style
+ \fi
+ \ifx\colorattributehash\empty \else
+ \resetinteractionparameter\c!contrastcolor
+ \resetinteractionparameter\c!color
+ \fi
\ifx\currentreferenceformatlabel\autoreferencelabeltextflag
\edef\currentreferenceformatlabel{\autoreferencelabeltext}%
\fi
- \doif{\referenceformatparameter\c!autocase}\v!yes
- {\setcharactercleaning[1]}%
+ \ifx\currentreferenceformatautocase\v!yes
+ \setcharactercleaning[1]%
+ \fi
\ifx\currentreferenceformatlabel\empty
\defaultleftreferencetoks {\referenceformatparameter\c!text}%
\defaultrightreferencetoks\emptytoks
@@ -1097,9 +1100,16 @@
\defaultleftreferencetoks {\leftlabeltext \currentreferenceformatlabel}%
\defaultrightreferencetoks{\rightlabeltext\currentreferenceformatlabel}%
\fi
- \doifelse{\referenceformatparameter\c!type}\v!page
- {\let\currentreferencecontent\currentreferencepage}
- {\let\currentreferencecontent\currentreferencedefault}%
+ \ifx\currentreferenceformattype\empty
+ \def\currentreferenceformattype{default}%
+ \fi
+ %
+ \ifx\currentreferenceformatsetups\empty
+ \def\currentreferencecontent{\filterreference\currentreferenceformattype}%
+ \else
+ \def\currentreferencecontent{\directsetup\currentreferenceformatsetups}%
+ \fi
+ %
\let\leftofreferencecontent \empty
\let\rightofreferencecontent\empty
\dopickupgotoreference}
@@ -1121,6 +1131,12 @@
% [\inxx{a}{b}[one]]
% \stoptext
+% \startsetups referenceformat:numberplustext
+% \filterreference{number}, \filterreference{title}
+% \stopsetups
+%
+% \definereferenceformat[hellup][text=Hellup ,setups=referenceformat:numberplustext]
+
%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
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index 0bb0eb961..f5f6991ea 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 07/14/11 12:19:31
+-- merge date : 07/14/11 16:09:42
do -- begin closure to overcome local limits and interference