summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2010-12-02 01:40:15 +0200
committerMarius <mariausol@gmail.com>2010-12-02 01:40:15 +0200
commit17e955be6ba36d7fb9169eb2a1e75ed10fa36b73 (patch)
tree94d2cfe450de45652ce8613ce09f525121f9e739
parent7792774480096b75afe676c07115958586c76ecc (diff)
downloadcontext-17e955be6ba36d7fb9169eb2a1e75ed10fa36b73.tar.gz
beta 2010.12.02 00:11
-rw-r--r--scripts/context/lua/mtxrun.lua9
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua9
-rw-r--r--scripts/context/stubs/unix/mtxrun9
-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.lua11
-rw-r--r--tex/context/base/data-tex.lua3
-rw-r--r--tex/context/base/luat-cod.lua4
-rw-r--r--tex/context/base/page-lin.mkiv2
-rw-r--r--tex/context/base/strc-des.mkiv2
-rw-r--r--tex/context/base/strc-lnt.mkiv28
-rw-r--r--tex/context/base/strc-not.mkiv78
-rw-r--r--tex/generic/context/luatex-fonts-merged.lua2
13 files changed, 113 insertions, 48 deletions
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 6b74022ae..bb16aaec0 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -11296,7 +11296,7 @@ function resolvers.registerfilehash(name,content,someerror)
end
function isreadable(name)
- local readable = file.is_readable(name)
+ local readable = lfs.isfile(name) -- not file.is_readable(name) asit can be a dir
if trace_detail then
if readable then
report_resolvers("file '%s' is readable",name)
@@ -11509,10 +11509,11 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo :
-- search spec
local filetype, extra, done, wantedfiles, ext = '', nil, false, { }, fileextname(filename)
-- tricky as filename can be bla.1.2.3
+
+-- to be checked
+
if ext == "" then
- if not instance.force_suffixes then
- wantedfiles[#wantedfiles+1] = filename
- end
+ wantedfiles[#wantedfiles+1] = filename
else
wantedfiles[#wantedfiles+1] = filename
end
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 6b74022ae..bb16aaec0 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -11296,7 +11296,7 @@ function resolvers.registerfilehash(name,content,someerror)
end
function isreadable(name)
- local readable = file.is_readable(name)
+ local readable = lfs.isfile(name) -- not file.is_readable(name) asit can be a dir
if trace_detail then
if readable then
report_resolvers("file '%s' is readable",name)
@@ -11509,10 +11509,11 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo :
-- search spec
local filetype, extra, done, wantedfiles, ext = '', nil, false, { }, fileextname(filename)
-- tricky as filename can be bla.1.2.3
+
+-- to be checked
+
if ext == "" then
- if not instance.force_suffixes then
- wantedfiles[#wantedfiles+1] = filename
- end
+ wantedfiles[#wantedfiles+1] = filename
else
wantedfiles[#wantedfiles+1] = filename
end
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 6b74022ae..bb16aaec0 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -11296,7 +11296,7 @@ function resolvers.registerfilehash(name,content,someerror)
end
function isreadable(name)
- local readable = file.is_readable(name)
+ local readable = lfs.isfile(name) -- not file.is_readable(name) asit can be a dir
if trace_detail then
if readable then
report_resolvers("file '%s' is readable",name)
@@ -11509,10 +11509,11 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo :
-- search spec
local filetype, extra, done, wantedfiles, ext = '', nil, false, { }, fileextname(filename)
-- tricky as filename can be bla.1.2.3
+
+-- to be checked
+
if ext == "" then
- if not instance.force_suffixes then
- wantedfiles[#wantedfiles+1] = filename
- end
+ wantedfiles[#wantedfiles+1] = filename
else
wantedfiles[#wantedfiles+1] = filename
end
diff --git a/tex/context/base/cont-new.tex b/tex/context/base/cont-new.tex
index 6210cb11d..a50c90129 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.12.01 18:05}
+\newcontextversion{2010.12.02 00:11}
%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 4cc9163e4..d1fa4e3d6 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.12.01 18:05}
+\edef\contextversion{2010.12.02 00:11}
%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 408aec83c..897adb5c4 100644
--- a/tex/context/base/data-res.lua
+++ b/tex/context/base/data-res.lua
@@ -796,7 +796,7 @@ function resolvers.registerfilehash(name,content,someerror)
end
function isreadable(name)
- local readable = file.is_readable(name)
+ local readable = lfs.isfile(name) -- not file.is_readable(name) asit can be a dir
if trace_detail then
if readable then
report_resolvers("file '%s' is readable",name)
@@ -904,6 +904,8 @@ local preparetreepattern = Cs((P(".")/"%%." + P("-")/"%%-" + P(1))^0 * Cc("$"))
local function collect_instance_files(filename,askedformat,allresults) -- todo : plugin (scanners, checkers etc)
local result = { }
local stamp = nil
+--~ local trace_locating = true
+--~ local trace_detail= true
askedformat = askedformat or ""
filename = collapsepath(filename)
-- speed up / beware: format problem
@@ -1012,10 +1014,11 @@ local function collect_instance_files(filename,askedformat,allresults) -- todo :
--~ if not suffixmap[ext] then --- probably needs to be done elsewhere too
--~ wantedfiles[#wantedfiles+1] = filename
--~ end
+
+-- to be checked
+
if ext == "" then
- if not instance.force_suffixes then
- wantedfiles[#wantedfiles+1] = filename
- end
+ wantedfiles[#wantedfiles+1] = filename
else
wantedfiles[#wantedfiles+1] = filename
end
diff --git a/tex/context/base/data-tex.lua b/tex/context/base/data-tex.lua
index 5c6cf5083..84ec549ae 100644
--- a/tex/context/base/data-tex.lua
+++ b/tex/context/base/data-tex.lua
@@ -55,6 +55,9 @@ function helpers.textopener(tag,filename,file_handle)
elseif file_handle then
lines = file_handle:read("*a")
file_handle:close()
+ else
+ report_resolvers("%s opener, weird error: filename=%s, handle=%s",tag,tostring(filename),tostring(file_handle))
+ lines = ""
end
if type(lines) == "string" then
local kind = unicode.filetype(lines)
diff --git a/tex/context/base/luat-cod.lua b/tex/context/base/luat-cod.lua
index a06c8c0bf..a9cd4551b 100644
--- a/tex/context/base/luat-cod.lua
+++ b/tex/context/base/luat-cod.lua
@@ -117,7 +117,7 @@ end
-- We need a few premature callbacks in the format generator. We
-- also do this when the format is loaded as otherwise we get
--- a kpse error when disabled. Thi sis en angine issue that will
+-- a kpse error when disabled. This is an engine issue that will
-- be sorted out in due time.
local isfile = lfs.isfile
@@ -163,5 +163,5 @@ local function open_read_file(name)
end
callback.register('find_read_file' , find_read_file )
-callback.register('open_read_file' , open_read_file)
+callback.register('open_read_file' , open_read_file )
callback.register('find_write_file', find_write_file)
diff --git a/tex/context/base/page-lin.mkiv b/tex/context/base/page-lin.mkiv
index 2cea2da03..4f2226f6e 100644
--- a/tex/context/base/page-lin.mkiv
+++ b/tex/context/base/page-lin.mkiv
@@ -487,7 +487,7 @@
% referencing
-\def\someline [#1]{\mkstartlinereference{#1}\mkstoplinereference{#1}}
+\unexpanded\def\someline [#1]{\mkstartlinereference{#1}\mkstoplinereference{#1}} % was just a def
\unexpanded\def\startline[#1]{\mkstartlinereference{#1}}
\unexpanded\def\stopline [#1]{\mkstoplinereference {#1}}
diff --git a/tex/context/base/strc-des.mkiv b/tex/context/base/strc-des.mkiv
index 68e3ba155..4407e32ea 100644
--- a/tex/context/base/strc-des.mkiv
+++ b/tex/context/base/strc-des.mkiv
@@ -70,6 +70,8 @@
\def\descriptionmainparameter #1{\csname\dodescriptionparameter{\??dd\currentdescriptionmain }#1\endcsname}
\def\descriptionnumberparameter#1{\csname\dodescriptionparameter{\??dd\currentdescriptionnumber}#1\endcsname}
+\def\nameddescriptionparameter #1#2{\csname\dodescriptionparameter{\??dd#1}#2\endcsname}
+
\def\detokenizeddescriptionparameter#1{\detokenize\expandafter\expandafter\expandafter{\csname\??dd\currentdescription#1\endcsname}}
\def\dodescriptionparameter#1#2%
diff --git a/tex/context/base/strc-lnt.mkiv b/tex/context/base/strc-lnt.mkiv
index 1289057df..442a9378f 100644
--- a/tex/context/base/strc-lnt.mkiv
+++ b/tex/context/base/strc-lnt.mkiv
@@ -14,18 +14,16 @@
\writestatus{loading}{ConTeXt Structure Macros / Line Notes}
%D This module loads on top of the footnote and line numbering macros.
-%D
-%D ln: might go away
\unprotect
-\newcounter\linenotecounter \newif\iftracelinenotes % will be tracker
+\newcount\noflinenotes \newif\iftracelinenotes % will be tracker
\def\dohandlelinenote#1#2#3%
{\bgroup
\def\linenotelinenumber##1{\inlinerange[#2]}% ##1 == order
- \setupnote[ln:#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% todo: deep hook
- \setnote[ln:#1]{#3}%
+ \setupnote[#1][\c!numbercommand=\linenotelinenumber,\c!textcommand=\gobbleoneargument]% todo: deep hook
+ \getvalue{\??vn:ln:#1}{#3}%
\egroup}
\def\dotracedlinenote#1%
@@ -34,7 +32,7 @@
{\forgetall
\hsize\zeropoint
\hss
- \vbox to \strutheight{\llap{\red\infofont\setstrut\linenotecounter}\vss}%
+ \vbox to \strutheight{\llap{\red\infofont\setstrut\the\noflinenotes}\vss}%
{\color[blue]{\vl}}%
\vbox to \strutheight{\rlap{\red\infofont\setstrut#1}\vss}%
\hss}%
@@ -42,13 +40,13 @@
\fi}
\def\dolinenote#1#2%
- {\doglobal\increment\linenotecounter
- \dohandlelinenote{#1}{\linenotecounter}{#2}%
+ {\global\advance\noflinenotes\plusone
+ \dohandlelinenote{#1}{\the\noflinenotes}{#2}%
\dotracedlinenote\empty
- \expanded{\someline[\linenotecounter]}}
+ \normalexpanded{\someline[\the\noflinenotes]}}
\def\dostartlinenote#1[#2]#3%
- {\doglobal\increment\linenotecounter
+ {\global\advance\noflinenotes\plusone
\dohandlelinenote{#1}{#2}{#3}%
\dotracedlinenote{#2}%
\startline[#2]}
@@ -57,16 +55,16 @@
{\stopline[#2]}
\unexpanded\def\definelinenote
- {\dodoubleempty\dodefinelinenote}
+ {\dotripleempty\dodefinelinenote}
-\def\dodefinelinenote[#1][#2]%
- {\definenote[ln:#1][#2]%
+\def\dodefinelinenote[#1][#2][#3]%
+ {\dodefinenote[#1][#2][#3]% do as we need to test for arguments
+ \expandafter\let\csname\??vn:ln:#1\expandafter\endcsname\csname#1\endcsname % use copy command
\setuvalue {#1}{\dolinenote {#1}}%
\setuvalue{\e!start#1}{\dostartlinenote{#1}}%
\setuvalue{\e!stop #1}{\dostoplinenote {#1}}}
-\unexpanded\def\setuplinenote[#1]% convenient
- {\setupnote[ln:#1]}
+\let\setuplinenote\setupnote
% We predefine one, namely \type {\linenote} cum suis.
diff --git a/tex/context/base/strc-not.mkiv b/tex/context/base/strc-not.mkiv
index 6f6f5638a..d011cf0f3 100644
--- a/tex/context/base/strc-not.mkiv
+++ b/tex/context/base/strc-not.mkiv
@@ -207,38 +207,85 @@
\newtoks \everysetupnote
\unexpanded\def\definenote
- {\dodoubleempty\dodefinenote}
+ {\dotripleempty\dodefinenote}
-\def\dodefinenote[#1][#2]%
+\def\dodefinenote[#1][#2][#3]% note [parent] [settings]
{\edef\currentnote{#1}%
\ifcsname\??vn:\currentnote\endcsname\else
\@EA\installinsertion\csname\??vn:\currentnote\endcsname\relax
\appendtoks\doprocesssomenote{#1}\to\tobeprocessednotes
\fi
- \defineenumeration % description
+ \ifsecondargument
+ \doifassignmentelse{#2}{\dodefinenotewithsettings{#2}}{\dodefinenotewithparent{#2}{#3}}%
+ \else
+ \dodefinenotesimple
+ \fi
+ \ctxlua{structures.notes.define("\currentnote","insert",\number\csname\??vn:\currentnote\endcsname)}%
+ \the\everysetupnote
+ \dochecknote}
+
+\def\dodefinenotesimple
+ {\defineenumeration
[\currentnote]
- [\c!location=\@@defaultnotedefloc,
+ [\s!handler=\v!note,
+ \c!text=,
+ \c!location=\@@defaultnotedefloc,
\c!distance=\@@defaultnotedefdis,
\c!width=\v!fit,
\c!headstyle=\noteparameter\c!style,
\c!headcolor=\noteparameter\c!color,
- \s!handler=\v!note,
- \c!text=,
\c!before=,
\c!after=]%
\doredefinenotecommands
+ \presetlocalframed
+ [\??vn\currentnote]%
\setupenumerations
[\currentnote]
[\s!parent=\??vn\currentnote,
\c!number=\v!yes]% no inheritance from decriptions which is okay
+ \getparameters
+ [\??vn\currentnote]
+ [\s!parent=\??vn]}
+
+\def\dodefinenotewithsettings#1%
+ {\defineenumeration % description
+ [\currentnote]
+ [\s!handler=\v!note,
+ \c!text=,
+ \c!location=\@@defaultnotedefloc,
+ \c!distance=\@@defaultnotedefdis,
+ \c!width=\v!fit,
+ \c!headstyle=\noteparameter\c!style,
+ \c!headcolor=\noteparameter\c!color,
+ \c!before=,
+ \c!after=]%
+ \doredefinenotecommands
\presetlocalframed
[\??vn\currentnote]%
+ \setupenumerations
+ [\currentnote]
+ [\s!parent=\??vn\currentnote,
+ \c!number=\v!yes]%
\getparameters
[\??vn\currentnote]
- [\s!parent=\??vn,#2]%
- \ctxlua{structures.notes.define("\currentnote","insert",\number\csname\??vn:\currentnote\endcsname)}%
- \the\everysetupnote
- \dochecknote}
+ [\s!parent=\??vn,#1]}
+
+\def\dodefinenotewithparent#1#2%
+ {%setevalue{\??vn:#2:kids}{\ifcsname\??vn:#2:kids\endcsname\csname\??vn:#2:kids\endcsname,\fi#1}%
+ \defineenumeration
+ [\currentnote]
+ [\s!handler=\v!note,
+ \c!text=]%
+ \doredefinenotecommands
+ \presetlocalframed
+ [\??vn\currentnote]%
+ \setupenumerations
+ [\currentnote]
+ [\s!parent=\??dd#1,
+ \c!number=\v!yes]%
+ \getparameters
+ [\??vn\currentnote]
+ [\s!parent=\??vn#1,#2]}
% \starttext
% text \startfootnote Test.\stopfootnote
@@ -265,6 +312,12 @@
\let\setupnotedefinition\setupenumerations
+% \def\dodowithcurrentnoteandkids#1#2% action kid
+% {\pushmacro\currentnote
+% \def\currentnote{#2}%
+% \dowithcurrentnoteandkids{#1}% recursive
+% \popmacro\currentnote}%
+
\appendtoks
\setupenumerations[\currentnote][]%
\to \everysetupnote
@@ -355,6 +408,8 @@
\def\dosetcheckednote#1{\csname\??vn @#1\endcsname}
+\newtoks\everychecknote
+
\def\dochecknote
{% node states
\setnotelocation\plusone % page
@@ -406,7 +461,8 @@
\global\dimen\currentnoteins\maxdimen
\global\count\currentnoteins\zerocount
\global\skip \currentnoteins\zeropoint
- \fi}
+ \fi
+ \the\everychecknote}
\def\dosetnotedistance
{\begingroup
diff --git a/tex/generic/context/luatex-fonts-merged.lua b/tex/generic/context/luatex-fonts-merged.lua
index d332cdc55..1cacbb665 100644
--- a/tex/generic/context/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : luatex-fonts-merged.lua
-- parent file : luatex-fonts.lua
--- merge date : 12/01/10 18:05:09
+-- merge date : 12/02/10 00:11:28
do -- begin closure to overcome local limits and interference