diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-11-07 12:49:36 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-11-07 12:49:36 +0100 |
commit | 75fbb107b15d01179a4b772844144e0661240e77 (patch) | |
tree | c5210f4f9ade25c89a540f755912a52966404792 | |
parent | 7830451577b876020de2a26bbfbf069625ab4d6f (diff) | |
download | context-75fbb107b15d01179a4b772844144e0661240e77.tar.gz |
2017-11-07 11:43:00
56 files changed, 682 insertions, 295 deletions
diff --git a/context/data/scite/context/lexers/data/scite-context-data-metafun.lua b/context/data/scite/context/lexers/data/scite-context-data-metafun.lua index 2084b1408..b577c8aee 100644 --- a/context/data/scite/context/lexers/data/scite-context-data-metafun.lua +++ b/context/data/scite/context/lexers/data/scite-context-data-metafun.lua @@ -1,4 +1,4 @@ return { - ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "fillup", "eofillup", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath" }, - ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption" }, + ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "fillup", "eofillup", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath" }, + ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption" }, }
\ No newline at end of file diff --git a/context/data/scite/context/scite-context-data-metafun.properties b/context/data/scite/context/scite-context-data-metafun.properties index e1e8040cf..e83313132 100644 --- a/context/data/scite/context/scite-context-data-metafun.properties +++ b/context/data/scite/context/scite-context-data-metafun.properties @@ -15,51 +15,52 @@ triangle smoothed cornered superellipsed randomized \ randomizedcontrols squeezed enlonged shortened punked \ curved unspiked simplified blownup stretched \ enlarged leftenlarged topenlarged rightenlarged bottomenlarged \ -crossed laddered randomshifted interpolated paralleled \ -cutends peepholed llenlarged lrenlarged urenlarged \ -ulenlarged llmoved lrmoved urmoved ulmoved \ -rightarrow leftarrow centerarrow boundingbox innerboundingbox \ -outerboundingbox pushboundingbox popboundingbox boundingradius boundingcircle \ -boundingpoint crossingunder insideof outsideof bottomboundary \ -leftboundary topboundary rightboundary xsized ysized \ -xysized sized xyscaled intersection_point intersection_found \ -penpoint bbwidth bbheight withshade withcircularshade \ -withlinearshade defineshade shaded shadedinto withshadecolors \ -withshadedomain withshademethod withshadefactor withshadevector withshadecenter \ -withshadedirection withshaderadius withshadetransform withshadestep withshadefraction \ -cmyk spotcolor multitonecolor namedcolor drawfill \ -undrawfill inverted uncolored softened grayed \ -greyed onlayer along graphictext loadfigure \ -externalfigure figure register outlinetext checkedbounds \ -checkbounds strut rule withmask bitmapimage \ -colordecimals ddecimal dddecimal ddddecimal colordecimalslist \ -textext thetextext rawtextext textextoffset texbox \ -thetexbox rawtexbox verbatim thelabel label \ -autoalign transparent withtransparency property properties \ -withproperties asgroup infont space crlf \ -dquote percent SPACE CRLF DQUOTE \ -PERCENT grayscale greyscale withgray withgrey \ -colorpart colorlike readfile clearxy unitvector \ -center epsed anchored originpath infinite \ -break xstretched ystretched snapped pathconnectors \ -function constructedfunction constructedpath constructedpairs straightfunction \ -straightpath straightpairs curvedfunction curvedpath curvedpairs \ -evenly oddly condition pushcurrentpicture popcurrentpicture \ -arrowpath resetarrows tensecircle roundedsquare colortype \ -whitecolor blackcolor basiccolors complementary complemented \ -resolvedcolor normalfill normaldraw visualizepaths detailpaths \ -naturalizepaths drawboundary drawwholepath drawpathonly visualizeddraw \ -visualizedfill detaileddraw draworigin drawboundingbox drawpath \ -drawpoint drawpoints drawcontrolpoints drawcontrollines drawpointlabels \ -drawlineoptions drawpointoptions drawcontroloptions drawlabeloptions draworiginoptions \ -drawboundoptions drawpathoptions resetdrawoptions undashed pencilled \ -decorated redecorated undecorated passvariable passarrayvariable \ -tostring topair format formatted quotation \ -quote startpassingvariable stoppassingvariable eofill eoclip \ -nofill fillup eofillup area addbackground \ -shadedup shadeddown shadedleft shadedright sortlist \ -copylist shapedlist listtocurves listtolines listsize \ -listlast uniquelist circularpath squarepath linearpath +crossed laddered randomshifted interpolated perpendicular \ +paralleled cutends peepholed llenlarged lrenlarged \ +urenlarged ulenlarged llmoved lrmoved urmoved \ +ulmoved rightarrow leftarrow centerarrow drawdoublearrows \ +boundingbox innerboundingbox outerboundingbox pushboundingbox popboundingbox \ +boundingradius boundingcircle boundingpoint crossingunder insideof \ +outsideof bottomboundary leftboundary topboundary rightboundary \ +xsized ysized xysized sized xyscaled \ +intersection_point intersection_found penpoint bbwidth bbheight \ +withshade withcircularshade withlinearshade defineshade shaded \ +shadedinto withshadecolors withshadedomain withshademethod withshadefactor \ +withshadevector withshadecenter withshadedirection withshaderadius withshadetransform \ +withshadestep withshadefraction cmyk spotcolor multitonecolor \ +namedcolor drawfill undrawfill inverted uncolored \ +softened grayed greyed onlayer along \ +graphictext loadfigure externalfigure figure register \ +outlinetext checkedbounds checkbounds strut rule \ +withmask bitmapimage colordecimals ddecimal dddecimal \ +ddddecimal colordecimalslist textext thetextext rawtextext \ +textextoffset texbox thetexbox rawtexbox istextext \ +verbatim thelabel label autoalign transparent \ +withtransparency property properties withproperties asgroup \ +infont space crlf dquote percent \ +SPACE CRLF DQUOTE PERCENT grayscale \ +greyscale withgray withgrey colorpart colorlike \ +readfile clearxy unitvector center epsed \ +anchored originpath infinite break xstretched \ +ystretched snapped pathconnectors function constructedfunction \ +constructedpath constructedpairs straightfunction straightpath straightpairs \ +curvedfunction curvedpath curvedpairs evenly oddly \ +condition pushcurrentpicture popcurrentpicture arrowpath resetarrows \ +tensecircle roundedsquare colortype whitecolor blackcolor \ +basiccolors complementary complemented resolvedcolor normalfill \ +normaldraw visualizepaths detailpaths naturalizepaths drawboundary \ +drawwholepath drawpathonly visualizeddraw visualizedfill detaileddraw \ +draworigin drawboundingbox drawpath drawpoint drawpoints \ +drawcontrolpoints drawcontrollines drawpointlabels drawlineoptions drawpointoptions \ +drawcontroloptions drawlabeloptions draworiginoptions drawboundoptions drawpathoptions \ +resetdrawoptions undashed pencilled decorated redecorated \ +undecorated passvariable passarrayvariable tostring topair \ +format formatted quotation quote startpassingvariable \ +stoppassingvariable eofill eoclip nofill fillup \ +eofillup area addbackground shadedup shadeddown \ +shadedleft shadedright sortlist copylist shapedlist \ +listtocurves listtolines listsize listlast uniquelist \ +circularpath squarepath linearpath keywordclass.metafun.internals=\ nocolormodel greycolormodel graycolormodel rgbcolormodel \ @@ -67,6 +68,6 @@ cmykcolormodel shadefactor textextoffset normaltransparent multiplytransparent \ screentransparent overlaytransparent softlighttransparent hardlighttransparent colordodgetransparent \ colorburntransparent darkentransparent lightentransparent differencetransparent exclusiontransparent \ huetransparent saturationtransparent colortransparent luminositytransparent ahvariant \ -ahdimple ahfactor metapostversion maxdimensions drawoptionsfactor \ -dq sq crossingscale crossingoption +ahdimple ahfactor ahscale metapostversion maxdimensions \ +drawoptionsfactor dq sq crossingscale crossingoption diff --git a/context/data/textadept/context/data/scite-context-data-metafun.lua b/context/data/textadept/context/data/scite-context-data-metafun.lua index 2084b1408..b577c8aee 100644 --- a/context/data/textadept/context/data/scite-context-data-metafun.lua +++ b/context/data/textadept/context/data/scite-context-data-metafun.lua @@ -1,4 +1,4 @@ return { - ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "fillup", "eofillup", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath" }, - ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption" }, + ["commands"]={ "loadfile", "loadimage", "loadmodule", "dispose", "nothing", "transparency", "tolist", "topath", "tocycle", "sqr", "log", "ln", "exp", "inv", "pow", "pi", "radian", "tand", "cotd", "sin", "cos", "tan", "cot", "atan", "asin", "acos", "invsin", "invcos", "invtan", "acosh", "asinh", "sinh", "cosh", "tanh", "zmod", "paired", "tripled", "unitcircle", "fulldiamond", "unitdiamond", "fullsquare", "unittriangle", "fulltriangle", "llcircle", "lrcircle", "urcircle", "ulcircle", "tcircle", "bcircle", "lcircle", "rcircle", "lltriangle", "lrtriangle", "urtriangle", "ultriangle", "uptriangle", "downtriangle", "lefttriangle", "righttriangle", "triangle", "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", "bottomboundary", "leftboundary", "topboundary", "rightboundary", "xsized", "ysized", "xysized", "sized", "xyscaled", "intersection_point", "intersection_found", "penpoint", "bbwidth", "bbheight", "withshade", "withcircularshade", "withlinearshade", "defineshade", "shaded", "shadedinto", "withshadecolors", "withshadedomain", "withshademethod", "withshadefactor", "withshadevector", "withshadecenter", "withshadedirection", "withshaderadius", "withshadetransform", "withshadestep", "withshadefraction", "cmyk", "spotcolor", "multitonecolor", "namedcolor", "drawfill", "undrawfill", "inverted", "uncolored", "softened", "grayed", "greyed", "onlayer", "along", "graphictext", "loadfigure", "externalfigure", "figure", "register", "outlinetext", "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "verbatim", "thelabel", "label", "autoalign", "transparent", "withtransparency", "property", "properties", "withproperties", "asgroup", "infont", "space", "crlf", "dquote", "percent", "SPACE", "CRLF", "DQUOTE", "PERCENT", "grayscale", "greyscale", "withgray", "withgrey", "colorpart", "colorlike", "readfile", "clearxy", "unitvector", "center", "epsed", "anchored", "originpath", "infinite", "break", "xstretched", "ystretched", "snapped", "pathconnectors", "function", "constructedfunction", "constructedpath", "constructedpairs", "straightfunction", "straightpath", "straightpairs", "curvedfunction", "curvedpath", "curvedpairs", "evenly", "oddly", "condition", "pushcurrentpicture", "popcurrentpicture", "arrowpath", "resetarrows", "tensecircle", "roundedsquare", "colortype", "whitecolor", "blackcolor", "basiccolors", "complementary", "complemented", "resolvedcolor", "normalfill", "normaldraw", "visualizepaths", "detailpaths", "naturalizepaths", "drawboundary", "drawwholepath", "drawpathonly", "visualizeddraw", "visualizedfill", "detaileddraw", "draworigin", "drawboundingbox", "drawpath", "drawpoint", "drawpoints", "drawcontrolpoints", "drawcontrollines", "drawpointlabels", "drawlineoptions", "drawpointoptions", "drawcontroloptions", "drawlabeloptions", "draworiginoptions", "drawboundoptions", "drawpathoptions", "resetdrawoptions", "undashed", "pencilled", "decorated", "redecorated", "undecorated", "passvariable", "passarrayvariable", "tostring", "topair", "format", "formatted", "quotation", "quote", "startpassingvariable", "stoppassingvariable", "eofill", "eoclip", "nofill", "fillup", "eofillup", "area", "addbackground", "shadedup", "shadeddown", "shadedleft", "shadedright", "sortlist", "copylist", "shapedlist", "listtocurves", "listtolines", "listsize", "listlast", "uniquelist", "circularpath", "squarepath", "linearpath" }, + ["internals"]={ "nocolormodel", "greycolormodel", "graycolormodel", "rgbcolormodel", "cmykcolormodel", "shadefactor", "textextoffset", "normaltransparent", "multiplytransparent", "screentransparent", "overlaytransparent", "softlighttransparent", "hardlighttransparent", "colordodgetransparent", "colorburntransparent", "darkentransparent", "lightentransparent", "differencetransparent", "exclusiontransparent", "huetransparent", "saturationtransparent", "colortransparent", "luminositytransparent", "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", "dq", "sq", "crossingscale", "crossingoption" }, }
\ No newline at end of file diff --git a/doc/context/documents/general/manuals/nodes.pdf b/doc/context/documents/general/manuals/nodes.pdf Binary files differindex 18c564192..5162808ab 100644 --- a/doc/context/documents/general/manuals/nodes.pdf +++ b/doc/context/documents/general/manuals/nodes.pdf diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf Binary files differindex 0d2a7dd74..4ffb8325a 100644 --- a/doc/context/documents/general/qrcs/setup-cs.pdf +++ b/doc/context/documents/general/qrcs/setup-cs.pdf diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf Binary files differindex d9f5ca79d..5952c0c26 100644 --- a/doc/context/documents/general/qrcs/setup-de.pdf +++ b/doc/context/documents/general/qrcs/setup-de.pdf diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf Binary files differindex 492576d86..50dc00a0c 100644 --- a/doc/context/documents/general/qrcs/setup-en.pdf +++ b/doc/context/documents/general/qrcs/setup-en.pdf diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf Binary files differindex 66989e8a9..2f525c51d 100644 --- a/doc/context/documents/general/qrcs/setup-fr.pdf +++ b/doc/context/documents/general/qrcs/setup-fr.pdf diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf Binary files differindex b4eddc61b..aca703e3c 100644 --- a/doc/context/documents/general/qrcs/setup-it.pdf +++ b/doc/context/documents/general/qrcs/setup-it.pdf diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf Binary files differindex ded507879..98a8f8141 100644 --- a/doc/context/documents/general/qrcs/setup-nl.pdf +++ b/doc/context/documents/general/qrcs/setup-nl.pdf diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf Binary files differindex c419e6e32..90fee7b25 100644 --- a/doc/context/documents/general/qrcs/setup-ro.pdf +++ b/doc/context/documents/general/qrcs/setup-ro.pdf diff --git a/doc/context/scripts/mkiv/mtx-youless.html b/doc/context/scripts/mkiv/mtx-youless.html index 726403371..d5678920b 100644 --- a/doc/context/scripts/mkiv/mtx-youless.html +++ b/doc/context/scripts/mkiv/mtx-youless.html @@ -45,11 +45,13 @@ <tr><th>--kwh</th><td></td><td>summative kwh data</td></tr> <tr><th>--watt</th><td></td><td>collected watt data</td></tr> <tr><th>--host</th><td></td><td>ip address of device</td></tr> + <tr><th>--auto</th><td></td><td>fetch kwh and watt data every hour</td></tr> </table> <br/> <h1>Example</h1> <tt>mtxrun --script youless --collect --host=192.168.2.50 --kwh</tt> <br/><tt>mtxrun --script youless --collect --host=192.168.2.50 --watt somefile.lua</tt> +<br/><tt>mtxrun --script youless --collect --host=192.168.2.50 --auto file-prefix</tt> <br/><br/> </div> </div> </body> diff --git a/doc/context/scripts/mkiv/mtx-youless.man b/doc/context/scripts/mkiv/mtx-youless.man index b48113381..64a108402 100644 --- a/doc/context/scripts/mkiv/mtx-youless.man +++ b/doc/context/scripts/mkiv/mtx-youless.man @@ -28,6 +28,9 @@ collected watt data .TP .B --host ip address of device +.TP +.B --auto +fetch kwh and watt data every hour .SH AUTHOR More information about ConTeXt and the tools that come with it can be found at: diff --git a/doc/context/scripts/mkiv/mtx-youless.xml b/doc/context/scripts/mkiv/mtx-youless.xml index cd402c3d0..888c34934 100644 --- a/doc/context/scripts/mkiv/mtx-youless.xml +++ b/doc/context/scripts/mkiv/mtx-youless.xml @@ -14,6 +14,7 @@ <flag name="kwh"><short>summative kwh data</short></flag> <flag name="watt"><short>collected watt data</short></flag> <flag name="host"><short>ip address of device</short></flag> + <flag name="auto"><short>fetch kwh and watt data every hour</short></flag> </subcategory> </category> </flags> @@ -23,6 +24,7 @@ <subcategory> <example><command>mtxrun --script youless --collect --host=192.168.2.50 --kwh</command></example> <example><command>mtxrun --script youless --collect --host=192.168.2.50 --watt somefile.lua</command></example> + <example><command>mtxrun --script youless --collect --host=192.168.2.50 --auto file-prefix</command></example> </subcategory> </category> </examples> diff --git a/doc/context/sources/general/manuals/nodes/nodes.tex b/doc/context/sources/general/manuals/nodes/nodes.tex index 190e654fc..7bf88302c 100644 --- a/doc/context/sources/general/manuals/nodes/nodes.tex +++ b/doc/context/sources/general/manuals/nodes/nodes.tex @@ -20,7 +20,7 @@ % comment : This manual orginates in an article by Alan so anything wrong in here is Hans % fault as he converted it. % -% comment : The conver images are form the NASA website. +% comment : The conver images are from the NASA website. \definemeasure [layout:margin] [\paperheight/20] @@ -179,6 +179,14 @@ [offset=1pt, foregroundcolor=white] +\startMPdefinitions + ahlength := 12pt ; + ahangle := 30 ; + ahvariant := 1 ; % dimpled +\stopMPdefinitions + +% Only here do we use the special nodes:: instance + \startreusableMPgraphic{nodes::krebs} % The Bethe cycle for energy production in stars (1939), following @@ -236,7 +244,7 @@ % Alan wanted a sun in the background combined somehow with the energy % harvesting molecule so here we go. The images that are used come from % the NASA website and I used them as screen saver for a while. The - % version that I generate use another variant than the one on the users + % version that I generate uses a variant from the one on the user's % machine. draw textext("\externalfigure[\framedparameter{imagename}]") @@ -292,10 +300,6 @@ figure} [fig:AB]. \startplacefigure [reference=fig:AB] \startMPcode - ahlength := 12pt ; - ahangle := 30 ; - ahvariant := 1 ; % dimpled - u := 1cm ; save nodepath ; path nodepath ; nodepath := (left -- right) scaled u ; @@ -673,6 +677,8 @@ located on the same path. \cite[authoryears] [Krebs1946] representation of a catalytic process.}] \startMPcode + % differs slightly from \reuseMPgraphic{nodes::krebs} + % The Bethe cycle for energy production in stars (1939), following Krebs (1946) save p ; path p[] ; @@ -1141,6 +1147,165 @@ the tree structure. \stopsubject +\startsubject [title=A 3D projection] + +% This special instance could become part of the base distribution... + +\defineMPinstance [three] [format=metafun,extensions=yes,initializations=yes,method=double] + +\startMPdefinitions{three} +% Simple 3D->2D projection +% Adapted from Urs Oswald, Dr.sc.math. ETH +% http://www.ursoswald.ch/metapost/tutorial.html +% and extended! + +transform t, Txy, Pxy ; +pair P[] ; +path p[] ; + +P0=origin ; % origin in MetaPost coordinates (bp) +P1=(left rotated 60) scaled (cosd 60) ; % x axis (in mathematical coordinates) + +% t: maps mathematical 2D coordinates onto MetaPost coordinates. + +t:=identity shifted P0 ; + +% Pxy is the projection of the 3D plane z=0 onto the mathematical 2D coordinates. +% Pxy is determined by 3 e q u a t i o n s describing +% how (1,0), (0,1), and (0,0) are mapped + + P1=(1,0)transformed Pxy ; % Pxy: (1,0) --> P1 +(1,0)=(0,1)transformed Pxy ; % (0,1) --> (1,0) +(0,0)=(0,0)transformed Pxy ; % (0,0) --> (0,0) + +% mathematical 2D coordinates --> MetaPost coordinates + +Txy:=Pxy transformed t ; + +let triplet=color ; +let Xpart=redpart ; +let Ypart=greenpart ; +let Zpart=bluepart ; +triplet Origin, Xunitvector, Yunitvector, Zunitvector ; +Origin = (0,0,0) ; +Xunitvector = (1,0,0) ; +Yunitvector = (0,1,0) ; +Zunitvector = (0,0,1) ; + +% overloads let abs=length ; from plain.mp + +vardef abs primary p = + if triplet p : sqrt((Xpart p)**2+(Ypart p)**2+(Zpart p)**2) else : length p fi +enddef ; + +vardef projection expr t = % returns MetaPost coordinates (bp) + if triplet t : + (Xpart t, Ypart t) transformed Txy shifted (0,Zpart t) + elseif pair t : + t transformed Txy + else : + origin transformed Txy + fi +enddef ; + +primarydef p dotproduct q = + ((Xpart p)*(Xpart q) + (Ypart p)*(Ypart q) + (Zpart p)*(Zpart q)) +enddef ; + +primarydef p crossproduct q = + ((Ypart p)*(Zpart q) - (Zpart p)*(Ypart q), + (Zpart p)*(Xpart q) - (Xpart p)*(Zpart q), + (Xpart p)*(Ypart q) - (Ypart p)*(Xpart q)) +enddef ; + +primarydef p rotatedaboutX q = + hide( + pair yz ; + yz:=(Ypart p, Zpart p) ; + yz:=yz rotated q ;) + (Xpart p, xpart yz, ypart yz) +enddef ; + +primarydef p rotatedaboutY q = + hide( + pair zx ; + zx:=(Zpart p, Xpart p) ; + zx:=zx rotated q ;) + (ypart zx, Ypart p, xpart zx) +enddef ; + +primarydef p rotatedaboutZ q = + hide( + pair xy ; + xy:=(Xpart p, Ypart p) ; + xy:=xy rotated q ;) + (xpart xy, ypart xy, Zpart p) +enddef ; + +vardef draw_vector@# (expr v, s) text t = + if triplet v : + drawarrow projection(Origin)--projection(v) t ; + if string s : + label@#(s, projection(v)) t ; + fi + fi +enddef ; + +\stopMPdefinitions + +\startMPcalculation{three} + ahlength := 12pt ; + ahangle := 30 ; + ahvariant := 1 ; % dimpled +\stopMPcalculation + +\startplacefigure [location=left] + \startMPcode{three} + + nodepath := ( + projection Origin -- + projection (1,0,0) -- + projection (1,1,0) -- + projection (0,1,0) -- + projection (0,1,1) -- + projection (1,1,1) -- + projection (1,0,1) -- + projection (0,0,1) -- + cycle + ) scaled 5cm ; + + draw node(0,"\node{${\cal C}_{i\cal P}^{\mathrm{nt}}$}") ; + draw node(1,"\node{${\cal C}_{i\cal G}^{\mathrm{nt}}$}") ; + draw node(2,"\node{${\cal C}_{j\cal P}^{\mathrm{nt}}$}") ; + draw node(3,"\node{${\cal C}_{j\cal G}^{\mathrm{nt}}$}") ; + draw node(4,"\node{${\cal C}_{j\cal G}$}") ; + draw node(5,"\node{${\cal C}_{j\cal P}$}") ; + draw node(6,"\node{${\cal C}_{i\cal G}$}") ; + draw node(7,"\node{${\cal C}_{i\cal P}$}") ; + + interim crossingscale := 30 ; + + drawdoublearrows fromto(0,0,1) ; + drawdoublearrows fromto(0,1,2) ; + drawdoublearrows fromto(0,2,3) ; + drawdoublearrows fromto(0,3,0) crossingunder fromto(0,2,5) ; + + drawdoublearrows fromto(0,7,6) ; + drawdoublearrows fromto(0,6,5) ; + drawdoublearrows fromto(0,5,4) ; label.lft("\node{$τ_j$~}", center fromto(0,5,4)) ; + drawdoublearrows fromto(0,7,4) ; label.top("\node{$σ$}", center fromto(0,7,4)) ; + + drawdoublearrows fromto(0,0,7) crossingunder fromto(0,6,5) ; + label.lrt("\node{$Ψ^{\mathrm{nt}}$}", center fromto(0,0,7)) ; + drawdoublearrows fromto(0,1,6) ; + drawdoublearrows fromto(0,2,5) ; + drawdoublearrows fromto(0,3,4) ; + + \stopMPcode +\stopplacefigure + +\stopsubject + \startsubject [title=Two final examples] \defineframed diff --git a/metapost/context/base/mpiv/mp-tool.mpiv b/metapost/context/base/mpiv/mp-tool.mpiv index 34984465f..478680d5e 100644 --- a/metapost/context/base/mpiv/mp-tool.mpiv +++ b/metapost/context/base/mpiv/mp-tool.mpiv @@ -1181,8 +1181,53 @@ enddef ; %D Interesting too: +% primarydef p paralleled d = ( +% p shifted if d < 0 : - fi ((point abs(d) on (p rotatedaround(point 0 of p,90))) - point 0 of p) +% ) enddef ; +% +% primarydef p paralleled d = ( +% p shifted ((d*unitvector(direction 0 of p) - point 0 of p) rotated 90) +% ) enddef ; +% +% Alan came up with an improved version and stepwise we ended up with (or +% might up with a variant of): + +vardef perpendicular expr t of p = + unitvector((direction t of p) rotated 90) +enddef ; + +def istextext(expr p) = + (path p and ((substring(0,3) of prescriptpart p) = "tx_")) +enddef ; + primarydef p paralleled d = ( - p shifted if d < 0 : - fi ((point abs(d) on (p rotatedaround(point 0 of p,90))) - point 0 of p) + if path p : + begingroup ; + save dp ; pair dp ; + for i=0 upto length p if cycle p : -1 fi : + hide(dp := d * perpendicular i of p) + if i > 0 : .. fi + (point i of p + dp) + if i < length p : + .. controls (postcontrol i of p + dp) and + (precontrol (i+1) of p + dp) + fi + endfor + if cycle p : .. cycle fi + endgroup + elseif picture p : + image( + for i within p : + draw (pathpart i) + if not istextext(i) : % dirty trick + paralleled d + fi + mfun_decoration_i i ; + endfor ; + ) + elseif pair p : + p + fi ) enddef ; vardef punked primary p = @@ -1268,6 +1313,7 @@ enddef ; newinternal ahvariant ; ahvariant := 0 ; newinternal ahdimple ; ahdimple := 1/5 ; +newinternal ahscale ; ahscale := 3/4 ; vardef arrowhead expr p = save q, e, r ; @@ -1310,7 +1356,8 @@ def resetarrows = ahangle := 45 ; ahvariant := 0 ; ahdimple := 1/5 ; - ) + ahscale := 3/4 ; +) enddef ; %D Points. @@ -1713,6 +1760,65 @@ def mfun_draw_arrow_picture_double text t = endgroup ; enddef ; +%D Some more arrow magic, by Alan: + +def drawdoublearrows expr p = + begingroup ; + save mfun_arrow_path ; + path mfun_arrow_path ; + save mfun_arrow_path_parallel ; + path mfun_arrow_path_parallel ; + if path p : + mfun_arrow_path := p ; + expandafter mfun_draw_arrow_paths + elseif picture p : + save mfun_arrow_picture ; + picture mfun_arrow_picture ; + mfun_arrow_picture := p ; + expandafter mfun_draw_arrow_pictures + else : + expandafter mfun_draw_arrow_nothing + fi +enddef ; + +def mfun_draw_arrow_paths text t = + if autoarrows : + set_ahlength(t) ; + fi + save d ; d := ahscale*ahlength*sind(ahangle/2) ; + mfun_arrow_path_parallel := mfun_arrow_path paralleled d ; + draw arrowpath mfun_arrow_path_parallel t ; + fillup arrowhead mfun_arrow_path_parallel t ; + mfun_arrow_path_parallel := (reverse mfun_arrow_path) paralleled d ; + draw arrowpath mfun_arrow_path_parallel t ; + fillup arrowhead mfun_arrow_path_parallel t ; + endgroup ; +enddef ; + +def mfun_draw_arrow_pictures text t = + if autoarrows : + set_ahlength(t) ; + fi + save d ; d := ahscale*ahlength*sind(ahangle/2) ; + mfun_with_arrow_picture( + if mfun_arrow_count = 1 : + draw (mfun_arrow_path paralleled d) mfun_decoration_i i t ; + mfun_arrow_path_parallel := (reverse mfun_arrow_path) paralleled d ; + draw arrowpath mfun_arrow_path_parallel mfun_decoration_i i t ; + fillup arrowhead mfun_arrow_path_parallel mfun_decoration_i i t ; + elseif mfun_arrow_count = mfun_arrow_snippets : + draw ((reverse mfun_arrow_path) paralleled d) mfun_decoration_i i t ; + mfun_arrow_path_parallel := mfun_arrow_path paralleled d ; + draw arrowpath mfun_arrow_path_parallel mfun_decoration_i i t ; + fillup arrowhead mfun_arrow_path_parallel mfun_decoration_i i t ; + else : + draw ( mfun_arrow_path paralleled d) mfun_decoration_i i t ; + draw ((reverse mfun_arrow_path) paralleled d) mfun_decoration_i i t ; + fi + ) + endgroup ; +enddef ; + %D Handy too ...... vardef pointarrow (expr pat, loc, len, off) = diff --git a/scripts/context/lua/mtx-youless.lua b/scripts/context/lua/mtx-youless.lua index 740fdcb65..6c600517a 100644 --- a/scripts/context/lua/mtx-youless.lua +++ b/scripts/context/lua/mtx-youless.lua @@ -33,6 +33,7 @@ local helpinfo = [[ <flag name="kwh"><short>summative kwh data</short></flag> <flag name="watt"><short>collected watt data</short></flag> <flag name="host"><short>ip address of device</short></flag> + <flag name="auto"><short>fetch kwh and watt data every hour</short></flag> </subcategory> </category> </flags> @@ -42,6 +43,7 @@ local helpinfo = [[ <subcategory> <example><command>mtxrun --script youless --collect --host=192.168.2.50 --kwh</command></example> <example><command>mtxrun --script youless --collect --host=192.168.2.50 --watt somefile.lua</command></example> + <example><command>mtxrun --script youless --collect --host=192.168.2.50 --auto file-prefix</command></example> </subcategory> </category> </examples> @@ -61,17 +63,32 @@ scripts.youless = scripts.youless or { } function scripts.youless.collect() local host = environment.arguments.host - local variant = environment.arguments.kwh and "kwh" or environment.arguments.watt and "watt" local nobackup = environment.arguments.nobackup local nofile = environment.arguments.nofile local password = environment.arguments.password local filename = environment.files[1] - if not variant then - report("provide variant --kwh or --watt") - return - else + local delay = tonumber(environment.delay) or 12*60*60 + + local function fetch(filename,variant) + local data = utilities.youless.collect { + filename = filename, + host = host, + variant = variant, + nobackup = nobackup, + password = password, + } + if type(data) ~= "table" then + report("no data collected") + elseif filename == "" then + report("data collected but not saved") + end report("using variant %a",variant) + if filename ~= "" then + report("using file %a",filename) + end + report("current time %a",os.now()) end + if not host then host = "192.168.2.50" report("using default host %a",host) @@ -81,25 +98,30 @@ function scripts.youless.collect() if nobackup then report("not backing up data file") end - if not filename and not nofile then - filename = formatters["youless-%s.lua"](variant) - end - if filename ~= "" then - report("using file %a",filename) - end - local data = utilities.youless.collect { - filename = filename, - host = host, - variant = variant, - nobackup = nobackup, - password = password, - } - if type(data) ~= "table" then - report("no data collected") - elseif filename == "" then - report("data collected but not saved") + + if environment.arguments.auto then + local filename_kwh = formatters["%s-kwh.lua" ](filename ~= "" and filename or "youless") + local filename_watt = formatters["%s-watt.lua"](filename ~= "" and filename or "youless") + while true do + fetch(filename_kwh,"kwh") + fetch(filename_watt,"watt") + report("sleeping for %i seconds",delay) + io.flush() + os.sleep(delay) + end + else + local variant = environment.arguments.kwh and "kwh" or environment.arguments.watt and "watt" + if not variant then + report("provide variant --kwh or --watt") + return + end + if nofile then + filename = "" + elseif not filename or filename == "" then + filename = formatters["youless-%s.lua"](variant) + end + fetch(filename,variant) end - report("current time %a",os.now()) end if environment.argument("collect") then diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 558b791fe..a92192a2a 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -598,7 +598,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-package"] = package.loaded["l-package"] or true --- original size: 11545, stripped down to: 8606 +-- original size: 11564, stripped down to: 8625 if not modules then modules={} end modules ['l-package']={ version=1.001, @@ -611,7 +611,7 @@ local type=type local gsub,format,find=string.gsub,string.format,string.find local P,S,Cs,lpegmatch=lpeg.P,lpeg.S,lpeg.Cs,lpeg.match local package=package -local searchers=package.searchers +local searchers=package.searchers or package.loaders local insert,remove=table.insert,table.remove local filejoin=file and file.join or function(path,name) return path.."/"..name end local isreadable=file and file.is_readable or function(name) local f=io.open(name) if f then f:close() return true end end @@ -1735,7 +1735,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-string"] = package.loaded["l-string"] or true --- original size: 6420, stripped down to: 3339 +-- original size: 6461, stripped down to: 3341 if not modules then modules={} end modules ['l-string']={ version=1.001, @@ -1837,9 +1837,9 @@ function string.tformat(fmt,...) end string.quote=string.quoted string.unquote=string.unquoted -if not string.bytetable then +if not string.bytetable then local limit=5000 - function string.bytetable(str) + function string.bytetable(str) local n=#str if n>limit then local t={ byte(str,1,limit) } @@ -3853,7 +3853,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 20997, stripped down to: 9986 +-- original size: 21090, stripped down to: 10074 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -3889,6 +3889,9 @@ end function lfs.isfile(name) return attributes(name,"mode")=="file" end +function lfs.isfound(name) + return attributes(name,"mode")=="file" and name or nil +end local colon=P(":") local period=P(".") local periods=P("..") @@ -10243,7 +10246,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-lua"] = package.loaded["util-lua"] or true --- original size: 6662, stripped down to: 4771 +-- original size: 6921, stripped down to: 4998 if not modules then modules={} end modules ['util-lua']={ version=1.001, @@ -10313,7 +10316,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) end if macros and macros.enabled then local f=io.open(fullname,"rb") local c=f:read("*a") f:close() - local n=c and macros.resolvestring(c) + local n=c and macros.resolvestring("--[["..fullname.."]] "..c) if n and #n~=#c then report_lua("preprocessed file %a: %i => %i bytes",fullname,#c,#n) end @@ -10343,7 +10346,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) return code,0 end end -function luautilities.strippedloadstring(code,forcestrip,name) +function luautilities.strippedloadstring(code,name,forcestrip) local code,message=load(code) if not code then report_lua("loading of file %a failed:\n\t%s",name,message or "no message") @@ -10355,6 +10358,13 @@ function luautilities.strippedloadstring(code,forcestrip,name) return code,0 end end +function luautilities.loadstring(code,name) + local code,message=load(code) + if not code then + report_lua("loading of file %a failed:\n\t%s",name,message or "no message") + end + return code,0 +end function luautilities.compile(luafile,lucfile,cleanup,strip,fallback) report_lua("compiling %a into %a",luafile,lucfile) os.remove(lucfile) @@ -20370,7 +20380,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-lib"] = package.loaded["util-lib"] or true --- original size: 14333, stripped down to: 7859 +-- original size: 14415, stripped down to: 7927 if not modules then modules={} end modules ['util-lib']={ version=1.001, @@ -20481,9 +20491,10 @@ local function locate(required,version,trace,report,action) end package.extralibpath(environment.ownpath) local paths=package.libpaths() + local pattern="/[^/]+%."..os.libsuffix.."$" for i=1,#paths do - required_path=paths[i] - local found=check(lfs.isfile) + required_path=gsub(paths[i],pattern,"") + local found=check(lfs.isfound) if type(found)=="string" and (not checkpattern or find(found,checkpattern)) then return found end @@ -20978,8 +20989,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 865625 --- stripped bytes : 315093 +-- original bytes : 866119 +-- stripped bytes : 315183 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 558b791fe..a92192a2a 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -598,7 +598,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-package"] = package.loaded["l-package"] or true --- original size: 11545, stripped down to: 8606 +-- original size: 11564, stripped down to: 8625 if not modules then modules={} end modules ['l-package']={ version=1.001, @@ -611,7 +611,7 @@ local type=type local gsub,format,find=string.gsub,string.format,string.find local P,S,Cs,lpegmatch=lpeg.P,lpeg.S,lpeg.Cs,lpeg.match local package=package -local searchers=package.searchers +local searchers=package.searchers or package.loaders local insert,remove=table.insert,table.remove local filejoin=file and file.join or function(path,name) return path.."/"..name end local isreadable=file and file.is_readable or function(name) local f=io.open(name) if f then f:close() return true end end @@ -1735,7 +1735,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-string"] = package.loaded["l-string"] or true --- original size: 6420, stripped down to: 3339 +-- original size: 6461, stripped down to: 3341 if not modules then modules={} end modules ['l-string']={ version=1.001, @@ -1837,9 +1837,9 @@ function string.tformat(fmt,...) end string.quote=string.quoted string.unquote=string.unquoted -if not string.bytetable then +if not string.bytetable then local limit=5000 - function string.bytetable(str) + function string.bytetable(str) local n=#str if n>limit then local t={ byte(str,1,limit) } @@ -3853,7 +3853,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 20997, stripped down to: 9986 +-- original size: 21090, stripped down to: 10074 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -3889,6 +3889,9 @@ end function lfs.isfile(name) return attributes(name,"mode")=="file" end +function lfs.isfound(name) + return attributes(name,"mode")=="file" and name or nil +end local colon=P(":") local period=P(".") local periods=P("..") @@ -10243,7 +10246,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-lua"] = package.loaded["util-lua"] or true --- original size: 6662, stripped down to: 4771 +-- original size: 6921, stripped down to: 4998 if not modules then modules={} end modules ['util-lua']={ version=1.001, @@ -10313,7 +10316,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) end if macros and macros.enabled then local f=io.open(fullname,"rb") local c=f:read("*a") f:close() - local n=c and macros.resolvestring(c) + local n=c and macros.resolvestring("--[["..fullname.."]] "..c) if n and #n~=#c then report_lua("preprocessed file %a: %i => %i bytes",fullname,#c,#n) end @@ -10343,7 +10346,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) return code,0 end end -function luautilities.strippedloadstring(code,forcestrip,name) +function luautilities.strippedloadstring(code,name,forcestrip) local code,message=load(code) if not code then report_lua("loading of file %a failed:\n\t%s",name,message or "no message") @@ -10355,6 +10358,13 @@ function luautilities.strippedloadstring(code,forcestrip,name) return code,0 end end +function luautilities.loadstring(code,name) + local code,message=load(code) + if not code then + report_lua("loading of file %a failed:\n\t%s",name,message or "no message") + end + return code,0 +end function luautilities.compile(luafile,lucfile,cleanup,strip,fallback) report_lua("compiling %a into %a",luafile,lucfile) os.remove(lucfile) @@ -20370,7 +20380,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-lib"] = package.loaded["util-lib"] or true --- original size: 14333, stripped down to: 7859 +-- original size: 14415, stripped down to: 7927 if not modules then modules={} end modules ['util-lib']={ version=1.001, @@ -20481,9 +20491,10 @@ local function locate(required,version,trace,report,action) end package.extralibpath(environment.ownpath) local paths=package.libpaths() + local pattern="/[^/]+%."..os.libsuffix.."$" for i=1,#paths do - required_path=paths[i] - local found=check(lfs.isfile) + required_path=gsub(paths[i],pattern,"") + local found=check(lfs.isfound) if type(found)=="string" and (not checkpattern or find(found,checkpattern)) then return found end @@ -20978,8 +20989,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 865625 --- stripped bytes : 315093 +-- original bytes : 866119 +-- stripped bytes : 315183 -- end library merge diff --git a/scripts/context/stubs/setup/setuptex b/scripts/context/stubs/setup/setuptex index d41e36707..78128ee8b 100644 --- a/scripts/context/stubs/setup/setuptex +++ b/scripts/context/stubs/setup/setuptex @@ -22,53 +22,59 @@ system=`uname -s` cpu=`uname -m` case "$system" in - # linux - Linux) - case "$cpu" in - i*86) platform="linux" ;; - x86_64|ia64) platform="linux-64" ;; - # a little bit of cheating with ppc64 (won't work on Gentoo) - ppc|ppc64) platform="linux-ppc" ;; - *) platform="unknown" ;; - esac ;; - # Mac OS X - Darwin) - case "$cpu" in - i*86) platform="osx-intel" ;; - x86_64) platform="osx-64" ;; - ppc*|powerpc|power*|Power*) platform="osx-ppc" ;; - *) platform="unknown" ;; - esac ;; - # FreeBSD - FreeBSD|freebsd) - case "$cpu" in - i*86) platform="freebsd" ;; - x86_64) platform="freebsd" ;; - amd64) platform="freebsd-amd64" ;; - *) platform="unknown" ;; - esac ;; - # kFreeBSD (Debian) - GNU/kFreeBSD) - case "$cpu" in - i*86) platform="kfreebsd-i386" ;; - x86_64|amd64) platform="kfreebsd-amd64" ;; - *) platform="unknown" ;; - esac ;; - # cygwin - CYGWIN) - case "$cpu" in - i*86) platform="cygwin" ;; - x86_64|ia64) platform="cygwin-64" ;; - *) platform="unknown" ;; - esac ;; - # SunOS/Solaris - SunOS) - case "$cpu" in - sparc) platform="solaris-sparc" ;; - i86pc) platform="solaris-intel" ;; - *) platform="unknown" ;; - esac ;; - *) platform="unknown" + # linux + Linux) + case "$cpu" in + i*86) platform="linux" ;; + x86_64|ia64) platform="linux-64" ;; + # a little bit of cheating with ppc64 (won't work on Gentoo) + ppc|ppc64) platform="linux-ppc" ;; + *) platform="unknown" ;; + esac ;; + # Mac OS X + Darwin) + case "$cpu" in + i*86) platform="osx-intel" ;; + x86_64) platform="osx-64" ;; + ppc*|powerpc|power*|Power*) platform="osx-ppc" ;; + *) platform="unknown" ;; + esac ;; + # FreeBSD + FreeBSD|freebsd) + case "$cpu" in + i*86) platform="freebsd" ;; + x86_64) platform="freebsd" ;; + amd64) platform="freebsd-amd64" ;; + *) platform="unknown" ;; + esac ;; + # kFreeBSD (Debian) + GNU/kFreeBSD) + case "$cpu" in + i*86) platform="kfreebsd-i386" ;; + x86_64|amd64) platform="kfreebsd-amd64" ;; + *) platform="unknown" ;; + esac ;; + # MSYS2|MSYS_NT-10.0) + case "$cpu" in + i*86) platform="win32" ;; + x86_64) platform="win64" ;; + *) platform="unknown" ;; + esac ;; + # cygwin + CYGWIN) + case "$cpu" in + i*86) platform="cygwin" ;; + x86_64|ia64) platform="cygwin-64" ;; + *) platform="unknown" ;; + esac ;; + # SunOS/Solaris + SunOS) + case "$cpu" in + sparc) platform="solaris-sparc" ;; + i86pc) platform="solaris-intel" ;; + *) platform="unknown" ;; + esac ;; + *) platform="unknown" esac # temporary fix for Snow Leopard diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 558b791fe..a92192a2a 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -598,7 +598,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-package"] = package.loaded["l-package"] or true --- original size: 11545, stripped down to: 8606 +-- original size: 11564, stripped down to: 8625 if not modules then modules={} end modules ['l-package']={ version=1.001, @@ -611,7 +611,7 @@ local type=type local gsub,format,find=string.gsub,string.format,string.find local P,S,Cs,lpegmatch=lpeg.P,lpeg.S,lpeg.Cs,lpeg.match local package=package -local searchers=package.searchers +local searchers=package.searchers or package.loaders local insert,remove=table.insert,table.remove local filejoin=file and file.join or function(path,name) return path.."/"..name end local isreadable=file and file.is_readable or function(name) local f=io.open(name) if f then f:close() return true end end @@ -1735,7 +1735,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-string"] = package.loaded["l-string"] or true --- original size: 6420, stripped down to: 3339 +-- original size: 6461, stripped down to: 3341 if not modules then modules={} end modules ['l-string']={ version=1.001, @@ -1837,9 +1837,9 @@ function string.tformat(fmt,...) end string.quote=string.quoted string.unquote=string.unquoted -if not string.bytetable then +if not string.bytetable then local limit=5000 - function string.bytetable(str) + function string.bytetable(str) local n=#str if n>limit then local t={ byte(str,1,limit) } @@ -3853,7 +3853,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 20997, stripped down to: 9986 +-- original size: 21090, stripped down to: 10074 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -3889,6 +3889,9 @@ end function lfs.isfile(name) return attributes(name,"mode")=="file" end +function lfs.isfound(name) + return attributes(name,"mode")=="file" and name or nil +end local colon=P(":") local period=P(".") local periods=P("..") @@ -10243,7 +10246,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-lua"] = package.loaded["util-lua"] or true --- original size: 6662, stripped down to: 4771 +-- original size: 6921, stripped down to: 4998 if not modules then modules={} end modules ['util-lua']={ version=1.001, @@ -10313,7 +10316,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) end if macros and macros.enabled then local f=io.open(fullname,"rb") local c=f:read("*a") f:close() - local n=c and macros.resolvestring(c) + local n=c and macros.resolvestring("--[["..fullname.."]] "..c) if n and #n~=#c then report_lua("preprocessed file %a: %i => %i bytes",fullname,#c,#n) end @@ -10343,7 +10346,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) return code,0 end end -function luautilities.strippedloadstring(code,forcestrip,name) +function luautilities.strippedloadstring(code,name,forcestrip) local code,message=load(code) if not code then report_lua("loading of file %a failed:\n\t%s",name,message or "no message") @@ -10355,6 +10358,13 @@ function luautilities.strippedloadstring(code,forcestrip,name) return code,0 end end +function luautilities.loadstring(code,name) + local code,message=load(code) + if not code then + report_lua("loading of file %a failed:\n\t%s",name,message or "no message") + end + return code,0 +end function luautilities.compile(luafile,lucfile,cleanup,strip,fallback) report_lua("compiling %a into %a",luafile,lucfile) os.remove(lucfile) @@ -20370,7 +20380,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-lib"] = package.loaded["util-lib"] or true --- original size: 14333, stripped down to: 7859 +-- original size: 14415, stripped down to: 7927 if not modules then modules={} end modules ['util-lib']={ version=1.001, @@ -20481,9 +20491,10 @@ local function locate(required,version,trace,report,action) end package.extralibpath(environment.ownpath) local paths=package.libpaths() + local pattern="/[^/]+%."..os.libsuffix.."$" for i=1,#paths do - required_path=paths[i] - local found=check(lfs.isfile) + required_path=gsub(paths[i],pattern,"") + local found=check(lfs.isfound) if type(found)=="string" and (not checkpattern or find(found,checkpattern)) then return found end @@ -20978,8 +20989,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 865625 --- stripped bytes : 315093 +-- original bytes : 866119 +-- stripped bytes : 315183 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 558b791fe..a92192a2a 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -598,7 +598,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-package"] = package.loaded["l-package"] or true --- original size: 11545, stripped down to: 8606 +-- original size: 11564, stripped down to: 8625 if not modules then modules={} end modules ['l-package']={ version=1.001, @@ -611,7 +611,7 @@ local type=type local gsub,format,find=string.gsub,string.format,string.find local P,S,Cs,lpegmatch=lpeg.P,lpeg.S,lpeg.Cs,lpeg.match local package=package -local searchers=package.searchers +local searchers=package.searchers or package.loaders local insert,remove=table.insert,table.remove local filejoin=file and file.join or function(path,name) return path.."/"..name end local isreadable=file and file.is_readable or function(name) local f=io.open(name) if f then f:close() return true end end @@ -1735,7 +1735,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-string"] = package.loaded["l-string"] or true --- original size: 6420, stripped down to: 3339 +-- original size: 6461, stripped down to: 3341 if not modules then modules={} end modules ['l-string']={ version=1.001, @@ -1837,9 +1837,9 @@ function string.tformat(fmt,...) end string.quote=string.quoted string.unquote=string.unquoted -if not string.bytetable then +if not string.bytetable then local limit=5000 - function string.bytetable(str) + function string.bytetable(str) local n=#str if n>limit then local t={ byte(str,1,limit) } @@ -3853,7 +3853,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-file"] = package.loaded["l-file"] or true --- original size: 20997, stripped down to: 9986 +-- original size: 21090, stripped down to: 10074 if not modules then modules={} end modules ['l-file']={ version=1.001, @@ -3889,6 +3889,9 @@ end function lfs.isfile(name) return attributes(name,"mode")=="file" end +function lfs.isfound(name) + return attributes(name,"mode")=="file" and name or nil +end local colon=P(":") local period=P(".") local periods=P("..") @@ -10243,7 +10246,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-lua"] = package.loaded["util-lua"] or true --- original size: 6662, stripped down to: 4771 +-- original size: 6921, stripped down to: 4998 if not modules then modules={} end modules ['util-lua']={ version=1.001, @@ -10313,7 +10316,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) end if macros and macros.enabled then local f=io.open(fullname,"rb") local c=f:read("*a") f:close() - local n=c and macros.resolvestring(c) + local n=c and macros.resolvestring("--[["..fullname.."]] "..c) if n and #n~=#c then report_lua("preprocessed file %a: %i => %i bytes",fullname,#c,#n) end @@ -10343,7 +10346,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) return code,0 end end -function luautilities.strippedloadstring(code,forcestrip,name) +function luautilities.strippedloadstring(code,name,forcestrip) local code,message=load(code) if not code then report_lua("loading of file %a failed:\n\t%s",name,message or "no message") @@ -10355,6 +10358,13 @@ function luautilities.strippedloadstring(code,forcestrip,name) return code,0 end end +function luautilities.loadstring(code,name) + local code,message=load(code) + if not code then + report_lua("loading of file %a failed:\n\t%s",name,message or "no message") + end + return code,0 +end function luautilities.compile(luafile,lucfile,cleanup,strip,fallback) report_lua("compiling %a into %a",luafile,lucfile) os.remove(lucfile) @@ -20370,7 +20380,7 @@ do -- create closure to overcome 200 locals limit package.loaded["util-lib"] = package.loaded["util-lib"] or true --- original size: 14333, stripped down to: 7859 +-- original size: 14415, stripped down to: 7927 if not modules then modules={} end modules ['util-lib']={ version=1.001, @@ -20481,9 +20491,10 @@ local function locate(required,version,trace,report,action) end package.extralibpath(environment.ownpath) local paths=package.libpaths() + local pattern="/[^/]+%."..os.libsuffix.."$" for i=1,#paths do - required_path=paths[i] - local found=check(lfs.isfile) + required_path=gsub(paths[i],pattern,"") + local found=check(lfs.isfound) if type(found)=="string" and (not checkpattern or find(found,checkpattern)) then return found end @@ -20978,8 +20989,8 @@ end -- of closure -- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua -- skipped libraries : - --- original bytes : 865625 --- stripped bytes : 315093 +-- original bytes : 866119 +-- stripped bytes : 315183 -- end library merge diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii index 797258b20..7162b6225 100644 --- a/tex/context/base/mkii/cont-new.mkii +++ b/tex/context/base/mkii/cont-new.mkii @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2017.11.01 15:58} +\newcontextversion{2017.11.07 11:37} %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/mkii/context.mkii b/tex/context/base/mkii/context.mkii index 67e3956b8..7226a502a 100644 --- a/tex/context/base/mkii/context.mkii +++ b/tex/context/base/mkii/context.mkii @@ -20,7 +20,7 @@ %D your styles an modules. \edef\contextformat {\jobname} -\edef\contextversion{2017.11.01 15:58} +\edef\contextversion{2017.11.07 11:37} %D For those who want to use this: diff --git a/tex/context/base/mkiv/anch-pos.lua b/tex/context/base/mkiv/anch-pos.lua index d082d8e92..e5f58c36c 100644 --- a/tex/context/base/mkiv/anch-pos.lua +++ b/tex/context/base/mkiv/anch-pos.lua @@ -22,7 +22,7 @@ more efficient.</p> local tostring, next, rawget, rawset, setmetatable, tonumber = tostring, next, rawget, rawset, setmetatable, tonumber local sort, sortedhash, sortedkeys = table.sort, table.sortedhash, table.sortedkeys -local format, gmatch, match, find = string.format, string.gmatch, string.match, string.find +local format, gmatch = string.format, string.gmatch local rawget = rawget local lpegmatch = lpeg.match local insert, remove = table.insert, table.remove diff --git a/tex/context/base/mkiv/char-ini.lua b/tex/context/base/mkiv/char-ini.lua index c17eb2726..8bf35a8dd 100644 --- a/tex/context/base/mkiv/char-ini.lua +++ b/tex/context/base/mkiv/char-ini.lua @@ -14,7 +14,7 @@ if not modules then modules = { } end modules ['char-ini'] = { local utfchar, utfbyte, utfvalues, ustring, utotable = utf.char, utf.byte, utf.values, utf.ustring, utf.totable local concat, unpack, tohash, insert = table.concat, table.unpack, table.tohash, table.insert local next, tonumber, type, rawget, rawset = next, tonumber, type, rawget, rawset -local format, lower, gsub, find, match = string.format, string.lower, string.gsub, string.find, string.match +local format, lower, gsub, find = string.format, string.lower, string.gsub, string.find local P, R, S, C, Cs, Ct, Cc, V = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg.Ct, lpeg.Cc, lpeg.V local formatters = string.formatters diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv index a9e11c3e3..565388df2 100644 --- a/tex/context/base/mkiv/cont-new.mkiv +++ b/tex/context/base/mkiv/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2017.11.01 15:58} +\newcontextversion{2017.11.07 11:37} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv index f9a74be28..4254db4d5 100644 --- a/tex/context/base/mkiv/context.mkiv +++ b/tex/context/base/mkiv/context.mkiv @@ -41,7 +41,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2017.11.01 15:58} +\edef\contextversion{2017.11.07 11:37} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/mkiv/font-ext.lua b/tex/context/base/mkiv/font-ext.lua index a393b18fe..0fa3f7279 100644 --- a/tex/context/base/mkiv/font-ext.lua +++ b/tex/context/base/mkiv/font-ext.lua @@ -792,7 +792,7 @@ local pop = { "pop" } -- end) local bp = number.dimenfactors.bp -local r = 0.25*65536*bp +local r = 16384 * bp -- 65536 // 4 local backcache = setmetatableindex(function(t,h) local h = h * bp diff --git a/tex/context/base/mkiv/font-otr.lua b/tex/context/base/mkiv/font-otr.lua index c36f1ae42..5bac75052 100644 --- a/tex/context/base/mkiv/font-otr.lua +++ b/tex/context/base/mkiv/font-otr.lua @@ -1345,7 +1345,7 @@ formatreaders[4] = function(f,fontdata,offset) offsets[i] = readushort(f) end -- format length language nofsegments searchrange entryselector rangeshift 4-tables - local size = (length - 2 * 2 - 5 * 2 - 4 * nofsegments * 2) / 2 + local size = (length - 2 * 2 - 5 * 2 - 4 * 2 * nofsegments) / 2 for i=1,size-1 do indices[i] = readushort(f) end diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua index 2e82de21a..246681d17 100644 --- a/tex/context/base/mkiv/font-ots.lua +++ b/tex/context/base/mkiv/font-ots.lua @@ -108,6 +108,9 @@ mechanisms. Both put some constraints on the code here.</p> -- Remark: We can provide a fast loop when there are no disc nodes (tests show a 1% -- gain). Smaller functions might perform better cache-wise. But ... memory becomes -- faster anyway, so ... +-- +-- Remark: Some optimizations made sense for 5.2 but seem less important for 5.3 but +-- anyway served their purpose. local type, next, tonumber = type, next, tonumber local random = math.random diff --git a/tex/context/base/mkiv/l-file.lua b/tex/context/base/mkiv/l-file.lua index f2a27ad18..c04883d8b 100644 --- a/tex/context/base/mkiv/l-file.lua +++ b/tex/context/base/mkiv/l-file.lua @@ -96,6 +96,10 @@ function lfs.isfile(name) return attributes(name,"mode") == "file" end +function lfs.isfound(name) + return attributes(name,"mode") == "file" and name or nil +end + local colon = P(":") local period = P(".") local periods = P("..") diff --git a/tex/context/base/mkiv/l-package.lua b/tex/context/base/mkiv/l-package.lua index 6a4f9d011..d43c5c5c6 100644 --- a/tex/context/base/mkiv/l-package.lua +++ b/tex/context/base/mkiv/l-package.lua @@ -22,7 +22,7 @@ local gsub, format, find = string.gsub, string.format, string.find local P, S, Cs, lpegmatch = lpeg.P, lpeg.S, lpeg.Cs, lpeg.match local package = package -local searchers = package.searchers +local searchers = package.searchers or package.loaders local insert, remove = table.insert, table.remove -------.loaders = nil -- old stuff that we don't want diff --git a/tex/context/base/mkiv/l-string.lua b/tex/context/base/mkiv/l-string.lua index cda837615..8ae8d8d1d 100644 --- a/tex/context/base/mkiv/l-string.lua +++ b/tex/context/base/mkiv/l-string.lua @@ -220,11 +220,11 @@ string.unquote = string.unquoted -- new -if not string.bytetable then +if not string.bytetable then -- used in font-cff.lua local limit = 5000 -- we can go to 8000 in luajit and much higher in lua if needed - function string.bytetable(str) + function string.bytetable(str) -- from a string local n = #str if n > limit then local t = { byte(str,1,limit) } diff --git a/tex/context/base/mkiv/luat-cnf.lua b/tex/context/base/mkiv/luat-cnf.lua index 416ae34fa..46294741f 100644 --- a/tex/context/base/mkiv/luat-cnf.lua +++ b/tex/context/base/mkiv/luat-cnf.lua @@ -119,16 +119,21 @@ function texconfig.init() -- shortcut and helper - local bytecode = lua.bytecode + local setbytecode = lua.setbytecode + local getbytecode = lua.getbytecode local function init(start) local i = start local t = os.clock() - while bytecode[i] do - bytecode[i]() ; - bytecode[i] = nil ; - i = i + 1 - -- collectgarbage('step') + while true do + local b = getbytecode(i) + if b then + b() ; + setbytecode(i,nil) ; + i = i + 1 + else + break + end end return i - start, os.clock() - t end diff --git a/tex/context/base/mkiv/luat-cod.lua b/tex/context/base/mkiv/luat-cod.lua index 3b0881147..445e365ff 100644 --- a/tex/context/base/mkiv/luat-cod.lua +++ b/tex/context/base/mkiv/luat-cod.lua @@ -20,14 +20,17 @@ texconfig.max_in_open = 1000 -- registering bytecode chunks -local bytecode = lua.bytecode or { } +----- bytecode = lua.bytecode or { } -- we use functions local bytedata = lua.bytedata or { } local bytedone = lua.bytedone or { } -lua.bytecode = bytecode -- built in anyway +---.bytecode = bytecode lua.bytedata = bytedata lua.bytedone = bytedone +local setbytecode = lua.setbytecode +local getbytecode = lua.getbytecode + lua.firstbytecode = 501 lua.lastbytecode = lua.lastbytecode or (lua.firstbytecode - 1) -- as we load ourselves again ... maybe return earlier @@ -54,7 +57,7 @@ function lua.registercode(filename,options) if environment.initex then local n = lua.lastbytecode + 1 bytedata[n] = { name = barename, options = opts } - bytecode[n] = code + setbytecode(n,code) lua.lastbytecode = n end elseif environment.initex then diff --git a/tex/context/base/mkiv/luat-fio.lua b/tex/context/base/mkiv/luat-fio.lua index a215d1b16..806caefe6 100644 --- a/tex/context/base/mkiv/luat-fio.lua +++ b/tex/context/base/mkiv/luat-fio.lua @@ -84,7 +84,7 @@ if not resolvers.initialized() then register('find_opentype_file' , function(name) return findbinfile(name,"otf") end, true) register('find_output_file' , function(name) return name end, true) register('find_pk_file' , findpk, true) - register('find_sfd_file' , function(name) return findbinfile(name,"sfd") end, true) + -- register('find_sfd_file' , function(name) return findbinfile(name,"sfd") end, true) register('find_truetype_file' , function(name) return findbinfile(name,"ttf") end, true) register('find_type1_file' , function(name) return findbinfile(name,"pfb") end, true) register('find_vf_file' , function(name) return findbinfile(name,"vf") end, true) @@ -98,7 +98,7 @@ if not resolvers.initialized() then register('read_map_file' , function(file) return loadbinfile(file,"map") end, true) -- output register('read_pk_file' , function(file) return loadbinfile(file,"pk") end, true) -- 600dpi/manfnt.720pk - register('read_sfd_file' , function(file) return loadbinfile(file,"sfd") end, true) + -- register('read_sfd_file' , function(file) return loadbinfile(file,"sfd") end, true) register('read_vf_file' , function(file) return loadbinfile(file,"vf" ) end, true) -- register('find_font_file' , function(name) return findbinfile(name,"ofm") end, true) diff --git a/tex/context/base/mkiv/luat-sto.lua b/tex/context/base/mkiv/luat-sto.lua index b04d655c2..e67830b0d 100644 --- a/tex/context/base/mkiv/luat-sto.lua +++ b/tex/context/base/mkiv/luat-sto.lua @@ -11,8 +11,9 @@ if not modules then modules = { } end modules ['luat-sto'] = { local type, next, setmetatable, getmetatable, collectgarbage = type, next, setmetatable, getmetatable, collectgarbage local gmatch, format = string.gmatch, string.format local serialize, concat, sortedhash = table.serialize, table.concat, table.sortedhash -local bytecode = lua.bytecode +local setbytecode = lua.setbytecode local strippedloadstring = utilities.lua.strippedloadstring +local loadstring = utilities.lua.loadstring local formatters = string.formatters local trace_storage = false @@ -53,36 +54,6 @@ local n = 0 -- is that one used ? if environment.initex then - -- local function dump() - -- local max = storage.max - -- for i=1,#data do - -- local d = data[i] - -- local message, original, target = d[1], d[2] ,d[3] - -- local c, code, name = 0, { }, nil - -- -- we have a nice definer for this - -- for str in gmatch(target,"([^%.]+)") do - -- if name then - -- name = name .. "." .. str - -- else - -- name = str - -- end - -- c = c + 1 ; code[c] = formatters["%s = %s or { }"](name,name) - -- end - -- max = max + 1 - -- if trace_storage then - -- c = c + 1 ; code[c] = formatters["print('restoring %s from slot %s')"](message,max) - -- end - -- c = c + 1 ; code[c] = serialize(original,name) - -- if trace_storage then - -- report_storage('saving %a in slot %a, size %s',message,max,#code[c]) - -- end - -- -- we don't need tracing in such tables - -- bytecode[max] = strippedloadstring(concat(code,"\n"),storage.strip,format("slot %s (%s)",max,name)) - -- collectgarbage("step") - -- end - -- storage.max = max - -- end - local function dump() local max = storage.max local strip = storage.strip @@ -105,7 +76,15 @@ if environment.initex then end -- we don't need tracing in such tables dumped = concat({ definition, comment, dumped },"\n") - bytecode[max] = strippedloadstring(dumped,strip,formatters["slot %s (%s)"](max,name)) + local code = nil + local name = formatters["slot %s (%s)"](max,name) + if LUAVERSION >= 5.3 and LUATEXFUNCTIONALITY >= 6454 then + local code = loadstring(dumped,name) + setbytecode(max,code,strip) + else + local code = strippedloadstring(dumped,name,strip) + setbytecode(max,code) + end collectgarbage("step") end storage.max = max @@ -131,18 +110,6 @@ function lua.collectgarbage(threshold) end end --- -- we also need to count at generation time (nicer for message) --- --- if lua.bytecode then -- from 0 upwards --- local i, b = storage.min, lua.bytecode --- while b[i] do --- storage.noftables = i --- b[i]() --- b[i] = nil --- i = i + 1 --- end --- end - statistics.register("stored bytecode data", function() local nofmodules = (storage.nofmodules > 0 and storage.nofmodules) or (status.luabytecodes - lua.firstbytecode - 1) local nofdumps = (storage.noftables > 0 and storage.noftables ) or storage.max-storage.min + 1 diff --git a/tex/context/base/mkiv/lxml-tex.lua b/tex/context/base/mkiv/lxml-tex.lua index 2fd26c3b2..5223fb8c9 100644 --- a/tex/context/base/mkiv/lxml-tex.lua +++ b/tex/context/base/mkiv/lxml-tex.lua @@ -1265,7 +1265,7 @@ function lxml.setsetup(id,pattern,setup) report_lxml("%s lpath matches for pattern: %s","no",pattern) end else - local a, b = match(setup,"^(.+:)([%*%-])$") + local a, b = match(setup,"^(.+:)([%*%-%+])$") if a and b then local collected = xmlapplylpath(getid(id),pattern) if collected then diff --git a/tex/context/base/mkiv/math-act.lua b/tex/context/base/mkiv/math-act.lua index 5d33031cf..404ebbbcd 100644 --- a/tex/context/base/mkiv/math-act.lua +++ b/tex/context/base/mkiv/math-act.lua @@ -231,12 +231,13 @@ function mathematics.overloaddimensions(target,original,set) if trace_defining then report_math("overloading dimensions in %a @ %p",target.properties.fullname,target.parameters.size) end - local characters = target.characters - local parameters = target.parameters - local factor = parameters.factor - local hfactor = parameters.hfactor - local vfactor = parameters.vfactor - local addprivate = fonts.helpers.addprivate + local characters = target.characters + local descriptions = target.descriptions + local parameters = target.parameters + local factor = parameters.factor + local hfactor = parameters.hfactor + local vfactor = parameters.vfactor + local addprivate = fonts.helpers.addprivate -- to be sure target.type = "virtual" target.properties.virtualized = true @@ -264,7 +265,14 @@ function mathematics.overloaddimensions(target,original,set) -- local xoffset = data.xoffset local yoffset = data.yoffset - if xoffset then + if xoffset == "llx" then + local d = descriptions[unicode] + if d then + xoffset = - d.boundingbox[1] * hfactor + character.width = character.width + xoffset + xoffset = { "right", xoffset } + end + elseif xoffset then xoffset = { "right", xoffset * hfactor } end if yoffset then diff --git a/tex/context/base/mkiv/mlib-pdf.lua b/tex/context/base/mkiv/mlib-pdf.lua index 0c2945316..7fd6cb62c 100644 --- a/tex/context/base/mkiv/mlib-pdf.lua +++ b/tex/context/base/mkiv/mlib-pdf.lua @@ -216,13 +216,14 @@ end local function flushnormalpath(path, t, open) local pth, ith, nt + local length = #path if t then nt = #t else t = { } nt = 0 end - for i=1,#path do + for i=1,length do nt = nt + 1 pth = path[i] if not ith then @@ -242,7 +243,7 @@ local function flushnormalpath(path, t, open) else t[nt] = f_l(one.x_coord,one.y_coord) end - elseif #path == 1 then + elseif length == 1 then -- special case .. draw point local one = path[1] nt = nt + 1 @@ -253,6 +254,7 @@ end local function flushconcatpath(path, t, open) local pth, ith, nt + local length = #path if t then nt = #t else @@ -261,7 +263,7 @@ local function flushconcatpath(path, t, open) end nt = nt + 1 t[nt] = f_cm(sx,rx,ry,sy,tx,ty) - for i=1,#path do + for i=1,length do nt = nt + 1 pth = path[i] if not ith then @@ -285,7 +287,7 @@ local function flushconcatpath(path, t, open) else t[nt] = f_l(mpconcat(one.x_coord,one.y_coord)) end - elseif #path == 1 then + elseif length == 1 then -- special case .. draw point nt = nt + 1 local one = path[1] diff --git a/tex/context/base/mkiv/mult-fun.lua b/tex/context/base/mkiv/mult-fun.lua index 34492b30a..9b7062605 100644 --- a/tex/context/base/mkiv/mult-fun.lua +++ b/tex/context/base/mkiv/mult-fun.lua @@ -11,7 +11,7 @@ return { -- "originlength", "tickstep ", "ticklength", -- "autoarrows", "ahfactor", -- "angleoffset", anglelength", anglemethod", - "ahvariant", "ahdimple", "ahfactor", + "ahvariant", "ahdimple", "ahfactor", "ahscale", "metapostversion", "maxdimensions", "drawoptionsfactor", @@ -36,10 +36,10 @@ return { "smoothed", "cornered", "superellipsed", "randomized", "randomizedcontrols", "squeezed", "enlonged", "shortened", "punked", "curved", "unspiked", "simplified", "blownup", "stretched", "enlarged", "leftenlarged", "topenlarged", "rightenlarged", "bottomenlarged", - "crossed", "laddered", "randomshifted", "interpolated", "paralleled", "cutends", "peepholed", + "crossed", "laddered", "randomshifted", "interpolated", "perpendicular", "paralleled", "cutends", "peepholed", "llenlarged", "lrenlarged", "urenlarged", "ulenlarged", "llmoved", "lrmoved", "urmoved", "ulmoved", - "rightarrow", "leftarrow", "centerarrow", + "rightarrow", "leftarrow", "centerarrow", "drawdoublearrows", "boundingbox", "innerboundingbox", "outerboundingbox", "pushboundingbox", "popboundingbox", "boundingradius", "boundingcircle", "boundingpoint", "crossingunder", "insideof", "outsideof", @@ -63,7 +63,7 @@ return { "checkedbounds", "checkbounds", "strut", "rule", "withmask", "bitmapimage", "colordecimals", "ddecimal", "dddecimal", "ddddecimal", "colordecimalslist", - "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", + "textext", "thetextext", "rawtextext", "textextoffset", "texbox", "thetexbox", "rawtexbox", "istextext", "verbatim", "thelabel", "label", "autoalign", diff --git a/tex/context/base/mkiv/publ-ini.lua b/tex/context/base/mkiv/publ-ini.lua index 130f9a49b..99a37e8b9 100644 --- a/tex/context/base/mkiv/publ-ini.lua +++ b/tex/context/base/mkiv/publ-ini.lua @@ -127,6 +127,7 @@ local ctx_btxsetafter = context.btxsetafter local ctx_btxsetbacklink = context.btxsetbacklink local ctx_btxsetfirstinternal = context.btxsetfirstinternal local ctx_btxsetlastinternal = context.btxsetlastinternal +local ctx_btxsetauthorfield = context.btxsetauthorfield -- local ctx_btxsetdataset = function(s) setmacro("currentbtxdataset", s) end -- context.btxsetdataset -- local ctx_btxsettag = function(s) setmacro("currentbtxtag", s) end -- context.btxsettag @@ -2637,6 +2638,7 @@ do local setter = specification.setter local compressor = specification.compressor local method = specification.method + local varfield = specification.varfield -- local reference = publications.parenttag(dataset,reference) -- @@ -2664,6 +2666,7 @@ do language = ldata.language, dataset = dataset, tag = tag, + varfield = varfield, -- combis = entry.userdata.btxcom, -- luadata = ldata, } @@ -3107,11 +3110,6 @@ do return keysorter(b,a) end - local currentbtxciteauthor = function() - context.currentbtxciteauthor() - return true -- needed? - end - local function authorcompressor(found,specification) -- HERE if specification.sorttype == v_normal then @@ -3219,7 +3217,13 @@ do local partialinteractive = false + local currentbtxciteauthor = function() + context.currentbtxciteauthorbyfield() + return true -- needed? + end + local function authorgetter(first,last,key,specification) -- only first + ctx_btxsetauthorfield(first.varfield or "author") if first.type == "author" then ctx_btxsetfirst(currentbtxciteauthor) -- formatter (much slower) else @@ -3246,15 +3250,16 @@ do return true end - -- author + -- author (the varfield hack is for editor and translator i.e author type) local function setter(data,dataset,tag,entry) - data.author, data.field, data.type = getcasted(dataset,tag,"author") + data.author, data.field, data.type = getcasted(dataset,tag,data.varfield or "author") data.sortkey = text and lpegmatch(numberonly,text) data.authorhash = getdetail(dataset,tag,"authorhash") -- todo let getcasted return end local function getter(first,last,_,specification) + ctx_btxsetauthorfield(specification.varfield or "author") if first.type == "author" then ctx_btxsetfirst(currentbtxciteauthor) -- formatter (much slower) else @@ -3269,6 +3274,7 @@ do setup = "author", setter = setter, getter = getter, + varfield = presets.variant or "author", compressor = authorcompressor, }) end diff --git a/tex/context/base/mkiv/publ-ini.mkiv b/tex/context/base/mkiv/publ-ini.mkiv index 5e496866b..0802fa7d0 100644 --- a/tex/context/base/mkiv/publ-ini.mkiv +++ b/tex/context/base/mkiv/publ-ini.mkiv @@ -1182,7 +1182,11 @@ \unexpanded\def\btxflushauthorinverted {\btx_flush_author{inverted}} % #1 \unexpanded\def\btxflushauthorinvertedshort{\btx_flush_author{invertedshort}} % #1 -\unexpanded\def\currentbtxciteauthor % always author +\let\currentbtxauthorfield\s!author + +\unexpanded\def\btxsetauthorfield#1{\edef\currentbtxauthorfield{#1}} + +\unexpanded\def\currentbtxciteauthorbyfield {\begingroup %\setbtxparameterset\s!cite\s!author % the alternatives inherit from cite:author @@ -1191,7 +1195,7 @@ \clf_btxauthor {\currentbtxdataset}% {\currentbtxtag}% - {\s!author}% + {\currentbtxauthorfield}% {% combiner {\btxparameter\c!authorconversion}% kind {cite}% @@ -1203,6 +1207,10 @@ \relax \endgroup} +\unexpanded\def\currentbtxciteauthor + {\let\currentbtxauthorfield\s!author + \currentbtxciteauthorbyfield} % always author + \unexpanded\def\btxstartauthor#1#2#3% a state > 0 signals that some authors can clash {\begingroup \currentbtxauthorindex#1\relax @@ -1226,12 +1234,6 @@ % \btxflushauthor{author} % \btxflushauthor{editor} -% -% \btxflushauthor[name]{author} -% \btxflushauthor[normal]{author} -% \btxflushauthor[normalshort]{author} -% \btxflushauthor[inverted]{author} -% \btxflushauthor[invertedshort]{author} % Interaction % diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf Binary files differindex fbcb8cc63..e21fd578f 100644 --- a/tex/context/base/mkiv/status-files.pdf +++ b/tex/context/base/mkiv/status-files.pdf diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf Binary files differindex 7ef4d1822..25226669a 100644 --- a/tex/context/base/mkiv/status-lua.pdf +++ b/tex/context/base/mkiv/status-lua.pdf diff --git a/tex/context/base/mkiv/syst-lua.lua b/tex/context/base/mkiv/syst-lua.lua index 86a9a28f3..35cd22123 100644 --- a/tex/context/base/mkiv/syst-lua.lua +++ b/tex/context/base/mkiv/syst-lua.lua @@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['syst-lua'] = { license = "see context related readme files" } -local find, match = string.find, string.match +local find = string.find local S, C, P, lpegmatch, lpegtsplitat = lpeg.S, lpeg.C, lpeg.P, lpeg.match, lpeg.tsplitat commands = commands or { } diff --git a/tex/context/base/mkiv/util-lib.lua b/tex/context/base/mkiv/util-lib.lua index 5c3f5f3cf..490cb3291 100644 --- a/tex/context/base/mkiv/util-lib.lua +++ b/tex/context/base/mkiv/util-lib.lua @@ -186,10 +186,11 @@ local function locate(required,version,trace,report,action) report("checking lib paths") end package.extralibpath(environment.ownpath) - local paths = package.libpaths() + local paths = package.libpaths() + local pattern = "/[^/]+%." .. os.libsuffix .. "$" for i=1,#paths do - required_path = paths[i] - local found = check(lfs.isfile) + required_path = gsub(paths[i],pattern,"") + local found = check(lfs.isfound) if type(found) == "string" and (not checkpattern or find(found,checkpattern)) then return found end diff --git a/tex/context/base/mkiv/util-lua.lua b/tex/context/base/mkiv/util-lua.lua index 1c25bcc03..bd74d0843 100644 --- a/tex/context/base/mkiv/util-lua.lua +++ b/tex/context/base/mkiv/util-lua.lua @@ -82,7 +82,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) if macros and macros.enabled then -- local c = io.loaddata(fullname) -- not yet available local f = io.open(fullname,"rb") local c = f:read("*a") f:close() - local n = c and macros.resolvestring(c) + local n = c and macros.resolvestring("--[["..fullname.."]] "..c) if n and #n ~= #c then report_lua("preprocessed file %a: %i => %i bytes",fullname,#c,#n) end @@ -113,7 +113,7 @@ function luautilities.loadedluacode(fullname,forcestrip,name,macros) end end -function luautilities.strippedloadstring(code,forcestrip,name) -- not executed +function luautilities.strippedloadstring(code,name,forcestrip) -- not executed local code, message = load(code) if not code then report_lua("loading of file %a failed:\n\t%s",name,message or "no message") @@ -126,6 +126,14 @@ function luautilities.strippedloadstring(code,forcestrip,name) -- not executed end end +function luautilities.loadstring(code,name) -- not executed + local code, message = load(code) + if not code then + report_lua("loading of file %a failed:\n\t%s",name,message or "no message") + end + return code, 0 +end + function luautilities.compile(luafile,lucfile,cleanup,strip,fallback) -- defaults: cleanup=false strip=true report_lua("compiling %a into %a",luafile,lucfile) os.remove(lucfile) diff --git a/tex/context/fonts/mkiv/bonum-math.lfg b/tex/context/fonts/mkiv/bonum-math.lfg index 00576aaef..8dfa63405 100644 --- a/tex/context/fonts/mkiv/bonum-math.lfg +++ b/tex/context/fonts/mkiv/bonum-math.lfg @@ -8,8 +8,13 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { + dimensions = { + default = { + [0x1D453] = { xoffset = "llx" },-- 𝑓 + }, + }, kerns = { - [0x1D449] = kern_200, -- + [0x1D449] = kern_200, -- 𝑉 [0x1D44A] = kern_100, -- 𝑊 }, alternates = { diff --git a/tex/context/fonts/mkiv/pagella-math.lfg b/tex/context/fonts/mkiv/pagella-math.lfg index 080b21c92..c85ff3f6b 100644 --- a/tex/context/fonts/mkiv/pagella-math.lfg +++ b/tex/context/fonts/mkiv/pagella-math.lfg @@ -1,6 +1,8 @@ local kern_200 = { bottomright = { { kern = -200 } } } local kern_100 = { bottomright = { { kern = -100 } } } +-- Beware of updates ! + return { name = "pagella-math", version = "1.00", @@ -8,6 +10,12 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { + dimensions = { + default = { + -- [0x1D453] = { xoffset = 162, width = 278 + 162 },-- 𝑓 + [0x1D453] = { xoffset = "llx" },-- 𝑓 + }, + }, kerns = { [0x1D449] = kern_200, -- 𝑉 [0x1D44A] = kern_100, -- 𝑊 diff --git a/tex/context/fonts/mkiv/termes-math.lfg b/tex/context/fonts/mkiv/termes-math.lfg index 557216cb1..1501fd536 100644 --- a/tex/context/fonts/mkiv/termes-math.lfg +++ b/tex/context/fonts/mkiv/termes-math.lfg @@ -8,8 +8,13 @@ return { author = "Hans Hagen", copyright = "ConTeXt development team", mathematics = { + dimensions = { + default = { + [0x1D453] = { xoffset = "llx" },-- 𝑓 + }, + }, kerns = { - [0x1D449] = kern_200, -- + [0x1D449] = kern_200, -- 𝑉 [0x1D44A] = kern_100, -- 𝑊 }, alternates = { diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf Binary files differindex 492576d86..50dc00a0c 100644 --- a/tex/context/interface/mkiv/i-context.pdf +++ b/tex/context/interface/mkiv/i-context.pdf diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf Binary files differindex e903a632a..ae04197dd 100644 --- a/tex/context/interface/mkiv/i-readme.pdf +++ b/tex/context/interface/mkiv/i-readme.pdf diff --git a/tex/generic/context/luatex/luatex-core.lua b/tex/generic/context/luatex/luatex-core.lua index 2d6f6a73d..c13d81257 100644 --- a/tex/generic/context/luatex/luatex-core.lua +++ b/tex/generic/context/luatex/luatex-core.lua @@ -182,7 +182,7 @@ if md5 then end --- compatibility +-- compatibility: this might go away if not unpack then unpack = table.unpack @@ -192,6 +192,12 @@ if not package.loaders then package.loaders = package.searchers end +if not loadstring then + loadstring = load +end + +-- compatibility: this might stay + if bit32 then -- lua 5.2: we're okay diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index a04b47d3c..100bd770e 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 : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 11/01/17 15:59:00 +-- merge date : 11/07/17 11:37:34 do -- begin closure to overcome local limits and interference @@ -1035,9 +1035,9 @@ function string.tformat(fmt,...) end string.quote=string.quoted string.unquote=string.unquoted -if not string.bytetable then +if not string.bytetable then local limit=5000 - function string.bytetable(str) + function string.bytetable(str) local n=#str if n>limit then local t={ byte(str,1,limit) } @@ -2505,6 +2505,9 @@ end function lfs.isfile(name) return attributes(name,"mode")=="file" end +function lfs.isfound(name) + return attributes(name,"mode")=="file" and name or nil +end local colon=P(":") local period=P(".") local periods=P("..") @@ -10537,7 +10540,7 @@ formatreaders[4]=function(f,fontdata,offset) for i=1,nofsegments do offsets[i]=readushort(f) end - local size=(length-2*2-5*2-4*nofsegments*2)/2 + local size=(length-2*2-5*2-4*2*nofsegments)/2 for i=1,size-1 do indices[i]=readushort(f) end |