diff options
47 files changed, 1031 insertions, 506 deletions
diff --git a/doc/context/manuals/allkind/mkiv-publications.tex b/doc/context/manuals/allkind/mkiv-publications.tex index c417af589..ea1e6359d 100644 --- a/doc/context/manuals/allkind/mkiv-publications.tex +++ b/doc/context/manuals/allkind/mkiv-publications.tex @@ -1644,6 +1644,9 @@ You can add additional entries with: As usual with such mechanisms, internally spaces, punctuation and case are ignored with a lookup. +There are also two manipulators for journals: \type {expandedjournal} and +\type {abbreviatedjournal}. + \stopchapter \startchapter[title=Combining] diff --git a/doc/context/scripts/mkiv/context.html b/doc/context/scripts/mkiv/context.html index 0833089aa..fa640d7c8 100644 --- a/doc/context/scripts/mkiv/context.html +++ b/doc/context/scripts/mkiv/context.html @@ -14,7 +14,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> - <title>ConTeXt Process Management 0.60</title> + <title>ConTeXt Process Management 0.61</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <style type="text/css"> body { color: #FFFFFF; background-color: #808080; font-family: optima, verdana, futura, "lucida sans", arial, geneva, helvetica, sans; font-size: 12px; line-height: 18px; } a:link, a:active, a:visited { color: #FFFFFF; } a.dir-view:link, a.dir-view:active, a.dir-view:visited { color: #FFFFFF; text-decoration: underline; } .valid { color: #00FF00; } .invalid { color: #FF0000; } button, .commonlink, .smallbutton { font-weight: bold; font-size: 12px; text-decoration: none; color: #000000; border-color: #7F7F7F; border-style: solid; border-width: .125ex; background-color: #FFFFFF; padding: .5ex; } .smallbutton { width: 1em; } a.commonlink:link, a.commonlink:active, a.commonlink:visited, a.smalllink:link, a.smalllink:active, a.smalllink:visited { font-weight: bold; font-size: 12px; text-decoration: none; color: #000000; } h1, .title { font-style: normal; font-weight: normal; font-size: 18px; line-height: 18px; margin-bottom: 20px; } h2, .subtitle { font-style: normal; font-weight: normal; font-size: 12px; margin-top: 18px; margin-bottom: 18px; } table { line-height: 18px; font-size: 12px; margin: 0; } th { font-weight: bold; text-align: left; padding-bottom: 6px; } .tc { font-weight: bold; text-align: left; } p, li { max-width: 60em; } .empty-line { margin-top: 4px; } .more-room { margin-right: 1.5em; } .much-more-room { margin-right: 3em; } #main { position: absolute; left: 10%; top: 10%; right: 10%; bottom: 10%; z-index: 2; width: 80%; height: 80%; padding: 0%; margin: 0%; overflow: auto; border-style: none; border-width: 0; background-color: #3F3F3F; } #main-settings { margin: 12px; x_max-width: 60em; line-height: 18px; font-size: 12px; } #left { position: absolute; top : 10%; left: 0%; bottom: 0%; right: 90%; z-index: 1; width: 10%; height: 90%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #4F6F6F; } #right { position: absolute; top : 0%; left: 90%; bottom: 10%; right: 0%; z-index: 1; width: 10%; height: 90%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #4F6F6F; _margin-left: -15px; } #bottom { position: absolute; left: 10%; right: 0%; top: 90%; bottom: 0%; z-index: 1; width: 90%; height: 10%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #6F6F8F; } #top { position: absolute; left: 0%; right: 10%; top: 0%; bottom: 90%; z-index: 1; width: 90%; height: 10%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #6F6F8F; } #top-one { position: absolute; bottom: 50%; width: 100%; buggedheight: 100%; } #top-two { position: relative; margin-bottom: -9px; margin-left: 12px; margin-right: 12px; line-height: 18px; text-align: right; vertical-align: middle; } #bottom-one { position: absolute; bottom: 50%; width: 100%; buggedheight: 100%; } #bottom-two { position: relative; margin-bottom: -9px; margin-left: 12px; margin-right: 12px; line-height: 18px; text-align: left; vertical-align: middle; } #left-one { position: absolute; width: 100%; buggedheight: 100%; } #left-two { position: relative; margin-top: 12px; line-height: 18px; text-align: center; vertical-align: top; } #right-one { display: table; height: 100%; width: 100%; } #right-two { display: table-row; height: 100%; width: 100%; } #right-three { display: table-cell; width: 100%; vertical-align: bottom; _position: absolute; _top: 100%; } #right-four { text-align: center; margin-bottom: 2ex; _position: relative; _top: -100%; } #more-top { position: absolute; top: 0%; left: 90%; bottom: 90%; right: 0%; z-index: 3; width: 10%; height: 10%; padding: 0%; margin: 0%; border-style: none; border-width: 0; } #more-top-settings { text-align: center; } #more-right-settings { margin-right: 12px; margin-left: 12px; line-height: 18px; font-size: 10px; text-align: center; } #right-safari { _display: table; width: 100%; height: 100%; } @@ -24,7 +24,7 @@ </head> <body> <div id="top"> <div id="top-one"> - <div id="top-two">ConTeXt Process Management 0.60 </div> + <div id="top-two">ConTeXt Process Management 0.61 </div> </div> </div> <div id="bottom"> <div id="bottom-one"> @@ -95,6 +95,7 @@ <tr><th>--update</th><td></td><td>update context from website (not to be confused with contextgarden)</td></tr> <tr><th>--profile</th><td></td><td>profile job (use: mtxrun --script profile --analyze)</td></tr> <tr><th>--timing</th><td></td><td>generate timing and statistics overview</td></tr> + <tr><th>--keeptuc</th><td></td><td>keep previous tuc files (numbered by run)</td></tr> <tr><th/><td/><td/></tr> <tr><th>--extra=name</th><td></td><td>process extra (mtx-context-... in distribution)</td></tr> <tr><th>--extras</th><td></td><td>show extras</td></tr> diff --git a/doc/context/scripts/mkiv/context.man b/doc/context/scripts/mkiv/context.man index c1808f073..163ad4392 100644 --- a/doc/context/scripts/mkiv/context.man +++ b/doc/context/scripts/mkiv/context.man @@ -141,6 +141,9 @@ profile job (use: mtxrun --script profile --analyze) .B --timing generate timing and statistics overview .TP +.B --keeptuc +keep previous tuc files (numbered by run) +.TP .B --extra=name process extra (mtx-context-... in distribution) .TP diff --git a/doc/context/scripts/mkiv/context.xml b/doc/context/scripts/mkiv/context.xml index af8d5cc20..009a87740 100644 --- a/doc/context/scripts/mkiv/context.xml +++ b/doc/context/scripts/mkiv/context.xml @@ -152,16 +152,19 @@ <short>update context version number (also provide <ref name="expert"/>, optionally provide <ref name="basepath"/>)</short> </flag> <flag name="nostatistics"> - <short>omit runtime statistics at the end of the run</short> + <short>omit runtime statistics at the end of the run</short> </flag> <flag name="update"> <short>update context from website (not to be confused with contextgarden)</short> </flag> - <flag name="profile"> - <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> + <flag name="profile"> + <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> </flag> - <flag name="timing"> - <short>generate timing and statistics overview</short> + <flag name="timing"> + <short>generate timing and statistics overview</short> + </flag> + <flag name="keeptuc"> + <short>keep previous tuc files (numbered by run)</short> </flag> </subcategory> <subcategory> diff --git a/doc/context/scripts/mkiv/mtx-bibtex.html b/doc/context/scripts/mkiv/mtx-bibtex.html new file mode 100644 index 000000000..ba1591b4b --- /dev/null +++ b/doc/context/scripts/mkiv/mtx-bibtex.html @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> + +<!-- compare with lmx framework variant --> + +<!-- + filename : context-base.xml + comment : companion to mtx-server-ctx-startup.tex + author : Hans Hagen, PRAGMA-ADE, Hasselt NL + copyright: PRAGMA ADE / ConTeXt Development Team + license : see context related readme files +--> + +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> + <head> + <title>bibtex helpers</title> + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> + <style type="text/css"> + body { color: #FFFFFF; background-color: #808080; font-family: optima, verdana, futura, "lucida sans", arial, geneva, helvetica, sans; font-size: 12px; line-height: 18px; } a:link, a:active, a:visited { color: #FFFFFF; } a.dir-view:link, a.dir-view:active, a.dir-view:visited { color: #FFFFFF; text-decoration: underline; } .valid { color: #00FF00; } .invalid { color: #FF0000; } button, .commonlink, .smallbutton { font-weight: bold; font-size: 12px; text-decoration: none; color: #000000; border-color: #7F7F7F; border-style: solid; border-width: .125ex; background-color: #FFFFFF; padding: .5ex; } .smallbutton { width: 1em; } a.commonlink:link, a.commonlink:active, a.commonlink:visited, a.smalllink:link, a.smalllink:active, a.smalllink:visited { font-weight: bold; font-size: 12px; text-decoration: none; color: #000000; } h1, .title { font-style: normal; font-weight: normal; font-size: 18px; line-height: 18px; margin-bottom: 20px; } h2, .subtitle { font-style: normal; font-weight: normal; font-size: 12px; margin-top: 18px; margin-bottom: 18px; } table { line-height: 18px; font-size: 12px; margin: 0; } th { font-weight: bold; text-align: left; padding-bottom: 6px; } .tc { font-weight: bold; text-align: left; } p, li { max-width: 60em; } .empty-line { margin-top: 4px; } .more-room { margin-right: 1.5em; } .much-more-room { margin-right: 3em; } #main { position: absolute; left: 10%; top: 10%; right: 10%; bottom: 10%; z-index: 2; width: 80%; height: 80%; padding: 0%; margin: 0%; overflow: auto; border-style: none; border-width: 0; background-color: #3F3F3F; } #main-settings { margin: 12px; x_max-width: 60em; line-height: 18px; font-size: 12px; } #left { position: absolute; top : 10%; left: 0%; bottom: 0%; right: 90%; z-index: 1; width: 10%; height: 90%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #4F6F6F; } #right { position: absolute; top : 0%; left: 90%; bottom: 10%; right: 0%; z-index: 1; width: 10%; height: 90%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #4F6F6F; _margin-left: -15px; } #bottom { position: absolute; left: 10%; right: 0%; top: 90%; bottom: 0%; z-index: 1; width: 90%; height: 10%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #6F6F8F; } #top { position: absolute; left: 0%; right: 10%; top: 0%; bottom: 90%; z-index: 1; width: 90%; height: 10%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #6F6F8F; } #top-one { position: absolute; bottom: 50%; width: 100%; buggedheight: 100%; } #top-two { position: relative; margin-bottom: -9px; margin-left: 12px; margin-right: 12px; line-height: 18px; text-align: right; vertical-align: middle; } #bottom-one { position: absolute; bottom: 50%; width: 100%; buggedheight: 100%; } #bottom-two { position: relative; margin-bottom: -9px; margin-left: 12px; margin-right: 12px; line-height: 18px; text-align: left; vertical-align: middle; } #left-one { position: absolute; width: 100%; buggedheight: 100%; } #left-two { position: relative; margin-top: 12px; line-height: 18px; text-align: center; vertical-align: top; } #right-one { display: table; height: 100%; width: 100%; } #right-two { display: table-row; height: 100%; width: 100%; } #right-three { display: table-cell; width: 100%; vertical-align: bottom; _position: absolute; _top: 100%; } #right-four { text-align: center; margin-bottom: 2ex; _position: relative; _top: -100%; } #more-top { position: absolute; top: 0%; left: 90%; bottom: 90%; right: 0%; z-index: 3; width: 10%; height: 10%; padding: 0%; margin: 0%; border-style: none; border-width: 0; } #more-top-settings { text-align: center; } #more-right-settings { margin-right: 12px; margin-left: 12px; line-height: 18px; font-size: 10px; text-align: center; } #right-safari { _display: table; width: 100%; height: 100%; } + </style> + <style type="text/css"> + </style> + </head> + <body> + <div id="top"> <div id="top-one"> + <div id="top-two">bibtex helpers </div> + </div> + </div> + <div id="bottom"> <div id="bottom-one"> + <div id="bottom-two">wiki: http://contextgarden.net | mail: ntg-context@ntg.nl | website: http://www.pragma-ade.nl</div> + </div> + </div> + <div id="left"></div> + <div id="right"></div> + <div id="main"> + <div id='main-settings'> + <h1>Command line options</h1> +<table> + <tr><th style="width: 10em">flag</th><th style="width: 8em">value</th><th>description</th></tr> + <tr><th/><td/><td/></tr> + <tr><th>--toxml</th><td></td><td>convert bibtex database(s) to xml</td></tr> + <tr><th>--tolua</th><td></td><td>convert bibtex database(s) to lua</td></tr> + </table> +<br/> +<h1>Example</h1> +<tt>mtxrun --script bibtex --tolua bibl-001.bib</tt> +<br/><tt>mtxrun --script bibtex --tolua --simple bibl-001.bib</tt> +<br/><tt>mtxrun --script bibtex --toxml bibl-001.bib bibl-002.bib bibl-003.bib biblio.xml</tt> +<br/><br/> </div> + </div> + </body> + </html> diff --git a/doc/context/scripts/mkiv/mtx-bibtex.man b/doc/context/scripts/mkiv/mtx-bibtex.man new file mode 100644 index 000000000..cedf41b8b --- /dev/null +++ b/doc/context/scripts/mkiv/mtx-bibtex.man @@ -0,0 +1,30 @@ +.TH "mtx-bibtex" "1" "01-01-2014" "version 1.00" "bibtex helpers" +.SH NAME +.B mtx-bibtex +.SH SYNOPSIS +.B mtxrun --script bibtex [ +.I OPTIONS ... +.B ] [ +.I FILENAMES +.B ] +.SH DESCRIPTION +.B bibtex helpers +.SH OPTIONS +.TP +.B --toxml +convert bibtex database(s) to xml +.TP +.B --tolua +convert bibtex database(s) to lua +.SH AUTHOR +More information about ConTeXt and the tools that come with it can be found at: + + +.B "maillist:" +ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context + +.B "webpage:" +http://www.pragma-ade.nl / http://tex.aanhet.net + +.B "wiki:" +http://contextgarden.net diff --git a/doc/context/scripts/mkiv/mtx-bibtex.xml b/doc/context/scripts/mkiv/mtx-bibtex.xml new file mode 100644 index 000000000..b33e1809c --- /dev/null +++ b/doc/context/scripts/mkiv/mtx-bibtex.xml @@ -0,0 +1,26 @@ +<?xml version="1.0"?> +<application> + <metadata> + <entry name="name">mtx-bibtex</entry> + <entry name="detail">bibtex helpers</entry> + <entry name="version">1.00</entry> + </metadata> + <flags> + <category name="basic"> + <subcategory> + <flag name="toxml"><short>convert bibtex database(s) to xml</short></flag> + <flag name="tolua"><short>convert bibtex database(s) to lua</short></flag> + </subcategory> + </category> + </flags> + <examples> + <category> + <title>Example</title> + <subcategory> + <example><command>mtxrun --script bibtex --tolua bibl-001.bib</command></example> + <example><command>mtxrun --script bibtex --tolua --simple bibl-001.bib</command></example> + <example><command>mtxrun --script bibtex --toxml bibl-001.bib bibl-002.bib bibl-003.bib biblio.xml</command></example> + </subcategory> + </category> + </examples> +</application> diff --git a/doc/context/scripts/mkiv/mtx-context.html b/doc/context/scripts/mkiv/mtx-context.html index 0833089aa..fa640d7c8 100644 --- a/doc/context/scripts/mkiv/mtx-context.html +++ b/doc/context/scripts/mkiv/mtx-context.html @@ -14,7 +14,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> - <title>ConTeXt Process Management 0.60</title> + <title>ConTeXt Process Management 0.61</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <style type="text/css"> body { color: #FFFFFF; background-color: #808080; font-family: optima, verdana, futura, "lucida sans", arial, geneva, helvetica, sans; font-size: 12px; line-height: 18px; } a:link, a:active, a:visited { color: #FFFFFF; } a.dir-view:link, a.dir-view:active, a.dir-view:visited { color: #FFFFFF; text-decoration: underline; } .valid { color: #00FF00; } .invalid { color: #FF0000; } button, .commonlink, .smallbutton { font-weight: bold; font-size: 12px; text-decoration: none; color: #000000; border-color: #7F7F7F; border-style: solid; border-width: .125ex; background-color: #FFFFFF; padding: .5ex; } .smallbutton { width: 1em; } a.commonlink:link, a.commonlink:active, a.commonlink:visited, a.smalllink:link, a.smalllink:active, a.smalllink:visited { font-weight: bold; font-size: 12px; text-decoration: none; color: #000000; } h1, .title { font-style: normal; font-weight: normal; font-size: 18px; line-height: 18px; margin-bottom: 20px; } h2, .subtitle { font-style: normal; font-weight: normal; font-size: 12px; margin-top: 18px; margin-bottom: 18px; } table { line-height: 18px; font-size: 12px; margin: 0; } th { font-weight: bold; text-align: left; padding-bottom: 6px; } .tc { font-weight: bold; text-align: left; } p, li { max-width: 60em; } .empty-line { margin-top: 4px; } .more-room { margin-right: 1.5em; } .much-more-room { margin-right: 3em; } #main { position: absolute; left: 10%; top: 10%; right: 10%; bottom: 10%; z-index: 2; width: 80%; height: 80%; padding: 0%; margin: 0%; overflow: auto; border-style: none; border-width: 0; background-color: #3F3F3F; } #main-settings { margin: 12px; x_max-width: 60em; line-height: 18px; font-size: 12px; } #left { position: absolute; top : 10%; left: 0%; bottom: 0%; right: 90%; z-index: 1; width: 10%; height: 90%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #4F6F6F; } #right { position: absolute; top : 0%; left: 90%; bottom: 10%; right: 0%; z-index: 1; width: 10%; height: 90%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #4F6F6F; _margin-left: -15px; } #bottom { position: absolute; left: 10%; right: 0%; top: 90%; bottom: 0%; z-index: 1; width: 90%; height: 10%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #6F6F8F; } #top { position: absolute; left: 0%; right: 10%; top: 0%; bottom: 90%; z-index: 1; width: 90%; height: 10%; padding: 0%; margin: 0%; font-size: 16px; border-style: none; border-width: 0; background-color: #6F6F8F; } #top-one { position: absolute; bottom: 50%; width: 100%; buggedheight: 100%; } #top-two { position: relative; margin-bottom: -9px; margin-left: 12px; margin-right: 12px; line-height: 18px; text-align: right; vertical-align: middle; } #bottom-one { position: absolute; bottom: 50%; width: 100%; buggedheight: 100%; } #bottom-two { position: relative; margin-bottom: -9px; margin-left: 12px; margin-right: 12px; line-height: 18px; text-align: left; vertical-align: middle; } #left-one { position: absolute; width: 100%; buggedheight: 100%; } #left-two { position: relative; margin-top: 12px; line-height: 18px; text-align: center; vertical-align: top; } #right-one { display: table; height: 100%; width: 100%; } #right-two { display: table-row; height: 100%; width: 100%; } #right-three { display: table-cell; width: 100%; vertical-align: bottom; _position: absolute; _top: 100%; } #right-four { text-align: center; margin-bottom: 2ex; _position: relative; _top: -100%; } #more-top { position: absolute; top: 0%; left: 90%; bottom: 90%; right: 0%; z-index: 3; width: 10%; height: 10%; padding: 0%; margin: 0%; border-style: none; border-width: 0; } #more-top-settings { text-align: center; } #more-right-settings { margin-right: 12px; margin-left: 12px; line-height: 18px; font-size: 10px; text-align: center; } #right-safari { _display: table; width: 100%; height: 100%; } @@ -24,7 +24,7 @@ </head> <body> <div id="top"> <div id="top-one"> - <div id="top-two">ConTeXt Process Management 0.60 </div> + <div id="top-two">ConTeXt Process Management 0.61 </div> </div> </div> <div id="bottom"> <div id="bottom-one"> @@ -95,6 +95,7 @@ <tr><th>--update</th><td></td><td>update context from website (not to be confused with contextgarden)</td></tr> <tr><th>--profile</th><td></td><td>profile job (use: mtxrun --script profile --analyze)</td></tr> <tr><th>--timing</th><td></td><td>generate timing and statistics overview</td></tr> + <tr><th>--keeptuc</th><td></td><td>keep previous tuc files (numbered by run)</td></tr> <tr><th/><td/><td/></tr> <tr><th>--extra=name</th><td></td><td>process extra (mtx-context-... in distribution)</td></tr> <tr><th>--extras</th><td></td><td>show extras</td></tr> diff --git a/doc/context/scripts/mkiv/mtx-context.man b/doc/context/scripts/mkiv/mtx-context.man index c1808f073..163ad4392 100644 --- a/doc/context/scripts/mkiv/mtx-context.man +++ b/doc/context/scripts/mkiv/mtx-context.man @@ -141,6 +141,9 @@ profile job (use: mtxrun --script profile --analyze) .B --timing generate timing and statistics overview .TP +.B --keeptuc +keep previous tuc files (numbered by run) +.TP .B --extra=name process extra (mtx-context-... in distribution) .TP diff --git a/doc/context/scripts/mkiv/mtx-context.xml b/doc/context/scripts/mkiv/mtx-context.xml index af8d5cc20..009a87740 100644 --- a/doc/context/scripts/mkiv/mtx-context.xml +++ b/doc/context/scripts/mkiv/mtx-context.xml @@ -152,16 +152,19 @@ <short>update context version number (also provide <ref name="expert"/>, optionally provide <ref name="basepath"/>)</short> </flag> <flag name="nostatistics"> - <short>omit runtime statistics at the end of the run</short> + <short>omit runtime statistics at the end of the run</short> </flag> <flag name="update"> <short>update context from website (not to be confused with contextgarden)</short> </flag> - <flag name="profile"> - <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> + <flag name="profile"> + <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> </flag> - <flag name="timing"> - <short>generate timing and statistics overview</short> + <flag name="timing"> + <short>generate timing and statistics overview</short> + </flag> + <flag name="keeptuc"> + <short>keep previous tuc files (numbered by run)</short> </flag> </subcategory> <subcategory> diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua index 9de6717bf..83030e2e7 100644 --- a/scripts/context/lua/mtx-context.lua +++ b/scripts/context/lua/mtx-context.lua @@ -28,10 +28,12 @@ local fileaddsuffix = file.addsuffix local filenewsuffix = file.replacesuffix local removesuffix = file.removesuffix local validfile = lfs.isfile +local removefile = os.remove +local renamefile = os.rename local application = logs.application { name = "mtx-context", - banner = "ConTeXt Process Management 0.60", + banner = "ConTeXt Process Management 0.61", -- helpinfo = helpinfo, -- table with { category_a = text_1, category_b = text_2 } or helpstring or xml_blob helpinfo = "mtx-context.xml", } @@ -279,11 +281,29 @@ local function multipass_changed(oldhash, newhash) return false end -local function multipass_copyluafile(jobname) +local function multipass_copyluafile(jobname,run) local tuaname, tucname = jobname..".tua", jobname..".tuc" if validfile(tuaname) then - os.remove(tucname) - os.rename(tuaname,tucname) + if run then + for i=1,10 do + local tmpname = format("%s-tuc-%02d.tmp",jobname,i) + if validfile(tmpname) then + removefile(tmpname) + report("removing %a",tmpname) + end + end + if validfile(tucname) then + local tmpname = format("%s-tuc-%02d.tmp",jobname,run or 1) + report("copying %a into %a",tucname,tmpname) + file.copy(tucname,tmpname) + else + report("no file %a, nothing kept",filename) + end + report("copying %a into %a",tuaname,tucname) + report() + end + removefile(tucname) + renamefile(tuaname,tucname) end end @@ -348,8 +368,8 @@ local function result_push_purge(oldbase,newbase) for _, suffix in next, usedsuffixes.after do local oldname = fileaddsuffix(oldbase,suffix) local newname = fileaddsuffix(newbase,suffix) - os.remove(newname) - os.remove(oldname) + removefile(newname) + removefile(oldname) end end @@ -358,10 +378,10 @@ local function result_push_keep(oldbase,newbase) local oldname = fileaddsuffix(oldbase,suffix) local newname = fileaddsuffix(newbase,suffix) local tmpname = "keep-"..oldname - os.remove(tmpname) - os.rename(oldname,tmpname) - os.remove(oldname) - os.rename(newname,oldname) + removefile(tmpname) + renamefile(oldname,tmpname) + removefile(oldname) + renamefile(newname,oldname) end end @@ -369,8 +389,8 @@ local function result_save_error(oldbase,newbase) for _, suffix in next, usedsuffixes.keep do local oldname = fileaddsuffix(oldbase,suffix) local newname = fileaddsuffix(newbase,suffix) - os.remove(newname) -- to be sure - os.rename(oldname,newname) + removefile(newname) -- to be sure + renamefile(oldname,newname) end end @@ -378,8 +398,8 @@ local function result_save_purge(oldbase,newbase) for _, suffix in next, usedsuffixes.after do local oldname = fileaddsuffix(oldbase,suffix) local newname = fileaddsuffix(newbase,suffix) - os.remove(newname) -- to be sure - os.rename(oldname,newname) + removefile(newname) -- to be sure + renamefile(oldname,newname) end end @@ -388,9 +408,9 @@ local function result_save_keep(oldbase,newbase) local oldname = fileaddsuffix(oldbase,suffix) local newname = fileaddsuffix(newbase,suffix) local tmpname = "keep-"..oldname - os.remove(newname) - os.rename(oldname,newname) - os.rename(tmpname,oldname) + removefile(newname) + renamefile(oldname,newname) + renamefile(tmpname,oldname) end end @@ -549,6 +569,7 @@ function scripts.context.run(ctxdata,filename) local a_jiton = getargument("jiton") local a_jithash = getargument("jithash") local a_texformat = getargument("texformat") + local a_keeptuc = getargument("keeptuc") -- a_batchmode = (a_batchmode and "batchmode") or (a_nonstopmode and "nonstopmode") or (a_scrollmode and "scrollmode") or nil a_synctex = check_synctex(a_synctex) @@ -715,7 +736,7 @@ function scripts.context.run(ctxdata,filename) os.exit(1) break elseif returncode == 0 then - multipass_copyluafile(jobname) + multipass_copyluafile(jobname,a_keeptuc and currentrun) if not multipass_forcedruns then newhash = multipass_hashfiles(jobname) if multipass_changed(oldhash,newhash) then @@ -852,7 +873,7 @@ function scripts.context.pipe() -- still used? scripts.context.purge_job(filename) elseif getargument("purgeall") then scripts.context.purge_job(filename,true) - os.remove(filename) + removefile(filename) end else if formatname then @@ -1046,11 +1067,11 @@ local special_runfiles = { local function purge_file(dfile,cfile) if cfile and validfile(cfile) then - if os.remove(dfile) then + if removefile(dfile) then return filebasename(dfile) end elseif dfile then - if os.remove(dfile) then + if removefile(dfile) then return filebasename(dfile) end end @@ -1144,8 +1165,8 @@ local function touch(path,name,versionpattern,kind,kindpattern) end if newdata ~= "" and (oldversion ~= newversion or oldkind ~= newkind or newdata ~= olddata) then local backup = filenewsuffix(name,"tmp") - os.remove(backup) - os.rename(name,backup) + removefile(backup) + renamefile(name,backup) io.savedata(name,newdata) return name, oldversion, newversion, oldkind, newkind end diff --git a/scripts/context/lua/mtx-context.xml b/scripts/context/lua/mtx-context.xml index af8d5cc20..009a87740 100644 --- a/scripts/context/lua/mtx-context.xml +++ b/scripts/context/lua/mtx-context.xml @@ -152,16 +152,19 @@ <short>update context version number (also provide <ref name="expert"/>, optionally provide <ref name="basepath"/>)</short> </flag> <flag name="nostatistics"> - <short>omit runtime statistics at the end of the run</short> + <short>omit runtime statistics at the end of the run</short> </flag> <flag name="update"> <short>update context from website (not to be confused with contextgarden)</short> </flag> - <flag name="profile"> - <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> + <flag name="profile"> + <short>profile job (use: mtxrun <ref name="script"/> profile <ref name="analyze"/>)</short> </flag> - <flag name="timing"> - <short>generate timing and statistics overview</short> + <flag name="timing"> + <short>generate timing and statistics overview</short> + </flag> + <flag name="keeptuc"> + <short>keep previous tuc files (numbered by run)</short> </flag> </subcategory> <subcategory> diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua index 7cf93ce4c..a6353dc67 100644 --- a/scripts/context/lua/mtxrun.lua +++ b/scripts/context/lua/mtxrun.lua @@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 32062, stripped down to: 16772 +-- original size: 32003, stripped down to: 16772 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -4359,7 +4359,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-unicode"] = package.loaded["l-unicode"] or true --- original size: 33706, stripped down to: 14938 +-- original size: 34171, stripped down to: 15086 if not modules then modules={} end modules ['l-unicode']={ version=1.001, @@ -4375,7 +4375,9 @@ local type=type local char,byte,format,sub,gmatch=string.char,string.byte,string.format,string.sub,string.gmatch local concat=table.concat local P,C,R,Cs,Ct,Cmt,Cc,Carg,Cp=lpeg.P,lpeg.C,lpeg.R,lpeg.Cs,lpeg.Ct,lpeg.Cmt,lpeg.Cc,lpeg.Carg,lpeg.Cp -local lpegmatch,patterns=lpeg.match,lpeg.patterns +local lpegmatch=lpeg.match +local patterns=lpeg.patterns +local tabletopattern=lpeg.utfchartabletopattern local bytepairs=string.bytepairs local finder=lpeg.finder local replacer=lpeg.replacer @@ -4384,7 +4386,7 @@ local utfgmatch=utf.gmatch local p_utftype=patterns.utftype local p_utfstricttype=patterns.utfstricttype local p_utfoffset=patterns.utfoffset -local p_utf8char=patterns.utf8char +local p_utf8char=patterns.utf8character local p_utf8byte=patterns.utf8byte local p_utfbom=patterns.utfbom local p_newline=patterns.newline @@ -4584,7 +4586,8 @@ if not utf.sub then end end function utf.remapper(mapping) - local pattern=Cs((p_utf8char/mapping)^0) + local pattern=type(mapping)=="table" and tabletopattern(mapping) or p_utf8char + local pattern=Cs((pattern/mapping+p_utf8char)^0) return function(str) if not str or str=="" then return "" @@ -11318,7 +11321,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true --- original size: 25374, stripped down to: 17841 +-- original size: 25139, stripped down to: 17839 if not modules then modules={} end modules ['lxml-aux']={ version=1.001, @@ -11655,7 +11658,7 @@ local function include(xmldata,pattern,attribute,recursive,loaddata) if name then break end end end - local data=(name and name~="" and loaddata(name)) or "" + local data=name and name~="" and loaddata(name) or "" if data=="" then epdt[ek.ni]="" elseif ekat["parse"]=="text" then @@ -13207,7 +13210,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-env"] = package.loaded["data-env"] or true --- original size: 8841, stripped down to: 6546 +-- original size: 8898, stripped down to: 6564 if not modules then modules={} end modules ['data-env']={ version=1.001, @@ -13300,7 +13303,7 @@ local relations=allocate { tex={ names={ "tex" }, variable='TEXINPUTS', - suffixes={ 'tex',"mkvi","mkiv","mkii" }, + suffixes={ "tex","mkvi","mkiv","mkii","cld","lfg","xml" }, }, icc={ names={ "icc","icc profile","icc profiles" }, @@ -13976,7 +13979,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-res"] = package.loaded["data-res"] or true --- original size: 61031, stripped down to: 42613 +-- original size: 61614, stripped down to: 42970 if not modules then modules={} end modules ['data-res']={ version=1.001, @@ -14562,42 +14565,44 @@ function resolvers.registerextrapath(paths,subpaths) instance.lists={} end end -local function made_list(instance,list) +local function made_list(instance,list,extra_too) + if not extra_too then + return list + end local ep=instance.extra_paths if not ep or #ep==0 then return list - else - local done,new,newn={},{},0 - for k=1,#list do - local v=list[k] - if not done[v] then - if find(v,"^[%.%/]$") then - done[v]=true - newn=newn+1 - new[newn]=v - else - break - end - end - end - for k=1,#ep do - local v=ep[k] - if not done[v] then + end + local done,new,newn={},{},0 + for k=1,#list do + local v=list[k] + if not done[v] then + if find(v,"^[%.%/]$") then done[v]=true newn=newn+1 new[newn]=v + else + break end end - for k=1,#list do - local v=list[k] - if not done[v] then - done[v]=true - newn=newn+1 - new[newn]=v - end + end + for k=1,#ep do + local v=ep[k] + if not done[v] then + done[v]=true + newn=newn+1 + new[newn]=v + end + end + for k=1,#list do + local v=list[k] + if not done[v] then + done[v]=true + newn=newn+1 + new[newn]=v end - return new end + return new end function resolvers.cleanpathlist(str) local t=resolvers.expandedpathlist(str) @@ -14611,7 +14616,7 @@ end function resolvers.expandpath(str) return joinpath(resolvers.expandedpathlist(str)) end -function resolvers.expandedpathlist(str) +function resolvers.expandedpathlist(str,extra_too) if not str then return {} elseif instance.savelists then @@ -14619,14 +14624,14 @@ function resolvers.expandedpathlist(str) local lists=instance.lists local lst=lists[str] if not lst then - local l=made_list(instance,resolvers.splitpath(resolvers.expansion(str))) + local l=made_list(instance,resolvers.splitpath(resolvers.expansion(str)),extra_too) lst=expandedpathfromlist(l) lists[str]=lst end return lst else local lst=resolvers.splitpath(resolvers.expansion(str)) - return made_list(instance,expandedpathfromlist(lst)) + return made_list(instance,expandedpathfromlist(lst),extra_too) end end function resolvers.expandedpathlistfromvariable(str) @@ -14881,7 +14886,7 @@ local function check_subpath(fname) end local function find_intree(filename,filetype,wantedfiles,allresults) local typespec=resolvers.variableofformat(filetype) - local pathlist=resolvers.expandedpathlist(typespec) + local pathlist=resolvers.expandedpathlist(typespec,filetype=="tex") local method="intree" if pathlist and #pathlist>0 then local filelist=collect_files(wantedfiles) @@ -14991,6 +14996,17 @@ local function find_intree(filename,filetype,wantedfiles,allresults) end else end + else + for k=1,#wantedfiles do + local fname=methodhandler('finders',pathname.."/"..wantedfiles[k]) + if fname then + result[#result+1]=fname + doen=true + if not allresults then + break + end + end + end end end if done and not allresults then @@ -16118,7 +16134,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tre"] = package.loaded["data-tre"] or true --- original size: 6609, stripped down to: 4280 +-- original size: 7874, stripped down to: 5289 if not modules then modules={} end modules ['data-tre']={ version=1.001, @@ -16129,7 +16145,7 @@ if not modules then modules={} end modules ['data-tre']={ } local find,gsub,lower=string.find,string.gsub,string.lower local basename,dirname,joinname=file.basename,file.dirname,file .join -local globdir,isdir=dir.glob,lfs.isdir +local globdir,isdir,isfile=dir.glob,lfs.isdir,lfs.isfile local P,lpegmatch=lpeg.P,lpeg.match local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end) local report_trees=logs.reporter("resolvers","trees") @@ -16203,7 +16219,25 @@ table.setmetatableindex(collectors,function(t,k) t[k]=content return content end) -function resolvers.finders.dirlist(specification) +local function checked(root,p,n) + if p then + if type(p)=="table" then + for i=1,#p do + local fullname=joinname(root,p[i],n) + if isfile(fullname) then + return fullname + end + end + else + local fullname=joinname(root,p,n) + if isfile(fullname) then + return fullname + end + end + end + return notfound() +end +local function resolve(specification) local filename=specification.filename if filename~="" then local root,rest=lpegmatch(splitter,filename) @@ -16221,39 +16255,56 @@ function resolvers.finders.dirlist(specification) for i=1,#p do local pi=p[i] if pi==path or find(pi,pattern) then - return joinname(root,pi,n) + local fullname=joinname(root,pi,n) + if isfile(fullname) then + return fullname + end end end - else - if p==path or find(p,pattern) then - return joinname(root,p,n) + elseif p==path or find(p,pattern) then + local fullname=joinname(root,p,n) + if isfile(fullname) then + return fullname end end local queries=specification.queries if queries and queries.option=="fileonly" then - return joinname(root,istable and p[1] or p,n) + return checked(root,p,n) + else + return notfound() end - return notfound() end end local path,name=dirname(filename),basename(filename) local root=lpegmatch(stripper,path) local content=collectors[path] local p,n=lookup(content,name) - if not p then - return notfound() - elseif type(p)=="table" then - p=p[1] + if p then + return checked(root,p,n) end - return joinname(root,p,n) end return notfound() end +resolvers.finders .dirlist=resolve resolvers.locators .dirlist=resolvers.locators .tree resolvers.hashers .dirlist=resolvers.hashers .tree resolvers.generators.dirlist=resolvers.generators.file resolvers.openers .dirlist=resolvers.openers .file resolvers.loaders .dirlist=resolvers.loaders .file +function resolvers.finders.dirfile(specification) + local queries=specification.queries + if queries then + queries.option="fileonly" + else + specification.queries={ option="fileonly" } + end + return resolve(specification) +end +resolvers.locators .dirfile=resolvers.locators .dirlist +resolvers.hashers .dirfile=resolvers.hashers .dirlist +resolvers.generators.dirfile=resolvers.generators.dirlist +resolvers.openers .dirfile=resolvers.openers .dirlist +resolvers.loaders .dirfile=resolvers.loaders .dirlist end -- of closure @@ -17173,8 +17224,8 @@ end -- of closure -- used libraries : l-lua.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-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-mrg.lua util-tpl.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 : 706951 --- stripped bytes : 251233 +-- original bytes : 709027 +-- stripped bytes : 251779 -- end library merge diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua index 7cf93ce4c..a6353dc67 100644 --- a/scripts/context/stubs/mswin/mtxrun.lua +++ b/scripts/context/stubs/mswin/mtxrun.lua @@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 32062, stripped down to: 16772 +-- original size: 32003, stripped down to: 16772 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -4359,7 +4359,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-unicode"] = package.loaded["l-unicode"] or true --- original size: 33706, stripped down to: 14938 +-- original size: 34171, stripped down to: 15086 if not modules then modules={} end modules ['l-unicode']={ version=1.001, @@ -4375,7 +4375,9 @@ local type=type local char,byte,format,sub,gmatch=string.char,string.byte,string.format,string.sub,string.gmatch local concat=table.concat local P,C,R,Cs,Ct,Cmt,Cc,Carg,Cp=lpeg.P,lpeg.C,lpeg.R,lpeg.Cs,lpeg.Ct,lpeg.Cmt,lpeg.Cc,lpeg.Carg,lpeg.Cp -local lpegmatch,patterns=lpeg.match,lpeg.patterns +local lpegmatch=lpeg.match +local patterns=lpeg.patterns +local tabletopattern=lpeg.utfchartabletopattern local bytepairs=string.bytepairs local finder=lpeg.finder local replacer=lpeg.replacer @@ -4384,7 +4386,7 @@ local utfgmatch=utf.gmatch local p_utftype=patterns.utftype local p_utfstricttype=patterns.utfstricttype local p_utfoffset=patterns.utfoffset -local p_utf8char=patterns.utf8char +local p_utf8char=patterns.utf8character local p_utf8byte=patterns.utf8byte local p_utfbom=patterns.utfbom local p_newline=patterns.newline @@ -4584,7 +4586,8 @@ if not utf.sub then end end function utf.remapper(mapping) - local pattern=Cs((p_utf8char/mapping)^0) + local pattern=type(mapping)=="table" and tabletopattern(mapping) or p_utf8char + local pattern=Cs((pattern/mapping+p_utf8char)^0) return function(str) if not str or str=="" then return "" @@ -11318,7 +11321,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true --- original size: 25374, stripped down to: 17841 +-- original size: 25139, stripped down to: 17839 if not modules then modules={} end modules ['lxml-aux']={ version=1.001, @@ -11655,7 +11658,7 @@ local function include(xmldata,pattern,attribute,recursive,loaddata) if name then break end end end - local data=(name and name~="" and loaddata(name)) or "" + local data=name and name~="" and loaddata(name) or "" if data=="" then epdt[ek.ni]="" elseif ekat["parse"]=="text" then @@ -13207,7 +13210,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-env"] = package.loaded["data-env"] or true --- original size: 8841, stripped down to: 6546 +-- original size: 8898, stripped down to: 6564 if not modules then modules={} end modules ['data-env']={ version=1.001, @@ -13300,7 +13303,7 @@ local relations=allocate { tex={ names={ "tex" }, variable='TEXINPUTS', - suffixes={ 'tex',"mkvi","mkiv","mkii" }, + suffixes={ "tex","mkvi","mkiv","mkii","cld","lfg","xml" }, }, icc={ names={ "icc","icc profile","icc profiles" }, @@ -13976,7 +13979,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-res"] = package.loaded["data-res"] or true --- original size: 61031, stripped down to: 42613 +-- original size: 61614, stripped down to: 42970 if not modules then modules={} end modules ['data-res']={ version=1.001, @@ -14562,42 +14565,44 @@ function resolvers.registerextrapath(paths,subpaths) instance.lists={} end end -local function made_list(instance,list) +local function made_list(instance,list,extra_too) + if not extra_too then + return list + end local ep=instance.extra_paths if not ep or #ep==0 then return list - else - local done,new,newn={},{},0 - for k=1,#list do - local v=list[k] - if not done[v] then - if find(v,"^[%.%/]$") then - done[v]=true - newn=newn+1 - new[newn]=v - else - break - end - end - end - for k=1,#ep do - local v=ep[k] - if not done[v] then + end + local done,new,newn={},{},0 + for k=1,#list do + local v=list[k] + if not done[v] then + if find(v,"^[%.%/]$") then done[v]=true newn=newn+1 new[newn]=v + else + break end end - for k=1,#list do - local v=list[k] - if not done[v] then - done[v]=true - newn=newn+1 - new[newn]=v - end + end + for k=1,#ep do + local v=ep[k] + if not done[v] then + done[v]=true + newn=newn+1 + new[newn]=v + end + end + for k=1,#list do + local v=list[k] + if not done[v] then + done[v]=true + newn=newn+1 + new[newn]=v end - return new end + return new end function resolvers.cleanpathlist(str) local t=resolvers.expandedpathlist(str) @@ -14611,7 +14616,7 @@ end function resolvers.expandpath(str) return joinpath(resolvers.expandedpathlist(str)) end -function resolvers.expandedpathlist(str) +function resolvers.expandedpathlist(str,extra_too) if not str then return {} elseif instance.savelists then @@ -14619,14 +14624,14 @@ function resolvers.expandedpathlist(str) local lists=instance.lists local lst=lists[str] if not lst then - local l=made_list(instance,resolvers.splitpath(resolvers.expansion(str))) + local l=made_list(instance,resolvers.splitpath(resolvers.expansion(str)),extra_too) lst=expandedpathfromlist(l) lists[str]=lst end return lst else local lst=resolvers.splitpath(resolvers.expansion(str)) - return made_list(instance,expandedpathfromlist(lst)) + return made_list(instance,expandedpathfromlist(lst),extra_too) end end function resolvers.expandedpathlistfromvariable(str) @@ -14881,7 +14886,7 @@ local function check_subpath(fname) end local function find_intree(filename,filetype,wantedfiles,allresults) local typespec=resolvers.variableofformat(filetype) - local pathlist=resolvers.expandedpathlist(typespec) + local pathlist=resolvers.expandedpathlist(typespec,filetype=="tex") local method="intree" if pathlist and #pathlist>0 then local filelist=collect_files(wantedfiles) @@ -14991,6 +14996,17 @@ local function find_intree(filename,filetype,wantedfiles,allresults) end else end + else + for k=1,#wantedfiles do + local fname=methodhandler('finders',pathname.."/"..wantedfiles[k]) + if fname then + result[#result+1]=fname + doen=true + if not allresults then + break + end + end + end end end if done and not allresults then @@ -16118,7 +16134,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tre"] = package.loaded["data-tre"] or true --- original size: 6609, stripped down to: 4280 +-- original size: 7874, stripped down to: 5289 if not modules then modules={} end modules ['data-tre']={ version=1.001, @@ -16129,7 +16145,7 @@ if not modules then modules={} end modules ['data-tre']={ } local find,gsub,lower=string.find,string.gsub,string.lower local basename,dirname,joinname=file.basename,file.dirname,file .join -local globdir,isdir=dir.glob,lfs.isdir +local globdir,isdir,isfile=dir.glob,lfs.isdir,lfs.isfile local P,lpegmatch=lpeg.P,lpeg.match local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end) local report_trees=logs.reporter("resolvers","trees") @@ -16203,7 +16219,25 @@ table.setmetatableindex(collectors,function(t,k) t[k]=content return content end) -function resolvers.finders.dirlist(specification) +local function checked(root,p,n) + if p then + if type(p)=="table" then + for i=1,#p do + local fullname=joinname(root,p[i],n) + if isfile(fullname) then + return fullname + end + end + else + local fullname=joinname(root,p,n) + if isfile(fullname) then + return fullname + end + end + end + return notfound() +end +local function resolve(specification) local filename=specification.filename if filename~="" then local root,rest=lpegmatch(splitter,filename) @@ -16221,39 +16255,56 @@ function resolvers.finders.dirlist(specification) for i=1,#p do local pi=p[i] if pi==path or find(pi,pattern) then - return joinname(root,pi,n) + local fullname=joinname(root,pi,n) + if isfile(fullname) then + return fullname + end end end - else - if p==path or find(p,pattern) then - return joinname(root,p,n) + elseif p==path or find(p,pattern) then + local fullname=joinname(root,p,n) + if isfile(fullname) then + return fullname end end local queries=specification.queries if queries and queries.option=="fileonly" then - return joinname(root,istable and p[1] or p,n) + return checked(root,p,n) + else + return notfound() end - return notfound() end end local path,name=dirname(filename),basename(filename) local root=lpegmatch(stripper,path) local content=collectors[path] local p,n=lookup(content,name) - if not p then - return notfound() - elseif type(p)=="table" then - p=p[1] + if p then + return checked(root,p,n) end - return joinname(root,p,n) end return notfound() end +resolvers.finders .dirlist=resolve resolvers.locators .dirlist=resolvers.locators .tree resolvers.hashers .dirlist=resolvers.hashers .tree resolvers.generators.dirlist=resolvers.generators.file resolvers.openers .dirlist=resolvers.openers .file resolvers.loaders .dirlist=resolvers.loaders .file +function resolvers.finders.dirfile(specification) + local queries=specification.queries + if queries then + queries.option="fileonly" + else + specification.queries={ option="fileonly" } + end + return resolve(specification) +end +resolvers.locators .dirfile=resolvers.locators .dirlist +resolvers.hashers .dirfile=resolvers.hashers .dirlist +resolvers.generators.dirfile=resolvers.generators.dirlist +resolvers.openers .dirfile=resolvers.openers .dirlist +resolvers.loaders .dirfile=resolvers.loaders .dirlist end -- of closure @@ -17173,8 +17224,8 @@ end -- of closure -- used libraries : l-lua.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-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-mrg.lua util-tpl.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 : 706951 --- stripped bytes : 251233 +-- original bytes : 709027 +-- stripped bytes : 251779 -- end library merge diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun index 7cf93ce4c..a6353dc67 100644 --- a/scripts/context/stubs/unix/mtxrun +++ b/scripts/context/stubs/unix/mtxrun @@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 32062, stripped down to: 16772 +-- original size: 32003, stripped down to: 16772 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -4359,7 +4359,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-unicode"] = package.loaded["l-unicode"] or true --- original size: 33706, stripped down to: 14938 +-- original size: 34171, stripped down to: 15086 if not modules then modules={} end modules ['l-unicode']={ version=1.001, @@ -4375,7 +4375,9 @@ local type=type local char,byte,format,sub,gmatch=string.char,string.byte,string.format,string.sub,string.gmatch local concat=table.concat local P,C,R,Cs,Ct,Cmt,Cc,Carg,Cp=lpeg.P,lpeg.C,lpeg.R,lpeg.Cs,lpeg.Ct,lpeg.Cmt,lpeg.Cc,lpeg.Carg,lpeg.Cp -local lpegmatch,patterns=lpeg.match,lpeg.patterns +local lpegmatch=lpeg.match +local patterns=lpeg.patterns +local tabletopattern=lpeg.utfchartabletopattern local bytepairs=string.bytepairs local finder=lpeg.finder local replacer=lpeg.replacer @@ -4384,7 +4386,7 @@ local utfgmatch=utf.gmatch local p_utftype=patterns.utftype local p_utfstricttype=patterns.utfstricttype local p_utfoffset=patterns.utfoffset -local p_utf8char=patterns.utf8char +local p_utf8char=patterns.utf8character local p_utf8byte=patterns.utf8byte local p_utfbom=patterns.utfbom local p_newline=patterns.newline @@ -4584,7 +4586,8 @@ if not utf.sub then end end function utf.remapper(mapping) - local pattern=Cs((p_utf8char/mapping)^0) + local pattern=type(mapping)=="table" and tabletopattern(mapping) or p_utf8char + local pattern=Cs((pattern/mapping+p_utf8char)^0) return function(str) if not str or str=="" then return "" @@ -11318,7 +11321,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true --- original size: 25374, stripped down to: 17841 +-- original size: 25139, stripped down to: 17839 if not modules then modules={} end modules ['lxml-aux']={ version=1.001, @@ -11655,7 +11658,7 @@ local function include(xmldata,pattern,attribute,recursive,loaddata) if name then break end end end - local data=(name and name~="" and loaddata(name)) or "" + local data=name and name~="" and loaddata(name) or "" if data=="" then epdt[ek.ni]="" elseif ekat["parse"]=="text" then @@ -13207,7 +13210,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-env"] = package.loaded["data-env"] or true --- original size: 8841, stripped down to: 6546 +-- original size: 8898, stripped down to: 6564 if not modules then modules={} end modules ['data-env']={ version=1.001, @@ -13300,7 +13303,7 @@ local relations=allocate { tex={ names={ "tex" }, variable='TEXINPUTS', - suffixes={ 'tex',"mkvi","mkiv","mkii" }, + suffixes={ "tex","mkvi","mkiv","mkii","cld","lfg","xml" }, }, icc={ names={ "icc","icc profile","icc profiles" }, @@ -13976,7 +13979,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-res"] = package.loaded["data-res"] or true --- original size: 61031, stripped down to: 42613 +-- original size: 61614, stripped down to: 42970 if not modules then modules={} end modules ['data-res']={ version=1.001, @@ -14562,42 +14565,44 @@ function resolvers.registerextrapath(paths,subpaths) instance.lists={} end end -local function made_list(instance,list) +local function made_list(instance,list,extra_too) + if not extra_too then + return list + end local ep=instance.extra_paths if not ep or #ep==0 then return list - else - local done,new,newn={},{},0 - for k=1,#list do - local v=list[k] - if not done[v] then - if find(v,"^[%.%/]$") then - done[v]=true - newn=newn+1 - new[newn]=v - else - break - end - end - end - for k=1,#ep do - local v=ep[k] - if not done[v] then + end + local done,new,newn={},{},0 + for k=1,#list do + local v=list[k] + if not done[v] then + if find(v,"^[%.%/]$") then done[v]=true newn=newn+1 new[newn]=v + else + break end end - for k=1,#list do - local v=list[k] - if not done[v] then - done[v]=true - newn=newn+1 - new[newn]=v - end + end + for k=1,#ep do + local v=ep[k] + if not done[v] then + done[v]=true + newn=newn+1 + new[newn]=v + end + end + for k=1,#list do + local v=list[k] + if not done[v] then + done[v]=true + newn=newn+1 + new[newn]=v end - return new end + return new end function resolvers.cleanpathlist(str) local t=resolvers.expandedpathlist(str) @@ -14611,7 +14616,7 @@ end function resolvers.expandpath(str) return joinpath(resolvers.expandedpathlist(str)) end -function resolvers.expandedpathlist(str) +function resolvers.expandedpathlist(str,extra_too) if not str then return {} elseif instance.savelists then @@ -14619,14 +14624,14 @@ function resolvers.expandedpathlist(str) local lists=instance.lists local lst=lists[str] if not lst then - local l=made_list(instance,resolvers.splitpath(resolvers.expansion(str))) + local l=made_list(instance,resolvers.splitpath(resolvers.expansion(str)),extra_too) lst=expandedpathfromlist(l) lists[str]=lst end return lst else local lst=resolvers.splitpath(resolvers.expansion(str)) - return made_list(instance,expandedpathfromlist(lst)) + return made_list(instance,expandedpathfromlist(lst),extra_too) end end function resolvers.expandedpathlistfromvariable(str) @@ -14881,7 +14886,7 @@ local function check_subpath(fname) end local function find_intree(filename,filetype,wantedfiles,allresults) local typespec=resolvers.variableofformat(filetype) - local pathlist=resolvers.expandedpathlist(typespec) + local pathlist=resolvers.expandedpathlist(typespec,filetype=="tex") local method="intree" if pathlist and #pathlist>0 then local filelist=collect_files(wantedfiles) @@ -14991,6 +14996,17 @@ local function find_intree(filename,filetype,wantedfiles,allresults) end else end + else + for k=1,#wantedfiles do + local fname=methodhandler('finders',pathname.."/"..wantedfiles[k]) + if fname then + result[#result+1]=fname + doen=true + if not allresults then + break + end + end + end end end if done and not allresults then @@ -16118,7 +16134,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tre"] = package.loaded["data-tre"] or true --- original size: 6609, stripped down to: 4280 +-- original size: 7874, stripped down to: 5289 if not modules then modules={} end modules ['data-tre']={ version=1.001, @@ -16129,7 +16145,7 @@ if not modules then modules={} end modules ['data-tre']={ } local find,gsub,lower=string.find,string.gsub,string.lower local basename,dirname,joinname=file.basename,file.dirname,file .join -local globdir,isdir=dir.glob,lfs.isdir +local globdir,isdir,isfile=dir.glob,lfs.isdir,lfs.isfile local P,lpegmatch=lpeg.P,lpeg.match local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end) local report_trees=logs.reporter("resolvers","trees") @@ -16203,7 +16219,25 @@ table.setmetatableindex(collectors,function(t,k) t[k]=content return content end) -function resolvers.finders.dirlist(specification) +local function checked(root,p,n) + if p then + if type(p)=="table" then + for i=1,#p do + local fullname=joinname(root,p[i],n) + if isfile(fullname) then + return fullname + end + end + else + local fullname=joinname(root,p,n) + if isfile(fullname) then + return fullname + end + end + end + return notfound() +end +local function resolve(specification) local filename=specification.filename if filename~="" then local root,rest=lpegmatch(splitter,filename) @@ -16221,39 +16255,56 @@ function resolvers.finders.dirlist(specification) for i=1,#p do local pi=p[i] if pi==path or find(pi,pattern) then - return joinname(root,pi,n) + local fullname=joinname(root,pi,n) + if isfile(fullname) then + return fullname + end end end - else - if p==path or find(p,pattern) then - return joinname(root,p,n) + elseif p==path or find(p,pattern) then + local fullname=joinname(root,p,n) + if isfile(fullname) then + return fullname end end local queries=specification.queries if queries and queries.option=="fileonly" then - return joinname(root,istable and p[1] or p,n) + return checked(root,p,n) + else + return notfound() end - return notfound() end end local path,name=dirname(filename),basename(filename) local root=lpegmatch(stripper,path) local content=collectors[path] local p,n=lookup(content,name) - if not p then - return notfound() - elseif type(p)=="table" then - p=p[1] + if p then + return checked(root,p,n) end - return joinname(root,p,n) end return notfound() end +resolvers.finders .dirlist=resolve resolvers.locators .dirlist=resolvers.locators .tree resolvers.hashers .dirlist=resolvers.hashers .tree resolvers.generators.dirlist=resolvers.generators.file resolvers.openers .dirlist=resolvers.openers .file resolvers.loaders .dirlist=resolvers.loaders .file +function resolvers.finders.dirfile(specification) + local queries=specification.queries + if queries then + queries.option="fileonly" + else + specification.queries={ option="fileonly" } + end + return resolve(specification) +end +resolvers.locators .dirfile=resolvers.locators .dirlist +resolvers.hashers .dirfile=resolvers.hashers .dirlist +resolvers.generators.dirfile=resolvers.generators.dirlist +resolvers.openers .dirfile=resolvers.openers .dirlist +resolvers.loaders .dirfile=resolvers.loaders .dirlist end -- of closure @@ -17173,8 +17224,8 @@ end -- of closure -- used libraries : l-lua.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-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-mrg.lua util-tpl.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 : 706951 --- stripped bytes : 251233 +-- original bytes : 709027 +-- stripped bytes : 251779 -- end library merge diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua index 7cf93ce4c..a6353dc67 100644 --- a/scripts/context/stubs/win64/mtxrun.lua +++ b/scripts/context/stubs/win64/mtxrun.lua @@ -437,7 +437,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-lpeg"] = package.loaded["l-lpeg"] or true --- original size: 32062, stripped down to: 16772 +-- original size: 32003, stripped down to: 16772 if not modules then modules={} end modules ['l-lpeg']={ version=1.001, @@ -4359,7 +4359,7 @@ do -- create closure to overcome 200 locals limit package.loaded["l-unicode"] = package.loaded["l-unicode"] or true --- original size: 33706, stripped down to: 14938 +-- original size: 34171, stripped down to: 15086 if not modules then modules={} end modules ['l-unicode']={ version=1.001, @@ -4375,7 +4375,9 @@ local type=type local char,byte,format,sub,gmatch=string.char,string.byte,string.format,string.sub,string.gmatch local concat=table.concat local P,C,R,Cs,Ct,Cmt,Cc,Carg,Cp=lpeg.P,lpeg.C,lpeg.R,lpeg.Cs,lpeg.Ct,lpeg.Cmt,lpeg.Cc,lpeg.Carg,lpeg.Cp -local lpegmatch,patterns=lpeg.match,lpeg.patterns +local lpegmatch=lpeg.match +local patterns=lpeg.patterns +local tabletopattern=lpeg.utfchartabletopattern local bytepairs=string.bytepairs local finder=lpeg.finder local replacer=lpeg.replacer @@ -4384,7 +4386,7 @@ local utfgmatch=utf.gmatch local p_utftype=patterns.utftype local p_utfstricttype=patterns.utfstricttype local p_utfoffset=patterns.utfoffset -local p_utf8char=patterns.utf8char +local p_utf8char=patterns.utf8character local p_utf8byte=patterns.utf8byte local p_utfbom=patterns.utfbom local p_newline=patterns.newline @@ -4584,7 +4586,8 @@ if not utf.sub then end end function utf.remapper(mapping) - local pattern=Cs((p_utf8char/mapping)^0) + local pattern=type(mapping)=="table" and tabletopattern(mapping) or p_utf8char + local pattern=Cs((pattern/mapping+p_utf8char)^0) return function(str) if not str or str=="" then return "" @@ -11318,7 +11321,7 @@ do -- create closure to overcome 200 locals limit package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true --- original size: 25374, stripped down to: 17841 +-- original size: 25139, stripped down to: 17839 if not modules then modules={} end modules ['lxml-aux']={ version=1.001, @@ -11655,7 +11658,7 @@ local function include(xmldata,pattern,attribute,recursive,loaddata) if name then break end end end - local data=(name and name~="" and loaddata(name)) or "" + local data=name and name~="" and loaddata(name) or "" if data=="" then epdt[ek.ni]="" elseif ekat["parse"]=="text" then @@ -13207,7 +13210,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-env"] = package.loaded["data-env"] or true --- original size: 8841, stripped down to: 6546 +-- original size: 8898, stripped down to: 6564 if not modules then modules={} end modules ['data-env']={ version=1.001, @@ -13300,7 +13303,7 @@ local relations=allocate { tex={ names={ "tex" }, variable='TEXINPUTS', - suffixes={ 'tex',"mkvi","mkiv","mkii" }, + suffixes={ "tex","mkvi","mkiv","mkii","cld","lfg","xml" }, }, icc={ names={ "icc","icc profile","icc profiles" }, @@ -13976,7 +13979,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-res"] = package.loaded["data-res"] or true --- original size: 61031, stripped down to: 42613 +-- original size: 61614, stripped down to: 42970 if not modules then modules={} end modules ['data-res']={ version=1.001, @@ -14562,42 +14565,44 @@ function resolvers.registerextrapath(paths,subpaths) instance.lists={} end end -local function made_list(instance,list) +local function made_list(instance,list,extra_too) + if not extra_too then + return list + end local ep=instance.extra_paths if not ep or #ep==0 then return list - else - local done,new,newn={},{},0 - for k=1,#list do - local v=list[k] - if not done[v] then - if find(v,"^[%.%/]$") then - done[v]=true - newn=newn+1 - new[newn]=v - else - break - end - end - end - for k=1,#ep do - local v=ep[k] - if not done[v] then + end + local done,new,newn={},{},0 + for k=1,#list do + local v=list[k] + if not done[v] then + if find(v,"^[%.%/]$") then done[v]=true newn=newn+1 new[newn]=v + else + break end end - for k=1,#list do - local v=list[k] - if not done[v] then - done[v]=true - newn=newn+1 - new[newn]=v - end + end + for k=1,#ep do + local v=ep[k] + if not done[v] then + done[v]=true + newn=newn+1 + new[newn]=v + end + end + for k=1,#list do + local v=list[k] + if not done[v] then + done[v]=true + newn=newn+1 + new[newn]=v end - return new end + return new end function resolvers.cleanpathlist(str) local t=resolvers.expandedpathlist(str) @@ -14611,7 +14616,7 @@ end function resolvers.expandpath(str) return joinpath(resolvers.expandedpathlist(str)) end -function resolvers.expandedpathlist(str) +function resolvers.expandedpathlist(str,extra_too) if not str then return {} elseif instance.savelists then @@ -14619,14 +14624,14 @@ function resolvers.expandedpathlist(str) local lists=instance.lists local lst=lists[str] if not lst then - local l=made_list(instance,resolvers.splitpath(resolvers.expansion(str))) + local l=made_list(instance,resolvers.splitpath(resolvers.expansion(str)),extra_too) lst=expandedpathfromlist(l) lists[str]=lst end return lst else local lst=resolvers.splitpath(resolvers.expansion(str)) - return made_list(instance,expandedpathfromlist(lst)) + return made_list(instance,expandedpathfromlist(lst),extra_too) end end function resolvers.expandedpathlistfromvariable(str) @@ -14881,7 +14886,7 @@ local function check_subpath(fname) end local function find_intree(filename,filetype,wantedfiles,allresults) local typespec=resolvers.variableofformat(filetype) - local pathlist=resolvers.expandedpathlist(typespec) + local pathlist=resolvers.expandedpathlist(typespec,filetype=="tex") local method="intree" if pathlist and #pathlist>0 then local filelist=collect_files(wantedfiles) @@ -14991,6 +14996,17 @@ local function find_intree(filename,filetype,wantedfiles,allresults) end else end + else + for k=1,#wantedfiles do + local fname=methodhandler('finders',pathname.."/"..wantedfiles[k]) + if fname then + result[#result+1]=fname + doen=true + if not allresults then + break + end + end + end end end if done and not allresults then @@ -16118,7 +16134,7 @@ do -- create closure to overcome 200 locals limit package.loaded["data-tre"] = package.loaded["data-tre"] or true --- original size: 6609, stripped down to: 4280 +-- original size: 7874, stripped down to: 5289 if not modules then modules={} end modules ['data-tre']={ version=1.001, @@ -16129,7 +16145,7 @@ if not modules then modules={} end modules ['data-tre']={ } local find,gsub,lower=string.find,string.gsub,string.lower local basename,dirname,joinname=file.basename,file.dirname,file .join -local globdir,isdir=dir.glob,lfs.isdir +local globdir,isdir,isfile=dir.glob,lfs.isdir,lfs.isfile local P,lpegmatch=lpeg.P,lpeg.match local trace_locating=false trackers.register("resolvers.locating",function(v) trace_locating=v end) local report_trees=logs.reporter("resolvers","trees") @@ -16203,7 +16219,25 @@ table.setmetatableindex(collectors,function(t,k) t[k]=content return content end) -function resolvers.finders.dirlist(specification) +local function checked(root,p,n) + if p then + if type(p)=="table" then + for i=1,#p do + local fullname=joinname(root,p[i],n) + if isfile(fullname) then + return fullname + end + end + else + local fullname=joinname(root,p,n) + if isfile(fullname) then + return fullname + end + end + end + return notfound() +end +local function resolve(specification) local filename=specification.filename if filename~="" then local root,rest=lpegmatch(splitter,filename) @@ -16221,39 +16255,56 @@ function resolvers.finders.dirlist(specification) for i=1,#p do local pi=p[i] if pi==path or find(pi,pattern) then - return joinname(root,pi,n) + local fullname=joinname(root,pi,n) + if isfile(fullname) then + return fullname + end end end - else - if p==path or find(p,pattern) then - return joinname(root,p,n) + elseif p==path or find(p,pattern) then + local fullname=joinname(root,p,n) + if isfile(fullname) then + return fullname end end local queries=specification.queries if queries and queries.option=="fileonly" then - return joinname(root,istable and p[1] or p,n) + return checked(root,p,n) + else + return notfound() end - return notfound() end end local path,name=dirname(filename),basename(filename) local root=lpegmatch(stripper,path) local content=collectors[path] local p,n=lookup(content,name) - if not p then - return notfound() - elseif type(p)=="table" then - p=p[1] + if p then + return checked(root,p,n) end - return joinname(root,p,n) end return notfound() end +resolvers.finders .dirlist=resolve resolvers.locators .dirlist=resolvers.locators .tree resolvers.hashers .dirlist=resolvers.hashers .tree resolvers.generators.dirlist=resolvers.generators.file resolvers.openers .dirlist=resolvers.openers .file resolvers.loaders .dirlist=resolvers.loaders .file +function resolvers.finders.dirfile(specification) + local queries=specification.queries + if queries then + queries.option="fileonly" + else + specification.queries={ option="fileonly" } + end + return resolve(specification) +end +resolvers.locators .dirfile=resolvers.locators .dirlist +resolvers.hashers .dirfile=resolvers.hashers .dirlist +resolvers.generators.dirfile=resolvers.generators.dirlist +resolvers.openers .dirfile=resolvers.openers .dirlist +resolvers.loaders .dirfile=resolvers.loaders .dirlist end -- of closure @@ -17173,8 +17224,8 @@ end -- of closure -- used libraries : l-lua.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-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-mrg.lua util-tpl.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 : 706951 --- stripped bytes : 251233 +-- original bytes : 709027 +-- stripped bytes : 251779 -- end library merge diff --git a/tex/context/base/buff-imp-default.lua b/tex/context/base/buff-imp-default.lua index 72a49d625..79f01c47d 100644 --- a/tex/context/base/buff-imp-default.lua +++ b/tex/context/base/buff-imp-default.lua @@ -20,7 +20,7 @@ local grammar = { "visualizer", beginline = makepattern(handler,"beginline",patterns.beginline), newline = makepattern(handler,"newline", patterns.newline), space = makepattern(handler,"space", patterns.space), - default = makepattern(handler,"default", patterns.utf8char), + default = makepattern(handler,"default", patterns.utf8character), content = makepattern(handler,"default", patterns.somecontent), -- not too efficient -- handy diff --git a/tex/context/base/char-ini.lua b/tex/context/base/char-ini.lua index a2505c0eb..e5806622c 100644 --- a/tex/context/base/char-ini.lua +++ b/tex/context/base/char-ini.lua @@ -22,7 +22,7 @@ if not characters then require("char-def") end local lpegpatterns = lpeg.patterns local lpegmatch = lpeg.match local utf8byte = lpegpatterns.utf8byte -local utf8char = lpegpatterns.utf8char +local utf8character = lpegpatterns.utf8character local utfchartabletopattern = lpeg.utfchartabletopattern @@ -879,13 +879,13 @@ end ----- toupper = Cs((utf8byte/ucchars)^0) ----- toshape = Cs((utf8byte/shchars)^0) -local tolower = Cs((utf8char/lcchars)^0) -- no need to check spacing -local toupper = Cs((utf8char/ucchars)^0) -- no need to check spacing -local toshape = Cs((utf8char/shchars)^0) -- no need to check spacing +local tolower = Cs((utf8character/lcchars)^0) -- no need to check spacing +local toupper = Cs((utf8character/ucchars)^0) -- no need to check spacing +local toshape = Cs((utf8character/shchars)^0) -- no need to check spacing -lpegpatterns.tolower = tolower -lpegpatterns.toupper = toupper -lpegpatterns.toshape = toshape +lpegpatterns.tolower = tolower -- old ones ... will be overloaded +lpegpatterns.toupper = toupper -- old ones ... will be overloaded +lpegpatterns.toshape = toshape -- old ones ... will be overloaded -- function characters.lower (str) return lpegmatch(tolower,str) end -- function characters.upper (str) return lpegmatch(toupper,str) end @@ -931,13 +931,25 @@ for k, v in next, characters.data do -- end end -local utf8lower = Cs((utfchartabletopattern(lhash) / lhash + utf8char)^0) -local utf8upper = Cs((utfchartabletopattern(uhash) / uhash + utf8char)^0) -local utf8shape = Cs((utfchartabletopattern(shash) / shash + utf8char)^0) +local utf8lowercharacter = utfchartabletopattern(lhash) / lhash +local utf8uppercharacter = utfchartabletopattern(uhash) / uhash +local utf8shapecharacter = utfchartabletopattern(shash) / shash -lpegpatterns.utf8lower = utf8lower -lpegpatterns.utf8upper = utf8upper -lpegpatterns.utf8shape = utf8shape +local utf8lower = Cs((utf8lowercharacter + utf8character)^0) +local utf8upper = Cs((utf8uppercharacter + utf8character)^0) +local utf8shape = Cs((utf8shapecharacter + utf8character)^0) + +lpegpatterns.utf8lowercharacter = utf8lowercharacter -- one character +lpegpatterns.utf8uppercharacter = utf8uppercharacter -- one character +lpegpatterns.utf8shapecharacter = utf8shapecharacter -- one character + +lpegpatterns.utf8lower = utf8lower -- string +lpegpatterns.utf8upper = utf8upper -- string +lpegpatterns.utf8shape = utf8shape -- string + +characters.lhash = lhash -- nil if no conversion +characters.uhash = uhash -- nil if no conversion +characters.shash = shash -- nil if no conversion function characters.lower (str) return lpegmatch(utf8lower,str) end function characters.upper (str) return lpegmatch(utf8upper,str) end diff --git a/tex/context/base/char-tex.lua b/tex/context/base/char-tex.lua index a9a760c7a..3aba53986 100644 --- a/tex/context/base/char-tex.lua +++ b/tex/context/base/char-tex.lua @@ -18,8 +18,6 @@ local P, C, R, S, V, Cs, Cc = lpeg.P, lpeg.C, lpeg.R, lpeg.S, lpeg.V, lpeg.Cs, l local lpegpatterns = lpeg.patterns local lpegmatch = lpeg.match -local utf8byte = lpegpatterns.utf8byte -local utf8char = lpegpatterns.utf8char local utfchartabletopattern = lpeg.utfchartabletopattern local allocate = utilities.storage.allocate @@ -44,19 +42,6 @@ local trace_defining = false trackers.register("characters.defining", fu local report_defining = logs.reporter("characters") - - - - - - - - - - - - - --[[ldx-- <p>In order to deal with 8-bit output, we need to find a way to go from <l n='utf'/> to 8-bit. This is handled in the <l n='luatex'/> engine itself.</p> @@ -426,6 +411,11 @@ function texcharacters.defineaccents() end end +if not context or not commands then + -- used in e.g. mtx-bibtex + return +end + -- all kind of initializations local tex = tex diff --git a/tex/context/base/cldf-prs.lua b/tex/context/base/cldf-prs.lua index 1554b5e57..f9fccd832 100644 --- a/tex/context/base/cldf-prs.lua +++ b/tex/context/base/cldf-prs.lua @@ -12,58 +12,54 @@ local lpegmatch, patterns = lpeg.match, lpeg.patterns local P, R, V, Cc, Cs = lpeg.P, lpeg.R, lpeg.V, lpeg.Cc, lpeg.Cs local format = string.format -local cpatterns = patterns.context or { } -patterns.context = cpatterns +local cpatterns = patterns.context or { } +patterns.context = cpatterns -local utf8char = patterns.utf8char -local cardinal = patterns.cardinal +local utf8character = patterns.utf8character +local cardinal = patterns.cardinal -local leftbrace = P("{") -local rightbrace = P("}") -local backslash = P("\\") -local csname = backslash * P(1) * (1-backslash-leftbrace)^0 * P(" ")^0 -local sign = P("+") / "\\textplus " - + P("-") / "\\textminus " -local nested = P { leftbrace * (V(1) + (1-rightbrace))^0 * rightbrace } -local subscript = P("_") -local superscript = P("^") +local leftbrace = P("{") +local rightbrace = P("}") +local backslash = P("\\") +local csname = backslash * P(1) * (1-backslash-leftbrace)^0 * P(" ")^0 +local sign = P("+") / "\\textplus " + + P("-") / "\\textminus " +local nested = P { leftbrace * (V(1) + (1-rightbrace))^0 * rightbrace } +local subscript = P("_") +local superscript = P("^") --- local scripts = P { "start", --- start = V("csname") + V("lowfirst") + V("highfirst"), --- csname = csname, --- content = Cs(V("csname") + nested + sign^-1 * (cardinal + utf8char)), --- lowfirst = subscript * ( Cc("\\lohi{%s}{%s}") * V("content") * superscript + Cc("\\low{%s}" ) ) * V("content") / format, --- highfirst = superscript * ( Cc("\\hilo{%s}{%s}") * V("content") * subscript + Cc("\\high{%s}") ) * V("content") / format, --- } +-- local scripts = P { "start", +-- start = V("csname") + V("lowfirst") + V("highfirst"), +-- csname = csname, +-- content = Cs(V("csname") + nested + sign^-1 * (cardinal + utf8character)), +-- lowfirst = subscript * ( Cc("\\lohi{%s}{%s}") * V("content") * superscript + Cc("\\low{%s}" ) ) * V("content") / format, +-- highfirst = superscript * ( Cc("\\hilo{%s}{%s}") * V("content") * subscript + Cc("\\high{%s}") ) * V("content") / format, +-- } --- local scripts = P { "start", --- start = (V("csname") + V("lowfirst") + V("highfirst"))^1, --- csname = csname, --- content = Cs(V("csname") + nested + sign^-1 * (cardinal + utf8char)), --- lowfirst = (subscript /"") * ( Cc("\\lohi{") * V("content") * Cc("}{") * (superscript/"") + Cc("\\low{" ) ) * V("content") * Cc("}"), --- highfirst = (superscript/"") * ( Cc("\\hilo{") * V("content") * Cc("}{") * (subscript /"") + Cc("\\high{") ) * V("content") * Cc("}"), --- } +-- local scripts = P { "start", +-- start = (V("csname") + V("lowfirst") + V("highfirst"))^1, +-- csname = csname, +-- content = Cs(V("csname") + nested + sign^-1 * (cardinal + utf8character)), +-- lowfirst = (subscript /"") * ( Cc("\\lohi{") * V("content") * Cc("}{") * (superscript/"") + Cc("\\low{" ) ) * V("content") * Cc("}"), +-- highfirst = (superscript/"") * ( Cc("\\hilo{") * V("content") * Cc("}{") * (subscript /"") + Cc("\\high{") ) * V("content") * Cc("}"), +-- } -local scripted = Cs { "start", - start = (V("csname") + V("nested") + V("lowfirst") + V("highfirst") + V("utf8char"))^1, - rest = V("csname") + V("nested") + V("lowfirst") + V("highfirst"), - csname = csname, - utf8char = utf8char, - -- nested = leftbrace * (V("rest") + (V("utf8char")-rightbrace))^0 * rightbrace, - nested = leftbrace * (V("start") -rightbrace)^0 * rightbrace, - content = Cs(V("nested") + sign^-1 * (cardinal + V("utf8char"))), - content = V("nested") + sign^-1 * (cardinal + V("utf8char")), - lowfirst = (subscript /"") * ( Cc("\\lohi{") * V("content") * Cc("}{") * (superscript/"") + Cc("\\low{" ) ) * V("content") * Cc("}"), - highfirst = (superscript/"") * ( Cc("\\hilo{") * V("content") * Cc("}{") * (subscript /"") + Cc("\\high{") ) * V("content") * Cc("}"), - } +local scripted = Cs { "start", + start = (V("csname") + V("nested") + V("lowfirst") + V("highfirst") + V("character"))^1, + rest = V("csname") + V("nested") + V("lowfirst") + V("highfirst"), + csname = csname, + character = utf8character, + -- nested = leftbrace * (V("rest") + (V("character")-rightbrace))^0 * rightbrace, + nested = leftbrace * (V("start") -rightbrace)^0 * rightbrace, + content = Cs(V("nested") + sign^-1 * (cardinal + V("character"))), + content = V("nested") + sign^-1 * (cardinal + V("character")), + lowfirst = (subscript /"") * ( Cc("\\lohi{") * V("content") * Cc("}{") * (superscript/"") + Cc("\\low{" ) ) * V("content") * Cc("}"), + highfirst = (superscript/"") * ( Cc("\\hilo{") * V("content") * Cc("}{") * (subscript /"") + Cc("\\high{") ) * V("content") * Cc("}"), + } - --- local scripted = Cs((scripts)) - --- cpatterns.scripts = scripts -cpatterns.csname = csname -cpatterns.scripted = scripted -cpatterns.nested = nested +cpatterns.csname = csname +cpatterns.scripted = scripted +cpatterns.nested = nested -- print(lpegmatch(scripted,"10^-3_x")) -- print(lpegmatch(scripted,"\\L {C_5}")) diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index c21e50c86..b87b4d5cd 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2014.07.07 17:48} +\newcontextversion{2014.07.09 10:26} %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/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 171f98b51..73fc6286d 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 2e5cc632b..24c3c8244 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -28,7 +28,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2014.07.07 17:48} +\edef\contextversion{2014.07.09 10:26} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/core-con.lua b/tex/context/base/core-con.lua index 99f8fc652..343485ed2 100644 --- a/tex/context/base/core-con.lua +++ b/tex/context/base/core-con.lua @@ -6,6 +6,8 @@ if not modules then modules = { } end modules ['core-con'] = { license = "see context related readme files" } +-- todo: split into char-lan.lua and core-con.lua + --[[ldx-- <p>This module implements a bunch of conversions. Some are more efficient than their <l n='tex'/> counterpart, some are even @@ -979,17 +981,28 @@ end -- These are just helpers but not really for the tex end. Do we have to -- use translate here? -local character = lpeg.patterns.utf8character local whitespace = lpeg.patterns.whitespace -local word = (character-whitespace) / characters.upper * (character-whitespace)^1 -local spacing = whitespace^1 -local pattern_one = Cs(word * P(1)^1) -local pattern_all = Cs((word + spacing)^1) - -function converters.word (s) return s end -function converters.words(s) return s end -function converters.Word (s) return lpegmatch(pattern_one,s) end -function converters.Words(s) return lpegmatch(pattern_all,s) end +local word = lpeg.patterns.utf8uppercharacter^-1 * (1-whitespace)^1 +local pattern_one = Cs(whitespace^0 * word^-1 * P(1)^1) +local pattern_all = Cs((whitespace^1 + word)^1) + +function converters.word (s) return s end -- dummies for typos +function converters.words(s) return s end -- dummies for typos +function converters.Word (s) return lpegmatch(pattern_one,s) or s end +function converters.Words(s) return lpegmatch(pattern_all,s) or s end + +converters.upper = characters.upper +converters.lower = characters.lower + +-- print(converters.Word("foo bar")) +-- print(converters.Word(" foo bar")) +-- print(converters.Word("123 foo bar")) +-- print(converters.Word(" 123 foo bar")) + +-- print(converters.Words("foo bar")) +-- print(converters.Words(" foo bar")) +-- print(converters.Words("123 foo bar")) +-- print(converters.Words(" 123 foo bar")) -- -- diff --git a/tex/context/base/core-env.mkiv b/tex/context/base/core-env.mkiv index 30fc83b4b..01d127d2f 100644 --- a/tex/context/base/core-env.mkiv +++ b/tex/context/base/core-env.mkiv @@ -149,7 +149,11 @@ \rawprocesscommacommand[#1]\syst_modes_define_indeed} \def\syst_modes_define_indeed#1% - {\syst_modes_new{#1}% + {\ifcsname\??mode#1\endcsname + % already set + \else + \syst_modes_new{#1} + \fi \ifx\m_modes_asked\v!keep % not changes, disabled when undefined \else diff --git a/tex/context/base/core-uti.lua b/tex/context/base/core-uti.lua index 1903ad823..d172eb05f 100644 --- a/tex/context/base/core-uti.lua +++ b/tex/context/base/core-uti.lua @@ -65,6 +65,7 @@ job.comment("version",job.version) local enabled = true directives.register("job.save",function(v) enabled = v end) +----------.register("job.keep",function(v) kept = v end) function job.disablesave() -- can be command enabled = false @@ -74,6 +75,9 @@ function job.initialize(loadname,savename) job.load(loadname) -- has to come after structure is defined ! luatex.registerstopactions(function() if enabled and not status.lasterrorstring or status.lasterrorstring == "" then + -- if kept then + -- job.keep(loadname) -- could move to mtx-context instead + -- end job.save(savename) end end) @@ -283,6 +287,28 @@ function job.loadother(filename) statistics.stoptiming(_load_) end +-- function job.keep(filename) +-- local suffix = file.suffix(filename) +-- local base = file.removesuffix(filename) +-- if suffix == "" then +-- suffix = "tuc" +-- end +-- for i=1,10 do +-- local tmpname = format("%s-%s-%02d.tmp",base,suffix,i) +-- if lfs.isfile(tmpname) then +-- os.remove(tmpname) +-- report_passes("removing %a",tmpname) +-- end +-- end +-- if lfs.isfile(filename) then +-- local tmpname = format("%s-%s-%02d.tmp",base,suffix,environment.currentrun or 1) +-- report_passes("copying %a into %a",filename,tmpname) +-- file.copy(filename,tmpname) +-- else +-- report_passes("no file %a, nothing kept",filename) +-- end +-- end + -- eventually this will end up in strc-ini statistics.register("startup time", function() @@ -352,6 +378,5 @@ function statistics.formatruntime(runtime) end end - commands.savevariable = job.variables.save commands.setjobcomment = job.comment diff --git a/tex/context/base/data-env.lua b/tex/context/base/data-env.lua index 90b031b0f..03a382e7b 100644 --- a/tex/context/base/data-env.lua +++ b/tex/context/base/data-env.lua @@ -96,7 +96,7 @@ local relations = allocate { -- todo: handlers also here tex = { names = { "tex" }, variable = 'TEXINPUTS', - suffixes = { 'tex', "mkvi", "mkiv", "mkii" }, + suffixes = { "tex", "mkvi", "mkiv", "mkii", "cld", "lfg", "xml" }, -- known suffixes have less lookups }, icc = { names = { "icc", "icc profile", "icc profiles" }, diff --git a/tex/context/base/data-res.lua b/tex/context/base/data-res.lua index 844a0601f..a22aea27f 100644 --- a/tex/context/base/data-res.lua +++ b/tex/context/base/data-res.lua @@ -761,45 +761,47 @@ function resolvers.registerextrapath(paths,subpaths) end end -local function made_list(instance,list) +local function made_list(instance,list,extra_too) + if not extra_too then + return list + end local ep = instance.extra_paths if not ep or #ep == 0 then return list - else - local done, new, newn = { }, { }, 0 - -- honour . .. ../.. but only when at the start - for k=1,#list do - local v = list[k] - if not done[v] then - if find(v,"^[%.%/]$") then - done[v] = true - newn = newn + 1 - new[newn] = v - else - break - end - end - end - -- first the extra paths - for k=1,#ep do - local v = ep[k] - if not done[v] then + end + local done, new, newn = { }, { }, 0 + -- honour . .. ../.. but only when at the start + for k=1,#list do + local v = list[k] + if not done[v] then + if find(v,"^[%.%/]$") then done[v] = true newn = newn + 1 new[newn] = v + else + break end end - -- next the formal paths - for k=1,#list do - local v = list[k] - if not done[v] then - done[v] = true - newn = newn + 1 - new[newn] = v - end + end + -- first the extra paths + for k=1,#ep do + local v = ep[k] + if not done[v] then + done[v] = true + newn = newn + 1 + new[newn] = v + end + end + -- next the formal paths + for k=1,#list do + local v = list[k] + if not done[v] then + done[v] = true + newn = newn + 1 + new[newn] = v end - return new end + return new end function resolvers.cleanpathlist(str) @@ -816,7 +818,7 @@ function resolvers.expandpath(str) return joinpath(resolvers.expandedpathlist(str)) end -function resolvers.expandedpathlist(str) +function resolvers.expandedpathlist(str,extra_too) if not str then return { } elseif instance.savelists then @@ -824,14 +826,14 @@ function resolvers.expandedpathlist(str) local lists = instance.lists local lst = lists[str] if not lst then - local l = made_list(instance,resolvers.splitpath(resolvers.expansion(str))) + local l = made_list(instance,resolvers.splitpath(resolvers.expansion(str)),extra_too) lst = expandedpathfromlist(l) lists[str] = lst end return lst else local lst = resolvers.splitpath(resolvers.expansion(str)) - return made_list(instance,expandedpathfromlist(lst)) + return made_list(instance,expandedpathfromlist(lst),extra_too) end end @@ -1138,7 +1140,7 @@ end local function find_intree(filename,filetype,wantedfiles,allresults) local typespec = resolvers.variableofformat(filetype) - local pathlist = resolvers.expandedpathlist(typespec) + local pathlist = resolvers.expandedpathlist(typespec,filetype=="tex") -- only extra path with user files local method = "intree" if pathlist and #pathlist > 0 then -- list search @@ -1261,6 +1263,19 @@ local function find_intree(filename,filetype,wantedfiles,allresults) else -- no access needed for non existing path, speedup (esp in large tree with lots of fake) end + else + -- we can have extra_paths that are urls + for k=1,#wantedfiles do + -- independent url scanner + local fname = methodhandler('finders',pathname .. "/" .. wantedfiles[k]) + if fname then + result[#result+1] = fname + doen = true + if not allresults then + break + end + end + end end end -- todo recursive scanning diff --git a/tex/context/base/data-tre.lua b/tex/context/base/data-tre.lua index 044e205c5..58e44c23b 100644 --- a/tex/context/base/data-tre.lua +++ b/tex/context/base/data-tre.lua @@ -21,7 +21,7 @@ if not modules then modules = { } end modules ['data-tre'] = { local find, gsub, lower = string.find, string.gsub, string.lower local basename, dirname, joinname = file.basename, file.dirname, file .join -local globdir, isdir = dir.glob, lfs.isdir +local globdir, isdir, isfile = dir.glob, lfs.isdir, lfs.isfile local P, lpegmatch = lpeg.P, lpeg.match local trace_locating = false trackers.register("resolvers.locating", function(v) trace_locating = v end) @@ -115,8 +115,29 @@ table.setmetatableindex(collectors, function(t,k) return content end) -function resolvers.finders.dirlist(specification) -- can be called directly too + +local function checked(root,p,n) + if p then + if type(p) == "table" then + for i=1,#p do + local fullname = joinname(root,p[i],n) + if isfile(fullname) then -- safeguard + return fullname + end + end + else + local fullname = joinname(root,p,n) + if isfile(fullname) then -- safeguard + return fullname + end + end + end + return notfound() +end + +local function resolve(specification) -- can be called directly too local filename = specification.filename + -- print(filename) -- in case we want to check for unwanted lookups if filename ~= "" then local root, rest = lpegmatch(splitter,filename) if root and rest then @@ -133,42 +154,60 @@ function resolvers.finders.dirlist(specification) -- can be called directly too for i=1,#p do local pi = p[i] if pi == path or find(pi,pattern) then - return joinname(root,pi,n) + local fullname = joinname(root,pi,n) + if isfile(fullname) then -- safeguard + return fullname + end end end - else - if p == path or find(p,pattern) then - return joinname(root,p,n) + elseif p == path or find(p,pattern) then + local fullname = joinname(root,p,n) + if isfile(fullname) then -- safeguard + return fullname end end local queries = specification.queries if queries and queries.option == "fileonly" then - return joinname(root,istable and p[1] or p,n) + return checked(root,p,n) + else + return notfound() end - return notfound() end end local path, name = dirname(filename), basename(filename) local root = lpegmatch(stripper,path) local content = collectors[path] local p, n = lookup(content,name) - if not p then - return notfound() - elseif type(p) == "table" then - -- maybe a warning that the first name is taken - p = p[1] + if p then + return checked(root,p,n) end - return joinname(root,p,n) end return notfound() end +resolvers.finders .dirlist = resolve resolvers.locators .dirlist = resolvers.locators .tree resolvers.hashers .dirlist = resolvers.hashers .tree resolvers.generators.dirlist = resolvers.generators.file resolvers.openers .dirlist = resolvers.openers .file resolvers.loaders .dirlist = resolvers.loaders .file +function resolvers.finders.dirfile(specification) + local queries = specification.queries + if queries then + queries.option = "fileonly" + else + specification.queries = { option = "fileonly" } + end + return resolve(specification) +end + +resolvers.locators .dirfile = resolvers.locators .dirlist +resolvers.hashers .dirfile = resolvers.hashers .dirlist +resolvers.generators.dirfile = resolvers.generators.dirlist +resolvers.openers .dirfile = resolvers.openers .dirlist +resolvers.loaders .dirfile = resolvers.loaders .dirlist + -- local locate = collectors[ [[E:\temporary\mb-mp]] ] -- local locate = collectors( [[\\storage-2\resources\mb-mp]] ) diff --git a/tex/context/base/file-ini.lua b/tex/context/base/file-ini.lua index 3314bb33d..e6acc9e5d 100644 --- a/tex/context/base/file-ini.lua +++ b/tex/context/base/file-ini.lua @@ -34,6 +34,10 @@ function commands.doifparentfileelse(n) end function commands.doiffileexistelse(name) - local foundname = resolvers.findtexfile(name) - commands_doifelse(foundname and foundname ~= "") + name = resolvers.findtexfile(name) + commands_doifelse(name and name ~= "") +end + +function commands.doifpathexistelse(name) + commands_doifelse(lfs.isdir(name)) end diff --git a/tex/context/base/file-ini.mkvi b/tex/context/base/file-ini.mkvi index 989241dd1..633407fe2 100644 --- a/tex/context/base/file-ini.mkvi +++ b/tex/context/base/file-ini.mkvi @@ -135,8 +135,10 @@ %D \stoptyping \def\doiffileexistselse#name{\ctxcommand{doiffileexistelse([[#name]])}} +\def\doifpathexistselse#name{\ctxcommand{doifpathexistelse([[#name]])}} \def\doiffileelse {\doiffileexistselse} +\def\doifpathelse {\doifpathexistselse} \def\doiffile #name{\doiffileexistselse{#name}\firstofoneargument\gobbleoneargument} \def\doifnotfile #name{\doiffileexistselse{#name}\gobbleoneargument\firstofoneargument} diff --git a/tex/context/base/file-job.mkvi b/tex/context/base/file-job.mkvi index 5f646ed28..243a8d856 100644 --- a/tex/context/base/file-job.mkvi +++ b/tex/context/base/file-job.mkvi @@ -45,6 +45,14 @@ \unexpanded\def\locatefilepath#name% no [] ? {\edef\locatedfilepath{\ctxcommand{locatefilepath("#name")}}} +% % maybe: +% +% % \dirlist{c:/data/temporary/foo}{images/bar.jpg} +% % \dirfile{c:/data/temporary/foo}{images/bar.jpg} +% +% \def\dirlist#1#2{dirlist://#1/**/#2} +% \def\dirfile#1#2{dirlist://#1/**/#2?option=fileonly} + % zip files are tree'd \unexpanded\def\usezipfile diff --git a/tex/context/base/grph-inc.lua b/tex/context/base/grph-inc.lua index d89c52996..a32773ecb 100644 --- a/tex/context/base/grph-inc.lua +++ b/tex/context/base/grph-inc.lua @@ -6,6 +6,7 @@ if not modules then modules = { } end modules ['grph-inc'] = { license = "see context related readme files" } +-- todo: files are sometimes located twice -- todo: empty filename or only suffix always false (not found) -- lowercase types -- mps tex tmp svg @@ -552,6 +553,9 @@ local function register(askedname,specification) report_inclusion("no converter for %a to %a",format,newformat) end if converter then + -- + -- todo: outline as helper function + -- local oldname = specification.fullname local newpath = file.dirname(oldname) local oldbase = file.basename(oldname) @@ -641,19 +645,21 @@ local function register(askedname,specification) end end end - local found = figures_suffixes[format] -- validtypes[format] - if not found then - specification.found = false - if trace_figures then - report_inclusion("format %a is not supported",format) - end - else - specification.found = true - if trace_figures then - if validtypes[format] then -- format? - report_inclusion("format %a natively supported by backend",format) - else - report_inclusion("format %a supported by output file format",format) + if format then + local found = figures_suffixes[format] -- validtypes[format] + if not found then + specification.found = false + if trace_figures then + report_inclusion("format %a is not supported",format) + end + else + specification.found = true + if trace_figures then + if validtypes[format] then -- format? + report_inclusion("format %a natively supported by backend",format) + else + report_inclusion("format %a supported by output file format",format) + end end end end @@ -697,6 +703,7 @@ local function locate(request) -- name, format, cache askedname = path end else +-- local fname = methodhandler('finders',pathname .. "/" .. wantedfiles[k]) local foundname = resolvers.findbinfile(askedname) if not foundname or not lfs.isfile(foundname) then -- foundname can be dummy if trace_figures then @@ -1011,11 +1018,15 @@ end function existers.generic(askedname,resolve) -- not findbinfile local result - if lfs.isfile(askedname) then + if url.hasscheme(askedname) then + result = resolvers.findbinfile(askedname) + elseif lfs.isfile(askedname) then result = askedname elseif resolve then - result = resolvers.findbinfile(askedname) or "" - if result == "" then result = false end + result = resolvers.findbinfile(askedname) + end + if not result or result == "" then + result = false end if trace_figures then if result then diff --git a/tex/context/base/l-lpeg.lua b/tex/context/base/l-lpeg.lua index 79e75a7b7..f3fd28b1d 100644 --- a/tex/context/base/l-lpeg.lua +++ b/tex/context/base/l-lpeg.lua @@ -499,7 +499,6 @@ function lpeg.finder(lst,makefunction,isutf) -- beware: slower than find with 'p pattern = P(lst) end if isutf then --- pattern = ((utf8char or 1)-pattern)^0 * pattern pattern = ((utf8char or 1)-pattern)^0 * pattern else pattern = (1-pattern)^0 * pattern diff --git a/tex/context/base/l-unicode.lua b/tex/context/base/l-unicode.lua index be61f3d73..fb4ea37fa 100644 --- a/tex/context/base/l-unicode.lua +++ b/tex/context/base/l-unicode.lua @@ -34,25 +34,29 @@ local type = type local char, byte, format, sub, gmatch = string.char, string.byte, string.format, string.sub, string.gmatch local concat = table.concat local P, C, R, Cs, Ct, Cmt, Cc, Carg, Cp = lpeg.P, lpeg.C, lpeg.R, lpeg.Cs, lpeg.Ct, lpeg.Cmt, lpeg.Cc, lpeg.Carg, lpeg.Cp -local lpegmatch, patterns = lpeg.match, lpeg.patterns -local bytepairs = string.bytepairs +local lpegmatch = lpeg.match +local patterns = lpeg.patterns +local tabletopattern = lpeg.utfchartabletopattern -local finder = lpeg.finder -local replacer = lpeg.replacer +local bytepairs = string.bytepairs -local utfvalues = utf.values -local utfgmatch = utf.gmatch -- not always present +local finder = lpeg.finder +local replacer = lpeg.replacer + +local utfvalues = utf.values +local utfgmatch = utf.gmatch -- not always present local p_utftype = patterns.utftype local p_utfstricttype = patterns.utfstricttype local p_utfoffset = patterns.utfoffset -local p_utf8char = patterns.utf8char +local p_utf8char = patterns.utf8character local p_utf8byte = patterns.utf8byte local p_utfbom = patterns.utfbom local p_newline = patterns.newline local p_whitespace = patterns.whitespace + if not unicode then unicode = { utf = utf } -- for a while @@ -510,8 +514,20 @@ end -- a replacement for simple gsubs: +-- function utf.remapper(mapping) +-- local pattern = Cs((p_utf8char/mapping)^0) +-- return function(str) +-- if not str or str == "" then +-- return "" +-- else +-- return lpegmatch(pattern,str) +-- end +-- end, pattern +-- end + function utf.remapper(mapping) - local pattern = Cs((p_utf8char/mapping)^0) + local pattern = type(mapping) == "table" and tabletopattern(mapping) or p_utf8char + local pattern = Cs((pattern/mapping + p_utf8char)^0) return function(str) if not str or str == "" then return "" diff --git a/tex/context/base/lxml-aux.lua b/tex/context/base/lxml-aux.lua index b3f1684e7..3f502df44 100644 --- a/tex/context/base/lxml-aux.lua +++ b/tex/context/base/lxml-aux.lua @@ -364,10 +364,9 @@ xml.injectafter = inject_element xml.injectbefore = function(r,p,e) inject_element(r,p,e,true) end local function include(xmldata,pattern,attribute,recursive,loaddata) - -- parse="text" (default: xml), encoding="" (todo) - -- attribute = attribute or 'href' - pattern = pattern or 'include' - loaddata = loaddata or io.loaddata + -- attribute = attribute or 'href' + pattern = pattern or 'include' + loaddata = loaddata or io.loaddata local collected = xmlapplylpath(xmldata,pattern) if collected then for c=1,#collected do @@ -386,16 +385,13 @@ local function include(xmldata,pattern,attribute,recursive,loaddata) if name then break end end end - local data = (name and name ~= "" and loaddata(name)) or "" + local data = name and name ~= "" and loaddata(name) or "" if data == "" then epdt[ek.ni] = "" -- xml.empty(d,k) elseif ekat["parse"] == "text" then -- for the moment hard coded epdt[ek.ni] = xml.escaped(data) -- d[k] = xml.escaped(data) else ---~ local settings = xmldata.settings ---~ settings.parent_root = xmldata -- to be tested ---~ local xi = xmlconvert(data,settings) local xi = xmlinheritedconvert(data,xmldata) if not xi then epdt[ek.ni] = "" -- xml.empty(d,k) diff --git a/tex/context/base/page-mix.mkiv b/tex/context/base/page-mix.mkiv index 57de14b88..0fe56d970 100644 --- a/tex/context/base/page-mix.mkiv +++ b/tex/context/base/page-mix.mkiv @@ -554,6 +554,8 @@ % needs packaging anyway \setbox\scratchbox\page_mix_command_package_column \page_marks_synchronize_column\plusone\c_page_mix_n_of_columns\recurselevel\scratchbox + % backgrounds +\anch_mark_column_box\scratchbox % for the moment a quick and dirty patch .. we need to go into the box (hence the \plusone) .. a slowdowner \page_lines_add_numbers_to_box\scratchbox\recurselevel\c_page_mix_n_of_columns\plusone % the framed needs a reset of strut, align, setups etc diff --git a/tex/context/base/publ-dat.lua b/tex/context/base/publ-dat.lua index 986ef75c2..1823b33c2 100644 --- a/tex/context/base/publ-dat.lua +++ b/tex/context/base/publ-dat.lua @@ -16,8 +16,7 @@ in a convenient way. Actually handling the data takes place elsewhere.</p> --ldx]]-- if not characters then - dofile(resolvers.findfile("char-def.lua")) - dofile(resolvers.findfile("char-ini.lua")) + dofile(resolvers.findfile("char-utf.lua")) dofile(resolvers.findfile("char-tex.lua")) end diff --git a/tex/context/base/publ-fnd.lua b/tex/context/base/publ-fnd.lua index 14d65a244..f9afd5fd0 100644 --- a/tex/context/base/publ-fnd.lua +++ b/tex/context/base/publ-fnd.lua @@ -8,8 +8,7 @@ if not modules then modules = { } end modules ['publ-fnd'] = { if not characters then dofile(resolvers.findfile("char-def.lua")) - dofile(resolvers.findfile("char-ini.lua")) - dofile(resolvers.findfile("char-tex.lua")) + dofile(resolvers.findfile("char-utf.lua")) end if not publications then @@ -18,7 +17,7 @@ end local tonumber, next, type = tonumber, next, type local P, R, C, Cs, Cp, Cc, Carg = lpeg.P, lpeg.R, lpeg.C, lpeg.Cs, lpeg.Cp, lpeg.Cc, lpeg.Carg -local lpegmatch = lpeg.match +local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns local concat = table.concat local formatters = string.formatters @@ -30,11 +29,11 @@ local colon = P(":") local dash = P("-") local lparent = P("(") local rparent = P(")") -local space = lpeg.patterns.whitespace +local space = lpegpatterns.whitespace local valid = 1 - colon - space - lparent - rparent ----- key = C(valid^1) local key = C(R("az","AZ")^1) -local word = Cs(lpeg.patterns.unquoted + valid^1) +local word = Cs(lpegpatterns.unquoted + lpegpatterns.argument + valid^1) local number = C(valid^1) ----- f_string_key = formatters[" local s_%s = entry[%q]"] @@ -75,21 +74,23 @@ local pattern = Cs(Cc("(") * (P("match")/"" * p_match)^1 * Cc(")")) -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -local tolower = lpeg.patterns.tolower -local lower = string.lower - -local allascii = R("\000\127")^1 * P(-1) - -function characters.checkedlower(str) - return lpegmatch(allascii,str) and lower(str) or lpegmatch(tolower,str) or str -end +-- no longer faster +-- +-- local tolower = lpegpatterns.tolower +-- local lower = string.lower +-- +-- local allascii = R("\000\127")^1 * P(-1) +-- +-- function characters.checkedlower(str) +-- return lpegmatch(allascii,str) and lower(str) or lpegmatch(tolower,str) or str +-- end -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- local f_template = string.formatters[ [[ local find = string.find -local lower = characters.checkedlower +local lower = characters.lower return function(entry) %s return %s and true or false @@ -120,6 +121,10 @@ local function compile(expr) return false end +-- compile([[match(key:"foo bar")]]) +-- compile([[match(key:'foo bar')]]) +-- compile([[match(key:{foo bar})]]) + local cache = { } -- todo: make weak, or just remember the last one (trial typesetting) local check = P("match") -- * space^0 * Cp() diff --git a/tex/context/base/publ-imp-apa.mkvi b/tex/context/base/publ-imp-apa.mkvi index cbec80365..08724a5f9 100644 --- a/tex/context/base/publ-imp-apa.mkvi +++ b/tex/context/base/publ-imp-apa.mkvi @@ -29,6 +29,7 @@ [apa:mastersthesis={Master's thesis}, apa:phdthesis={PhD thesis}, apa:technicalreport={Technical report}, + apa:patent=patent, apa:editor=editor, apa:editors=editors, apa:edition=edition, @@ -50,6 +51,7 @@ [apa:mastersthesis={Thèse de master (DEA, DESS, master)}, apa:phdthesis={Thèse de doctorat}, apa:technicalreport={Rapport technique}, + apa:patent=brevet, apa:editor=éditeur, apa:editors=éditeurs, apa:edition=édition, @@ -71,6 +73,7 @@ [apa:mastersthesis={Masterarbeit}, apa:phdthesis={Dissertation}, apa:technicalreport={Technischer Bericht}, + apa:patent=Patent, apa:editor=Herausgeber, apa:editors=Herausgeber, apa:edition=Auflage, @@ -740,6 +743,26 @@ \texdefinition{btx:apa:note} \stopsetups +\startsetups btx:apa:patent + \texdefinition{btx:apa:author-and-year} + \btxdoif {title} { + \btxspace + \texdefinition{btx:apa:italic}{converters.Word -> title} + } + \btxdoif {nationality} { + \btxspace + \btxflush{nationality} + } + \btxspace + \btxlabeltext{apa:patent} + \btxdoif {number} { + \btxspace + \btxflush{number} + } + \texdefinition{btx:apa:wherefrom}{publisher} + \texdefinition{btx:apa:note} +\stopsetups + \startsetups btx:apa:misc \texdefinition{btx:apa:author-and-year} \texdefinition{btx:apa:title-and-series} diff --git a/tex/context/base/publ-tra.lua b/tex/context/base/publ-tra.lua index 1cbbf3383..0b7e840c8 100644 --- a/tex/context/base/publ-tra.lua +++ b/tex/context/base/publ-tra.lua @@ -146,6 +146,10 @@ local categories = { required = { "author", "title", "institution", "year" }, optional = { "type", "number", "address", "month", "note" }, }, + patent = { + required = { "nationality", "number", "year", "yearfiled" }, + optional = { "author", "title", "language", "assignee", "address", "type", "day", "dayfiled", "month", "monthfiled", "note", }, + }, unpublished = { required = { "author", "title", "note" }, optional = { "month", "year" }, diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex a37c74d32..8541081c8 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 6f309ed57..5160a3765 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/syst-aux.lua b/tex/context/base/syst-aux.lua index de15428f9..e645bb3b9 100644 --- a/tex/context/base/syst-aux.lua +++ b/tex/context/base/syst-aux.lua @@ -13,15 +13,16 @@ if not modules then modules = { } end modules ['syst-aux'] = { local commands, context = commands, context +local tonumber = tonumber local settings_to_array = utilities.parsers.settings_to_array local format = string.format local utfsub = utf.sub -local P, S, C, Cc, Cs, Carg, lpegmatch, utf8char = lpeg.P, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Carg, lpeg.match, lpeg.patterns.utf8char - +local P, S, C, Cc, Cs, Carg, lpegmatch, utf8character = lpeg.P, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cs, lpeg.Carg, lpeg.match, lpeg.patterns.utf8character +local todimen = number.todimen local setvalue = context.setvalue -local pattern = C(utf8char^-1) * C(P(1)^0) +local pattern = C(utf8character^-1) * C(P(1)^0) function commands.getfirstcharacter(str) local first, rest = lpegmatch(pattern,str) @@ -38,7 +39,7 @@ function commands.theremainingcharacters(str) context(rest) end -local pattern = C(utf8char^-1) +local pattern = C(utf8character^-1) function commands.doiffirstcharelse(chr,str) commands.doifelse(lpegmatch(pattern,str) == chr) @@ -114,3 +115,5 @@ local upper, lower, strip = utf.upper, utf.lower, string.strip function commands.upper(s) context(upper(s)) end function commands.lower(s) context(lower(s)) end function commands.strip(s) context(strip(s)) end + +function commands.converteddimen(dimen,unit) context(todimen(dimen,unit or "pt","%0.5f")) end -- no unit appended diff --git a/tex/context/base/syst-aux.mkiv b/tex/context/base/syst-aux.mkiv index 2288223af..3642d6753 100644 --- a/tex/context/base/syst-aux.mkiv +++ b/tex/context/base/syst-aux.mkiv @@ -7000,6 +7000,10 @@ %def\getsubstring#1#2#3{\cldcontext{utf.sub([[#3]],tonumber("#1"),tonumber("#2"))}} \def\getsubstring#1#2#3{\ctxcommand{getsubstring(\!!bs#3\!!es,"#1","#2")}} +%D Other dimensions that pt: + +% \def\converteddimen#1#2{\ctxcommand{converteddimen(\number\dimexpr#1,"#2")}} + \protect \endinput % \edef\choicetokenyes{+} diff --git a/tex/context/base/util-dim.lua b/tex/context/base/util-dim.lua index 69061495f..bfffb1010 100644 --- a/tex/context/base/util-dim.lua +++ b/tex/context/base/util-dim.lua @@ -24,13 +24,15 @@ local formatters = string.formatters local texget = tex and tex.get or function() return 65536*10*100 end +local p_stripzeros = lpeg.patterns.stripzeros + --this might become another namespace number = number or { } local number = number -number.tonumberf = function(n) return match(format("%.20f",n),"(.-0?)0*$") end -- one zero too much but alas -number.tonumberg = function(n) return format("%.20g",n) end +number.tonumberf = function(n) return lpegmatch(p_stripzeros,format("%.20f",n)) end +number.tonumberg = function(n) return format("%.20g",n) end local dimenfactors = allocate { ["pt"] = 1/65536, @@ -46,66 +48,65 @@ local dimenfactors = allocate { ["nc"] = ( 5080/65043)/65536 } ---~ print(table.serialize(dimenfactors)) ---~ ---~ %.99g: ---~ ---~ t={ ---~ ["bp"]=1.5201782378580324e-005, ---~ ["cc"]=1.1883696112892098e-006, ---~ ["cm"]=5.3628510057769479e-007, ---~ ["dd"]=1.4260435335470516e-005, ---~ ["em"]=0.000152587890625, ---~ ["ex"]=6.103515625e-005, ---~ ["in"]=2.1113586636917117e-007, ---~ ["mm"]=5.3628510057769473e-008, ---~ ["nc"]=1.1917446679504327e-006, ---~ ["nd"]=1.4300936015405194e-005, ---~ ["pc"]=1.2715657552083333e-006, ---~ ["pt"]=1.52587890625e-005, ---~ ["sp"]=1, ---~ } ---~ ---~ patched %s and tonumber ---~ ---~ t={ ---~ ["bp"]=0.00001520178238, ---~ ["cc"]=0.00000118836961, ---~ ["cm"]=0.0000005362851, ---~ ["dd"]=0.00001426043534, ---~ ["em"]=0.00015258789063, ---~ ["ex"]=0.00006103515625, ---~ ["in"]=0.00000021113587, ---~ ["mm"]=0.00000005362851, ---~ ["nc"]=0.00000119174467, ---~ ["nd"]=0.00001430093602, ---~ ["pc"]=0.00000127156576, ---~ ["pt"]=0.00001525878906, ---~ ["sp"]=1, ---~ } +-- print(table.serialize(dimenfactors)) +-- +-- %.99g: +-- +-- t={ +-- ["bp"]=1.5201782378580324e-005, +-- ["cc"]=1.1883696112892098e-006, +-- ["cm"]=5.3628510057769479e-007, +-- ["dd"]=1.4260435335470516e-005, +-- ["em"]=0.000152587890625, +-- ["ex"]=6.103515625e-005, +-- ["in"]=2.1113586636917117e-007, +-- ["mm"]=5.3628510057769473e-008, +-- ["nc"]=1.1917446679504327e-006, +-- ["nd"]=1.4300936015405194e-005, +-- ["pc"]=1.2715657552083333e-006, +-- ["pt"]=1.52587890625e-005, +-- ["sp"]=1, +-- } +-- +-- patched %s and tonumber +-- +-- t={ +-- ["bp"]=0.00001520178238, +-- ["cc"]=0.00000118836961, +-- ["cm"]=0.0000005362851, +-- ["dd"]=0.00001426043534, +-- ["em"]=0.00015258789063, +-- ["ex"]=0.00006103515625, +-- ["in"]=0.00000021113587, +-- ["mm"]=0.00000005362851, +-- ["nc"]=0.00000119174467, +-- ["nd"]=0.00001430093602, +-- ["pc"]=0.00000127156576, +-- ["pt"]=0.00001525878906, +-- ["sp"]=1, +-- } --[[ldx-- <p>A conversion function that takes a number, unit (string) and optional format (string) is implemented using this table.</p> --ldx]]-- +local f_none = formatters["%s%s"] +local f_true = formatters["%0.5f%s"] local function numbertodimen(n,unit,fmt) if type(n) == 'string' then return n else unit = unit or 'pt' + n = n * dimenfactors[unit] if not fmt then - fmt = "%s%s" + fmt = f_none(n,unit) elseif fmt == true then - fmt = "%0.5f%s" + fmt = f_true(n,unit) + else + return formatters[fmt](n,unit) end - return format(fmt,n*dimenfactors[unit],unit) - -- if fmt then - -- return format(fmt,n*dimenfactors[unit],unit) - -- else - -- return match(format("%.20f",n*dimenfactors[unit]),"(.-0?)0*$") .. unit - -- end end end diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index ea3a8cc12..a7b7b83d0 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 07/07/14 17:48:35 +-- merge date : 07/09/14 10:26:17 do -- begin closure to overcome local limits and interference |