From fdce6325c8f90b29b7bd29ee7e0eb0f7019bccc0 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Sat, 17 Sep 2011 09:40:00 +0200 Subject: beta 2011.09.17 09:40 --- .../lexers/data/scite-context-data-context.lua | 4 +- .../data/scite/lexers/scite-context-lexer-cld.lua | 162 +------------- .../data/scite/lexers/scite-context-lexer-lua.lua | 219 +++++++++++++++++++ .../data/scite/lexers/scite-context-lexer-tex.lua | 197 +++++++++++++---- context/data/scite/metapost.properties | 2 +- .../scite/scite-context-data-context.properties | 66 +++--- .../data/scite/scite-context-external.properties | 14 +- .../data/scite/scite-context-internal.properties | 10 +- context/data/scite/scite-context-readme.tex | 50 ++++- context/data/scite/scite-context.properties | 215 +++++++++++++----- context/data/scite/tex.properties | 2 +- tex/context/base/anch-pgr.mkiv | 11 +- tex/context/base/colo-ini.lua | 1 - tex/context/base/cont-new.mkii | 2 +- tex/context/base/cont-new.mkiv | 2 +- tex/context/base/context-version.pdf | Bin 4094 -> 4090 bytes tex/context/base/context-version.png | Bin 106550 -> 105912 bytes tex/context/base/context.mkii | 2 +- tex/context/base/context.mkiv | 2 +- tex/context/base/mult-aux.mkiv | 9 +- tex/context/base/mult-de.mkii | 2 + tex/context/base/mult-def.lua | 6 + tex/context/base/mult-en.mkii | 2 + tex/context/base/mult-fr.mkii | 2 + tex/context/base/mult-it.mkii | 2 + tex/context/base/mult-low.lua | 20 +- tex/context/base/mult-nl.mkii | 2 + tex/context/base/mult-pe.mkii | 2 + tex/context/base/mult-ro.mkii | 2 + tex/context/base/node-bck.lua | 2 +- tex/context/base/node-bck.mkiv | 2 +- tex/context/base/node-rul.mkiv | 23 +- tex/context/base/pack-box.mkiv | 2 +- tex/context/base/pack-rul.mkiv | 6 + tex/context/base/page-flt.mkiv | 4 +- tex/context/base/page-mul.mkiv | 20 +- tex/context/base/page-one.mkiv | 22 +- tex/context/base/page-set.mkiv | 12 +- tex/context/base/status-files.pdf | Bin 23935 -> 23919 bytes tex/context/base/status-lua.pdf | Bin 162353 -> 162348 bytes tex/context/base/strc-flt.mkiv | 242 ++++++--------------- tex/context/base/strc-num.mkiv | 14 +- tex/context/base/strc-sbe.mkiv | 22 +- tex/context/base/syst-aux.mkiv | 5 + tex/context/interface/keys-cs.xml | 2 + tex/context/interface/keys-de.xml | 2 + tex/context/interface/keys-en.xml | 2 + tex/context/interface/keys-fr.xml | 2 + tex/context/interface/keys-it.xml | 2 + tex/context/interface/keys-nl.xml | 2 + tex/context/interface/keys-pe.xml | 2 + tex/context/interface/keys-ro.xml | 2 + tex/generic/context/luatex/luatex-fonts-merged.lua | 2 +- 53 files changed, 847 insertions(+), 557 deletions(-) create mode 100644 context/data/scite/lexers/scite-context-lexer-lua.lua diff --git a/context/data/scite/lexers/data/scite-context-data-context.lua b/context/data/scite/lexers/data/scite-context-data-context.lua index ba7500e01..4142d2a29 100644 --- a/context/data/scite/lexers/data/scite-context-data-context.lua +++ b/context/data/scite/lexers/data/scite-context-data-context.lua @@ -1,4 +1,4 @@ return { - ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "plussixteen", "plushundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "zeropoint", "onepoint", "onebasepoint", "maxdimen", "scaledpoint", "thousandpoint", "points", "zeroskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "etexversion", "pdftexversion", "xetexversion", "xetexrevision", "activecatcode", "bgroup", "egroup", "endline", "attributeunsetvalue", "uprotationangle", "rightrotatioangle", "downrotatioangle", "leftrotatioangle" }, - ["helpers"]={ "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", "htdp", "unvoidbox", "scratchcounter", "globalscratchcounter", "scratchdimen", "globalscratchdimen", "scratchskip", "globalscratchskip", "scratchmuskip", "globalscratchmuskip", "scratchtoks", "globalscratchtoks", "scratchbox", "globalscratchbox", "scratchwidth", "scratchheight", "scratchdepth", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchboxone", "scratchboxtwo", "scratchboxthree", "doif", "doifnot", "doifelse", "doifinset", "doifnotinset", "doifinsetelse", "doifnextcharelse", "doifnextoptionalelse", "doifnextparenthesiselse", "doiffastoptionalcheckelse", "doifundefinedelse", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifdimensionelse", "doifnumberelse", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifinstringelse", "tracingall", "tracingnone", "loggingall", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "endgraf", "empty", "null", "space", "obeyspaces", "obeylines", "normalspace", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "wait", "writestatus", "define", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "measure", "getvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "glet", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protected", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "newconstant", "setnewconstant", "newconditional", "settrue", "setfalse", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doiffirstcharelse" }, + ["constants"]={ "zerocount", "minusone", "minustwo", "plusone", "plustwo", "plusthree", "plusfour", "plusfive", "plussix", "plusseven", "pluseight", "plusnine", "plusten", "plussixteen", "plushundred", "plusthousand", "plustenthousand", "plustwentythousand", "medcard", "maxcard", "zeropoint", "onepoint", "onebasepoint", "maxdimen", "scaledpoint", "thousandpoint", "points", "zeroskip", "pluscxxvii", "pluscxxviii", "pluscclv", "pluscclvi", "endoflinetoken", "outputnewlinechar", "emptytoks", "empty", "undefined", "voidbox", "emptybox", "emptyvbox", "emptyhbox", "bigskipamount", "medskipamount", "smallskipamount", "fmtname", "fmtversion", "texengine", "texenginename", "texengineversion", "luatexengine", "pdftexengine", "xetexengine", "unknownengine", "etexversion", "pdftexversion", "xetexversion", "xetexrevision", "activecatcode", "bgroup", "egroup", "endline", "attributeunsetvalue", "uprotationangle", "rightrotatioangle", "downrotatioangle", "leftrotatioangle", "startmode", "stopmode", "startnotmode", "stopnotmode", "doifmode", "doifmodeelse", "doifnotmode", "startenvironment", "stopenvironment", "environment", "startcomponent", "stopcomponent", "component", "startproduct", "stopproduct", "product", "startproject", "stopproject", "project", "starttext", "stoptext" }, + ["helpers"]={ "startsetups", "stopsetups", "startxmlsetups", "stopxmlsetups", "starttexdefinition", "stoptexdefinition", "starttexcode", "stoptexcode", "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", "htdp", "unvoidbox", "scratchcounter", "globalscratchcounter", "scratchdimen", "globalscratchdimen", "scratchskip", "globalscratchskip", "scratchmuskip", "globalscratchmuskip", "scratchtoks", "globalscratchtoks", "scratchbox", "globalscratchbox", "scratchwidth", "scratchheight", "scratchdepth", "scratchcounterone", "scratchcountertwo", "scratchcounterthree", "scratchdimenone", "scratchdimentwo", "scratchdimenthree", "scratchskipone", "scratchskiptwo", "scratchskipthree", "scratchmuskipone", "scratchmuskiptwo", "scratchmuskipthree", "scratchtoksone", "scratchtokstwo", "scratchtoksthree", "scratchboxone", "scratchboxtwo", "scratchboxthree", "doif", "doifnot", "doifelse", "doifinset", "doifnotinset", "doifinsetelse", "doifnextcharelse", "doifnextoptionalelse", "doifnextparenthesiselse", "doiffastoptionalcheckelse", "doifundefinedelse", "doifdefinedelse", "doifundefined", "doifdefined", "doifelsevalue", "doifvalue", "doifnotvalue", "doifnothing", "doifsomething", "doifelsenothing", "doifsomethingelse", "doifvaluenothing", "doifvaluesomething", "doifelsevaluenothing", "doifdimensionelse", "doifnumberelse", "doifcommonelse", "doifcommon", "doifnotcommon", "doifinstring", "doifnotinstring", "doifinstringelse", "tracingall", "tracingnone", "loggingall", "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "endgraf", "empty", "null", "space", "obeyspaces", "obeylines", "normalspace", "executeifdefined", "singleexpandafter", "doubleexpandafter", "tripleexpandafter", "dontleavehmode", "wait", "writestatus", "define", "redefine", "setmeasure", "setemeasure", "setgmeasure", "setxmeasure", "definemeasure", "measure", "getvalue", "setvalue", "setevalue", "setgvalue", "setxvalue", "letvalue", "letgvalue", "resetvalue", "undefinevalue", "ignorevalue", "setuvalue", "setuevalue", "setugvalue", "setuxvalue", "globallet", "glet", "getparameters", "geteparameters", "getgparameters", "getxparameters", "forgetparameters", "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", "unexpanded", "expanded", "startexpanded", "stopexpanded", "protected", "protect", "unprotect", "firstofoneargument", "firstoftwoarguments", "secondoftwoarguments", "firstofthreearguments", "secondofthreearguments", "thirdofthreearguments", "firstoffourarguments", "secondoffourarguments", "thirdoffourarguments", "fourthoffourarguments", "firstoffivearguments", "secondoffivearguments", "thirdoffivearguments", "fourthoffivearguments", "fifthoffivearguments", "firstofsixarguments", "secondofsixarguments", "thirdofsixarguments", "fourthofsixarguments", "fifthofsixarguments", "sixthofsixarguments", "gobbleoneargument", "gobbletwoarguments", "gobblethreearguments", "gobblefourarguments", "gobblefivearguments", "gobblesixarguments", "gobblesevenarguments", "gobbleeightarguments", "gobbleninearguments", "gobbletenarguments", "gobbleoneoptional", "gobbletwooptionals", "gobblethreeoptionals", "gobblefouroptionals", "gobblefiveoptionals", "dorecurse", "doloop", "exitloop", "dostepwiserecurse", "recurselevel", "recursedepth", "newconstant", "setnewconstant", "newconditional", "settrue", "setfalse", "dosingleempty", "dodoubleempty", "dotripleempty", "doquadrupleempty", "doquintupleempty", "dosixtupleempty", "doseventupleempty", "dosinglegroupempty", "dodoublegroupempty", "dotriplegroupempty", "doquadruplegroupempty", "doquintuplegroupempty", "nopdfcompression", "maximumpdfcompression", "normalpdfcompression", "modulonumber", "dividenumber", "getfirstcharacter", "doiffirstcharelse" }, } \ No newline at end of file diff --git a/context/data/scite/lexers/scite-context-lexer-cld.lua b/context/data/scite/lexers/scite-context-lexer-cld.lua index 1abc55f91..632a7672c 100644 --- a/context/data/scite/lexers/scite-context-lexer-cld.lua +++ b/context/data/scite/lexers/scite-context-lexer-cld.lua @@ -6,166 +6,14 @@ local info = { license = "see context related readme files", } --- Adapted from lua.lua by Mitchell who based it on a lexer by Peter Odding. - local lexer = lexer -local token, style, colors, exact_match, no_style = lexer.token, lexer.style, lexer.colors, lexer.exact_match, lexer.style_nothing -local P, R, S, C, Cg, Cb, Cs, Cmt = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cg, lpeg.Cb, lpeg.Cs, lpeg.Cmt -local match, find = string.match, string.find -local global = _G module(...) -local cldlexer = _M - -local keywords = { - 'and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for', 'function', - 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat', 'return', 'then', 'true', - 'until', 'while', -} - -local functions = { - 'assert', 'collectgarbage', 'dofile', 'error', 'getfenv', 'getmetatable', - 'ipairs', 'load', 'loadfile', 'loadstring', 'module', 'next', 'pairs', - 'pcall', 'print', 'rawequal', 'rawget', 'rawset', 'require', 'setfenv', - 'setmetatable', 'tonumber', 'tostring', 'type', 'unpack', 'xpcall', -} - -local constants = { - '_G', '_VERSION', -} - -local csnames = { - "context", - "metafun", -} - -local level = nil -local setlevel = function(_,i,s) level = s return i end - -local equals = P("=")^0 - -local longonestart = P("[[") -local longonestop = P("]]") -local longonestring = (1-longonestop)^0 - -local longtwostart = P('[') * Cmt(equals,setlevel) * P('[') -local longtwostop = P(']') * equals * P(']') - -local longtwostring = P(function(input,index) - if level then - local sentinel = ']' .. level .. ']' - local _, stop = find(input,sentinel,index,true) - return stop and stop + 1 - #sentinel or #input + 1 - end -end) - --- local longtwostart = P("[") * Cg(equals, "init") * P("[") --- local longtwostop = P("]") * C(equals) * P("]") --- local longtwocheck = Cmt(longtwostop * Cb("init"), function(s,i,a,b) return a == b end) --- local longtwostring = (P(1) - longtwocheck)^0 - -local longcomment = Cmt(#('[[' + ('[' * P('=')^0 * '[')), function(input,index) - local level = match(input,'^%[(=*)%[',index) - level = "==" - if level then - local _, stop = find(input,']' .. level .. ']',index,true) - return stop and stop + 1 or #input + 1 - end -end) +local cldlexer = lexer.load('scite-context-lexer-lua') -local longcomment = Cmt(#('[[' + ('[' * C(P('=')^0) * '[')), function(input,index,level) - local _, stop = find(input,']' .. level .. ']',index,true) - return stop and stop + 1 or #input + 1 -end) +_rules = cldlexer._rules_cld +_tokenstyles = cldlexer._tokenstyles +_foldsymbols = cldlexer._foldsymbols -local whitespace = cldlexer.WHITESPACE -- triggers states - -local space = lexer.space -- S(" \n\r\t\f\v") -local any = lexer.any - -local squote = P("'") -local dquote = P('"') -local escaped = P("\\") * P(1) -local dashes = P('--') - -local spacing = token(whitespace, space^1) -local rest = token("default", any) - -local shortcomment = dashes * lexer.nonnewline^0 -local longcomment = dashes * longcomment -local comment = token("comment", longcomment + shortcomment) - -local shortstring = token("quote", squote) - * token("string", (escaped + (1-squote))^0 ) - * token("quote", squote) - + token("quote", dquote) - * token("string", (escaped + (1-dquote))^0 ) - * token("quote", dquote) - -local longstring = token("quote", longonestart) - * token("string", longonestring) - * token("quote", longonestop) - + token("quote", longtwostart) - * token("string", longtwostring) - * token("quote", longtwostop) - -local string = shortstring - + longstring - -local integer = P('-')^-1 * (lexer.hex_num + lexer.dec_num) -local number = token("number", lexer.float + integer) - -local word = R('AZ','az','__','\127\255') * (lexer.alnum + '_')^0 -local identifier = token("default", word) - -local operator = token("special", P('~=') + S('+-*/%^#=<>;:,.{}[]()')) -- maybe split of {}[]() - -local keyword = token("keyword", exact_match(keywords)) -local builtin = token("plain", exact_match(functions)) -local constant = token("data", exact_match(constants)) -local csname = token("user", exact_match(csnames)) * ( - spacing^0 * #S("{(") - + ( spacing^0 * token("special", P(".")) * spacing^0 * token("csname",word) )^1 - ) - -_rules = { - { 'whitespace', spacing }, - { 'keyword', keyword }, - { 'function', builtin }, - { 'csname', csname }, - { 'constant', constant }, - { 'identifier', identifier }, - { 'string', string }, - { 'comment', comment }, - { 'number', number }, - { 'operator', operator }, - { 'rest', rest }, -} - -_tokenstyles = lexer.context.styleset - -_foldsymbols = { - _patterns = { - '%l+', - '[%({%)}%[%]]', - }, - ['keyword'] = { - ['if'] = 1, - ['end'] = -1, - ['do'] = 1, - ['function'] = 1, - ['repeat'] = 1, - ['until'] = -1, - }, - ['comment'] = { - ['['] = 1, [']'] = -1, - }, - ['quote'] = { -- to be tested - ['['] = 1, [']'] = -1, - }, - ['special'] = { - ['('] = 1, [')'] = -1, - ['{'] = 1, ['}'] = -1, - }, -} +_directives = cldlexer._directives diff --git a/context/data/scite/lexers/scite-context-lexer-lua.lua b/context/data/scite/lexers/scite-context-lexer-lua.lua new file mode 100644 index 000000000..2a0f48026 --- /dev/null +++ b/context/data/scite/lexers/scite-context-lexer-lua.lua @@ -0,0 +1,219 @@ +local info = { + version = 1.002, + comment = "scintilla lpeg lexer for cld/lua", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files", +} + +-- Adapted from lua.lua by Mitchell who based it on a lexer by Peter Odding. + +local lexer = lexer +local token, style, colors, exact_match, no_style = lexer.token, lexer.style, lexer.colors, lexer.exact_match, lexer.style_nothing +local P, R, S, C, Cg, Cb, Cs, Cmt = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cg, lpeg.Cb, lpeg.Cs, lpeg.Cmt +local match, find = string.match, string.find +local global = _G + +module(...) + +local cldlexer = _M + +_directives = { } -- communication channel + +local keywords = { + 'and', 'break', 'do', 'else', 'elseif', 'end', 'false', 'for', 'function', + 'if', 'in', 'local', 'nil', 'not', 'or', 'repeat', 'return', 'then', 'true', + 'until', 'while', +} + +local functions = { + 'assert', 'collectgarbage', 'dofile', 'error', 'getfenv', 'getmetatable', + 'ipairs', 'load', 'loadfile', 'loadstring', 'module', 'next', 'pairs', + 'pcall', 'print', 'rawequal', 'rawget', 'rawset', 'require', 'setfenv', + 'setmetatable', 'tonumber', 'tostring', 'type', 'unpack', 'xpcall', +} + +local constants = { + '_G', '_VERSION', '_M', +} + +local csnames = { -- todo: option + "context", + "metafun", +} + +local level = nil +local setlevel = function(_,i,s) level = s return i end + +local equals = P("=")^0 + +local longonestart = P("[[") +local longonestop = P("]]") +local longonestring = (1-longonestop)^0 + +local longtwostart = P('[') * Cmt(equals,setlevel) * P('[') +local longtwostop = P(']') * equals * P(']') + +local longtwostring = P(function(input,index) + if level then + local sentinel = ']' .. level .. ']' + local _, stop = find(input,sentinel,index,true) + return stop and stop + 1 - #sentinel or #input + 1 + end +end) + +-- local longtwostart = P("[") * Cg(equals, "init") * P("[") +-- local longtwostop = P("]") * C(equals) * P("]") +-- local longtwocheck = Cmt(longtwostop * Cb("init"), function(s,i,a,b) return a == b end) +-- local longtwostring = (P(1) - longtwocheck)^0 + +local longcomment = Cmt(#('[[' + ('[' * P('=')^0 * '[')), function(input,index) + local level = match(input,'^%[(=*)%[',index) + level = "==" + if level then + local _, stop = find(input,']' .. level .. ']',index,true) + return stop and stop + 1 or #input + 1 + end +end) + +local longcomment = Cmt(#('[[' + ('[' * C(P('=')^0) * '[')), function(input,index,level) + local _, stop = find(input,']' .. level .. ']',index,true) + return stop and stop + 1 or #input + 1 +end) + +local whitespace = cldlexer.WHITESPACE -- triggers states + +local space = lexer.space -- S(" \n\r\t\f\v") +local any = lexer.any + +local squote = P("'") +local dquote = P('"') +local escaped = P("\\") * P(1) +local dashes = P('--') + +local spacing = token(whitespace, space^1) +local rest = token("default", any) + +local shortcomment = token("comment", dashes * lexer.nonnewline^0) +local longcomment = token("comment", dashes * longcomment) + +local shortstring = token("quote", dquote) + * token("string", (escaped + (1-dquote))^0 ) + * token("quote", dquote) + + token("quote", squote) + * token("string", (escaped + (1-squote))^0 ) + * token("quote", squote) + +local longstring = token("quote", longonestart) + * token("string", longonestring) + * token("quote", longonestop) + + token("quote", longtwostart) + * token("string", longtwostring) + * token("quote", longtwostop) + +local string = shortstring + + longstring + +local integer = P('-')^-1 * (lexer.hex_num + lexer.dec_num) +local number = token("number", lexer.float + integer) + +-- officially 127-255 are ok but not utf so useless + +local validword = R("AZ","az","__") * R("AZ","az","__","09")^0 + +local identifier = token("default",validword) + +local operator = token("special", P('..') + P('~=') + S('+-*/%^#=<>;:,.{}[]()')) -- maybe split off {}[]() + +local optionalspace = spacing^0 +local hasargument = #S("{(") + +local keyword = token("keyword", exact_match(keywords )) +local builtin = token("plain", exact_match(functions)) +local constant = token("data", exact_match(constants)) +local csname = token("user", exact_match(csnames )) + * ( + optionalspace * hasargument + + ( optionalspace * token("special", P(".")) * optionalspace * token("user", validword) )^1 + ) + +_rules = { + { 'whitespace', spacing }, + { 'keyword', keyword }, + { 'function', builtin }, + { 'csname', csname }, + { 'constant', constant }, + { 'identifier', identifier }, + { 'string', string }, + { 'longcomment', longcomment }, + { 'shortcomment', shortcomment }, + { 'number', number }, + { 'operator', operator }, + { 'rest', rest }, +} + +_tokenstyles = lexer.context.styleset + +_foldsymbols = { + _patterns = { + '%l+', + '[%({%)}%[%]]', + }, + ['keyword'] = { + ['if'] = 1, + ['end'] = -1, + ['do'] = 1, + ['function'] = 1, + ['repeat'] = 1, + ['until'] = -1, + }, + ['comment'] = { + ['['] = 1, [']'] = -1, + }, + ['quote'] = { -- to be tested + ['['] = 1, [']'] = -1, + }, + ['special'] = { + ['('] = 1, [')'] = -1, + ['{'] = 1, ['}'] = -1, + }, +} + +-- embedded in tex: + +local cstoken = R("az","AZ","\127\255") + S("@!?_") +local csnametex = P("\\") * cstoken^1 +local commentline = P('%') * (1-S("\n\r"))^0 + +local texcomment = token('comment', Cmt(commentline, function() return _directives.cld_inline end)) + +local longthreestart = P("\\!!bs") +local longthreestop = P("\\!!es") +local longthreestring = (1-longthreestop)^0 + +local texstring = token("quote", longthreestart) + * token("string", longthreestring) + * token("quote", longthreestop) + +-- local texcommand = token("user", csnametex) +-- +-- local texstring = token("quote", longthreestart) +-- * (texcommand + token("string",P(1-texcommand-longthreestop)^1) - longthreestop)^0 -- we match long non-\cs sequences +-- * token("quote", longthreestop) + +_rules_cld = { + { 'whitespace', spacing }, + { 'texstring', texstring }, + { 'texcomment', texcomment }, + { 'keyword', keyword }, + { 'function', builtin }, + { 'csname', csname }, + { 'constant', constant }, + { 'identifier', identifier }, + { 'string', string }, + { 'longcomment', longcomment }, + { 'shortcomment', shortcomment }, -- should not be used inline so best signal it as comment (otherwise complex state till end of inline) + { 'number', number }, + { 'operator', operator }, + { 'rest', rest }, +} diff --git a/context/data/scite/lexers/scite-context-lexer-tex.lua b/context/data/scite/lexers/scite-context-lexer-tex.lua index 01000657b..dac3ada63 100644 --- a/context/data/scite/lexers/scite-context-lexer-tex.lua +++ b/context/data/scite/lexers/scite-context-lexer-tex.lua @@ -42,6 +42,8 @@ local find, match = string.find, string.match module(...) local contextlexer = _M +local cldlexer = lexer.load('scite-context-lexer-cld') +local mpslexer = lexer.load('scite-context-lexer-mps') local basepath = lexer.context and lexer.context.path or _LEXERHOME @@ -158,62 +160,172 @@ end) -- end -- end) +-- experiment: keep space with whatever ... less tables + +local commentline = P('%') * (1-S("\n\r"))^0 +local endline = S("\n\r")^1 + local whitespace = contextlexer.WHITESPACE -- triggers states local space = lexer.space -- S(" \n\r\t\f\v") local any = lexer.any -local spacing = token(whitespace, space^1) -local rest = token('default', any) -local preamble = token('preamble', knownpreamble) -local comment = token('comment', P('%') * (1-S("\n\r"))^0) -local command = token('command', P('\\') * knowncommand) -local constant = token('data', P('\\') * exact_match(constants)) -local helper = token('plain', P('\\') * exact_match(helpers)) -local primitive = token('primitive', P('\\') * exact_match(primitives)) -local ifprimitive = token('primitive', P('\\if') * cstoken^1) -local csname = token('user', P('\\') * (cstoken^1 + P(1))) -local grouping = token('grouping', S("{$}")) -- maybe also \bgroup \egroup \begingroup \endgroup -local special = token('special', S("#()[]<>=\"")) -local extra = token('extra', S("`~%^&_-+/\'|")) - -local text = token('default', cstoken^1 ) +local p_spacing = space^1 +local p_rest = any + +local p_preamble = knownpreamble +local p_comment = commentline +local p_command = P('\\') * knowncommand +local p_constant = P('\\') * exact_match(constants) +local p_helper = P('\\') * exact_match(helpers) +local p_primitive = P('\\') * exact_match(primitives) +local p_ifprimitive = P('\\if') * cstoken^1 +local p_csname = P('\\') * (cstoken^1 + P(1)) +local p_grouping = S("{$}") +local p_special = S("#()[]<>=\"") +local p_extra = S("`~%^&_-+/\'|") +local p_text = cstoken^1 + +-- keep key pressed at end-of syst-aux.mkiv: +-- +-- 0 : 15 sec +-- 1 : 13 sec +-- 2 : 10 sec +-- +-- the problem is that quite some style subtables get generated so collapsing ranges helps + +local option = 1 + +if option == 1 then + + p_comment = p_comment^1 + p_grouping = p_grouping^1 + p_special = p_special^1 + p_extra = p_extra^1 + p_text = p_text^1 + + p_command = p_command^1 + p_constant = p_constant^1 + p_helper = p_helper^1 + p_primitive = p_primitive^1 + p_ifprimitive = p_ifprimitive^1 + +elseif option == 2 then + + local included = space^0 + + p_comment = (p_comment * included)^1 + p_grouping = (p_grouping * included)^1 + p_special = (p_special * included)^1 + p_extra = (p_extra * included)^1 + p_text = (p_text * included)^1 + + p_command = (p_command * included)^1 + p_constant = (p_constant * included)^1 + p_helper = (p_helper * included)^1 + p_primitive = (p_primitive * included)^1 + p_ifprimitive = (p_ifprimitive * included)^1 + +end + +local spacing = token(whitespace, p_spacing ) + +local rest = token('default', p_rest ) +local preamble = token('preamble', p_preamble ) +local comment = token('comment', p_comment ) +local command = token('command', p_command ) +local constant = token('data', p_constant ) +local helper = token('plain', p_helper ) +local primitive = token('primitive', p_primitive ) +local ifprimitive = token('primitive', p_ifprimitive) +local csname = token('user', p_csname ) +local grouping = token('grouping', p_grouping ) +local special = token('special', p_special ) +local extra = token('extra', p_extra ) +local text = token('default', p_text ) ----- startluacode = token("grouping", P("\\startluacode")) ----- stopluacode = token("grouping", P("\\stopluacode")) -local luastatus = nil +local luastatus = false +local luatag = nil +local lualevel = 0 + +local function startdisplaylua(_,i,s) + luatag = s + luastatus = "display" + cldlexer._directives.cld_inline = false + return true +end + +local function stopdisplaylua(_,i,s) + local ok = luatag == s + if ok then + luastatus = false + end + return ok +end + +local function startinlinelua(_,i,s) + if luastatus == "display" then + return false + elseif not luastatus then + luastatus = "inline" + cldlexer._directives.cld_inline = true + lualevel = 1 + return true + else + lualevel = lualevel + 1 + return true + end +end + +local function stopinlinelua_b(_,i,s) -- { + if luastatus == "display" then + return false + elseif luastatus == "inline" then + lualevel = lualevel + 1 + return false + else + return true + end +end + +local function stopinlinelua_e(_,i,s) -- } + if luastatus == "display" then + return false + elseif luastatus == "inline" then + lualevel = lualevel - 1 + local ok = lualevel <= 0 + if ok then + luastatus = false + end + return ok + else + return true + end +end + local luaenvironment = P("luacode") -local inlinelua = P("\\ctx") * ( P("lua") + P("command") ) - + P("\\cldcontext") +local inlinelua = P("\\") * ( + P("ctx") * ( P("lua") + P("command") ) + + P("cldcontext") + ) -local startlua = P("\\start") * Cmt(luaenvironment,function(_,i,s) luastatus = s return true end) - + inlinelua - * space^0 - * Cmt(P("{"),function(_,i,s) luastatus = "}" return true end) -local stoplua = P("\\stop") * Cmt(luaenvironment,function(_,i,s) return luastatus == s end) - + Cmt(P("}"),function(_,i,s) return luastatus == "}" end) +local startlua = P("\\start") * Cmt(luaenvironment,startdisplaylua) + + inlinelua * space^0 * Cmt(P("{"),startinlinelua) + +local stoplua = P("\\stop") * Cmt(luaenvironment,stopdisplaylua) + + Cmt(P("{"),stopinlinelua_b) + + Cmt(P("}"),stopinlinelua_e) local startluacode = token("embedded", startlua) local stopluacode = token("embedded", stoplua) --- local metafunenvironment = P("useMPgraphic") --- + P("reusableMPgraphic") --- + P("uniqueMPgraphic") --- + P("MPcode") --- + P("MPpage") --- + P("MPinclusions") --- + P("MPextensions") --- + P("MPgraphic") - local metafunenvironment = ( P("use") + P("reusable") + P("unique") ) * ("MPgraphic") + P("MP") * ( P("code")+ P("page") + P("inclusions") + P("extensions") + P("graphic") ) --- local metafunstatus = nil -- this does not work, as the status gets lost in an embedded lexer --- local startmetafun = P("\\start") * Cmt(metafunenvironment,function(_,i,s) metafunstatus = s return true end) --- local stopmetafun = P("\\stop") * Cmt(metafunenvironment,function(_,i,s) return metafunstatus == s end) - local startmetafun = P("\\start") * metafunenvironment local stopmetafun = P("\\stop") * metafunenvironment @@ -226,9 +338,6 @@ local metafunarguments = (spacing^0 * openargument * argumentcontent * clo local startmetafuncode = token("embedded", startmetafun) * metafunarguments local stopmetafuncode = token("embedded", stopmetafun) -local cldlexer = lexer.load('scite-context-lexer-cld') -local mpslexer = lexer.load('scite-context-lexer-mps') - lexer.embed_lexer(contextlexer, cldlexer, startluacode, stopluacode) lexer.embed_lexer(contextlexer, mpslexer, startmetafuncode, stopmetafuncode) @@ -238,24 +347,18 @@ lexer.embed_lexer(contextlexer, mpslexer, startmetafuncode, stopmetafuncode) _rules = { { "whitespace", spacing }, { "preamble", preamble }, - { "text", text }, - { "comment", comment }, - { "constant", constant }, { "helper", helper }, { "command", command }, - { "ifprimitive", ifprimitive }, { "primitive", primitive }, + { "ifprimitive", ifprimitive }, { "csname", csname }, - -- { "whatever", specialword }, -- not yet, crashes - { "grouping", grouping }, { "special", special }, { "extra", extra }, - { "rest", rest }, } diff --git a/context/data/scite/metapost.properties b/context/data/scite/metapost.properties index 2141f5f4c..fe89b65eb 100644 --- a/context/data/scite/metapost.properties +++ b/context/data/scite/metapost.properties @@ -1 +1 @@ -import scite-metapost.properties +import scite-metapost diff --git a/context/data/scite/scite-context-data-context.properties b/context/data/scite/scite-context-data-context.properties index d67729651..4d352d708 100644 --- a/context/data/scite/scite-context-data-context.properties +++ b/context/data/scite/scite-context-data-context.properties @@ -1,34 +1,34 @@ keywordclass.context.helpers=\ -newcount newdimen newskip newmuskip \ -newbox newtoks newread newwrite newmarks \ -newinsert newattribute newif newlanguage newfamily \ -newfam newhelp htdp unvoidbox scratchcounter \ -globalscratchcounter scratchdimen globalscratchdimen scratchskip globalscratchskip \ -scratchmuskip globalscratchmuskip scratchtoks globalscratchtoks scratchbox \ -globalscratchbox scratchwidth scratchheight scratchdepth scratchcounterone \ -scratchcountertwo scratchcounterthree scratchdimenone scratchdimentwo scratchdimenthree \ -scratchskipone scratchskiptwo scratchskipthree scratchmuskipone scratchmuskiptwo \ -scratchmuskipthree scratchtoksone scratchtokstwo scratchtoksthree scratchboxone \ -scratchboxtwo scratchboxthree doif doifnot doifelse \ -doifinset doifnotinset doifinsetelse doifnextcharelse doifnextoptionalelse \ -doifnextparenthesiselse doiffastoptionalcheckelse doifundefinedelse doifdefinedelse doifundefined \ -doifdefined doifelsevalue doifvalue doifnotvalue doifnothing \ -doifsomething doifelsenothing doifsomethingelse doifvaluenothing doifvaluesomething \ -doifelsevaluenothing doifdimensionelse doifnumberelse doifcommonelse doifcommon \ -doifnotcommon doifinstring doifnotinstring doifinstringelse tracingall \ -tracingnone loggingall appendtoks prependtoks appendtotoks \ -prependtotoks endgraf empty null space \ -obeyspaces obeylines normalspace executeifdefined singleexpandafter \ -doubleexpandafter tripleexpandafter dontleavehmode wait writestatus \ -define redefine setmeasure setemeasure setgmeasure \ -setxmeasure definemeasure measure getvalue setvalue \ -setevalue setgvalue setxvalue letvalue letgvalue \ -resetvalue undefinevalue ignorevalue setuvalue setuevalue \ -setugvalue setuxvalue globallet glet getparameters \ -geteparameters getgparameters getxparameters forgetparameters processcommalist \ -processcommacommand quitcommalist quitprevcommalist processaction processallactions \ -processfirstactioninset processallactionsinset startsetups stopsetups startxmlsetups \ -stopxmlsetups starttexdefinition stoptexdefinition starttexcode stoptexcode \ +startsetups stopsetups startxmlsetups stopxmlsetups \ +starttexdefinition stoptexdefinition starttexcode stoptexcode newcount \ +newdimen newskip newmuskip newbox newtoks \ +newread newwrite newmarks newinsert newattribute \ +newif newlanguage newfamily newfam newhelp \ +htdp unvoidbox scratchcounter globalscratchcounter scratchdimen \ +globalscratchdimen scratchskip globalscratchskip scratchmuskip globalscratchmuskip \ +scratchtoks globalscratchtoks scratchbox globalscratchbox scratchwidth \ +scratchheight scratchdepth scratchcounterone scratchcountertwo scratchcounterthree \ +scratchdimenone scratchdimentwo scratchdimenthree scratchskipone scratchskiptwo \ +scratchskipthree scratchmuskipone scratchmuskiptwo scratchmuskipthree scratchtoksone \ +scratchtokstwo scratchtoksthree scratchboxone scratchboxtwo scratchboxthree \ +doif doifnot doifelse doifinset doifnotinset \ +doifinsetelse doifnextcharelse doifnextoptionalelse doifnextparenthesiselse doiffastoptionalcheckelse \ +doifundefinedelse doifdefinedelse doifundefined doifdefined doifelsevalue \ +doifvalue doifnotvalue doifnothing doifsomething doifelsenothing \ +doifsomethingelse doifvaluenothing doifvaluesomething doifelsevaluenothing doifdimensionelse \ +doifnumberelse doifcommonelse doifcommon doifnotcommon doifinstring \ +doifnotinstring doifinstringelse tracingall tracingnone loggingall \ +appendtoks prependtoks appendtotoks prependtotoks endgraf \ +empty null space obeyspaces obeylines \ +normalspace executeifdefined singleexpandafter doubleexpandafter tripleexpandafter \ +dontleavehmode wait writestatus define redefine \ +setmeasure setemeasure setgmeasure setxmeasure definemeasure \ +measure getvalue setvalue setevalue setgvalue \ +setxvalue letvalue letgvalue resetvalue undefinevalue \ +ignorevalue setuvalue setuevalue setugvalue setuxvalue \ +globallet glet getparameters geteparameters getgparameters \ +getxparameters forgetparameters processcommalist processcommacommand quitcommalist \ +quitprevcommalist processaction processallactions processfirstactioninset processallactionsinset \ unexpanded expanded startexpanded stopexpanded protected \ protect unprotect firstofoneargument firstoftwoarguments secondoftwoarguments \ firstofthreearguments secondofthreearguments thirdofthreearguments firstoffourarguments secondoffourarguments \ @@ -59,5 +59,9 @@ fmtname fmtversion texengine texenginename texengineversion \ luatexengine pdftexengine xetexengine unknownengine etexversion \ pdftexversion xetexversion xetexrevision activecatcode bgroup \ egroup endline attributeunsetvalue uprotationangle rightrotatioangle \ -downrotatioangle leftrotatioangle +downrotatioangle leftrotatioangle startmode stopmode startnotmode \ +stopnotmode doifmode doifmodeelse doifnotmode startenvironment \ +stopenvironment environment startcomponent stopcomponent component \ +startproduct stopproduct product startproject stopproject \ +project starttext stoptext diff --git a/context/data/scite/scite-context-external.properties b/context/data/scite/scite-context-external.properties index 7396e8b63..5cb0e8f98 100644 --- a/context/data/scite/scite-context-external.properties +++ b/context/data/scite/scite-context-external.properties @@ -16,11 +16,13 @@ if PLAT_GTK lexer.*.lpeg=lpeg +# an xml lexer will also be provided + lexer.$(file.patterns.metapost)=lpeg_scite-context-lexer-mps lexer.$(file.patterns.metafun)=lpeg_scite-context-lexer-mps lexer.$(file.patterns.context)=lpeg_scite-context-lexer-tex lexer.$(file.patterns.tex)=lpeg_scite-context-lexer-tex -lexer.$(file.patterns.lua)=lpeg_scite-context-lexer-cld +lexer.$(file.patterns.lua)=lpeg_scite-context-lexer-lua lexer.$(file.patterns.xml)=lpeg_xml comment.block.lpeg_scite-context-lexer-tex=% @@ -29,11 +31,17 @@ comment.block.at.line.start.lpeg_scite-context-lexer-tex=1 comment.block.lpeg_scite-context-lexer-mps=% comment.block.at.line.start.lpeg_scite-context-lexer-mps=1 +comment.block.lpeg_scite-context-lexer-lua=-- +comment.block.at.line.start.lpeg_scite-context-lexer-lua=1 + comment.block.lpeg_scite-context-lexer-cld=-- comment.block.at.line.start.lpeg_scite-context-lexer-cld=1 comment.block.lpeg_props=# comment.block.at.line.start.lpeg_props=1 -style.*.34=bold -style.*.35=bold +#~ style.*.34=bold +#~ style.*.35=bold + +style.*.34=$(styles.bracelight) +style.*.35=$(styles.bracebad) diff --git a/context/data/scite/scite-context-internal.properties b/context/data/scite/scite-context-internal.properties index fe86260d9..92806b8e2 100644 --- a/context/data/scite/scite-context-internal.properties +++ b/context/data/scite/scite-context-internal.properties @@ -12,14 +12,17 @@ import scite-context-data-metapost import scite-context-data-metafun keywordclass.metapost.all=$(keywordclass.metapost.tex) $(keywordclass.metapost.plain) $(keywordclass.metapost.primitives) -keywordclass.metafun.all=$(keywordclass.metapost.constants) $(keywordclass.metapost.helpers) +keywordclass.metafun.all=$(keywordclass.metafun.constants) $(keywordclass.metafun.helpers) keywords.$(file.patterns.metafun)=$(keywordclass.metapost.all) -keywords2.$(file.patterns.metafun)=$(keywordclass.metafun.all) +keywords2.$(file.patterns.metafun)=$(keywordclass.metapost.all) $(keywordclass.metafun.all) lexer.metapost.interface.default=2 lexer.metapost.comment.process=0 +lexer.$(file.patterns.metapost)=metapost +lexer.$(file.patterns.metafun)=metapost + # Metapost: comments comment.block.metapost=% @@ -74,3 +77,6 @@ lexer.context.interface.default=0 lexer.context.use.keywords=1 lexer.context.comment.process=0 lexer.context.auto.if=1 + +lexer.$(file.patterns.context)=tex +lexer.$(file.patterns.tex)=tex diff --git a/context/data/scite/scite-context-readme.tex b/context/data/scite/scite-context-readme.tex index a5d2ab084..3a6d673c5 100644 --- a/context/data/scite/scite-context-readme.tex +++ b/context/data/scite/scite-context-readme.tex @@ -1,5 +1,7 @@ \starttext +\subject{Installing Scite} + Scite has built-in lexers as well as external lpeg based ones. We can use both but for the external lexers some more work is needed to get them running. As they are more advanced it's worth the @@ -20,18 +22,54 @@ code.google.com/p/scintilla On windows you need to copy the \type {lexers} subfolder to the \type {wscite} folder. For Linux the place depends on the distribution. +\subject{Extending Scite} + In the \CONTEXT\ distribution you find the relevant files in: \starttyping /tex/texmf-context/context/data/scite \stoptyping +The easy way is to copy all the files in that path to the path where +the global properties files lives + +\starttyping +SciteGlobal.properties +\stoptyping + +At the end of that file (on windows it is in the path where the Scite +binary) you then add a line to the end: + +\starttyping +import scite-context-user +\stoptyping + +You need to restart Scite in order to see if things work out as expected. + +Disabling the external lexer in a recent Scite is somewhat tricky. In that +case the end of that file looks like: + +\starttyping +imports.exclude=scite-context-external +import * +import scite-context-user +\stoptyping + +In any case you need to make sure that the user file is loaded last. + +\subject{An alternative approach} + +If for some reason you prefer not to mess with property files in the main +Scite path, you can follow a different route and selectively copy files to +places. + The following files are needed for the lpeg based lexer: \starttyping lexers/scite-context-lexer.lua lexers/scite-context-lexer-tex.lua lexers/scite-context-lexer-mps.lua +lexers/scite-context-lexer-lua.lua lexers/scite-context-lexer-cld.lua lexers/context/data/scite-context-data-tex.lua @@ -62,8 +100,14 @@ files to the same path where the loading is defined: \starttyping scite-context.properties +scite-context-internal.properties +scite-context-external.properties + scite-pragma.properties +scite-tex.properties +scite-metapost.properties + scite-context-data-tex.properties scite-context-data-context.properties scite-context-data-interfaces.properties @@ -72,8 +116,6 @@ scite-context-data-metafun.properties scite-ctx.properties scite-ctx-context.properties -scite-ctx-context-internal.properties -scite-ctx-context-external.properties scite-ctx-example.properties \stoptyping @@ -101,6 +143,8 @@ SciTEUser.properties Of course the pragma import is optional. You can comment either the internal or external variant but there is no reason not to keep them both. +\subject{Spell checking} + If you want to have spellchecking, you need have files with correct words on each line. The first line of a file determines the language: @@ -120,6 +164,8 @@ This file is searched on the the path determined by the environment variable: CTXSPELLPATH \stoptyping +\subject{Interface selection} + In a similar fashion you can drive the interface checking: \starttyping diff --git a/context/data/scite/scite-context.properties b/context/data/scite/scite-context.properties index a958eb842..03df9fb75 100644 --- a/context/data/scite/scite-context.properties +++ b/context/data/scite/scite-context.properties @@ -326,28 +326,69 @@ font.embedded.base=$(font.monospace) font.embedded.comment=$(font.monospace) font.vbs=$(font.monospace) -# Editor: colors - -color.back.linepanel=back:#A7A7A7 -color.back.textpanel=back:#CFCFCF -color.back.logpanel=back:#EFEFEF -color.back.selection=#F7F7F7 - -color.fore.red=fore:#7F0000 -color.fore.green=fore:#007F00 -color.fore.blue=fore:#00007F -color.fore.cyan=fore:#007F7F -color.fore.magenta=fore:#7F007F -color.fore.yellow=fore:#7F7F00 +# colors and styles + +colors.red=#7F0000 +colors.green=#007F00 +colors.blue=#00007F +colors.cyan=#007F7F +colors.magenta=#7F007F +colors.yellow=#7F7F00 + +colors.white=#FFFFFF +colors.light= #CFCFCF +colors.grey= #808080 +colors.dark= #4F4F4F +colors.black= #000000 +colors.selection=#F7F7F7 +colors.logpanel=#E7E7E7 +colors.textpanel=#CFCFCF +colors.linepanel=#A7A7A7 +colors.tippanel=#444444 +colors.right=#0000FF +colors.wrong=#FF0000 + +colors.teal=$(colors.cyan) +colors.purple=$(colors.magenta) + +styles.default=fore:$(colors.black),back:$(colors.textpanel),$(font.base) +styles.nothing= + +styles.number=fore:$(colors.cyan) +styles.comment=fore:$(colors.yellow) +styles.string=fore:$(colors.magenta) +styles.keyword=fore:$(colors.blue),bold + +styles.char=fore:$(colors.magenta) +styles.class=fore:$(colors.black),bold +styles.constant=fore:$(colors.cyan),bold +styles.definition=fore:$(colors.black),bold +styles.error=fore:$(colors.red) +styles.function=fore:$(colors.black),bold +styles.operator=fore:$(colors.blue) +styles.preproc=fore:$(colors.yellow),bold +styles.tag=fore:$(colors.cyan) +styles.type=fore:$(colors.blue) +styles.variable=fore:$(colors.black) +styles.identifier=$(styles.nothing) + +styles.linenumber=back:$(colors.linepanel) +styles.bracelight=fore:$(colors.orange),bold +styles.bracebad=fore:$(colors.orange),bold +styles.indentguide=fore:$(colors.linepanel),back:$(colors.white) +styles.calltip=fore:$(colors.white),back:$(colors.tippanel) +styles.controlchar=$(styles.nothing) + +# end of colors and styles # Editor: color schemes caret.width=3 -style.*.32=$(font.base),$(color.back.textpanel) -style.*.33=$(font.base),$(color.back.linepanel) +style.*.32=$(font.base),back:$(colors.textpanel) +style.*.33=$(font.base),back:$(colors.linepanel) -style.errorlist.32=$(font.errorfont),$(color.back.logpanel) +style.errorlist.32=$(font.errorfont),back:$(colors.logpanel) selection.back=#000000 @@ -407,7 +448,9 @@ find.files=*.tex *.xml *.mp if PLAT_WIN find.command=fgrep -n $(find.what) $(find.files) -source.files=$(file.patterns.context);$(file.patterns.metafun);$(file.patterns.example);*.pl;*.rb +# todo: + +source.files=$(file.patterns.context);$(file.patterns.metafun);$(file.patterns.example);*.pl;*.rb;*.lua # Editor: printing @@ -443,27 +486,27 @@ autocomplete.choose.single=0 # Logging -style.errorlist.32=$(font.errorfont),$(color.back.logpanel) +style.errorlist.32=$(font.errorfont),back:$(colors.logpanel) # Default -style.errorlist.0=fore:#000000 -style.errorlist.1=$(color.fore.red) -style.errorlist.2=$(color.fore.red) -style.errorlist.3=$(color.fore.red) -style.errorlist.4=$(color.fore.green) -style.errorlist.5=$(color.fore.red) -style.errorlist.6=$(color.fore.red) -style.errorlist.7=$(color.fore.red) -style.errorlist.8=$(color.fore.red) -style.errorlist.9=$(color.fore.red) -style.errorlist.10=$(color.fore.green) -style.errorlist.11=$(color.fore.blue) -style.errorlist.12=$(color.fore.cyan) -style.errorlist.13=$(color.fore.red) -style.errorlist.14=$(color.fore.red) -style.errorlist.15=$(color.fore.red) -style.errorlist.16=$(color.fore.red) +style.errorlist.0=fore:$(colors.black) +style.errorlist.1=fore:$(colors.red) +style.errorlist.2=fore:$(colors.red) +style.errorlist.3=fore:$(colors.red) +style.errorlist.4=fore:$(colors.green) +style.errorlist.5=fore:$(colors.red) +style.errorlist.6=fore:$(colors.red) +style.errorlist.7=fore:$(colors.red) +style.errorlist.8=fore:$(colors.red) +style.errorlist.9=fore:$(colors.red) +style.errorlist.10=fore:$(colors.green) +style.errorlist.11=fore:$(colors.blue) +style.errorlist.12=fore:$(colors.cyan) +style.errorlist.13=fore:$(colors.red) +style.errorlist.14=fore:$(colors.red) +style.errorlist.15=fore:$(colors.red) +style.errorlist.16=fore:$(colors.red) # Metapost: patterns @@ -490,25 +533,83 @@ command.7.$(file.patterns.metafun)= command.8.$(file.patterns.metafun)= command.9.$(file.patterns.metafun)= -# Metapost: highlighting - -style.metapost.0=fore:#3F3F3F -style.metapost.1=fore:#007F7F -style.metapost.2=fore:#7F0000 -style.metapost.3=fore:#7F7F00 -style.metapost.4=fore:#007F00 -style.metapost.5=fore:#000000 -style.metapost.6=fore:#007F00,italics -style.metapost.34=fore:#00007F -style.metapost.35=fore:#7F007F - -# Context: highlighting - -style.context.0=fore:#3F3F3F -style.context.1=fore:#007F7F -style.context.2=fore:#7F0000 -style.context.3=fore:#7F7F00 -style.context.4=fore:#007F00 - -style.context.34=fore:#00007F -style.context.35=fore:#7F007F +# Shared highlighting + +styles.context.default=$(styles.nothing) +styles.context.number=$(styles.number) +styles.context.comment=$(styles.comment) +styles.context.keyword=$(styles.keyword) +styles.context.string=$(styles.string) + +styles.context.command=fore:$(colors.green),bold +styles.context.preamble=$(styles.comment) +styles.context.embedded=fore:$(colors.black),bold +styles.context.grouping=fore:$(colors.red) +styles.context.primitive=$(styles.keyword) +styles.context.plain=fore:$(colors.dark),bold +styles.context.user=fore:$(colors.green) +styles.context.data=$(styles.constant) +styles.context.special=fore:$(colors.blue) +styles.context.extra=fore:$(colors.yellow) +styles.context.quote=fore:$(colors.blue),bold + +# Metapost highlighting + +style.metapost.0=$(styles.context.default) +style.metapost.1=$(styles.context.special) +style.metapost.2=$(styles.context.grouping) +style.metapost.3=$(styles.context.comment) +style.metapost.4=$(styles.context.keyword) +style.metapost.5=$(styles.context.default) +style.metapost.6=$(styles.context.plain) +style.metapost.34=$(styles.bracelight) +style.metapost.35=$(styles.bracebad) + +# TeX highlighting + +style.tex.0=$(styles.context.default) +style.tex.1=$(styles.context.special) +style.tex.2=$(styles.context.grouping) +style.tex.3=$(styles.context.comment) +style.tex.4=$(styles.context.user) +style.tex.34=$(styles.bracelight) +style.tex.35=$(styles.bracebad) + +# style.tex.* : external styling happens elsewhere +# style.mps.* : external styling happens elsewhere +# style.cls.* : external styling happens elsewhere + +# Lua highlighting: +# +# might change as we change the cld lexer + +comment.block.lua=-- +comment.block.at.line.start.lua=1 + +# braces.lua.style=10 + +style.lua.32=$(styles.context.default) +style.lua.0=$(styles.context.default) +style.lua.1=$(styles.context.comment) +style.lua.2=$(styles.context.comment) +style.lua.3=$(styles.context.comment) +style.lua.4=$(styles.context.number) +style.lua.5=$(styles.context.keyword) +style.lua.6=$(styles.context.string) +style.lua.7=$(styles.context.string) +style.lua.8=$(styles.context.comment) +style.lua.9=$(styles.context.default) +style.lua.10=$(styles.context.special) +style.lua.11=$(styles.context.default) +style.lua.12=$(styles.context.default) +style.lua.13=$(styles.context.default) +style.lua.14=$(styles.context.default) +style.lua.15=$(styles.context.default) +style.lua.16=$(styles.context.default) +style.lua.17=$(styles.context.default) +style.lua.18=$(styles.context.default) +style.lua.19=$(styles.context.default) +style.lua.20=$(styles.context.default) + +style.context.34=$(styles.bracelight) +style.context.35=$(styles.bracebad) diff --git a/context/data/scite/tex.properties b/context/data/scite/tex.properties index e31e7e69b..3fbad41cb 100644 --- a/context/data/scite/tex.properties +++ b/context/data/scite/tex.properties @@ -1 +1 @@ -import scite-context-tex.properties +import scite-tex diff --git a/tex/context/base/anch-pgr.mkiv b/tex/context/base/anch-pgr.mkiv index f052b4ddb..af99602c7 100644 --- a/tex/context/base/anch-pgr.mkiv +++ b/tex/context/base/anch-pgr.mkiv @@ -558,12 +558,17 @@ \iftracepositions show_multi_pars \else draw_multi_pars \fi ; \stopuseMPgraphic -\startuseMPgraphic{mpos:par:sideline}{linecolor,lineoffset} +\startuseMPgraphic{mpos:par:sideline}{linecolor,lineoffset,linewidth} + begingroup ; save p ; picture p ; for i=1 upto nofmultipars : - fill leftboundary multipars[i] + p := image ( fill leftboundary multipars[i] shifted (-\MPvar{lineoffset},0) - rightenlarged 1mm withcolor \MPvar{linecolor} ; + rightenlarged \MPvar{linewidth} withcolor \MPvar{linecolor} ; + ) ; + setbounds p to multipars[i] ; + draw p ; endfor ; + endgroup ; \stopuseMPgraphic \startMPpositionmethod{mpos:par:columnset} diff --git a/tex/context/base/colo-ini.lua b/tex/context/base/colo-ini.lua index 4ad564213..5e504e388 100644 --- a/tex/context/base/colo-ini.lua +++ b/tex/context/base/colo-ini.lua @@ -30,7 +30,6 @@ local gettexattribute = tex.getattribute local a_color = attributes.private('color') local a_transparency = attributes.private('transparency') local a_colorspace = attributes.private('colormodel') -local a_background = attributes.private('background') local register_color = colors.register local attributes_list = attributes.list diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii index b73bd2cb1..b6c35d923 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.09.15 19:53} +\newcontextversion{2011.09.17 09:40} %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 7dd01c0d4..9ee827ce1 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.09.15 19:53} +\newcontextversion{2011.09.17 09:40} %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-version.pdf b/tex/context/base/context-version.pdf index e58e270c6..781926a10 100644 Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png index 716a502de..ca5f0a5e2 100644 Binary files a/tex/context/base/context-version.png and b/tex/context/base/context-version.png differ diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii index 2a07bf7e6..04eb70d4e 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.09.15 19:53} +\edef\contextversion{2011.09.17 09:40} %D For those who want to use this: diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 76ccaceb5..5bb9eb360 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.09.15 19:53} +\edef\contextversion{2011.09.17 09:40} %D For those who want to use this: diff --git a/tex/context/base/mult-aux.mkiv b/tex/context/base/mult-aux.mkiv index 01c186589..0e71ad661 100644 --- a/tex/context/base/mult-aux.mkiv +++ b/tex/context/base/mult-aux.mkiv @@ -64,14 +64,15 @@ % todo: add (relaxed) postsetup and postdefine hooks, just after the everys -\unexpanded\def\doinstallparameterhandler#1#2#3#4#5#6#7#8% +\unexpanded\def\doinstallparameterhandler#1#2#3#4#5#6#7#8#9% {\ifx#2\relax\let#2\empty\fi \def#3##1{\csname#4{#1#2}{##1}\endcsname}% \def#4##1##2{\ifcsname##1:##2\endcsname##1:##2\else\expandafter#5\csname##1:\s!parent\endcsname{##2}\fi}% \def#5##1##2{\ifx##1\relax\s!empty\else#4{##1}{##2}\fi}% is {} needed around ##1 ? \def#6##1##2{\csname#4{#1##1}{##2}\endcsname}% \def#7##1{\detokenize\expandafter\expandafter\expandafter{\csname#1:##1\endcsname}}% always root - \def#8##1{\csname\ifcsname#1#2:##1\endcsname#1#2:##1\else\s!empty\fi\endcsname}} + \def#8##1{\csname\ifcsname#1#2:##1\endcsname#1#2:##1\else\s!empty\fi\endcsname}% + \def#9##1{\csname\ifcsname#1:##1\endcsname#1:##1\else\s!empty\fi\endcsname}} \unexpanded\def\installparameterhandler#1#2% {\normalexpanded @@ -83,7 +84,8 @@ \expandafter\noexpand\csname do#2parentparameter\endcsname \expandafter\noexpand\csname named#2parameter\endcsname \expandafter\noexpand\csname detokenized#2parameter\endcsname - \expandafter\noexpand\csname strict#2parameter\endcsname}} + \expandafter\noexpand\csname strict#2parameter\endcsname + \expandafter\noexpand\csname root#2parameter\endcsname}} \unexpanded\def\doinstallparameterhashhandler#1#2#3#4#5#6#7% {\ifx#2\relax\let#2\empty\fi @@ -325,4 +327,3 @@ {\writestatus\m!system{chain: [ \doshowparentchain{#1#2}]}} \protect - diff --git a/tex/context/base/mult-de.mkii b/tex/context/base/mult-de.mkii index 0f78b568d..6fcbc3463 100644 --- a/tex/context/base/mult-de.mkii +++ b/tex/context/base/mult-de.mkii @@ -499,6 +499,8 @@ \setinterfacevariable{unavailable}{nichtverfuegbar} \setinterfacevariable{underbar}{unterstrichen} \setinterfacevariable{underbars}{unterstreichen} +\setinterfacevariable{understrike}{understrike} +\setinterfacevariable{understrikes}{understrikes} \setinterfacevariable{unit}{einheit} \setinterfacevariable{units}{einheiten} \setinterfacevariable{unknown}{unbekannt} diff --git a/tex/context/base/mult-def.lua b/tex/context/base/mult-def.lua index 1144dba22..28ebeb7ac 100644 --- a/tex/context/base/mult-def.lua +++ b/tex/context/base/mult-def.lua @@ -11271,6 +11271,12 @@ return { ["pe"]="میله‌ها‌رو", ["ro"]="supralinie", }, + ["understrike"]={ + ["en"]="understrike", + }, + ["understrikes"]={ + ["en"]="understrikes", + }, ["overstrike"]={ ["cs"]="preskrtnuto", ["de"]="durchgestrichen", diff --git a/tex/context/base/mult-en.mkii b/tex/context/base/mult-en.mkii index f36227e25..a5e01fdb8 100644 --- a/tex/context/base/mult-en.mkii +++ b/tex/context/base/mult-en.mkii @@ -499,6 +499,8 @@ \setinterfacevariable{unavailable}{unavailable} \setinterfacevariable{underbar}{underbar} \setinterfacevariable{underbars}{underbars} +\setinterfacevariable{understrike}{understrike} +\setinterfacevariable{understrikes}{understrikes} \setinterfacevariable{unit}{unit} \setinterfacevariable{units}{units} \setinterfacevariable{unknown}{unknown} diff --git a/tex/context/base/mult-fr.mkii b/tex/context/base/mult-fr.mkii index 2c583bbf3..89efb4bfb 100644 --- a/tex/context/base/mult-fr.mkii +++ b/tex/context/base/mult-fr.mkii @@ -499,6 +499,8 @@ \setinterfacevariable{unavailable}{indisponible} \setinterfacevariable{underbar}{souslignetout} \setinterfacevariable{underbars}{sousligne} +\setinterfacevariable{understrike}{understrike} +\setinterfacevariable{understrikes}{understrikes} \setinterfacevariable{unit}{unite} \setinterfacevariable{units}{unites} \setinterfacevariable{unknown}{inconnu} diff --git a/tex/context/base/mult-it.mkii b/tex/context/base/mult-it.mkii index 2a971812f..4acba1e28 100644 --- a/tex/context/base/mult-it.mkii +++ b/tex/context/base/mult-it.mkii @@ -499,6 +499,8 @@ \setinterfacevariable{unavailable}{nondisponibile} \setinterfacevariable{underbar}{sottolinea} \setinterfacevariable{underbars}{sottolinee} +\setinterfacevariable{understrike}{understrike} +\setinterfacevariable{understrikes}{understrikes} \setinterfacevariable{unit}{unita} \setinterfacevariable{units}{unita} \setinterfacevariable{unknown}{ignoto} diff --git a/tex/context/base/mult-low.lua b/tex/context/base/mult-low.lua index 051303349..91fb4baf8 100644 --- a/tex/context/base/mult-low.lua +++ b/tex/context/base/mult-low.lua @@ -39,8 +39,21 @@ return { -- "uprotationangle", "rightrotatioangle", "downrotatioangle", "leftrotatioangle", -- + -- maybe a different class + -- + "startmode", "stopmode", "startnotmode", "stopnotmode", "doifmode", "doifmodeelse", "doifnotmode", + "startenvironment", "stopenvironment", "environment", + "startcomponent", "stopcomponent", "component", + "startproduct", "stopproduct", "product", + "startproject", "stopproject", "project", + "starttext", "stoptext" }, ["helpers"] = { + -- + "startsetups", "stopsetups", + "startxmlsetups", "stopxmlsetups", + "starttexdefinition", "stoptexdefinition", + "starttexcode", "stoptexcode", -- "newcount", "newdimen", "newskip", "newmuskip", "newbox", "newtoks", "newread", "newwrite", "newmarks", "newinsert", "newattribute", "newif", "newlanguage", "newfamily", "newfam", "newhelp", -- not used @@ -77,7 +90,7 @@ return { -- "tracingall", "tracingnone", "loggingall", -- - "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", + "appendtoks", "prependtoks", "appendtotoks", "prependtotoks", "to", -- "endgraf", "empty", "null", "space", "obeyspaces", "obeylines", "normalspace", -- @@ -100,11 +113,6 @@ return { "processcommalist", "processcommacommand", "quitcommalist", "quitprevcommalist", "processaction", "processallactions", "processfirstactioninset", "processallactionsinset", -- - "startsetups", "stopsetups", - "startxmlsetups", "stopxmlsetups", - "starttexdefinition", "stoptexdefinition", - "starttexcode", "stoptexcode", - -- "unexpanded", "expanded", "startexpanded", "stopexpanded", "protected", "protect", "unprotect", -- "firstofoneargument", diff --git a/tex/context/base/mult-nl.mkii b/tex/context/base/mult-nl.mkii index 3cae35da7..361c30db0 100644 --- a/tex/context/base/mult-nl.mkii +++ b/tex/context/base/mult-nl.mkii @@ -499,6 +499,8 @@ \setinterfacevariable{unavailable}{nietbeschikbaar} \setinterfacevariable{underbar}{onderstreep} \setinterfacevariable{underbars}{onderstrepen} +\setinterfacevariable{understrike}{understrike} +\setinterfacevariable{understrikes}{understrikes} \setinterfacevariable{unit}{eenheid} \setinterfacevariable{units}{eenheden} \setinterfacevariable{unknown}{onbekend} diff --git a/tex/context/base/mult-pe.mkii b/tex/context/base/mult-pe.mkii index 43ad6b122..0ea8547af 100644 --- a/tex/context/base/mult-pe.mkii +++ b/tex/context/base/mult-pe.mkii @@ -499,6 +499,8 @@ \setinterfacevariable{unavailable}{غیرموجود} \setinterfacevariable{underbar}{میله‌زیر} \setinterfacevariable{underbars}{میله‌‌های‌زیر} +\setinterfacevariable{understrike}{understrike} +\setinterfacevariable{understrikes}{understrikes} \setinterfacevariable{unit}{واحد} \setinterfacevariable{units}{واحدها} \setinterfacevariable{unknown}{ناشناس} diff --git a/tex/context/base/mult-ro.mkii b/tex/context/base/mult-ro.mkii index 50274c1d3..47a6cd401 100644 --- a/tex/context/base/mult-ro.mkii +++ b/tex/context/base/mult-ro.mkii @@ -499,6 +499,8 @@ \setinterfacevariable{unavailable}{nedisponibil} \setinterfacevariable{underbar}{sublinie} \setinterfacevariable{underbars}{sublinii} +\setinterfacevariable{understrike}{understrike} +\setinterfacevariable{understrikes}{understrikes} \setinterfacevariable{unit}{unitate} \setinterfacevariable{units}{unitati} \setinterfacevariable{unknown}{necunoscut} diff --git a/tex/context/base/node-bck.lua b/tex/context/base/node-bck.lua index e1e4d4652..a0044eb78 100644 --- a/tex/context/base/node-bck.lua +++ b/tex/context/base/node-bck.lua @@ -31,7 +31,7 @@ local a_transparency = attributes.private('transparency') local a_colorspace = attributes.private('colormodel') local a_background = attributes.private('background') -local function add_backgrounds(head) -- boxes, inline will be done too +local function add_backgrounds(head) local id = head.id if id == vlist_code or id == hlist_code then local current = head.list diff --git a/tex/context/base/node-bck.mkiv b/tex/context/base/node-bck.mkiv index f53584396..50f27aec6 100644 --- a/tex/context/base/node-bck.mkiv +++ b/tex/context/base/node-bck.mkiv @@ -20,7 +20,7 @@ \registerctxluafile{node-bck}{1.001} -\def\doinitializeboxbackgrounds +\def\doinitializeboxbackgrounds % will move to lua {\ctxlua{nodes.tasks.enableaction("shipouts","nodes.handlers.backgrounds")}% \glet\doinitializeboxbackgrounds\donothing} diff --git a/tex/context/base/node-rul.mkiv b/tex/context/base/node-rul.mkiv index cf94ac5e0..0978a650e 100644 --- a/tex/context/base/node-rul.mkiv +++ b/tex/context/base/node-rul.mkiv @@ -119,13 +119,15 @@ {\groupedcommand{\dodoruled{#1}}\relax} \def\dodoruled - {\ctxlua{nodes.rules.enable()}% + {\ctxlua{nodes.rules.enable()}% will be moved to lua \glet\dodoruled\dodoruledindeed \dodoruled} -\def\dodoruledindeed#1% maybe reverse the 1000 - {\advance\csname\??on:#1:c\endcsname\plusone % local ? +\def\dodoruledindeed#1% maybe reverse the 1000 (also maybe use more attributes instead of settings) + {\edef\currentbar{#1}% + \advance\csname\??on:#1:c\endcsname\plusone % local ? \scratchcounter\csname\??on:#1:c\endcsname + \dosetbarattributes\c!foregroundstyle\c!foregroundcolor \attribute\ruledattribute\numexpr 1000*\scratchcounter +\csname\??on#1\ifcsname\??on#1:\number\scratchcounter\s!parent\endcsname:\number\scratchcounter\fi:a\endcsname @@ -158,6 +160,7 @@ \c!offset=0, % upwards, replaces: topoffset bottomoffset \c!dy=0, \c!max=3, + \c!style=, \c!rulethickness=.1, \c!order=\v!foreground, \c!unit=ex, % so now we are relative @@ -166,13 +169,23 @@ % \definebar[touchbar] [\c!method=0,\c!dy=-0.4,\c!offset=-0.0] % \definebar[touchbars] [touchbar] [\c!continue=\v!yes] -\definebar[\v!overstrike] [\c!method=0,\c!dy= 0.4,\c!offset= 0.5,\c!continue=\v!yes] +\definebar[\v!overstrike] [\c!method=0,\c!dy=0.4,\c!offset=0.5,\c!continue=\v!yes] \definebar[\v!underbar] [\c!method=1,\c!dy=-0.4,\c!offset=-0.3,\c!continue=\v!yes] -\definebar[\v!overbar] [\c!method=1,\c!dy= 0.4,\c!offset= 1.8,\c!continue=\v!yes] +\definebar[\v!overbar] [\c!method=1,\c!dy=0.4,\c!offset=1.8,\c!continue=\v!yes] + +\definebar + [\v!understrike] + [\c!method=0, + \c!offset=1.375, + \c!rulethickness=2.5, + \c!continue=\v!yes, + \c!order=\v!background, + \c!color=lightgray] \definebar[\v!overstrikes] [\v!overstrike] [\c!continue=\v!no] \definebar[\v!underbars] [\v!underbar] [\c!continue=\v!no] \definebar[\v!overbars] [\v!overbar] [\c!continue=\v!no] +\definebar[\v!understrikes][\v!understrike][\c!continue=\v!no] % we want these always so ... diff --git a/tex/context/base/pack-box.mkiv b/tex/context/base/pack-box.mkiv index 7c755ee7f..9fab9c434 100644 --- a/tex/context/base/pack-box.mkiv +++ b/tex/context/base/pack-box.mkiv @@ -585,7 +585,7 @@ {\dowithnextbox % we could use a local setlayer command (no doif..empty) which also saves a nextbox {\setlayer[#1][\c!width=\nextboxwd,\c!height=\nextboxht,#2,\c!offset=\!!zeropoint]{\flushnextbox}}% % \hbox\framed[\c!location=\v!normal,#2]}% could be a fast one (no #2,\c!offset=\defaultframeoffset) - \hbox\localframedwithsettings[][\c!location=\v!normal,#2]}% + \hbox\normalframedwithsettings[\c!location=\v!normal,#2]}% fast call (no arg check) \def\setlayertext {\dotripleempty\dosetlayertext} diff --git a/tex/context/base/pack-rul.mkiv b/tex/context/base/pack-rul.mkiv index face31209..ebadf90e0 100644 --- a/tex/context/base/pack-rul.mkiv +++ b/tex/context/base/pack-rul.mkiv @@ -625,6 +625,12 @@ \unexpanded\def\setupframed {\dodoubleempty\dosetupframed} +\unexpanded\def\normalframedwithsettings + {\bgroup + \advance\framednesting\plusone + \expandafter\let\csname\??ol:\the\framednesting\s!parent\endcsname\??ol + \dolocalframed[\??ol:\the\framednesting]} + % we can consider setting the parent of the regular framed to % something else in the otr so that we isolate it there diff --git a/tex/context/base/page-flt.mkiv b/tex/context/base/page-flt.mkiv index e182c1695..504e2b032 100644 --- a/tex/context/base/page-flt.mkiv +++ b/tex/context/base/page-flt.mkiv @@ -143,9 +143,9 @@ \exitloop \else \def\currentfloat{#1}% - \blank[\@@bkspacebefore]% + \blank[\rootfloatparameter\c!spacebefore]% \box\floatbox - \blank[\@@bkspaceafter] + \blank[\rootfloatparameter\c!spaceafter] \fi}} %D The following code is in transition as we don't want to break the diff --git a/tex/context/base/page-mul.mkiv b/tex/context/base/page-mul.mkiv index 6589e63bb..46fc28189 100644 --- a/tex/context/base/page-mul.mkiv +++ b/tex/context/base/page-mul.mkiv @@ -1341,7 +1341,7 @@ \getcolumnstatus\column\count255\total\dimen0\goal\dimen2\\% \dofloatsgetinfo\s!text \setbox\scratchbox\vbox % tricky met objecten ? - {\blank[\@@bkspacebefore] + {\blank[\rootfloatparameter\c!spacebefore] \snaptogrid\vbox{\vskip\floatheight}}% copy? \advance\dimen0\dimexpr\ht\scratchbox+2\openlineheight+.5\lineheight\relax\relax % needed because goal a bit higher \ifdim\dimen0>\dimen2 @@ -1374,7 +1374,7 @@ % dropped ? \else \setbox2\vbox - {\blank[\@@bkspacebefore] + {\blank[\rootfloatparameter\c!spacebefore] \snaptogrid\vbox{\vskip\floatheight}}% \advance\dimen0 \ht2 \ifdim\dimen0>\dimen2 @@ -1385,7 +1385,7 @@ \global\setbox\currenttopcolumnbox\vbox {\snaptogrid\vbox{\box\floatbox} \whitespace % nodig ? - \blank[\@@bkspaceafter]}% + \blank[\rootfloatparameter\c!spaceafter]}% \dimen4=\htdp\currenttopcolumnbox \global\advance\vsize -\dimen4 \advance\dimen4 -\pagegoal @@ -1402,12 +1402,12 @@ \par \ifdim\prevdepth<\zeropoint \else % anders bovenaan kolom witruimte \nobreak - \blank[\@@bkspacebefore] + \blank[\rootfloatparameter\c!spacebefore] \nobreak \fi \dofloatsflush\s!text{1}% \flushfloatbox - \blank[\@@bkspaceafter] + \blank[\rootfloatparameter\c!spaceafter] \fi \fi \fi @@ -1444,7 +1444,7 @@ {\copy\currenttopcolumnbox \hbox{\vphantom{\vskip\floatheight}}}% known from previous \whitespace % nodig ? - \blank[\@@bkspaceafter]}% + \blank[\rootfloatparameter\c!spaceafter]}% \else \dofloatsgetinfo\s!text \ifdim\floatwidth>\hsize @@ -1462,7 +1462,7 @@ \global\setbox\floatbox\hbox to \finalcolumntextwidth{\hss\box\floatbox\hss}% \fi % otherwise the graphic may disappear \global\setbox\floatbox\hbox to \dimen0 - {\processaction[\@@bklocation] % how easy to forget + {\processaction[\rootfloatparameter\c!location] % how easy to forget [ \v!left=>\box\floatbox\hss, \v!right=>\hss\box\floatbox, \s!default=>\hss\box\floatbox\hss, @@ -1482,7 +1482,7 @@ {\box\currenttopcolumnbox % was copy \box\floatbox} \whitespace % nodig ? - \blank[\@@bkspaceafter]}% + \blank[\rootfloatparameter\c!spaceafter]}% \fi \dimen6\htdp\currenttopcolumnbox \fi @@ -1511,9 +1511,9 @@ \forgetall % no check for width \dogetfloat - \blank[\@@bkspacebefore] + \blank[\rootfloatparameter\c!spacebefore] \snaptogrid\vbox{\copy\floatbox} - \blank[\@@bkspaceafter] + \blank[\rootfloatparameter\c!spaceafter] \egroup \else \exitloop diff --git a/tex/context/base/page-one.mkiv b/tex/context/base/page-one.mkiv index e1e47abcd..ec22dca72 100644 --- a/tex/context/base/page-one.mkiv +++ b/tex/context/base/page-one.mkiv @@ -190,11 +190,11 @@ \noffloatinserts\zerocount \let\totaltopinserted\!!zeropoint \OTRONEdodosettopinserts - \ifnum\@@bknbottom=\zerocount - \ifnum\@@bknlines>\zerocount + \ifnum\rootfloatparameter\c!nbottom=\zerocount + \ifnum\rootfloatparameter\c!nlines>\zerocount \ifdim\totaltopinserted>\zeropoint\relax - \ifdim\dimexpr\@@bknlines\lineheight+\totaltopinserted\relax>\textheight - \showmessage\m!floatblocks8\@@bknlines + \ifdim\dimexpr\rootfloatparameter\c!nlines\lineheight+\totaltopinserted\relax>\textheight + \showmessage\m!floatblocks8\rootfloatparameter\c!nlines \vfilll\eject \fi \fi @@ -221,11 +221,11 @@ \kern-\lineskip\par \prevdepth\maxdimen \else - %\blank[-\@@bkspaceafter,\@@bkspacebefore]% inserts can't look back + %\blank[-\rootfloatparameter\c!spaceafter,\rootfloatparameter\c!spacebefore]% inserts can't look back \betweenfloatblanko \fi \flushfloatbox - \blank[\@@bkspaceafter]}% + \blank[\rootfloatparameter\c!spaceafter]}% \ifsomefloatwaiting \advance\noffloatinserts \plusone \else @@ -261,7 +261,7 @@ \ifdim\botinserted<\pagegoal\relax \insert\botins {\forgetall - \blank[\@@bkspacebefore]% + \blank[\rootfloatparameter\c!spacebefore]% \flushfloatbox}% \ifsomefloatwaiting \advance\noffloatinserts \plusone @@ -289,7 +289,7 @@ \OTRONEdosettopinserts \OTRONEdosetbotinserts \ifsomefloatwaiting - \doif\@@bkcache\v!no\doflushfloats + \doif\rootfloatparameter\c!cache\v!no\doflushfloats \fi \fi} @@ -520,18 +520,18 @@ \topskipcorrection % [xx] new: see icare topbleed \kern-\lineskip\par\prevdepth\maxdimen \else - %\blank[-\@@bkspaceafter,\@@bkspacebefore]% inserts can't look back + %\blank[-\rootfloatparameter\c!spaceafter,\rootfloatparameter\c!spacebefore]% inserts can't look back \betweenfloatblanko \fi \flushfloatbox - \blank[\@@bkspaceafter]}% + \blank[\rootfloatparameter\c!spaceafter]}% \doinsertfloatinfo} \def\OTRONEsomebotsfloat[#1]% {\global\advance\botinserted\dimexpr\ht\floatbox+\dp\floatbox+\floattopskip\relax \insert\botins {\forgetall - \blank[\@@bkspacebefore]% + \blank[\rootfloatparameter\c!spacebefore]% \flushfloatbox}% %\global\nofloatpermittedtrue \doinsertfloatinfo} diff --git a/tex/context/base/page-set.mkiv b/tex/context/base/page-set.mkiv index 3c0993db4..7ef196d53 100644 --- a/tex/context/base/page-set.mkiv +++ b/tex/context/base/page-set.mkiv @@ -2022,14 +2022,14 @@ \noffloatinserts\zerocount \let\totaltopinserted\!!zeropoint \OTRSETdodosettopinserts - \ifnum\@@bknbottom=\zerocount - \ifnum\@@bknlines>\zerocount + \ifnum\rootfloatparameter\c!nbottom=\zerocount + \ifnum\rootfloatparameter\c!nlines>\zerocount \ifdim\totaltopinserted>\zeropoint\relax \dimen0\lineheight - \dimen0=\@@bknlines\dimen0 + \dimen0=\rootfloatparameter\c!nlines\dimen0 \advance\dimen0 \totaltopinserted\relax \ifdim\dimen0>\textheight % \vsize %%%%%%%%% \textheight - \showmessage\m!floatblocks8{\@@bknlines}% + \showmessage\m!floatblocks8{\rootfloatparameter\c!nlines}% \vfilll\eject \fi \fi @@ -2056,7 +2056,7 @@ \betweenfloatblanko % inserts can't look back \fi \flushfloatbox - \blank[\@@bkspaceafter]}% + \blank[\rootfloatparameter\c!spaceafter]}% \global\advance\topinserted \ht\scratchbox\relax \ifdim\topinserted>\vsize % was \textheight\relax \OTRSETresavebox\floatbox @@ -2098,7 +2098,7 @@ \ifdim\botinserted<\pagegoal\relax \insert\botins {\forgetall - \blank[\@@bkspacebefore]% + \blank[\rootfloatparameter\c!spacebefore]% \flushfloatbox}% \ifsomefloatwaiting \advance\noffloatinserts \plusone diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf index 37e8ae081..c2bd7d806 100644 Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf index b150b502d..26089e691 100644 Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ diff --git a/tex/context/base/strc-flt.mkiv b/tex/context/base/strc-flt.mkiv index fbedab659..7511a2a79 100644 --- a/tex/context/base/strc-flt.mkiv +++ b/tex/context/base/strc-flt.mkiv @@ -24,68 +24,17 @@ \unexpanded\def\placefloats{\doflushfloats} % keep this one -\let\currentfloat\empty +\installframedcommandhandler \??fl {float} \??fl +\installframedcommandhandler \??kj {floatcaption} \??kj -\def\letfloatparameter #1{\expandafter\let\csname\??fl\currentfloat#1\endcsname} - -\def\floatparameter #1{\csname\dofloatparameter{\??fl\currentfloat}#1\endcsname} -\def\floatsharedparameter#1{\csname \??fl #1\endcsname} -\def\floatparameterhash #1{\dofloatparameterhash {\??fl\currentfloat}#1} - -\def\dofloatparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\dofloatparentparameter \csname#1\s!parent\endcsname#2\fi} -\def\dofloatparameterhash#1#2{\ifcsname#1#2\endcsname #1\else\expandafter\dofloatparentparameterhash\csname#1\s!parent\endcsname#2\fi} - -\def\dofloatparentparameter #1#2{\ifx#1\relax\s!empty\else\dofloatparameter #1#2\fi} -\def\dofloatparentparameterhash#1#2{\ifx#1\relax \else\dofloatparameterhash#1#2\fi} - -\def\detokenizedfloatparameter#1{\detokenize\expandafter\expandafter\expandafter{\csname\??fl\currentfloat#1\endcsname}} - -\def\dosetfloatattributes#1#2% style color - {\edef\fontattributehash {\floatparameterhash#1}% - \edef\colorattributehash{\floatparameterhash#2}% - \ifx\fontattributehash \empty\else\dosetfontattribute \fontattributehash #1\fi - \ifx\colorattributehash\empty\else\dosetcolorattribute\colorattributehash#2\fi} - -\def\floatcaptionparameter #1{\csname\dofloatcaptionparameter{\??kj\currentfloat}#1\endcsname} -\def\floatcaptionparameterhash#1{\dofloatcaptionparameterhash {\??kj\currentfloat}#1} - -\def\dofloatcaptionparameter #1#2{\ifcsname#1#2\endcsname#1#2\else\expandafter\dofloatcaptionparentparameter \csname#1\s!parent\endcsname#2\fi} -\def\dofloatcaptionparameterhash#1#2{\ifcsname#1#2\endcsname #1\else\expandafter\dofloatcaptionparentparameterhash\csname#1\s!parent\endcsname#2\fi} - -\def\dofloatcaptionparentparameter #1#2{\ifx#1\relax\s!empty\else\dofloatcaptionparameter #1#2\fi} -\def\dofloatcaptionparentparameterhash#1#2{\ifx#1\relax \else\dofloatcaptionparameterhash#1#2\fi} - -\def\detokenizedcaptionparameter#1{\detokenize\expandafter\expandafter\expandafter{\csname\??kj\currentfloat#1\endcsname}} - -\def\dosetfloatcaptionattributes#1#2% style color - {\edef\fontattributehash {\floatcaptionparameterhash#1}% - \edef\colorattributehash{\floatcaptionparameterhash#2}% - \ifx\fontattributehash \empty\else\dosetfontattribute \fontattributehash #1\fi - \ifx\colorattributehash\empty\else\dosetcolorattribute\colorattributehash#2\fi} +\let\setupfloats \setupfloat +\let\setupcaption \setupfloatcaption +\let\setupcaptions\setupfloatcaption \def\dohandlenextfloatindent {\checknextindentation[\floatparameter\c!indentnext]% \dorechecknextindentation} -%D The two shared (parent) definitions: - -% todo: everysetupfloat everysetupcaption for all floats - -\unexpanded\def\setupfloats {\dosingleargument\dosetupfloats} % was \??bk -\unexpanded\def\setupcaptions{\dosingleargument\dosetupcaptions} - -\let\alldefinedfloats\empty - -\def\doprocessallfloats#1% - {\def\doprocesssomefloat##1{\def\currentfloat{##1}#1}% - \processcommacommand[\alldefinedfloats]\doprocesssomefloat} - -\def\dosetupfloats [#1]{\getparameters[\??fl][#1]\doprocessallfloats{\the\everysetupfloat}} -\def\dosetupcaptions[#1]{\getparameters[\??kj][#1]\doprocessallfloats{\the\everysetupcaption}} - -% \def\dosetupfloats [#1]{\getparameters[\??fl][#1]} -% \def\dosetupcaptions[#1]{\getparameters[\??kj][#1]} - \setupcaptions [\c!location=\v!bottom, \c!grid=, @@ -137,20 +86,20 @@ \c!strut=\v!no, \c!radius=.5\bodyfontsize, \c!corner=\v!rectangular, - \c!background=, - \c!backgroundcolor=, + %\c!background=, + %\c!backgroundcolor=, \c!backgroundoffset=\!!zeropoint, - \c!topframe=, - \c!bottomframe=, - \c!leftframe=, - \c!rightframe=, + %\c!topframe=, + %\c!bottomframe=, + %\c!leftframe=, + %\c!rightframe=, \c!frameoffset=\!!zeropoint, - \c!before=, - \c!after=, + %\c!before=, + %\c!after=, \c!spacebefore=\v!big, \c!spaceafter=\v!big, - \c!sidespacebefore=\floatsharedparameter\c!spacebefore, - \c!sidespaceafter=\floatsharedparameter\c!spaceafter, + \c!sidespacebefore=\rootfloatparameter\c!spacebefore, + \c!sidespaceafter=\rootfloatparameter\c!spaceafter, \c!sidealign=\v!normal, \c!textmethod=\ifgridsnapping2\else0\fi, % 0=raw 1=safe (.99pg) 2=tight (-1pt) % THIS WILL CHANGE \c!sidemethod=\ifgridsnapping2\else1\fi, % 0=raw 1=safe (.99pg) 2=tight (-1pt) % THIS WILL CHANGE @@ -167,71 +116,26 @@ \c!ntop=2, \c!nbottom=0, \c!nlines=4, - \c!local=, - \c!bottombefore=, % e.g. \vfill - \c!bottomafter=, - \c!default=, % default location + %\c!local=, + %\c!bottombefore=, % e.g. \vfill + %\c!bottomafter=, + %\c!default=, % default location \c!numbering=\v!yes] -\def\@@bknumbering {\floatsharedparameter\c!numbering } % global one -\def\@@bkspaceafter {\floatsharedparameter\c!spaceafter } % global one -\def\@@bkspacebefore{\floatsharedparameter\c!spacebefore} % global one -\def\@@bknbottom {\floatsharedparameter\c!nbottom } % global one -\def\@@bkntop {\floatsharedparameter\c!ntop } % global one -\def\@@bknlines {\floatsharedparameter\c!nlines } % global one -\def\@@bkmargin {\floatsharedparameter\c!margin } % global one -\def\@@bkcache {\floatsharedparameter\c!cache } % global one -\def\@@bklocation {\floatsharedparameter\c!location } - -% float -% -% [%\c!width=8\lineheight, % 15\bodyfontsize, -% %\c!height=6\lineheight, % 10\bodyfontsize, -% \c!offset=\v!overlay, -% \c!width=\v!fit, -% \c!height=\v!fit, -% \c!minwidth=, -% \c!maxwidth=, -% \c!maxheight=, -% \c!criterium=, -% % inherited -% \c!pageboundaries=, -% \c!default=]% - -% number -% -% [\c!text=#1, -% \c!location=\v!intext, -% \c!way=\floatcaptionparameter\c!way, -% \c!blockway=\floatcaptionparameter\c!blockway, -% \c!sectionnumber=\floatcaptionparameter\c!sectionnumber, -% \c!conversion=\floatcaptionparameter\c!conversion]% - %D Individial settings: -\unexpanded\def\setupfloat {\dodoubleargument\dosetupfloat} -\unexpanded\def\setupcaption{\dodoubleargument\dosetupcaption} - -\newtoks\everysetupfloat -\newtoks\everysetupcaption - -\def\dosetupfloat[#1][#2]% - {\def\docommand##1{\getparameters[\??fl##1][#2]\def\currentfloat{##1}\the\everysetupfloat}% - \processcommalist[#1]\docommand} - -\def\dosetupcaption[#1][#2]% - {\def\docommand##1{\getparameters[\??kj##1][#2]\def\currentfloat{##1}\the\everysetupcaption}% - \processcommalist[#1]\docommand} - -\presetstructurecountersetup\setupcaptions\sharedstructurecounterparameter +\presetstructurecountersetup\setupcaption\sharedstructurecounterparameter \appendtoks + \let\currenfloat\currentcaption \dostructurecountersetup\currentfloat\floatcaptionparameter \docheckstructurecountersetup\currentfloat -\to \everysetupcaption +\to \everysetupfloatcaption %D Definitions: +\let\saveddefinefloat\definefloat + \unexpanded\def\definefloat {\dotripleempty\dodefinefloat} @@ -244,28 +148,22 @@ \dododefinefloat[#1][#1]% \fi\fi} -\presetlocalframed[\??fl] - \def\dododefinefloat[#1][#2]% - {\inheritlocalframed[\??fl#1][\??fl]% + {\definefloatcaption[#1]% \definestructurecounter[#1]% - \addtocommalist{#1}\alldefinedfloats - \setupfloat[#1][\s!parent=\??fl]% - \setupcaption[#1][\s!parent=\??kj]% \definelist[#1]% \presetlabeltext[#1=\Word{#1}~]% \presetheadtext[#2=\Word{#2}]% - \dodefinefloatcommands[#1][#2]% - }% \newnodelocation{\v!float\@@thenumber{#1}}} + \saveddefinefloat[#1]% + \dodefinefloatcommands[#1][#2]} \def\redodefinefloat[#1][#2][#3]% - {\inheritlocalframed[\??fl#1][\??fl#3]% - \setupfloat[#1][\s!parent=\??fl#3]% - \setupcaption[#1][\s!parent=\??kj#3]% + {\definefloatcaption[#1][#3]% \definestructurecounter[#1][#3]% \definelist[#1][#3]% \presetlabeltext[#1=\Word{#3}~]% \presetheadtext[#2=\Word{#2}]% + \saveddefinefloat[#1][#3]% \dodefinefloatcommands[#1][#2]} \def\dodefinefloatcommands[#1][#2]% @@ -287,10 +185,10 @@ \def\doemptyfloatblock#1% {\framed [\c!frame=\v!on, - \c!width=\floatsharedparameter\c!width, - \c!height=\floatsharedparameter\c!height, + \c!width=\rootfloatparameter\c!width, + \c!height=\rootfloatparameter\c!height, \c!location=\v!normal, - \c!offset=\floatsharedparameter\c!offset]% + \c!offset=\rootfloatparameter\c!offset]% {\getmessage\m!floatblocks{12}\empty}} %D Data. We can generalize this to lists. @@ -299,7 +197,6 @@ \newif\ifnofloatnumber \newif\ifemptyfloatcaption -\def\getfloatparameters {\getparameters[\??fl\currentfloat]} \def\getcaptionparameters{\getparameters[\??kj\currentfloat]} \installstructurelistprocessor{float}{\usestructurelistprocessor{number+title}} @@ -312,18 +209,6 @@ \def\thecurrentfloatnumber {\ifnofloatcaption \else \ifnofloatnumber \else \ifx\currentfloatnumber\relax\else -% \dostarttagged\t!floatlabel\empty -% \labeltexts\currentfloat -% {\dostoptagged -% \dostarttagged\t!floatnumber\empty -% \ctxlua{structures.lists.savedprefixednumber("\currentfloat",\currentfloatnumber)}% -% \thecurrentfloatnumbersuffix -% \dostoptagged -% \dostarttagged\t!floatlabel\empty}% -% \dostoptagged -% \taggedlabeltexts\currentfloat\currentfloat -% {\ctxlua{structures.lists.savedprefixednumber("\currentfloat",\currentfloatnumber)}% -% \thecurrentfloatnumbersuffix}% \namedtaggedlabeltexts \t!floatlabel \currentfloat \t!floatnumber\currentfloat @@ -525,7 +410,7 @@ \fi} \def\tracefloatnumber#1% - {\doifnot{\floatsharedparameter\c!numbering}\v!nocheck{\tagnodelocation{\v!float\@@thenumber{#1}}}} + {\doifnot{\rootfloatparameter\c!numbering}\v!nocheck{\tagnodelocation{\v!float\@@thenumber{#1}}}} \newconditional\retainfloatnumber @@ -533,7 +418,7 @@ {\xdef\floatcaptionnumber{#1}% \doifelsenodelocation{\v!float\@@thenumber{#1}} \donothing {\nodelocationmode\zerocount}% - \doifelse{\floatsharedparameter\c!numbering}\v!nocheck + \doifelse{\rootfloatparameter\c!numbering}\v!nocheck {\incrementnumber[#1]% \makesectionnumber[#1]% \ifconditional\retainfloatnumber\decrementnumber[#1]\fi} @@ -595,6 +480,7 @@ \unexpanded\def\docomplexplacefloat[#1][#2]% [#3]#4% {\edef\currentfloat{#1}% + \let\currentfloatcaption\currentfloat \doifnothing\currentfloat{\let\currentfloat\v!figure}% hack \doifelsenothing{#2} {\edef\floatlocation{\floatparameter\c!default}} @@ -823,7 +709,7 @@ {float}% \getcaptionparameters \floatcaptionparameter - \detokenizedcaptionparameter + \detokenizedfloatcaptionparameter \relax \relax \relax @@ -908,14 +794,14 @@ \global\sidefloatextrashift\zeropoint \doifassignmentelse{#1}% {\bgroup - \getparameters[\??fl][\c!x=\zeropoint,\c!y=\zeropoint,#1]% + \getparameters[\??fl\??fl][\c!x=\zeropoint,\c!y=\zeropoint,#1]% \ifgridsnapping \getnoflines\@@fly \global\sidefloatdownshift\noflines\lineheight \else - \global\sidefloatdownshift\@@fly + \global\sidefloatdownshift\@@fl@@fly \fi - \global\sidefloatextrashift\@@flx + \global\sidefloatextrashift\@@fl@@flx \egroup} {\movedownsidefloat[#1]}} @@ -1026,8 +912,16 @@ \flushsidefloats % hoort eigenlijk niet hier \docomplexplacefloat[#1][\v!text,#2,\v!left][#3]} +\def\docomplexreserveblock#1#2% + {\begingroup + \edef\currentfloat{#1}% + \let\currentfloatcaption\currentfloat + \setupcurrentfloat[#2]% + \inheritedfloatframed{#1}% + \endgroup} + \long\def\docomplexreserveblock[#1][#2][#3][#4]#5% - {\getvalue{\e!place#1}[#3][#4]{#5}{\localframed[\??fl#1][#2]{#1}}} + {\getvalue{\e!place#1}[#3][#4]{#5}{\docomplexreserveblock{#1}{#2}{#1}}} \def\docomplexstartreservetextblock[#1][#2][#3][#4]% {\flushsidefloats % hoort eigenlijk niet hier @@ -1070,38 +964,38 @@ \global#1\ht\scratchbox}}} \def\calculatefloatskips - {{\docalculatefloatskip\floattopskip{\floatsharedparameter\c!spacebefore}% - \docalculatefloatskip\floatbottomskip{\floatsharedparameter\c!spaceafter}% - \docalculatefloatskip\sidefloattopskip{\floatsharedparameter\c!sidespacebefore}% - \docalculatefloatskip\sidefloatbottomskip{\floatsharedparameter\c!sidespaceafter}% + {{\docalculatefloatskip\floattopskip{\rootfloatparameter\c!spacebefore}% + \docalculatefloatskip\floatbottomskip{\rootfloatparameter\c!spaceafter}% + \docalculatefloatskip\sidefloattopskip{\rootfloatparameter\c!sidespacebefore}% + \docalculatefloatskip\sidefloatbottomskip{\rootfloatparameter\c!sidespaceafter}% \gdef\sidefloattopoffset{\openstrutdepth}% was \def - \global\floatsideskip\floatsharedparameter\c!margin + \global\floatsideskip\rootfloatparameter\c!margin \global\sidefloatleftshift\floatparameter\c!leftmargindistance \global\sidefloatrightshift\floatparameter\c!rightmargindistance - \global\noftopfloats\floatsharedparameter\c!ntop\relax - \global\nofbotfloats\floatsharedparameter\c!nbottom\relax}} + \global\noftopfloats\rootfloatparameter\c!ntop\relax + \global\nofbotfloats\rootfloatparameter\c!nbottom\relax}} % beter de laatste skip buiten de \insert uitvoeren, % bovendien bij volle flush onder baseline. % \def\betweenfloatblanko% assumes that spaceafter is present % {\bgroup -% \setbox0\vbox{\strut\blank[\floatsharedparameter\c!spacebefore]\strut}% -% \setbox2\vbox{\strut\blank[\floatsharedparameter\c!spaceafter]\strut}% +% \setbox0\vbox{\strut\blank[\rootfloatparameter\c!spacebefore]\strut}% +% \setbox2\vbox{\strut\blank[\rootfloatparameter\c!spaceafter]\strut}% % \ifdim\ht0>\ht2 -% \blank[-\floatsharedparameter\c!spaceafter,\floatsharedparameter\c!spacebefore]% +% \blank[-\rootfloatparameter\c!spaceafter,\rootfloatparameter\c!spacebefore]% % \fi % \egroup} \def\betweenfloatblanko% assumes that spaceafter is present - {\blank[\floatsharedparameter\c!spacebefore]} % or v!back,.... + {\blank[\rootfloatparameter\c!spacebefore]} % or v!back,.... \def\doplacefloatbox {%\forgetall % NO \whitespace - \blank[\floatsharedparameter\c!spacebefore] + \blank[\rootfloatparameter\c!spacebefore] \flushfloatbox - \blank[\floatsharedparameter\c!spaceafter]} + \blank[\rootfloatparameter\c!spaceafter]} \ifdefined\someherefloat\else \let\someherefloat\doplacefloatbox \fi \ifdefined\someslotfloat\else \let\someslotfloat\doplacefloatbox \fi @@ -1123,7 +1017,7 @@ \global\floatwidth\wd\floatbox \global\floatheight\ht\floatbox % forget about the depth \global\advance\floattextwidth -\floatwidth - \global\advance\floattextwidth -\floatsharedparameter\c!margin\relax % was \tfskipsize + \global\advance\floattextwidth -\rootfloatparameter\c!margin\relax % was \tfskipsize \doifinsetelse\v!tall{#1} {\floattextheight\pagegoal \advance\floattextheight -\pagetotal @@ -1184,12 +1078,12 @@ \box\floattext}}% \baselinecorrection \whitespace - \blank[\floatsharedparameter\c!spacebefore]% + \blank[\rootfloatparameter\c!spacebefore]% \doifnotinset\v!tall{#1}% {\dp\floatbox\openstrutdepth}% dp\strutbox}% % toegevoegd \box\floatbox \dostoptagged - \blank[\floatsharedparameter\c!spaceafter]% + \blank[\rootfloatparameter\c!spaceafter]% \endgroup % ** % \dostoptagged \doinsertfloatinfo} @@ -1252,10 +1146,10 @@ {\placesomeherefloat[#1]}}}} \def\borderedfloatbox - {\localframed - [\??fl\currentfloat] - [\c!location=\v!normal,\c!width=\wd\floatbox,\c!height=\htdp\floatbox] - {\box\floatbox}} + {\begingroup + \setupcurrentfloat[\c!location=\v!normal,\c!width=\v!fit,\c!height=\v!fit]% + \inheritedfloatframed{\box\floatbox}% + \endgroup} \newbox\tempfloatbox diff --git a/tex/context/base/strc-num.mkiv b/tex/context/base/strc-num.mkiv index 675fb2127..2fd8d3e72 100644 --- a/tex/context/base/strc-num.mkiv +++ b/tex/context/base/strc-num.mkiv @@ -171,13 +171,13 @@ \unexpanded\def\incrementedstructurecounter[#1]{\ctxcommand{incrementedstructurecounter("\@@thestructurecounter{#1}",1, 1)}} \unexpanded\def\decrementedstructurecounter[#1]{\ctxcommand{incrementedstructurecounter("\@@thestructurecounter{#1}",1,-1)}} -\unexpanded\def\setsubstructurecounter {\dodoubleargument\dosetsubstructurecounter} -\unexpanded\def\setsubstructurecounterown {\dodoubleargument\dosetsubstructurecounterown} -\unexpanded\def\resetsubstructurecounter {\dodoubleargument\doresetsubstructurecounter} -\unexpanded\def\restartsubstructurecounter {\dodoubleargument\dorestartsubstructurecounter} -\unexpanded\def\incrementsubstructurecounter {\dodoubleargument\doincrementsubstructurecounter} -\unexpanded\def\decrementsubstructurecounter {\dodoubleargument\dodecrementsubstructurecounter} - \def\rawsubstructurecounter {\dodoubleargument\dorawsubstructurecounter} +\unexpanded\def\setsubstructurecounter {\dodoubleargument\dosetsubstructurecounter} +\unexpanded\def\setsubstructurecounterown {\dodoubleargument\dosetsubstructurecounterown} +\unexpanded\def\resetsubstructurecounter {\dodoubleargument\doresetsubstructurecounter} +\unexpanded\def\restartsubstructurecounter {\dodoubleargument\dorestartsubstructurecounter} +\unexpanded\def\incrementsubstructurecounter{\dodoubleargument\doincrementsubstructurecounter} +\unexpanded\def\decrementsubstructurecounter{\dodoubleargument\dodecrementsubstructurecounter} + \def\rawsubstructurecounter {\dodoubleargument\dorawsubstructurecounter} \def\dosetsubstructurecounter [#1][#2]#3{\ctxcommand{setstructurecounter ("\@@thestructurecounter{#1}",#2,\number#3)}} \def\dosetsubstructurecounterown [#1][#2]#3{\ctxcommand{setownstructurecounter ("\@@thestructurecounter{#1}",#2,"#3")}} diff --git a/tex/context/base/strc-sbe.mkiv b/tex/context/base/strc-sbe.mkiv index fda7f3981..a98b67885 100644 --- a/tex/context/base/strc-sbe.mkiv +++ b/tex/context/base/strc-sbe.mkiv @@ -102,15 +102,15 @@ %D \starttyping %D \startsectionblockenvironment[frontpart] -%D \setuppagenumbering[conversion=romannumerals] +%D \setupnumber[userpage][numberconversion=romannumerals,start=1] %D \stopsectionblockenvironment %D %D \startsectionblockenvironment[bodypart] -%D \setuppagenumber[number=1] +%D \setupnumber[userpage][numberconversion=numbers,start=1] %D \stopsectionblockenvironment %D -%D \startsectionblockenvironment[frontpart] -%D \setuppagenumbering[conversion=character] +%D \startsectionblockenvironment[backpart] +%D \setupnumber[userpage][numberconversion=numbers,start=1] %D \stopsectionblockenvironment %D %D \starttext @@ -124,18 +124,6 @@ {\dosingleargument\dostartsectionblockenvironment} \def\dostartsectionblockenvironment[#1]% evt \pushendofline \popendofline - {\long\def\do##1##2{\setsectionblockenvironment{#1}{##1##2}}% - %\grabuntil{\e!stop\v!sectionblockenvironment}{\sectionblockparameter{\s!do#1}}} - \grabuntil{\e!stop\v!sectionblockenvironment}{\csname\??sb\s!do#1\endcsname}} - -% this will become: (we ran in parallel for a while during transition) - -\setvalue{\e!start\v!sectionblockenvironment}% - {\dosingleargument\dostartsectionblockenvironment} - -\def\dostartsectionblockenvironment[#1]% evt \pushendofline \popendofline - {\long\def\do##1##2{\setsectionblockenvironment{#1}{##1##2}}% - %\grabuntil{\e!stop\v!sectionblockenvironment}{\sectionblockparameter{\s!do#1}}} - \grabuntil{\e!stop\v!sectionblockenvironment}{\csname\??sb\s!do#1\endcsname}} + {\grabuntil{\e!stop\v!sectionblockenvironment}{\setsectionblockenvironment{#1}}} \protect \endinput diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv index 408a290ad..a0f32c713 100644 --- a/tex/context/base/syst-aux.mkiv +++ b/tex/context/base/syst-aux.mkiv @@ -349,6 +349,8 @@ %D \type{\:} becomes a delimiter of the longer named %D \type{\reinspectnextcharacter}. +% try: \expandafter\def\firstofoneargument{\reinspect_next_character} {...} + \let\next\: \def\:{\let\blankspace= } \: @@ -362,6 +364,9 @@ \def\:{\reinspect_next_bgroup_character} \expandafter\def\: {\let\if_next_blank_space_token\iftrue\futurelet\nexttoken\inspect_next_bgroup_character} +\def\:{\reinspect_next_parenthesis_character} +\expandafter\def\: {\let\if_next_blank_space_token\iftrue\futurelet\nexttoken\inspect_next_parenthesis_character} + \let\:\next %D \macros diff --git a/tex/context/interface/keys-cs.xml b/tex/context/interface/keys-cs.xml index 7027f8c0c..e2e3b985f 100644 --- a/tex/context/interface/keys-cs.xml +++ b/tex/context/interface/keys-cs.xml @@ -502,6 +502,8 @@ + + diff --git a/tex/context/interface/keys-de.xml b/tex/context/interface/keys-de.xml index 37a3ee77d..5ef5ad82e 100644 --- a/tex/context/interface/keys-de.xml +++ b/tex/context/interface/keys-de.xml @@ -502,6 +502,8 @@ + + diff --git a/tex/context/interface/keys-en.xml b/tex/context/interface/keys-en.xml index 9bd938d43..edeec95b8 100644 --- a/tex/context/interface/keys-en.xml +++ b/tex/context/interface/keys-en.xml @@ -502,6 +502,8 @@ + + diff --git a/tex/context/interface/keys-fr.xml b/tex/context/interface/keys-fr.xml index 51588a244..1c5850603 100644 --- a/tex/context/interface/keys-fr.xml +++ b/tex/context/interface/keys-fr.xml @@ -502,6 +502,8 @@ + + diff --git a/tex/context/interface/keys-it.xml b/tex/context/interface/keys-it.xml index f44709875..d8b685e89 100644 --- a/tex/context/interface/keys-it.xml +++ b/tex/context/interface/keys-it.xml @@ -502,6 +502,8 @@ + + diff --git a/tex/context/interface/keys-nl.xml b/tex/context/interface/keys-nl.xml index 67e9152b2..528446083 100644 --- a/tex/context/interface/keys-nl.xml +++ b/tex/context/interface/keys-nl.xml @@ -502,6 +502,8 @@ + + diff --git a/tex/context/interface/keys-pe.xml b/tex/context/interface/keys-pe.xml index 0cdf2d2c1..d0123485e 100644 --- a/tex/context/interface/keys-pe.xml +++ b/tex/context/interface/keys-pe.xml @@ -502,6 +502,8 @@ + + diff --git a/tex/context/interface/keys-ro.xml b/tex/context/interface/keys-ro.xml index 5b0df2880..eb18cef07 100644 --- a/tex/context/interface/keys-ro.xml +++ b/tex/context/interface/keys-ro.xml @@ -502,6 +502,8 @@ + + diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 586f5e882..d779357af 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 : 09/15/11 19:53:57 +-- merge date : 09/17/11 09:40:07 do -- begin closure to overcome local limits and interference -- cgit v1.2.3