summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-03-21 09:47:34 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2018-03-21 09:47:34 +0100
commitf47b4939787074397c9ea37c1d892a1f7ccc7290 (patch)
tree7768be58efe0faab8e2dccb999686c6a674bf0d7
parentf923c957a3b322ae3ee8e7a0b20df1580869bee7 (diff)
downloadcontext-f47b4939787074397c9ea37c1d892a1f7ccc7290.tar.gz
2018-03-21 09:24:00
-rw-r--r--context/data/scite/context/lexers/scite-context-lexer-bnf.lua99
-rw-r--r--doc/context/documents/general/manuals/luatex.pdfbin1172101 -> 1172403 bytes
-rw-r--r--doc/context/documents/general/manuals/sql-mkiv.pdfbin94190 -> 94186 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-cs.pdfbin844221 -> 844254 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-de.pdfbin844075 -> 844110 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-en.pdfbin848116 -> 848123 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-fr.pdfbin839780 -> 839796 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-it.pdfbin845621 -> 845669 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-cs.pdfbin358994 -> 358991 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-de.pdfbin438379 -> 438372 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-en.pdfbin356101 -> 356100 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-fr.pdfbin359078 -> 359081 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-it.pdfbin357924 -> 357923 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-nl.pdfbin357383 -> 357376 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-mapping-ro.pdfbin624173 -> 624172 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-nl.pdfbin836725 -> 836763 bytes
-rw-r--r--doc/context/documents/general/qrcs/setup-ro.pdfbin839721 -> 839748 bytes
-rw-r--r--doc/context/scripts/mkiv/context.html4
-rw-r--r--doc/context/scripts/mkiv/context.man8
-rw-r--r--doc/context/scripts/mkiv/context.xml8
-rw-r--r--doc/context/scripts/mkiv/mtx-context.html4
-rw-r--r--doc/context/scripts/mkiv/mtx-context.man8
-rw-r--r--doc/context/scripts/mkiv/mtx-context.xml8
-rw-r--r--doc/context/sources/general/fonts/fonts/fonts-extensions.tex10
-rw-r--r--doc/context/sources/general/manuals/hybrid/hybrid-grouping.tex2
-rw-r--r--doc/context/sources/general/manuals/hybrid/hybrid-parbuilder.tex2
-rw-r--r--doc/context/sources/general/manuals/luatex/luatex-nodes.tex2
-rw-r--r--scripts/context/lua/mtx-context.lua32
-rw-r--r--scripts/context/lua/mtx-context.xml8
-rw-r--r--scripts/context/lua/mtxrun.lua51
-rw-r--r--scripts/context/stubs/mswin/mtxrun.lua51
-rw-r--r--scripts/context/stubs/unix/mtxrun51
-rw-r--r--scripts/context/stubs/win64/mtxrun.lua51
-rw-r--r--tex/context/base/mkii/cont-new.mkii2
-rw-r--r--tex/context/base/mkii/context.mkii2
-rw-r--r--tex/context/base/mkii/mult-cs.mkii1
-rw-r--r--tex/context/base/mkii/mult-en.mkii1
-rw-r--r--tex/context/base/mkii/mult-fr.mkii5
-rw-r--r--tex/context/base/mkiv/back-exp.lua39
-rw-r--r--tex/context/base/mkiv/back-exp.mkiv7
-rw-r--r--tex/context/base/mkiv/buff-ver.lua9
-rw-r--r--tex/context/base/mkiv/cont-new.mkiv2
-rw-r--r--tex/context/base/mkiv/cont-run.lua25
-rw-r--r--tex/context/base/mkiv/context.mkiv2
-rw-r--r--tex/context/base/mkiv/data-exp.lua86
-rw-r--r--tex/context/base/mkiv/font-ext.lua10
-rw-r--r--tex/context/base/mkiv/font-otj.lua113
-rw-r--r--tex/context/base/mkiv/l-lua.lua3
-rw-r--r--tex/context/base/mkiv/l-table.lua4
-rw-r--r--tex/context/base/mkiv/lxml-aux.lua26
-rw-r--r--tex/context/base/mkiv/lxml-css.lua145
-rw-r--r--tex/context/base/mkiv/lxml-css.mkiv40
-rw-r--r--tex/context/base/mkiv/lxml-tex.lua20
-rw-r--r--tex/context/base/mkiv/math-ini.mkiv4
-rw-r--r--tex/context/base/mkiv/meta-ini.lua5
-rw-r--r--tex/context/base/mkiv/node-nut.lua10
-rw-r--r--tex/context/base/mkiv/node-syn.lua53
-rw-r--r--tex/context/base/mkiv/page-ini.lua17
-rw-r--r--tex/context/base/mkiv/page-inj.mkvi20
-rw-r--r--tex/context/base/mkiv/page-pcl.mkiv54
-rw-r--r--tex/context/base/mkiv/page-set.mkiv4
-rw-r--r--tex/context/base/mkiv/publ-imp-apa.mkvi2
-rw-r--r--tex/context/base/mkiv/scrn-fld.mkvi2
-rw-r--r--tex/context/base/mkiv/scrn-pag.mkvi13
-rw-r--r--tex/context/base/mkiv/spac-hor.mkiv35
-rw-r--r--tex/context/base/mkiv/spac-ver.mkiv16
-rw-r--r--tex/context/base/mkiv/status-files.pdfbin25856 -> 25801 bytes
-rw-r--r--tex/context/base/mkiv/status-lua.pdfbin252176 -> 254074 bytes
-rw-r--r--tex/context/base/mkiv/strc-flt.mkvi39
-rw-r--r--tex/context/base/mkiv/typo-duc.lua5
-rw-r--r--tex/context/base/mkiv/util-sha.lua326
-rw-r--r--tex/context/base/mkiv/util-sql-imp-library.lua2
-rw-r--r--tex/context/base/mkiv/util-sql-loggers.lua5
-rw-r--r--tex/context/base/mkiv/util-sql-logins.lua39
-rw-r--r--tex/context/base/mkiv/util-sql-sessions.lua14
-rw-r--r--tex/context/base/mkiv/util-sql-tickets.lua22
-rw-r--r--tex/context/base/mkiv/util-sql-users.lua102
-rw-r--r--tex/context/base/mkiv/util-str.lua6
-rw-r--r--tex/context/fonts/mkiv/type-imp-texgyre.mkiv4
-rw-r--r--tex/context/interface/mkii/keys-cs.xml1
-rw-r--r--tex/context/interface/mkii/keys-en.xml1
-rw-r--r--tex/context/interface/mkii/keys-fr.xml5
-rw-r--r--tex/context/interface/mkiv/context-en.xml4
-rw-r--r--tex/context/interface/mkiv/i-context.pdfbin848116 -> 848123 bytes
-rw-r--r--tex/context/interface/mkiv/i-narrow.xml12
-rw-r--r--tex/context/interface/mkiv/i-readme.pdfbin60774 -> 60776 bytes
-rw-r--r--tex/context/modules/common/s-abbreviations-logos.tex340
-rw-r--r--tex/context/modules/common/s-abbreviations-mixed.mkiv28
-rw-r--r--tex/context/modules/common/s-abbreviations-pseudocaps.mkiv30
-rw-r--r--tex/context/modules/common/s-abbreviations-smallcaps.mkiv31
-rw-r--r--tex/context/modules/common/s-abbreviations-words.mkiv28
-rw-r--r--tex/context/modules/common/s-faq-01.tex12
-rw-r--r--tex/context/modules/common/s-faq-02.tex6
-rw-r--r--tex/context/modules/mkiv/m-scite.mkiv5
-rw-r--r--tex/context/modules/mkiv/s-fonts-variable.mkiv3
-rw-r--r--tex/context/modules/mkiv/x-lmx-demo.mkiv143
-rw-r--r--tex/context/modules/mkiv/x-lmx-html.mkiv122
-rw-r--r--tex/context/sample/common/samples.tex2
-rw-r--r--tex/generic/context/luatex/luatex-fonts-merged.lua63
99 files changed, 2046 insertions, 530 deletions
diff --git a/context/data/scite/context/lexers/scite-context-lexer-bnf.lua b/context/data/scite/context/lexers/scite-context-lexer-bnf.lua
new file mode 100644
index 000000000..ce57642ba
--- /dev/null
+++ b/context/data/scite/context/lexers/scite-context-lexer-bnf.lua
@@ -0,0 +1,99 @@
+local info = {
+ version = 1.001,
+ comment = "scintilla lpeg lexer for bnf",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+}
+
+-- will replace the one in metafun
+
+local global, lpeg = _G, lpeg
+local P, R, S = lpeg.P, lpeg.R, lpeg.S
+
+local lexer = require("scite-context-lexer")
+local context = lexer.context
+local patterns = context.patterns
+
+local token = lexer.token
+local exact_match = lexer.exact_match
+
+local bnflexer = lexer.new("bnf","scite-context-lexer-bnf")
+local whitespace = bnflexer.whitespace
+
+-- from wikipedia:
+--
+-- <syntax> ::= <rule> | <rule> <syntax>
+-- <rule> ::= <opt-whitespace> "<" <rule-name> ">" <opt-whitespace> "::=" <opt-whitespace> <expression> <line-end>
+-- <opt-whitespace> ::= " " <opt-whitespace> | ""
+-- <expression> ::= <list> | <list> <opt-whitespace> "|" <opt-whitespace> <expression>
+-- <line-end> ::= <opt-whitespace> <EOL> | <line-end> <line-end>
+-- <list> ::= <term> | <term> <opt-whitespace> <list>
+-- <term> ::= <literal> | "<" <rule-name> ">"
+-- <literal> ::= '"' <text1> '"' | "'" <text2> "'"
+-- <text1> ::= "" | <character1> <text1>
+-- <text2> ::= "" | <character2> <text2>
+-- <character> ::= <letter> | <digit> | <symbol>
+-- <letter> ::= "A" | "B" | "C" | "D" | "E" | "F" | "G" | "H" | "I" | "J" | "K" | "L" | "M" | "N" | "O" | "P" | "Q" | "R" | "S" | "T" | "U" | "V" | "W" | "X" | "Y" | "Z" | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z"
+-- <digit> ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
+-- <symbol> ::= "|" | " " | "-" | "!" | "#" | "$" | "%" | "&" | "(" | ")" | "*" | "+" | "," | "-" | "." | "/" | ":" | ";" | ">" | "=" | "<" | "?" | "@" | "[" | "\" | "]" | "^" | "_" | "`" | "{" | "}" | "~"
+-- <character1> ::= <character> | "'"
+-- <character2> ::= <character> | '"'
+-- <rule-name> ::= <letter> | <rule-name> <rule-char>
+-- <rule-char> ::= <letter> | <digit> | "-"
+
+local anything = patterns.anything
+local separator = P("|")
+local left = P("<")
+local right = P(">")
+local space = S(" \t\n\r\f")
+local spaces = space^1
+local letter = R("AZ","az")
+local digit = R("09")
+local symbol = S([[| -!#$%&()*+,-./:;>=<?@[\]^_`{}~]])
+local text = (letter + digit + symbol^0)
+local name = letter * (letter + digit + P("-"))^0
+local becomes = P("::=")
+local extra = P("|")
+local single = P("'")
+local double = P('"')
+
+local t_spacing = token(whitespace,space^1)
+local t_term = token("command",left)
+ * token("text",name)
+ * token("command",right)
+local t_text = token("quote",single)
+ * token("text",text)
+ * token("quote",single)
+ + token("quote",double)
+ * token("text",text)
+ * token("quote",double)
+local t_becomes = token("operator",becomes)
+local t_extra = token("extra",extra)
+local t_rest = token("default",anything)
+
+bnflexer._rules = {
+ { "whitespace", t_spacing },
+ { "term", t_term },
+ { "text", t_text },
+ { "becomes", t_becomes },
+ { "extra", t_extra },
+ { "rest", t_rest },
+}
+
+bnflexer._tokenstyles = context.styleset
+
+bnflexer._foldpattern = left + right
+
+bnflexer._foldsymbols = {
+ _patterns = {
+ "<",
+ ">",
+ },
+ ["grouping"] = {
+ ["<"] = 1,
+ [">"] = -1,
+ },
+}
+
+return bnflexer
diff --git a/doc/context/documents/general/manuals/luatex.pdf b/doc/context/documents/general/manuals/luatex.pdf
index b9925775e..f8d7ec51a 100644
--- a/doc/context/documents/general/manuals/luatex.pdf
+++ b/doc/context/documents/general/manuals/luatex.pdf
Binary files differ
diff --git a/doc/context/documents/general/manuals/sql-mkiv.pdf b/doc/context/documents/general/manuals/sql-mkiv.pdf
index 593b27368..09e63bcc8 100644
--- a/doc/context/documents/general/manuals/sql-mkiv.pdf
+++ b/doc/context/documents/general/manuals/sql-mkiv.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-cs.pdf b/doc/context/documents/general/qrcs/setup-cs.pdf
index de2869863..1604f5f71 100644
--- a/doc/context/documents/general/qrcs/setup-cs.pdf
+++ b/doc/context/documents/general/qrcs/setup-cs.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-de.pdf b/doc/context/documents/general/qrcs/setup-de.pdf
index 9d9163c15..c5b2c365b 100644
--- a/doc/context/documents/general/qrcs/setup-de.pdf
+++ b/doc/context/documents/general/qrcs/setup-de.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-en.pdf b/doc/context/documents/general/qrcs/setup-en.pdf
index c53f0ae43..bdcfefbb0 100644
--- a/doc/context/documents/general/qrcs/setup-en.pdf
+++ b/doc/context/documents/general/qrcs/setup-en.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-fr.pdf b/doc/context/documents/general/qrcs/setup-fr.pdf
index f6ff554ee..72fdd762a 100644
--- a/doc/context/documents/general/qrcs/setup-fr.pdf
+++ b/doc/context/documents/general/qrcs/setup-fr.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-it.pdf b/doc/context/documents/general/qrcs/setup-it.pdf
index 3c3616572..36ac146e6 100644
--- a/doc/context/documents/general/qrcs/setup-it.pdf
+++ b/doc/context/documents/general/qrcs/setup-it.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf
index aa1ca8bfa..997587ef6 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-cs.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-cs.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-de.pdf b/doc/context/documents/general/qrcs/setup-mapping-de.pdf
index 63f97a235..2b83ff0c9 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-de.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-de.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-en.pdf b/doc/context/documents/general/qrcs/setup-mapping-en.pdf
index a7cc85e52..34c49e4db 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-en.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-en.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf
index 42207c1f7..bf2bbaa50 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-fr.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-fr.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-it.pdf b/doc/context/documents/general/qrcs/setup-mapping-it.pdf
index 3225e3b6f..c6d7ef61c 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-it.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-it.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf
index 385ded7ae..8a2210430 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-nl.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-nl.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf
index 5398ef863..da590962a 100644
--- a/doc/context/documents/general/qrcs/setup-mapping-ro.pdf
+++ b/doc/context/documents/general/qrcs/setup-mapping-ro.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-nl.pdf b/doc/context/documents/general/qrcs/setup-nl.pdf
index 43d452f7e..eaf020ea1 100644
--- a/doc/context/documents/general/qrcs/setup-nl.pdf
+++ b/doc/context/documents/general/qrcs/setup-nl.pdf
Binary files differ
diff --git a/doc/context/documents/general/qrcs/setup-ro.pdf b/doc/context/documents/general/qrcs/setup-ro.pdf
index 3a9bd0822..27a283406 100644
--- a/doc/context/documents/general/qrcs/setup-ro.pdf
+++ b/doc/context/documents/general/qrcs/setup-ro.pdf
Binary files differ
diff --git a/doc/context/scripts/mkiv/context.html b/doc/context/scripts/mkiv/context.html
index 0eb5f7e72..cb841477a 100644
--- a/doc/context/scripts/mkiv/context.html
+++ b/doc/context/scripts/mkiv/context.html
@@ -82,8 +82,8 @@
<tr><th/><td/><td/></tr>
<tr><th>--batchmode</th><td></td><td>run without stopping and do not show messages on the console</td></tr>
<tr><th>--nonstopmode</th><td></td><td>run without stopping</td></tr>
- <tr><th>--synctex</th><td></td><td>run with synctex enabled (optional value: zipped, unzipped, 1, -1, context)</td></tr>
- <tr><th>--syncttx</th><td></td><td>a shortcut for --synctex=context</td></tr>
+ <tr><th>--nosynctex</th><td></td><td>never initializes synctex (for production runs)</td></tr>
+ <tr><th>--synctex</th><td></td><td>run with synctex enabled (better use \setupsynctex[state=start]</td></tr>
<tr><th>--nodates</th><td></td><td>omit runtime dates in pdf file (optional value: a number (this 1970 offset time) or string "YYYY-MM-DD HH:MM")</td></tr>
<tr><th>--nocompression</th><td></td><td>forcefully turns off compression in the backend</td></tr>
<tr><th>--trailerid</th><td></td><td>alternative trailer id (or constant one)</td></tr>
diff --git a/doc/context/scripts/mkiv/context.man b/doc/context/scripts/mkiv/context.man
index e1480b4c5..39882b77e 100644
--- a/doc/context/scripts/mkiv/context.man
+++ b/doc/context/scripts/mkiv/context.man
@@ -113,11 +113,11 @@ run without stopping and do not show messages on the console
.B --nonstopmode
run without stopping
.TP
-.B --synctex
-run with synctex enabled (optional value: zipped, unzipped, 1, -1, context)
+.B --nosynctex
+never initializes synctex (for production runs)
.TP
-.B --syncttx
-a shortcut for --synctex=context
+.B --synctex
+run with synctex enabled (better use \setupsynctex[state=start]
.TP
.B --nodates
omit runtime dates in pdf file (optional value: a number (this 1970 offset time) or string "YYYY-MM-DD HH:MM")
diff --git a/doc/context/scripts/mkiv/context.xml b/doc/context/scripts/mkiv/context.xml
index e58d71f5f..9003b549a 100644
--- a/doc/context/scripts/mkiv/context.xml
+++ b/doc/context/scripts/mkiv/context.xml
@@ -128,11 +128,11 @@
<flag name="nonstopmode">
<short>run without stopping</short>
</flag>
- <flag name="synctex">
- <short>run with synctex enabled (optional value: zipped, unzipped, 1, -1, context)</short>
+ <flag name="nosynctex">
+ <short>never initializes synctex (for production runs)</short>
</flag>
- <flag name="syncttx">
- <short>a shortcut for --synctex=context</short>
+ <flag name="synctex">
+ <short>run with synctex enabled (better use \setupsynctex[state=start]</short>
</flag>
<flag name="nodates">
<short>omit runtime dates in pdf file (optional value: a number (this 1970 offset time) or string "YYYY-MM-DD HH:MM")</short>
diff --git a/doc/context/scripts/mkiv/mtx-context.html b/doc/context/scripts/mkiv/mtx-context.html
index 0eb5f7e72..cb841477a 100644
--- a/doc/context/scripts/mkiv/mtx-context.html
+++ b/doc/context/scripts/mkiv/mtx-context.html
@@ -82,8 +82,8 @@
<tr><th/><td/><td/></tr>
<tr><th>--batchmode</th><td></td><td>run without stopping and do not show messages on the console</td></tr>
<tr><th>--nonstopmode</th><td></td><td>run without stopping</td></tr>
- <tr><th>--synctex</th><td></td><td>run with synctex enabled (optional value: zipped, unzipped, 1, -1, context)</td></tr>
- <tr><th>--syncttx</th><td></td><td>a shortcut for --synctex=context</td></tr>
+ <tr><th>--nosynctex</th><td></td><td>never initializes synctex (for production runs)</td></tr>
+ <tr><th>--synctex</th><td></td><td>run with synctex enabled (better use \setupsynctex[state=start]</td></tr>
<tr><th>--nodates</th><td></td><td>omit runtime dates in pdf file (optional value: a number (this 1970 offset time) or string "YYYY-MM-DD HH:MM")</td></tr>
<tr><th>--nocompression</th><td></td><td>forcefully turns off compression in the backend</td></tr>
<tr><th>--trailerid</th><td></td><td>alternative trailer id (or constant one)</td></tr>
diff --git a/doc/context/scripts/mkiv/mtx-context.man b/doc/context/scripts/mkiv/mtx-context.man
index e1480b4c5..39882b77e 100644
--- a/doc/context/scripts/mkiv/mtx-context.man
+++ b/doc/context/scripts/mkiv/mtx-context.man
@@ -113,11 +113,11 @@ run without stopping and do not show messages on the console
.B --nonstopmode
run without stopping
.TP
-.B --synctex
-run with synctex enabled (optional value: zipped, unzipped, 1, -1, context)
+.B --nosynctex
+never initializes synctex (for production runs)
.TP
-.B --syncttx
-a shortcut for --synctex=context
+.B --synctex
+run with synctex enabled (better use \setupsynctex[state=start]
.TP
.B --nodates
omit runtime dates in pdf file (optional value: a number (this 1970 offset time) or string "YYYY-MM-DD HH:MM")
diff --git a/doc/context/scripts/mkiv/mtx-context.xml b/doc/context/scripts/mkiv/mtx-context.xml
index e58d71f5f..9003b549a 100644
--- a/doc/context/scripts/mkiv/mtx-context.xml
+++ b/doc/context/scripts/mkiv/mtx-context.xml
@@ -128,11 +128,11 @@
<flag name="nonstopmode">
<short>run without stopping</short>
</flag>
- <flag name="synctex">
- <short>run with synctex enabled (optional value: zipped, unzipped, 1, -1, context)</short>
+ <flag name="nosynctex">
+ <short>never initializes synctex (for production runs)</short>
</flag>
- <flag name="syncttx">
- <short>a shortcut for --synctex=context</short>
+ <flag name="synctex">
+ <short>run with synctex enabled (better use \setupsynctex[state=start]</short>
</flag>
<flag name="nodates">
<short>omit runtime dates in pdf file (optional value: a number (this 1970 offset time) or string "YYYY-MM-DD HH:MM")</short>
diff --git a/doc/context/sources/general/fonts/fonts/fonts-extensions.tex b/doc/context/sources/general/fonts/fonts/fonts-extensions.tex
index 8de29fcaf..ace0f771e 100644
--- a/doc/context/sources/general/fonts/fonts/fonts-extensions.tex
+++ b/doc/context/sources/general/fonts/fonts/fonts-extensions.tex
@@ -430,6 +430,9 @@ This is a rather special one. First we show a couple of definitions:
\typebuffer \getbuffer
+When you don't want a dimension to change you leave an entry empty, so
+valid entries are for instance: \type {,3,} and \type {1,,}.
+
As usual you apply such a feature as follows:
\starttyping
@@ -475,7 +478,8 @@ A special case is the following:
\typebuffer \getbuffer
-This will make the height and depth the same as the current strut height and depth:
+This will make the height and depth the same as the {\em current} strut height
+and depth:
\startbuffer
\ruledhbox{\definedfont[Serif*default,dimensions-e at 8pt]clipped}
@@ -489,6 +493,10 @@ The dimensions are (in this case) limited:
\startlinecorrection[blank] \dontleavehmode \hpack{\maincolor\inlinebuffer} \stoplinecorrection
+Another special case is \type {dimensions=mono} which will make an characters the
+fonts em|-|width. This is handy when you define font fallbacks where glyphs come
+from a non monospaced font.
+
\stopsection
\startsection[title=Unicoding]
diff --git a/doc/context/sources/general/manuals/hybrid/hybrid-grouping.tex b/doc/context/sources/general/manuals/hybrid/hybrid-grouping.tex
index 44018e746..c95186c99 100644
--- a/doc/context/sources/general/manuals/hybrid/hybrid-grouping.tex
+++ b/doc/context/sources/general/manuals/hybrid/hybrid-grouping.tex
@@ -25,7 +25,7 @@
keywords=,
author=Hans Hagen,
address=PRAGMA ADE\\Ridderstraat 27\\8061GH Hasselt NL,
- email=pragma@wxs.nl]
+ email=pragma@xs4all.nl]
%
% we use a buffer as abstract themselves are buffers and
% inside macros we loose line endings and such
diff --git a/doc/context/sources/general/manuals/hybrid/hybrid-parbuilder.tex b/doc/context/sources/general/manuals/hybrid/hybrid-parbuilder.tex
index 06519b2fb..cceac6d55 100644
--- a/doc/context/sources/general/manuals/hybrid/hybrid-parbuilder.tex
+++ b/doc/context/sources/general/manuals/hybrid/hybrid-parbuilder.tex
@@ -28,7 +28,7 @@
keywords=,
author=Hans Hagen,
address=PRAGMA ADE\\Ridderstraat 27\\8061GH Hasselt NL,
- email=pragma@wxs.nl]
+ email=pragma@xs4all.nl]
%
% we use a buffer as abstract themselves are buffers and
% inside macros we loose line endings and such
diff --git a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
index daa583cbd..517d9b6c8 100644
--- a/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
+++ b/doc/context/sources/general/manuals/luatex/luatex-nodes.tex
@@ -1872,7 +1872,7 @@ end
Some accessors are used frequently and for these we provide more efficient helpers:
-\starttabulate[|t|p|]
+\starttabulate[|l|p|]
\NC \type{getnext} \NC parsing nodelist always involves this one \NC \NR
\NC \type{getprev} \NC used less but is logical companion to \type {getnext} \NC \NR
\NC \type{getboth} \NC returns the next and prev pointer of a node \NC \NR
diff --git a/scripts/context/lua/mtx-context.lua b/scripts/context/lua/mtx-context.lua
index 1df3a5d5b..f380dc6ff 100644
--- a/scripts/context/lua/mtx-context.lua
+++ b/scripts/context/lua/mtx-context.lua
@@ -591,17 +591,6 @@ local function run_texexec(filename,a_purge,a_purgeall)
end
end
--- context mode will become the only method some day
-
--- local function check_synctex(a_synctex) -- context is intercepted elsewhere
--- return a_synctex and (
--- tonumber(a_synctex) or
--- (toboolean(a_synctex,true) and 1) or
--- (a_synctex == "zipped" and 1) or
--- (a_synctex == "unzipped" and -1)
--- ) or nil
--- end
-
function scripts.context.run(ctxdata,filename)
--
local a_nofile = getargument("nofile")
@@ -659,7 +648,6 @@ function scripts.context.run(ctxdata,filename)
local a_nonstopmode = getargument("nonstopmode")
local a_scollmode = getargument("scrollmode")
local a_once = getargument("once")
- -- local a_synctex = getargument("synctex")
local a_backend = getargument("backend")
local a_arrange = getargument("arrange")
local a_noarrange = getargument("noarrange")
@@ -711,8 +699,6 @@ function scripts.context.run(ctxdata,filename)
--
local analysis = preamble_analyze(filename)
--
- -- a_synctex = a_synctex or analysis.synctex
- --
if a_mkii or analysis.engine == 'pdftex' or analysis.engine == 'xetex' then
run_texexec(filename,a_purge,a_purgeall)
elseif plain_format(a_texformat or analysis.texformat) then
@@ -822,9 +808,9 @@ function scripts.context.run(ctxdata,filename)
--
local l_flags = {
["interaction"] = a_batchmode,
- -- ["synctex"] = check_synctex(a_synctex), -- otherwise not working
- ["no-parse-first-line"] = true, -- obsolete
- ["safer"] = a_safer, -- better use --sandbox
+ -- ["synctex"] = false, -- context has its own way
+ ["no-parse-first-line"] = true, -- obsolete
+ ["safer"] = a_safer, -- better use --sandbox
-- ["no-mktex"] = true,
-- ["file-line-error-style"] = true,
["fmt"] = formatfile,
@@ -848,7 +834,7 @@ function scripts.context.run(ctxdata,filename)
directives[#directives+1] = format("backend.date=%s",type(a_nodates) == "string" and a_nodates or " no")
end
--
- if a_trailerid then
+ if type(a_trailerid) == "string" then
directives[#directives+1] = format("backend.trailerid=%s",a_trailerid)
end
--
@@ -859,9 +845,6 @@ function scripts.context.run(ctxdata,filename)
for i=1,#synctex_runfiles do
removefile(fileaddsuffix(jobname,synctex_runfiles[i]))
end
- -- if a_synctex then
- -- directives[#directives+1] = format("system.synctex")
- -- end
--
if #directives > 0 then
c_flags.directives = concat(directives,",")
@@ -920,7 +903,6 @@ function scripts.context.run(ctxdata,filename)
-- this will go away after we update luatex
--
local syncctx = fileaddsuffix(jobname,"syncctx")
- -- if a_synctex == "context" or validfile(syncctx) then
if validfile(syncctx) then
renamefile(syncctx,fileaddsuffix(jobname,"synctex"))
end
@@ -1337,12 +1319,6 @@ function scripts.context.purge_job(jobname,all,mkiitoo,fulljobname)
deleted[#deleted+1] = purge_file(fileaddsuffix(fulljobname,temporary_suffixes[i],true))
end
end
- -- if not environment.argument("synctex") then
- -- -- special case: not deleted when --synctex is given, but what if given in preamble
- -- for i=1,#synctex_runfiles do
- -- deleted[#deleted+1] = purge_file(fileaddsuffix(filebase,synctex_runfiles[i]))
- -- end
- -- end
if all then
for i=1,#persistent_runfiles do
deleted[#deleted+1] = purge_file(fileaddsuffix(filebase,persistent_runfiles[i]))
diff --git a/scripts/context/lua/mtx-context.xml b/scripts/context/lua/mtx-context.xml
index e58d71f5f..9003b549a 100644
--- a/scripts/context/lua/mtx-context.xml
+++ b/scripts/context/lua/mtx-context.xml
@@ -128,11 +128,11 @@
<flag name="nonstopmode">
<short>run without stopping</short>
</flag>
- <flag name="synctex">
- <short>run with synctex enabled (optional value: zipped, unzipped, 1, -1, context)</short>
+ <flag name="nosynctex">
+ <short>never initializes synctex (for production runs)</short>
</flag>
- <flag name="syncttx">
- <short>a shortcut for --synctex=context</short>
+ <flag name="synctex">
+ <short>run with synctex enabled (better use \setupsynctex[state=start]</short>
</flag>
<flag name="nodates">
<short>omit runtime dates in pdf file (optional value: a number (this 1970 offset time) or string "YYYY-MM-DD HH:MM")</short>
diff --git a/scripts/context/lua/mtxrun.lua b/scripts/context/lua/mtxrun.lua
index 340d4699e..cec16c7e5 100644
--- a/scripts/context/lua/mtxrun.lua
+++ b/scripts/context/lua/mtxrun.lua
@@ -56,7 +56,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lua"] = package.loaded["l-lua"] or true
--- original size: 6090, stripped down to: 3527
+-- original size: 6230, stripped down to: 3662
if not modules then modules={} end modules ['l-lua']={
version=1.001,
@@ -180,6 +180,8 @@ end
local loaded=package.loaded
if not loaded["socket"] then loaded["socket"]=loaded["socket.core"] end
if not loaded["mime"] then loaded["mime"]=loaded["mime.core"] end
+if not socket.mime then socket.mime=package.loaded["mime"] end
+if not loaded["socket.mime"] then loaded["socket.mime"]=socket.mime end
if not loaded["socket.http"] then loaded["socket.http"]=socket.http end
if not loaded["socket.ftp"] then loaded["socket.ftp"]=socket.ftp end
if not loaded["socket.smtp"] then loaded["socket.smtp"]=socket.smtp end
@@ -1869,7 +1871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-table"] = package.loaded["l-table"] or true
--- original size: 40161, stripped down to: 23559
+-- original size: 40200, stripped down to: 23561
if not modules then modules={} end modules ['l-table']={
version=1.001,
@@ -2781,10 +2783,10 @@ function table.reversed(t)
return tt
end
end
-function table.reverse(t)
+function table.reverse(t)
if t then
local n=#t
- for i=1,floor(n/2) do
+ for i=1,floor(n/2) do
local j=n-i+1
t[i],t[j]=t[j],t[i]
end
@@ -6035,7 +6037,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 38616, stripped down to: 21710
+-- original size: 38725, stripped down to: 21726
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -6428,7 +6430,7 @@ local format_left=function(f)
end
local format_q=function()
n=n+1
- return format("(a%s and format('%%q',a%s) or '')",n,n)
+ return format("(a%s ~= nil and format('%%q',tostring(a%s)) or '')",n,n)
end
local format_Q=function()
n=n+1
@@ -6699,7 +6701,7 @@ local builder=Cs { "start",
["X"]=(prefix_any*P("X"))/format_X,
["o"]=(prefix_any*P("o"))/format_o,
["S"]=(prefix_any*P("S"))/format_S,
- ["Q"]=(prefix_any*P("Q"))/format_S,
+ ["Q"]=(prefix_any*P("Q"))/format_Q,
["N"]=(prefix_any*P("N"))/format_N,
["k"]=(prefix_sub*P("k"))/format_k,
["c"]=(prefix_any*P("c"))/format_c,
@@ -14703,7 +14705,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true
--- original size: 30075, stripped down to: 21379
+-- original size: 30650, stripped down to: 21793
if not modules then modules={} end modules ['lxml-aux']={
version=1.001,
@@ -15571,6 +15573,27 @@ function xml.totable(x,strip,flat)
return convert(x,strip,flat)
end
end
+function xml.rename(e,namespace,name,attributes)
+ if type(e)~="table" or not e.tg then
+ return
+ end
+ if type(name)=="table" then
+ attributes=name
+ name=namespace
+ namespace=""
+ elseif type(name)~="string" then
+ attributes={}
+ name=namespace
+ namespace=""
+ end
+ if type(attributes)~="table" then
+ attributes={}
+ end
+ e.ns=namespace
+ e.rn=namespace
+ e.tg=name
+ e.at=attributes
+end
end -- of closure
@@ -16383,7 +16406,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 21319, stripped down to: 11325
+-- original size: 18105, stripped down to: 11207
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -16749,12 +16772,6 @@ function resolvers.get_from_content(content,path,name)
return path,remap[used] or used
else
local name=path
- if addcasecraptoo then
- local path=files[name]
- if path then
- return path,name
- end
- end
local used=lower(name)
local path=files[used]
if path then
@@ -21217,8 +21234,8 @@ end -- of closure
-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 877239
--- stripped bytes : 320368
+-- original bytes : 874888
+-- stripped bytes : 317568
-- end library merge
diff --git a/scripts/context/stubs/mswin/mtxrun.lua b/scripts/context/stubs/mswin/mtxrun.lua
index 340d4699e..cec16c7e5 100644
--- a/scripts/context/stubs/mswin/mtxrun.lua
+++ b/scripts/context/stubs/mswin/mtxrun.lua
@@ -56,7 +56,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lua"] = package.loaded["l-lua"] or true
--- original size: 6090, stripped down to: 3527
+-- original size: 6230, stripped down to: 3662
if not modules then modules={} end modules ['l-lua']={
version=1.001,
@@ -180,6 +180,8 @@ end
local loaded=package.loaded
if not loaded["socket"] then loaded["socket"]=loaded["socket.core"] end
if not loaded["mime"] then loaded["mime"]=loaded["mime.core"] end
+if not socket.mime then socket.mime=package.loaded["mime"] end
+if not loaded["socket.mime"] then loaded["socket.mime"]=socket.mime end
if not loaded["socket.http"] then loaded["socket.http"]=socket.http end
if not loaded["socket.ftp"] then loaded["socket.ftp"]=socket.ftp end
if not loaded["socket.smtp"] then loaded["socket.smtp"]=socket.smtp end
@@ -1869,7 +1871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-table"] = package.loaded["l-table"] or true
--- original size: 40161, stripped down to: 23559
+-- original size: 40200, stripped down to: 23561
if not modules then modules={} end modules ['l-table']={
version=1.001,
@@ -2781,10 +2783,10 @@ function table.reversed(t)
return tt
end
end
-function table.reverse(t)
+function table.reverse(t)
if t then
local n=#t
- for i=1,floor(n/2) do
+ for i=1,floor(n/2) do
local j=n-i+1
t[i],t[j]=t[j],t[i]
end
@@ -6035,7 +6037,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 38616, stripped down to: 21710
+-- original size: 38725, stripped down to: 21726
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -6428,7 +6430,7 @@ local format_left=function(f)
end
local format_q=function()
n=n+1
- return format("(a%s and format('%%q',a%s) or '')",n,n)
+ return format("(a%s ~= nil and format('%%q',tostring(a%s)) or '')",n,n)
end
local format_Q=function()
n=n+1
@@ -6699,7 +6701,7 @@ local builder=Cs { "start",
["X"]=(prefix_any*P("X"))/format_X,
["o"]=(prefix_any*P("o"))/format_o,
["S"]=(prefix_any*P("S"))/format_S,
- ["Q"]=(prefix_any*P("Q"))/format_S,
+ ["Q"]=(prefix_any*P("Q"))/format_Q,
["N"]=(prefix_any*P("N"))/format_N,
["k"]=(prefix_sub*P("k"))/format_k,
["c"]=(prefix_any*P("c"))/format_c,
@@ -14703,7 +14705,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true
--- original size: 30075, stripped down to: 21379
+-- original size: 30650, stripped down to: 21793
if not modules then modules={} end modules ['lxml-aux']={
version=1.001,
@@ -15571,6 +15573,27 @@ function xml.totable(x,strip,flat)
return convert(x,strip,flat)
end
end
+function xml.rename(e,namespace,name,attributes)
+ if type(e)~="table" or not e.tg then
+ return
+ end
+ if type(name)=="table" then
+ attributes=name
+ name=namespace
+ namespace=""
+ elseif type(name)~="string" then
+ attributes={}
+ name=namespace
+ namespace=""
+ end
+ if type(attributes)~="table" then
+ attributes={}
+ end
+ e.ns=namespace
+ e.rn=namespace
+ e.tg=name
+ e.at=attributes
+end
end -- of closure
@@ -16383,7 +16406,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 21319, stripped down to: 11325
+-- original size: 18105, stripped down to: 11207
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -16749,12 +16772,6 @@ function resolvers.get_from_content(content,path,name)
return path,remap[used] or used
else
local name=path
- if addcasecraptoo then
- local path=files[name]
- if path then
- return path,name
- end
- end
local used=lower(name)
local path=files[used]
if path then
@@ -21217,8 +21234,8 @@ end -- of closure
-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 877239
--- stripped bytes : 320368
+-- original bytes : 874888
+-- stripped bytes : 317568
-- end library merge
diff --git a/scripts/context/stubs/unix/mtxrun b/scripts/context/stubs/unix/mtxrun
index 340d4699e..cec16c7e5 100644
--- a/scripts/context/stubs/unix/mtxrun
+++ b/scripts/context/stubs/unix/mtxrun
@@ -56,7 +56,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lua"] = package.loaded["l-lua"] or true
--- original size: 6090, stripped down to: 3527
+-- original size: 6230, stripped down to: 3662
if not modules then modules={} end modules ['l-lua']={
version=1.001,
@@ -180,6 +180,8 @@ end
local loaded=package.loaded
if not loaded["socket"] then loaded["socket"]=loaded["socket.core"] end
if not loaded["mime"] then loaded["mime"]=loaded["mime.core"] end
+if not socket.mime then socket.mime=package.loaded["mime"] end
+if not loaded["socket.mime"] then loaded["socket.mime"]=socket.mime end
if not loaded["socket.http"] then loaded["socket.http"]=socket.http end
if not loaded["socket.ftp"] then loaded["socket.ftp"]=socket.ftp end
if not loaded["socket.smtp"] then loaded["socket.smtp"]=socket.smtp end
@@ -1869,7 +1871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-table"] = package.loaded["l-table"] or true
--- original size: 40161, stripped down to: 23559
+-- original size: 40200, stripped down to: 23561
if not modules then modules={} end modules ['l-table']={
version=1.001,
@@ -2781,10 +2783,10 @@ function table.reversed(t)
return tt
end
end
-function table.reverse(t)
+function table.reverse(t)
if t then
local n=#t
- for i=1,floor(n/2) do
+ for i=1,floor(n/2) do
local j=n-i+1
t[i],t[j]=t[j],t[i]
end
@@ -6035,7 +6037,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 38616, stripped down to: 21710
+-- original size: 38725, stripped down to: 21726
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -6428,7 +6430,7 @@ local format_left=function(f)
end
local format_q=function()
n=n+1
- return format("(a%s and format('%%q',a%s) or '')",n,n)
+ return format("(a%s ~= nil and format('%%q',tostring(a%s)) or '')",n,n)
end
local format_Q=function()
n=n+1
@@ -6699,7 +6701,7 @@ local builder=Cs { "start",
["X"]=(prefix_any*P("X"))/format_X,
["o"]=(prefix_any*P("o"))/format_o,
["S"]=(prefix_any*P("S"))/format_S,
- ["Q"]=(prefix_any*P("Q"))/format_S,
+ ["Q"]=(prefix_any*P("Q"))/format_Q,
["N"]=(prefix_any*P("N"))/format_N,
["k"]=(prefix_sub*P("k"))/format_k,
["c"]=(prefix_any*P("c"))/format_c,
@@ -14703,7 +14705,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true
--- original size: 30075, stripped down to: 21379
+-- original size: 30650, stripped down to: 21793
if not modules then modules={} end modules ['lxml-aux']={
version=1.001,
@@ -15571,6 +15573,27 @@ function xml.totable(x,strip,flat)
return convert(x,strip,flat)
end
end
+function xml.rename(e,namespace,name,attributes)
+ if type(e)~="table" or not e.tg then
+ return
+ end
+ if type(name)=="table" then
+ attributes=name
+ name=namespace
+ namespace=""
+ elseif type(name)~="string" then
+ attributes={}
+ name=namespace
+ namespace=""
+ end
+ if type(attributes)~="table" then
+ attributes={}
+ end
+ e.ns=namespace
+ e.rn=namespace
+ e.tg=name
+ e.at=attributes
+end
end -- of closure
@@ -16383,7 +16406,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 21319, stripped down to: 11325
+-- original size: 18105, stripped down to: 11207
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -16749,12 +16772,6 @@ function resolvers.get_from_content(content,path,name)
return path,remap[used] or used
else
local name=path
- if addcasecraptoo then
- local path=files[name]
- if path then
- return path,name
- end
- end
local used=lower(name)
local path=files[used]
if path then
@@ -21217,8 +21234,8 @@ end -- of closure
-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 877239
--- stripped bytes : 320368
+-- original bytes : 874888
+-- stripped bytes : 317568
-- end library merge
diff --git a/scripts/context/stubs/win64/mtxrun.lua b/scripts/context/stubs/win64/mtxrun.lua
index 340d4699e..cec16c7e5 100644
--- a/scripts/context/stubs/win64/mtxrun.lua
+++ b/scripts/context/stubs/win64/mtxrun.lua
@@ -56,7 +56,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-lua"] = package.loaded["l-lua"] or true
--- original size: 6090, stripped down to: 3527
+-- original size: 6230, stripped down to: 3662
if not modules then modules={} end modules ['l-lua']={
version=1.001,
@@ -180,6 +180,8 @@ end
local loaded=package.loaded
if not loaded["socket"] then loaded["socket"]=loaded["socket.core"] end
if not loaded["mime"] then loaded["mime"]=loaded["mime.core"] end
+if not socket.mime then socket.mime=package.loaded["mime"] end
+if not loaded["socket.mime"] then loaded["socket.mime"]=socket.mime end
if not loaded["socket.http"] then loaded["socket.http"]=socket.http end
if not loaded["socket.ftp"] then loaded["socket.ftp"]=socket.ftp end
if not loaded["socket.smtp"] then loaded["socket.smtp"]=socket.smtp end
@@ -1869,7 +1871,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["l-table"] = package.loaded["l-table"] or true
--- original size: 40161, stripped down to: 23559
+-- original size: 40200, stripped down to: 23561
if not modules then modules={} end modules ['l-table']={
version=1.001,
@@ -2781,10 +2783,10 @@ function table.reversed(t)
return tt
end
end
-function table.reverse(t)
+function table.reverse(t)
if t then
local n=#t
- for i=1,floor(n/2) do
+ for i=1,floor(n/2) do
local j=n-i+1
t[i],t[j]=t[j],t[i]
end
@@ -6035,7 +6037,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["util-str"] = package.loaded["util-str"] or true
--- original size: 38616, stripped down to: 21710
+-- original size: 38725, stripped down to: 21726
if not modules then modules={} end modules ['util-str']={
version=1.001,
@@ -6428,7 +6430,7 @@ local format_left=function(f)
end
local format_q=function()
n=n+1
- return format("(a%s and format('%%q',a%s) or '')",n,n)
+ return format("(a%s ~= nil and format('%%q',tostring(a%s)) or '')",n,n)
end
local format_Q=function()
n=n+1
@@ -6699,7 +6701,7 @@ local builder=Cs { "start",
["X"]=(prefix_any*P("X"))/format_X,
["o"]=(prefix_any*P("o"))/format_o,
["S"]=(prefix_any*P("S"))/format_S,
- ["Q"]=(prefix_any*P("Q"))/format_S,
+ ["Q"]=(prefix_any*P("Q"))/format_Q,
["N"]=(prefix_any*P("N"))/format_N,
["k"]=(prefix_sub*P("k"))/format_k,
["c"]=(prefix_any*P("c"))/format_c,
@@ -14703,7 +14705,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["lxml-aux"] = package.loaded["lxml-aux"] or true
--- original size: 30075, stripped down to: 21379
+-- original size: 30650, stripped down to: 21793
if not modules then modules={} end modules ['lxml-aux']={
version=1.001,
@@ -15571,6 +15573,27 @@ function xml.totable(x,strip,flat)
return convert(x,strip,flat)
end
end
+function xml.rename(e,namespace,name,attributes)
+ if type(e)~="table" or not e.tg then
+ return
+ end
+ if type(name)=="table" then
+ attributes=name
+ name=namespace
+ namespace=""
+ elseif type(name)~="string" then
+ attributes={}
+ name=namespace
+ namespace=""
+ end
+ if type(attributes)~="table" then
+ attributes={}
+ end
+ e.ns=namespace
+ e.rn=namespace
+ e.tg=name
+ e.at=attributes
+end
end -- of closure
@@ -16383,7 +16406,7 @@ do -- create closure to overcome 200 locals limit
package.loaded["data-exp"] = package.loaded["data-exp"] or true
--- original size: 21319, stripped down to: 11325
+-- original size: 18105, stripped down to: 11207
if not modules then modules={} end modules ['data-exp']={
version=1.001,
@@ -16749,12 +16772,6 @@ function resolvers.get_from_content(content,path,name)
return path,remap[used] or used
else
local name=path
- if addcasecraptoo then
- local path=files[name]
- if path then
- return path,name
- end
- end
local used=lower(name)
local path=files[used]
if path then
@@ -21217,8 +21234,8 @@ end -- of closure
-- used libraries : l-lua.lua l-macro.lua l-sandbox.lua l-package.lua l-lpeg.lua l-function.lua l-string.lua l-table.lua l-io.lua l-number.lua l-set.lua l-os.lua l-file.lua l-gzip.lua l-md5.lua l-url.lua l-dir.lua l-boolean.lua l-unicode.lua l-math.lua util-str.lua util-tab.lua util-fil.lua util-sac.lua util-sto.lua util-prs.lua util-fmt.lua trac-set.lua trac-log.lua trac-inf.lua trac-pro.lua util-lua.lua util-deb.lua util-tpl.lua util-sbx.lua util-mrg.lua util-env.lua luat-env.lua lxml-tab.lua lxml-lpt.lua lxml-mis.lua lxml-aux.lua lxml-xml.lua trac-xml.lua data-ini.lua data-exp.lua data-env.lua data-tmp.lua data-met.lua data-res.lua data-pre.lua data-inp.lua data-out.lua data-fil.lua data-con.lua data-use.lua data-zip.lua data-tre.lua data-sch.lua data-lua.lua data-aux.lua data-tmf.lua data-lst.lua util-lib.lua luat-sta.lua luat-fmt.lua
-- skipped libraries : -
--- original bytes : 877239
--- stripped bytes : 320368
+-- original bytes : 874888
+-- stripped bytes : 317568
-- end library merge
diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 51b6ba7e2..58823af2c 100644
--- a/tex/context/base/mkii/cont-new.mkii
+++ b/tex/context/base/mkii/cont-new.mkii
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2018.03.10 14:52}
+\newcontextversion{2018.03.21 09:16}
%D This file is loaded at runtime, thereby providing an
%D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/mkii/context.mkii b/tex/context/base/mkii/context.mkii
index 4d00fa41e..1a4769614 100644
--- a/tex/context/base/mkii/context.mkii
+++ b/tex/context/base/mkii/context.mkii
@@ -20,7 +20,7 @@
%D your styles an modules.
\edef\contextformat {\jobname}
-\edef\contextversion{2018.03.10 14:52}
+\edef\contextversion{2018.03.21 09:16}
%D For those who want to use this:
diff --git a/tex/context/base/mkii/mult-cs.mkii b/tex/context/base/mkii/mult-cs.mkii
index d27c9a0ea..9a4cc112b 100644
--- a/tex/context/base/mkii/mult-cs.mkii
+++ b/tex/context/base/mkii/mult-cs.mkii
@@ -1077,6 +1077,7 @@
\setinterfaceconstant{preview}{nahled}
\setinterfaceconstant{previous}{predchozi}
\setinterfaceconstant{previousnumber}{predchozicislo}
+\setinterfaceconstant{print}{print}
\setinterfaceconstant{printable}{tisknutelne}
\setinterfaceconstant{process}{process}
\setinterfaceconstant{profile}{profile}
diff --git a/tex/context/base/mkii/mult-en.mkii b/tex/context/base/mkii/mult-en.mkii
index ed1c5d3a5..5c233a0c4 100644
--- a/tex/context/base/mkii/mult-en.mkii
+++ b/tex/context/base/mkii/mult-en.mkii
@@ -1077,6 +1077,7 @@
\setinterfaceconstant{preview}{preview}
\setinterfaceconstant{previous}{previous}
\setinterfaceconstant{previousnumber}{previousnumber}
+\setinterfaceconstant{print}{print}
\setinterfaceconstant{printable}{printable}
\setinterfaceconstant{process}{process}
\setinterfaceconstant{profile}{profile}
diff --git a/tex/context/base/mkii/mult-fr.mkii b/tex/context/base/mkii/mult-fr.mkii
index a744a1a53..7cf1bc684 100644
--- a/tex/context/base/mkii/mult-fr.mkii
+++ b/tex/context/base/mkii/mult-fr.mkii
@@ -185,6 +185,7 @@
\setinterfacevariable{extremestretch}{extremestretch}
\setinterfacevariable{fact}{fait}
\setinterfacevariable{february}{fevrier}
+\setinterfacevariable{field}{field}
\setinterfacevariable{figure}{figure}
\setinterfacevariable{figures}{figures}
\setinterfacevariable{file}{fichier}
@@ -849,6 +850,7 @@
\setinterfaceconstant{headerstate}{etatentete}
\setinterfaceconstant{headlabel}{etiquettetete}
\setinterfaceconstant{headnumber}{numerotete}
+\setinterfaceconstant{headseparator}{headseparator}
\setinterfaceconstant{headstyle}{styletete}
\setinterfaceconstant{height}{hauteur}
\setinterfaceconstant{hfactor}{facteurhauteur}
@@ -1075,6 +1077,7 @@
\setinterfaceconstant{preview}{previsualisation}
\setinterfaceconstant{previous}{precedent}
\setinterfaceconstant{previousnumber}{numeroprecedent}
+\setinterfaceconstant{print}{print}
\setinterfaceconstant{printable}{editable}
\setinterfaceconstant{process}{process}
\setinterfaceconstant{profile}{profile}
@@ -1160,8 +1163,10 @@
\setinterfaceconstant{sidemethod}{sidemethod}
\setinterfaceconstant{sidespaceafter}{espacelateralapres}
\setinterfaceconstant{sidespacebefore}{espacelateralavant}
+\setinterfaceconstant{sidespaceinbetween}{sidespaceinbetween}
\setinterfaceconstant{sidethreshold}{sidethreshold}
\setinterfaceconstant{sign}{signe}
+\setinterfaceconstant{simplecommand}{simplecommand}
\setinterfaceconstant{size}{dimension}
\setinterfaceconstant{slantedfeatures}{slantedfeatures}
\setinterfaceconstant{slantedfont}{slantedfont}
diff --git a/tex/context/base/mkiv/back-exp.lua b/tex/context/base/mkiv/back-exp.lua
index 84be8cff9..2d51d933d 100644
--- a/tex/context/base/mkiv/back-exp.lua
+++ b/tex/context/base/mkiv/back-exp.lua
@@ -39,7 +39,7 @@ local validstring = string.valid
local lpegmatch = lpeg.match
local utfchar, utfvalues = utf.char, utf.values
local concat, insert, remove, merge, sort = table.concat, table.insert, table.remove, table.merge, table.sort
-local sortedhash = table.sortedhash
+local sortedhash, sortedkeys = table.sortedhash, table.sortedkeys
local formatters = string.formatters
local todimen = number.todimen
local replacetemplate = utilities.templates.replace
@@ -74,6 +74,7 @@ local implement = interfaces.implement
local included = backends.included
local settings_to_array = utilities.parsers.settings_to_array
+local settings_to_hash = utilities.parsers.settings_to_hash
local setmetatableindex = table.setmetatableindex
local tasks = nodes.tasks
@@ -1790,7 +1791,35 @@ do
resolve(di,element,n,fulltag)
end
- extras.float = resolve
+ local floats = { }
+
+ function structurestags.setfloat(options,method)
+ floats[locatedtag("float")] = {
+ options = options,
+ method = method,
+ }
+ end
+
+ function extras.float(di,element,n,fulltag)
+ local hash = floats[fulltag]
+ if hash then
+ local method = hash.method
+ if not method or method == "" then
+ method = "here"
+ end
+ setattribute(di,"method",method)
+ local options = hash.options
+ if options and options ~= "" then
+ options = settings_to_hash(options)
+ options[method] = nil
+ options = concat(sortedkeys(options),",")
+ if #options > 0 then
+ setattribute(di,"options",options)
+ end
+ end
+ end
+ resolve(di,element,n,fulltag)
+ end
-- todo: internal is already hashed
@@ -3845,6 +3874,12 @@ implement {
}
implement {
+ name = "settagfloat",
+ actions = structurestags.setfloat,
+ arguments = { "string", "string" }
+}
+
+implement {
name = "settagdelimitedsymbol",
actions = structurestags.settagdelimitedsymbol,
arguments = "string"
diff --git a/tex/context/base/mkiv/back-exp.mkiv b/tex/context/base/mkiv/back-exp.mkiv
index 6803c2a92..ad5ba8371 100644
--- a/tex/context/base/mkiv/back-exp.mkiv
+++ b/tex/context/base/mkiv/back-exp.mkiv
@@ -228,6 +228,13 @@
\to \everyenableelements
\appendtoks
+ \unexpanded\def\dotagregisterfloat#1#2%
+ {\iftrialtypesetting\else
+ \clf_settagfloat{#1}{#2}\relax
+ \fi}%
+\to \everyenableelements
+
+\appendtoks
\let\specialfixedspace \explicitfixedspace
\let\specialobeyedspace \explicitobeyedspace
\let\specialstretchedspace\explicitstretchedspace
diff --git a/tex/context/base/mkiv/buff-ver.lua b/tex/context/base/mkiv/buff-ver.lua
index a39e90bda..d9178b1df 100644
--- a/tex/context/base/mkiv/buff-ver.lua
+++ b/tex/context/base/mkiv/buff-ver.lua
@@ -14,7 +14,7 @@ if not modules then modules = { } end modules ['buff-ver'] = {
-- todo: update to match context scite lexing
local type, next, rawset, rawget, setmetatable, getmetatable, tonumber = type, next, rawset, rawget, setmetatable, getmetatable, tonumber
-local format, lower, upper,match, find, sub = string.format, string.lower, string.upper, string.match, string.find, string.sub
+local lower, upper,match, find, sub = string.lower, string.upper, string.match, string.find, string.sub
local splitlines = string.splitlines
local concat = table.concat
local C, P, R, S, V, Carg, Cc, Cs = lpeg.C, lpeg.P, lpeg.R, lpeg.S, lpeg.V, lpeg.Carg, lpeg.Cc, lpeg.Cs
@@ -239,12 +239,13 @@ function visualizers.load(name)
name = lower(name)
if rawget(specifications,name) == nil then
name = lower(name)
- local texname = findfile(format("buff-imp-%s.mkiv",name))
- local luaname = findfile(format("buff-imp-%s.lua" ,name))
+ local impname = "buff-imp-"..name
+ local texname = findfile(addsuffix(impname,"mkiv"))
+ local luaname = findfile(addsuffix(impname,"lua"))
if texname == "" or luaname == "" then
-- assume a user specific file
luaname = findfile(addsuffix(name,"mkiv"))
- texname = findfile(addsuffix(name,"lua" ))
+ texname = findfile(addsuffix(name,"lua"))
end
if texname == "" or luaname == "" then
if trace_visualize then
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 79be46772..cb7607eac 100644
--- a/tex/context/base/mkiv/cont-new.mkiv
+++ b/tex/context/base/mkiv/cont-new.mkiv
@@ -11,7 +11,7 @@
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.
-\newcontextversion{2018.03.10 14:52}
+\newcontextversion{2018.03.21 09:16}
%D This file is loaded at runtime, thereby providing an excellent place for
%D hacks, patches, extensions and new features.
diff --git a/tex/context/base/mkiv/cont-run.lua b/tex/context/base/mkiv/cont-run.lua
index 73620adb6..9bd252e60 100644
--- a/tex/context/base/mkiv/cont-run.lua
+++ b/tex/context/base/mkiv/cont-run.lua
@@ -180,13 +180,36 @@ local function processjob()
local suffix = environment.suffix
local filename = environment.filename -- hm, not inputfilename !
- if arguments.synctex then
+ if arguments.nosynctex then
+ luatex.synctex.setup {
+ state = interfaces.variables.never,
+ }
+ elseif arguments.synctex then
luatex.synctex.setup {
state = interfaces.variables.start,
method = interfaces.variables.max,
}
end
+ -- -- todo: move from mtx-context to here:
+ --
+ -- local timing = arguments.timing
+ -- if type(timing) == "string" then
+ -- context.usemodule { timing }
+ -- end
+ -- local nodates = arguments.nodates
+ -- if nodates then
+ -- context.enabledirectives { "backend.date=" .. (type(nodates) == "string" and nodates or "no") }
+ -- end
+ -- local trailerid = arguments.trailerid
+ -- if type(trailerid) == "string" then
+ -- context.enabledirectives { "backend.trailerid=" .. trailerid }
+ -- end
+ -- local profile = arguments.profile
+ -- if profile then
+ -- context.enabledirectives { "system.profile=" .. tonumber(profile) or 0 }
+ -- end
+
-- -- already done in mtxrun / mtx-context, has to happen very early
--
-- if arguments.silent then
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 482a24192..f786d1d0c 100644
--- a/tex/context/base/mkiv/context.mkiv
+++ b/tex/context/base/mkiv/context.mkiv
@@ -42,7 +42,7 @@
%D has to match \type {YYYY.MM.DD HH:MM} format.
\edef\contextformat {\jobname}
-\edef\contextversion{2018.03.10 14:52}
+\edef\contextversion{2018.03.21 09:16}
\edef\contextkind {beta}
%D For those who want to use this:
diff --git a/tex/context/base/mkiv/data-exp.lua b/tex/context/base/mkiv/data-exp.lua
index 994399e36..76fd3c7b0 100644
--- a/tex/context/base/mkiv/data-exp.lua
+++ b/tex/context/base/mkiv/data-exp.lua
@@ -337,80 +337,6 @@ local addcasecraptoo = true -- experiment to let case matter a bit (still fuzzy
-- So, we assume either a lowercase name or a mixed case one but only one such case
-- as having Foo fOo foo FoO FOo etc on the system is braindead in any sane project.
--- local function scan(files,remap,spec,path,n,m,r,onlyone,tolerant)
--- local full = path == "" and spec or (spec .. path .. '/')
--- local dirs = { }
--- local nofdirs = 0
--- local pattern = tolerant and lessweird or weird
--- for name in directory(full) do
--- if not lpegmatch(pattern,name) then
--- local mode = attributes(full..name,"mode")
--- if mode == "file" then
--- n = n + 1
--- local lower = lower(name)
--- local paths = files[lower]
--- if paths then
--- if onlyone then
--- -- forget about it
--- else
--- if name ~= lower then
--- local rl = remap[lower]
--- if not rl then
--- remap[lower] = name
--- r = r + 1
--- elseif trace_globbing and rl ~= name then
--- report_globbing("confusing filename, name: %a, lower: %a, already: %a",name,lower,rl)
--- end
--- if addcasecraptoo then
--- local paths = files[name]
--- if not paths then
--- files[name] = path
--- elseif type(paths) == "string" then
--- files[name] = { paths, path }
--- else
--- paths[#paths+1] = path
--- end
--- end
--- end
--- if type(paths) == "string" then
--- files[lower] = { paths, path }
--- else
--- paths[#paths+1] = path
--- end
--- end
--- else -- probably unique anyway
--- files[lower] = path
--- if name ~= lower then
--- local rl = remap[lower]
--- if not rl then
--- remap[lower] = name
--- r = r + 1
--- elseif trace_globbing and rl ~= name then
--- report_globbing("confusing filename, name: %a, lower: %a, already: %a",name,lower,rl)
--- end
--- end
--- end
--- elseif mode == "directory" then
--- m = m + 1
--- nofdirs = nofdirs + 1
--- if path ~= "" then
--- dirs[nofdirs] = path .. "/" .. name
--- else
--- dirs[nofdirs] = name
--- end
--- end
--- end
--- end
--- if nofdirs > 0 then
--- sort(dirs)
--- for i=1,nofdirs do
--- files, remap, n, m, r = scan(files,remap,spec,dirs[i],n,m,r,onlyonce,tolerant)
--- end
--- end
--- scancache[sub(full,1,-2)] = files
--- return files, remap, n, m, r
--- end
-
local function scan(files,remap,spec,path,n,m,r,onlyone,tolerant)
local full = path == "" and spec or (spec .. path .. '/')
local dirlist = { }
@@ -585,12 +511,12 @@ function resolvers.get_from_content(content,path,name) -- or (content,name)
else
-- this one does a lookup and resolves a remapped name
local name = path
- if addcasecraptoo then
- local path = files[name]
- if path then
- return path, name
- end
- end
+-- if addcasecraptoo then
+-- local path = files[name]
+-- if path then
+-- return path, name
+-- end
+-- end
local used = lower(name)
local path = files[used]
if path then
diff --git a/tex/context/base/mkiv/font-ext.lua b/tex/context/base/mkiv/font-ext.lua
index f9db5e0d9..0def526d0 100644
--- a/tex/context/base/mkiv/font-ext.lua
+++ b/tex/context/base/mkiv/font-ext.lua
@@ -671,15 +671,17 @@ local function manipulatedimensions(tfmdata,key,value)
local width = newwidth or oldwidth or 0
local height = newheight or oldheight or 0
local depth = newdepth or olddepth or 0
- if oldwidth ~= width then
+ if oldwidth ~= width or oldheight ~= height or olddepth ~= depth then
-- Defining the tables in one step is more efficient
-- than adding fields later.
local private = getprivate(tfmdata)
+ local newslot = { "slot", 1, private } -- { "slot", 0, private }
local new_c
- local commands = {
+ local commands = oldwidth ~= width and {
{ "right", (width - oldwidth) / 2 },
- { "slot", 1, private },
- -- { "slot", 0, private },
+ newslot,
+ } or {
+ newslot,
}
if height > 0 then
if depth > 0 then
diff --git a/tex/context/base/mkiv/font-otj.lua b/tex/context/base/mkiv/font-otj.lua
index 1f9fd1ac1..9037939df 100644
--- a/tex/context/base/mkiv/font-otj.lua
+++ b/tex/context/base/mkiv/font-otj.lua
@@ -34,13 +34,20 @@ if not nodes.properties then return end
local next, rawget, tonumber = next, rawget, tonumber
local fastcopy = table.fastcopy
-local registertracker = trackers.register
+local registertracker = trackers.register
+local registerdirective = directives.register
local trace_injections = false registertracker("fonts.injections", function(v) trace_injections = v end)
local trace_marks = false registertracker("fonts.injections.marks", function(v) trace_marks = v end)
local trace_cursive = false registertracker("fonts.injections.cursive", function(v) trace_cursive = v end)
local trace_spaces = false registertracker("fonts.injections.spaces", function(v) trace_spaces = v end)
+-- local fix_cursive_marks = false
+--
+-- registerdirective("fonts.injections.fixcursivemarks", function(v)
+-- fix_cursive_marks = v
+-- end)
+
local report_injections = logs.reporter("fonts","injections")
local report_spaces = logs.reporter("fonts","spaces")
@@ -1033,6 +1040,8 @@ local function inject_everything(head,where)
local marks = { }
local nofmarks = 0
--
+ -- local applyfix = hascursives and fix_cursive_marks
+ --
-- move out
--
local function processmark(p,n,pn) -- p = basenode
@@ -1118,7 +1127,7 @@ local function inject_everything(head,where)
end
end
-- begin of temp fix --
- local base = nil -- bah, some arabic fonts have no mark anchoring
+ -- local base = nil -- bah, some arabic fonts have no mark anchoring
-- end of temp fix --
while current do
local next = getnext(current)
@@ -1126,62 +1135,62 @@ local function inject_everything(head,where)
if char then
local p = rawget(properties,current)
-- begin of temp fix --
- if hascursives then
- if not p then
- local m = fontmarks[getfont(current)]
- if m and m[char] then
- if base then
- p = { injections = { markbasenode = base } }
- nofmarks = nofmarks + 1
- marks[nofmarks] = current
- properties[current] = p
- hasmarks = true
- end
- else
- base = current
- end
- end
- end
+ -- if applyfix then
+ -- if not p then
+ -- local m = fontmarks[getfont(current)]
+ -- if m and m[char] then
+ -- if base then
+ -- p = { injections = { markbasenode = base } }
+ -- nofmarks = nofmarks + 1
+ -- marks[nofmarks] = current
+ -- properties[current] = p
+ -- hasmarks = true
+ -- end
+ -- else
+ -- base = current
+ -- end
+ -- end
+ -- end
-- end of temp fix
if p then
local i = p.injections
-- begin of temp fix --
- if hascursives then
- if not i then
- local m = fontmarks[getfont(current)]
- if m and m[char] then
- if base then
- i = { markbasenode = base }
- nofmarks = nofmarks + 1
- marks[nofmarks] = current
- p.injections = i
- hasmarks = true
- end
- else
- base = current
- end
- end
- end
+ -- if applyfix then
+ -- if not i then
+ -- local m = fontmarks[getfont(current)]
+ -- if m and m[char] then
+ -- if base then
+ -- i = { markbasenode = base }
+ -- nofmarks = nofmarks + 1
+ -- marks[nofmarks] = current
+ -- p.injections = i
+ -- hasmarks = true
+ -- end
+ -- else
+ -- base = current
+ -- end
+ -- end
+ -- end
-- end of temp fix --
if i then
local pm = i.markbasenode
-- begin of temp fix --
- if hascursives then
- if not pm then
- local m = fontmarks[getfont(current)]
- if m and m[char] then
- if base then
- pm = base
- i.markbasenode = pm
- hasmarks = true
- end
- else
- base = current
- end
- else
- base = current
- end
- end
+ -- if applyfix then
+ -- if not pm then
+ -- local m = fontmarks[getfont(current)]
+ -- if m and m[char] then
+ -- if base then
+ -- pm = base
+ -- i.markbasenode = pm
+ -- hasmarks = true
+ -- end
+ -- else
+ -- base = current
+ -- end
+ -- else
+ -- base = current
+ -- end
+ -- end
-- end of temp fix --
if pm then
nofmarks = nofmarks + 1
@@ -1326,9 +1335,11 @@ local function inject_everything(head,where)
prevdisc = nil
prevglyph = current
elseif char == false then
+ -- base = nil
prevdisc = nil
prevglyph = current
elseif id == disc_code then
+ -- base = nil
pre, post, replace, pretail, posttail, replacetail = getdisc(current,true)
local done = false
if pre then
@@ -1460,9 +1471,9 @@ local function inject_everything(head,where)
prevglyph = nil
prevdisc = current
else
+ -- base = nil
prevglyph = nil
prevdisc = nil
-base = nil
end
prev = current
current = next
diff --git a/tex/context/base/mkiv/l-lua.lua b/tex/context/base/mkiv/l-lua.lua
index b36bde422..426706f06 100644
--- a/tex/context/base/mkiv/l-lua.lua
+++ b/tex/context/base/mkiv/l-lua.lua
@@ -242,6 +242,9 @@ local loaded = package.loaded
if not loaded["socket"] then loaded["socket"] = loaded["socket.core"] end
if not loaded["mime"] then loaded["mime"] = loaded["mime.core"] end
+if not socket.mime then socket.mime = package.loaded["mime"] end
+
+if not loaded["socket.mime"] then loaded["socket.mime"] = socket.mime end
if not loaded["socket.http"] then loaded["socket.http"] = socket.http end
if not loaded["socket.ftp"] then loaded["socket.ftp"] = socket.ftp end
if not loaded["socket.smtp"] then loaded["socket.smtp"] = socket.smtp end
diff --git a/tex/context/base/mkiv/l-table.lua b/tex/context/base/mkiv/l-table.lua
index 9d7152544..269b89667 100644
--- a/tex/context/base/mkiv/l-table.lua
+++ b/tex/context/base/mkiv/l-table.lua
@@ -1225,10 +1225,10 @@ function table.reversed(t)
end
end
-function table.reverse(t)
+function table.reverse(t) -- check with 5.3 ?
if t then
local n = #t
- for i=1,floor(n/2) do
+ for i=1,floor(n/2) do -- maybe just n//2
local j = n - i + 1
t[i], t[j] = t[j], t[i]
end
diff --git a/tex/context/base/mkiv/lxml-aux.lua b/tex/context/base/mkiv/lxml-aux.lua
index 59760cb94..78cf1d6bd 100644
--- a/tex/context/base/mkiv/lxml-aux.lua
+++ b/tex/context/base/mkiv/lxml-aux.lua
@@ -1022,3 +1022,29 @@ function xml.totable(x,strip,flat)
return convert(x,strip,flat)
end
end
+
+-- namespace, name, attributes
+-- name, attributes
+-- name
+
+function xml.rename(e,namespace,name,attributes)
+ if type(e) ~= "table" or not e.tg then
+ return
+ end
+ if type(name) == "table" then
+ attributes = name
+ name = namespace
+ namespace = ""
+ elseif type(name) ~= "string" then
+ attributes = { }
+ name = namespace
+ namespace = ""
+ end
+ if type(attributes) ~= "table" then
+ attributes = { }
+ end
+ e.ns = namespace
+ e.rn = namespace
+ e.tg = name
+ e.at = attributes
+end
diff --git a/tex/context/base/mkiv/lxml-css.lua b/tex/context/base/mkiv/lxml-css.lua
index bc6297ac2..a4d15ba1f 100644
--- a/tex/context/base/mkiv/lxml-css.lua
+++ b/tex/context/base/mkiv/lxml-css.lua
@@ -12,10 +12,13 @@ local topattern, is_empty = string.topattern, string.is_empty
local P, S, C, R, Cb, Cg, Carg, Ct, Cc, Cf, Cs = lpeg.P, lpeg.S, lpeg.C, lpeg.R, lpeg.Cb, lpeg.Cg, lpeg.Carg, lpeg.Ct, lpeg.Cc, lpeg.Cf, lpeg.Cs
local lpegmatch, lpegpatterns = lpeg.match, lpeg.patterns
local sort = table.sort
+local setmetatableindex = table.setmetatableindex
xml.css = xml.css or { }
local css = xml.css
+local getid = lxml.getid
+
if not number.dimenfactors then
require("util-dim.lua")
end
@@ -26,6 +29,9 @@ local cmf = 1/dimenfactors.cm
local mmf = 1/dimenfactors.mm
local inf = 1/dimenfactors["in"]
+local whitespace = lpegpatterns.whitespace
+local skipspace = whitespace^0
+
local percentage, exheight, emwidth, pixels
if tex then
@@ -62,7 +68,7 @@ local validdimen = Cg(lpegpatterns.number,'a') * (
+ Cb('a') * Carg(1) / pixels
)
-local pattern = (validdimen * lpegpatterns.whitespace^0)^1
+local pattern = (validdimen * skipspace)^1
-- todo: default if ""
@@ -645,9 +651,7 @@ end
local P, R, S, C, Cs, Ct, Cc, Carg, lpegmatch = lpeg.P, lpeg.R, lpeg.S, lpeg.C, lpeg.Cs, lpeg.Ct, lpeg.Cc, lpeg.Carg, lpeg.match
-local whitespace = lpegpatterns.whitespace
local p_number = lpegpatterns.integer / tonumber
-local p_space = whitespace^0
local p_key = C((R("az","AZ","09") + S("_-"))^1)
local p_left = S("#.[],:()")
@@ -657,10 +661,10 @@ local p_value = C((1-P("]"))^0)
local p_unquoted = (P('"')/"") * C((1-P('"'))^0) * (P('"')/"")
+ (1-P("]"))^1
local p_element = Ct( (
- P(">") * p_space * Cc(s_element_a) +
- P("+") * p_space * Cc(s_element_b) +
- P("~") * p_space * Cc(s_element_c) +
- Cc(s_element_d)
+ P(">") * skipspace * Cc(s_element_a) +
+ P("+") * skipspace * Cc(s_element_b) +
+ P("~") * skipspace * Cc(s_element_c) +
+ Cc(s_element_d)
) * p_tag )
local p_attribute = P("[") * Ct(Cc(s_attribute) * p_key * (
P("=" ) * Cc(1) * Cs( p_unquoted)
@@ -670,16 +674,16 @@ local p_attribute = P("[") * Ct(Cc(s_attribute) * p_key * (
+ P("~=") * Cc(3) * Cs( p_unquoted)
)^0 * P("]"))
-local p_separator = p_space * P(",") * p_space
+local p_separator = skipspace * P(",") * skipspace
-local p_formula = p_space * P("(")
- * p_space
+local p_formula = skipspace * P("(")
+ * skipspace
* (
- p_number * p_space * (C("n") * p_space * (p_number + Cc(0)))^-1
+ p_number * skipspace * (C("n") * skipspace * (p_number + Cc(0)))^-1
+ P("even") * Cc(0) * Cc("n") * Cc(2)
+ P("odd") * Cc(-1) * Cc("n") * Cc(2)
)
- * p_space
+ * skipspace
* P(")")
local p_step = P(".") * Ct(Cc(s_attribute) * Cc("class") * Cc(3) * p_tag)
@@ -699,13 +703,13 @@ local p_step = P(".") * Ct(Cc(s_attribute) * Cc("class") * Cc(3) * p
+ P(":empty") * Ct(Cc(s_empty) )
+ P(":root") * Ct(Cc(s_root) )
-local p_not = P(":not") * Cc(true) * p_space * P("(") * p_space * p_step * p_space * P(")")
-local p_yes = Cc(false) * p_space * p_step
+local p_not = P(":not") * Cc(true) * skipspace * P("(") * skipspace * p_step * skipspace * P(")")
+local p_yes = Cc(false) * skipspace * p_step
-local p_stepper = Ct((p_space * (p_not+p_yes))^1)
-local p_steps = Ct((p_stepper * p_separator^0)^1) * p_space * (P(-1) + function() print("error") end)
+local p_stepper = Ct((skipspace * (p_not+p_yes))^1)
+local p_steps = Ct((p_stepper * p_separator^0)^1) * skipspace * (P(-1) + function() print("error") end)
-local cache = table.setmetatableindex(function(t,k)
+local cache = setmetatableindex(function(t,k)
local v = lpegmatch(p_steps,k) or false
t[k] = v
return v
@@ -877,10 +881,115 @@ xml.applyselector= selector
-- local s = [[ g:empty ]]
-- local s = [[ g:root ]]
+-- local c = css.applyselector(xml.convert(t),s) for i=1,#c do print(xml.tostring(c[i])) end
+
function css.applyselector(x,str)
-- the wrapping needs checking so this is a placeholder
return applyselector({ x },str)
end
--- local c = css.applyselector(xml.convert(t),s) for i=1,#c do print(xml.tostring(c[i])) end
+-- -- Some helpers to map e.g. style attributes:
+--
+-- -- string based (2.52):
+--
+-- local match = string.match
+-- local topattern = string.topattern
+--
+-- function css.stylevalue(root,name)
+-- local list = getid(root).at.style
+-- if list then
+-- local pattern = topattern(name) .. ":%s*([^;]+)"
+-- local value = match(list,pattern)
+-- if value then
+-- context(value)
+-- end
+-- end
+-- end
+--
+-- -- string based, cached (2.28 / 2.17 interfaced):
+--
+-- local match = string.match
+-- local topattern = string.topattern
+--
+-- local patterns = table.setmetatableindex(function(t,k)
+-- local v = topattern(k) .. ":%s*([^;]+)"
+-- t[k] = v
+-- return v
+-- end)
+--
+-- function css.stylevalue(root,name)
+-- local list = getid(root).at.style
+-- if list then
+-- local value = match(list,patterns[name])
+-- if value then
+-- context(value)
+-- end
+-- end
+-- end
+--
+-- -- lpeg based (4.26):
+--
+-- the lpeg variant also removes trailing spaces and accepts spaces before a colon
+
+local ctx_sprint = context.sprint
+local ctx_xmlvalue = context.xmlvalue
+
+local colon = P(":")
+local semicolon = P(";")
+local eos = P(-1)
+local somevalue = (1 - (skipspace * (semicolon + eos)))^1
+local someaction = skipspace * colon * skipspace * (somevalue/ctx_sprint)
+
+-- function css.stylevalue(root,name)
+-- local list = getid(root).at.style
+-- if list then
+-- lpegmatch(P(name * someaction + 1)^0,list)
+-- end
+-- end
+-- -- cache patterns (2.13):
+
+local patterns= setmetatableindex(function(t,k)
+ local v = P(k * someaction + 1)^0
+ t[k] = v
+ return v
+end)
+
+function css.stylevalue(root,name)
+ local list = getid(root).at.style -- hard coded style
+ if list then
+ lpegmatch(patterns[name],list)
+ end
+end
+
+local somevalue = (1 - whitespace - semicolon - eos)^1
+local someaction = skipspace * colon * (skipspace * Carg(1) * C(somevalue)/function(m,s)
+ ctx_xmlvalue(m,s,"") -- use one with two args
+end)^1
+
+local patterns= setmetatableindex(function(t,k)
+ local v = P(k * someaction + 1)^0
+ t[k] = v
+ return v
+end)
+
+function css.mappedstylevalue(root,map,name)
+ local list = getid(root).at.style -- hard coded style
+ if list then
+ lpegmatch(patterns[name],list,1,map)
+ end
+end
+
+-- -- faster interface (1.02):
+
+interfaces.implement {
+ name = "xmlstylevalue",
+ actions = css.stylevalue,
+ arguments = { "string", "string" },
+}
+
+interfaces.implement {
+ name = "xmlmappedstylevalue",
+ actions = css.mappedstylevalue,
+ arguments = { "string", "string", "string" },
+}
diff --git a/tex/context/base/mkiv/lxml-css.mkiv b/tex/context/base/mkiv/lxml-css.mkiv
index cb8735485..04000a6ca 100644
--- a/tex/context/base/mkiv/lxml-css.mkiv
+++ b/tex/context/base/mkiv/lxml-css.mkiv
@@ -13,6 +13,8 @@
\registerctxluafile{lxml-css}{}
+\unprotect
+
\def\ctxmodulecss#1{\ctxlua{moduledata.css.#1}}
% No stable interface yet.
@@ -23,7 +25,7 @@
% \else
% \edef\CellPadding{\cssgetsinglepadding{\xmlatt{#1}{cellpadding}}}
% \fi
-
+%
% \starttexdefinition cssgetsinglepadding #1
% \ctxlua {
% context((moduledata.css.padding(
@@ -36,5 +38,39 @@
% }sp
% \stoptexdefinition
-\endinput
+% \startxmlsetups html:settings
+% \xmlsetsetup{#1}{p}{html:p}
+% \stopxmlsetups
+%
+% \xmlmapvalue{ctx-before} {one} {\page BEFORE\par}
+% \xmlmapvalue{ctx-after} {two} {\par AFTER\page}
+% \xmlmapvalue{text-decoration}{underline}{U}
+% \xmlmapvalue{text-decoration}{overline} {O}
+%
+% \startxmlsetups html:p
+% \testfeatureonce{100000}{
+% \edef\foo{\xmlcssstylevalue{#1}{ctx-before}\xmlcssstylevalue{#1}{ctx-after}}
+% }
+% \page {\tttf style="\xmlatt{#1}{style}"} : \elapsedtime\ s \page
+% \xmlvalue{ctx-before}{\xmlcssstylevalue{#1}{ctx-before}}{}
+% \xmlflush{#1}
+% (\xmlcssstylevalue{#1}{text-decoration})
+% (\xmlcssmappedstylevalue{#1}{text-decoration}{text-decoration})
+% \xmlvalue{ctx-after} {\xmlcssstylevalue{#1}{ctx-after}}{}
+% \stopxmlsetups
+%
+% \startbuffer[temp]
+% <body>
+% <p style='ctx-before: one; text-decoration: underline overline; ctx-after: two;'>foo 1</p>
+% <p>foo 2</p>
+% </body>
+% \stopbuffer
+%
+% \xmlregistersetup{html:settings}
+% \xmlprocessbuffer{main}{temp}{}
+
+\let\xmlcssstylevalue \clf_xmlstylevalue
+\let\xmlcssmappedstylevalue\clf_xmlmappedstylevalue
+
+\protect \endinput
diff --git a/tex/context/base/mkiv/lxml-tex.lua b/tex/context/base/mkiv/lxml-tex.lua
index 1413159ec..f1abab9e7 100644
--- a/tex/context/base/mkiv/lxml-tex.lua
+++ b/tex/context/base/mkiv/lxml-tex.lua
@@ -17,7 +17,7 @@ local lpegmatch = lpeg.match
local P, S, C, Cc, Cs = lpeg.P, lpeg.S, lpeg.C, lpeg.Cc, lpeg.Cs
local patterns = lpeg.patterns
local setmetatableindex = table.setmetatableindex
-local formatters = string.formatters
+local formatters, strip = string.formatters, string.strip
local tex, xml = tex, xml
local lowerchars, upperchars, lettered = characters.lower, characters.upper, characters.lettered
@@ -60,6 +60,7 @@ local xmlpushmatch = xml.pushmatch
local xmlpopmatch = xml.popmatch
local xmlstring = xml.string
local xmlserializetotext = xml.serializetotext
+local xmlrename = xml.rename
local variables = interfaces and interfaces.variables or { }
@@ -2579,3 +2580,20 @@ implement {
actions = lxml.applyselectors,
arguments = "string"
}
+
+-- bonus: see x-lmx-html.mkiv
+
+function texfinalizers.xml(collected,name,setup)
+ local root = collected[1]
+ if not root then
+ return
+ end
+ if not name or name == "" then
+ report_lxml("missing name in xml finalizer")
+ return
+ end
+ xmlrename(root,name)
+ name = "lmx:" .. name
+ buffers.assign(name,strip(xmltostring(root)))
+ context.xmlprocessbuffer(name,name,setup or (name..":setup"))
+end
diff --git a/tex/context/base/mkiv/math-ini.mkiv b/tex/context/base/mkiv/math-ini.mkiv
index 4e00e200d..17d900d74 100644
--- a/tex/context/base/mkiv/math-ini.mkiv
+++ b/tex/context/base/mkiv/math-ini.mkiv
@@ -1487,8 +1487,8 @@
\attribute\mathitalicsattribute\c_math_italics_attribute
\to \everymathematics
-\setupmathematics
- [\s!italics=3] % 4 is probably better
+% \setupmathematics % done later
+% [\s!italics=3] % 4 is probably better
% looks nicer but can generate bogus csnames
%
diff --git a/tex/context/base/mkiv/meta-ini.lua b/tex/context/base/mkiv/meta-ini.lua
index 4ba0cec2d..6c4768671 100644
--- a/tex/context/base/mkiv/meta-ini.lua
+++ b/tex/context/base/mkiv/meta-ini.lua
@@ -96,7 +96,10 @@ do
-- formatters["\\times10^{%N}"](s) -- strips leading zeros too
local one = Cs((P("@")/"%%." * (R("09")^1) + P("@")/"%%" + 1)^0)
- local two = Cs((P("e")/"" * ((S("+-")^0 * R("09")^1) / function(s) return format("\\times10^{%s}",tonumber(s) or s) end) + 1)^1)
+ local two = Cs((P("e")/"" * ((S("+-")^0 * R("09")^1) / function(s)
+ -- return format("\\times10^{%s}",tonumber(s) or s)
+ return "\\times10^{" .. (tonumber(s) or s) .."}"
+ end) + 1)^1)
-- local two = Cs((P("e")/"" * ((S("+-")^0 * R("09")^1) / formatters["\\times10^{%N}"]) + 1)^1)
diff --git a/tex/context/base/mkiv/node-nut.lua b/tex/context/base/mkiv/node-nut.lua
index fe154504f..3e9a08b48 100644
--- a/tex/context/base/mkiv/node-nut.lua
+++ b/tex/context/base/mkiv/node-nut.lua
@@ -175,11 +175,11 @@ if not direct.getdirection then
end
direct.setdirection = function(n,d,c)
- if d == 0 then if c == true then setdir("-TLT") elseif c == false then setdir("+TLT") else setdir("TLT") end
- elseif d == 1 then if c == true then setdir("-TRT") elseif c == false then setdir("+TRT") else setdir("TRT") end
- elseif d == 2 then if c == true then setdir("-LTL") elseif c == false then setdir("+LTL") else setdir("LTL") end
- elseif d == 3 then if c == true then setdir("-RTT") elseif c == false then setdir("+RTT") else setdir("RTT") end
- else if c == true then setdir("-TLT") elseif c == false then setdir("+TLT") else setdir("TLT") end end
+ if d == 0 then if c == true then setdir(n,"-TLT") elseif c == false then setdir(n,"+TLT") else setdir(n,"TLT") end
+ elseif d == 1 then if c == true then setdir(n,"-TRT") elseif c == false then setdir(n,"+TRT") else setdir(n,"TRT") end
+ elseif d == 2 then if c == true then setdir(n,"-LTL") elseif c == false then setdir(n,"+LTL") else setdir(n,"LTL") end
+ elseif d == 3 then if c == true then setdir(n,"-RTT") elseif c == false then setdir(n,"+RTT") else setdir(n,"RTT") end
+ else if c == true then setdir(n,"-TLT") elseif c == false then setdir(n,"+TLT") else setdir(n,"TLT") end end
end
end
diff --git a/tex/context/base/mkiv/node-syn.lua b/tex/context/base/mkiv/node-syn.lua
index d8320e3b3..9d716c44a 100644
--- a/tex/context/base/mkiv/node-syn.lua
+++ b/tex/context/base/mkiv/node-syn.lua
@@ -204,6 +204,7 @@ luatex.synctex = synctex
local enabled = false
local paused = 0
local used = false
+local never = false
-- get rid of overhead
@@ -673,7 +674,7 @@ function synctex.registerdisabler(f)
end
function synctex.enable()
- if not enabled then
+ if not never and not enabled then
enabled = true
set_synctex_mode(3) -- we want details
if not used then
@@ -712,13 +713,13 @@ local filename = nil
function synctex.pause()
paused = paused + 1
- if paused == 1 and enabled then
+ if enabled and paused == 1 then
set_synctex_mode(0)
end
end
function synctex.resume()
- if paused == 1 and enabled then
+ if enabled and paused == 1 then
set_synctex_mode(3)
end
paused = paused - 1
@@ -735,37 +736,45 @@ statistics.register("synctex tracing",function()
end
end)
-interfaces.implement {
+local implement = interfaces.implement
+local variables = interfaces.variables
+
+function synctex.setup(t)
+ if t.state == variables.never then
+ synctex.disable() -- just in case
+ never = true
+ return
+ end
+ if t.method == variables.max then
+ collect = collect_max
+ else
+ collect = collect_min
+ end
+ if t.state == variables.start then
+ synctex.enable()
+ else
+ synctex.disable()
+ end
+end
+
+implement {
name = "synctexblockfilename",
arguments = "string",
actions = synctex.blockfilename,
}
-interfaces.implement {
+implement {
name = "synctexsetfilename",
arguments = "string",
actions = synctex.setfilename,
}
-interfaces.implement {
+implement {
name = "synctexresetfilename",
actions = synctex.resetfilename,
}
-function synctex.setup(t)
- if t.method == interfaces.variables.max then
- collect = collect_max
- else
- collect = collect_min
- end
- if t.state == interfaces.variables.start then
- synctex.enable()
- else
- synctex.disable()
- end
-end
-
-interfaces.implement {
+implement {
name = "setupsynctex",
actions = synctex.setup,
arguments = {
@@ -776,12 +785,12 @@ interfaces.implement {
},
}
-interfaces.implement {
+implement {
name = "synctexpause",
actions = synctex.pause,
}
-interfaces.implement {
+implement {
name = "synctexresume",
actions = synctex.resume,
}
diff --git a/tex/context/base/mkiv/page-ini.lua b/tex/context/base/mkiv/page-ini.lua
index 17723c421..6325e1d39 100644
--- a/tex/context/base/mkiv/page-ini.lua
+++ b/tex/context/base/mkiv/page-ini.lua
@@ -6,7 +6,7 @@ if not modules then modules = { } end modules ['page-ini'] = {
license = "see context related readme files"
}
-local tonumber, rawget, type, next = tonumber, rawget, type, next
+local tonumber, rawget, rawset, type, next = tonumber, rawget, rawset, type, next
local match = string.match
local sort, tohash, insert, remove = table.sort, table.tohash, table.insert, table.remove
local settings_to_array, settings_to_hash = utilities.parsers.settings_to_array, utilities.parsers.settings_to_hash
@@ -14,7 +14,7 @@ local settings_to_array, settings_to_hash = utilities.parsers.settings_to_array,
local texgetcount = tex.getcount
local context = context
-local ctx_testcase = commands.testcase
+local ctx_doifelse = commands.doifelse
local data = table.setmetatableindex("table")
local last = 0
@@ -69,13 +69,14 @@ function pages.mark(name,list)
end
end
-function pages.marked(name)
+local function marked(name)
local realpage = texgetcount("realpageno")
for i=last,realpage-1 do
- data[i] = nil
+ rawset(data,i,nil)
end
local pagedata = rawget(data,realpage)
- return pagedata and pagedata[name]
+ print(pagedata and pagedata[name] and true or false)
+ return pagedata and pagedata[name] and true or false
end
local function toranges(marked)
@@ -97,8 +98,6 @@ local function toranges(marked)
return list
end
-pages.toranges = toranges
-
local function allmarked(list)
if list then
local collected = pages.collected
@@ -139,6 +138,8 @@ local function allmarked(list)
end
end
+pages.marked = marked
+pages.toranges = toranges
pages.allmarked = allmarked
-- An alternative is to use an attribute and identify the state by parsing the node
@@ -170,7 +171,7 @@ interfaces.implement {
interfaces.implement {
name = "doifelsemarkedpage",
arguments = "string",
- actions = { marked, ctx_testcase }
+ actions = { marked, ctx_doifelse }
}
interfaces.implement {
diff --git a/tex/context/base/mkiv/page-inj.mkvi b/tex/context/base/mkiv/page-inj.mkvi
index e03569f23..cabd07bac 100644
--- a/tex/context/base/mkiv/page-inj.mkvi
+++ b/tex/context/base/mkiv/page-inj.mkvi
@@ -32,6 +32,11 @@
\let\page_boxes_flush_before\clf_flushpageinjectionsbefore
\let\page_boxes_flush_after \clf_flushpageinjectionsafter
+\def\page_injections_flush_indeed
+ {\scrn_canvas_synchronize_set{\pageinjectionparameter\c!width}{\pageinjectionparameter\c!height}%
+ \invokepagehandler\v!normal{\inheritedpageinjectionframed{\texsetup\p_page_injectionalternative_rederingsetup}}%
+ \scrn_canvas_synchronize_reset}
+
\def\page_injections_flush_saved#name#parameters%
{\begingroup
\edef\currentpageinjection{#name}%
@@ -39,7 +44,7 @@
\edef\currentpageinjectionalternative {\pageinjectionparameter \c!alternative }%
\edef\p_page_injectionalternative_rederingsetup{\pageinjectionalternativeparameter\c!renderingsetup}%
\page_injections_nextpage
- \invokepagehandler\v!normal{\inheritedpageinjectionframed{\texsetup\p_page_injectionalternative_rederingsetup}}%
+ \page_injections_flush_indeed
\endgroup}
\unexpanded\def\pageinjection
@@ -104,12 +109,23 @@
\page_injections_place
\endgroup}
+% \def\page_injections_place
+% {\edef\currentpageinjectionalternative {\pageinjectionparameter \c!alternative }%
+% \edef\p_page_injectionalternative_rederingsetup{\pageinjectionalternativeparameter\c!renderingsetup}%
+% \page_injections_nextpage
+% \ifx\currentpageinjectionalternative\v!none \else % increment counter but don’t generate output
+% \invokepagehandler\v!normal{\inheritedpageinjectionframed{\texsetup\p_page_injectionalternative_rederingsetup}}%
+% \fi}
+
\def\page_injections_place
{\edef\currentpageinjectionalternative {\pageinjectionparameter \c!alternative }%
\edef\p_page_injectionalternative_rederingsetup{\pageinjectionalternativeparameter\c!renderingsetup}%
\page_injections_nextpage
\ifx\currentpageinjectionalternative\v!none \else % increment counter but don’t generate output
- \invokepagehandler\v!normal{\inheritedpageinjectionframed{\texsetup\p_page_injectionalternative_rederingsetup}}%
+ \forgetparindent
+ \dontcomplain
+ \setconstant\shipoutfinalizemethod\zerocount
+ \page_injections_flush_indeed
\fi}
\def\page_injections_nextpage
diff --git a/tex/context/base/mkiv/page-pcl.mkiv b/tex/context/base/mkiv/page-pcl.mkiv
index 086cf69b0..53d9f781d 100644
--- a/tex/context/base/mkiv/page-pcl.mkiv
+++ b/tex/context/base/mkiv/page-pcl.mkiv
@@ -602,43 +602,25 @@
%D \unknown
\unexpanded\def\page_col_command_routine
- {\ifconditional\c_page_sides_short
- \page_sides_output_routine_yes_column
- \else
- \page_sides_output_routine_nop_column
- \fi}
+ {\page_sides_output_routine}
-\let\page_sides_output_routine_nop_column\page_sides_output_routine_nop
-
-\def\page_sides_output_routine_yes_column % this might become the main one too
- {\unvbox\normalpagebox % bah, and the discards?
- %\page_col_column
- \column % \page
- %
- % % do we really need the next code
- %
- % \setbox\b_page_sides_bottom\lastbox
- % \ifdim\wd\b_page_sides_bottom>\d_page_sides_hsize
- % \penalty-201 % hm, i really need to write this from scatch
- % \box\b_page_sides_bottom
- % \else\ifvoid\b_page_sides_bottom
- % \else
- % \page_sides_restore_left_indent
- % \ifdim\wd\b_page_sides_bottom<\d_page_sides_hsize
- % \parskip\zeropoint
- % %\noindent
- % \ifinner\else
- % \vadjust{\penalty\minusone}%
- % \fi
- % \global\advance\d_page_sides_hsize -\wd\b_page_sides_bottom
- % \global\divide\d_page_sides_hsize \plustwo
- % \hskip\d_page_sides_hsize % \kern
- % \fi
- % \box\b_page_sides_bottom
- % \page_sides_restore_output_penalty
- % \fi\fi
- % why was this \global\holdinginserts\zerocount
- \global\setfalse\c_page_sides_short}
+% % not:
+%
+% \unexpanded\def\page_col_command_routine
+% {\ifconditional\c_page_sides_short
+% \page_sides_output_routine_yes_column
+% \else
+% \page_sides_output_routine_nop_column
+% \fi}
+%
+% \let\page_sides_output_routine_nop_column\page_sides_output_routine
+%
+% \def\page_sides_output_routine_yes_column % this might become the main one too
+% {\unvbox\normalpagebox % bah, and the discards?
+% %\page_col_column
+% \column % \page
+% % why was this \global\holdinginserts\zerocount
+% \global\setfalse\c_page_sides_short}
\let\page_col_command_flush_all_floats\relax
diff --git a/tex/context/base/mkiv/page-set.mkiv b/tex/context/base/mkiv/page-set.mkiv
index fb6f607a1..3579e3b48 100644
--- a/tex/context/base/mkiv/page-set.mkiv
+++ b/tex/context/base/mkiv/page-set.mkiv
@@ -1198,12 +1198,12 @@
{\OTRSETcheckprefered
\enoughcolumncellsfalse
\donefalse
- \dostepwiserecurse{#1}{#2}{#3#4}
+ \dostepwiserecurse{#1}{#2}{#31}
{\ifdone
\exitloop
\else
#4=\recurselevel
- \dostepwiserecurse{#5}{#6}{#7#8}
+ \dostepwiserecurse{#5}{#6}{#71}
{\ifdone
\exitloop
\else
diff --git a/tex/context/base/mkiv/publ-imp-apa.mkvi b/tex/context/base/mkiv/publ-imp-apa.mkvi
index 38841b16b..cd78a8799 100644
--- a/tex/context/base/mkiv/publ-imp-apa.mkvi
+++ b/tex/context/base/mkiv/publ-imp-apa.mkvi
@@ -575,7 +575,7 @@
apa:Editors=Éditeurs,
apa:Volume=Volume,
apa:Volumes=Volumes,
- apa:nd={s.d.} % sans date
+ apa:nd={s.d.}, % sans date
apa:supplement=Supplément,
apa:MotionPicture={Film cinématographique},
apa:Writer=Scénariste,
diff --git a/tex/context/base/mkiv/scrn-fld.mkvi b/tex/context/base/mkiv/scrn-fld.mkvi
index 38c4e1461..dec334209 100644
--- a/tex/context/base/mkiv/scrn-fld.mkvi
+++ b/tex/context/base/mkiv/scrn-fld.mkvi
@@ -47,7 +47,7 @@
%D A definition can refer to this category:
%D
%D \starttyping
-%D \definefieldbody [email] [type=line,category=all-email,default=pragma@wxs.nl]
+%D \definefieldbody [email] [type=line,category=all-email,default=pragma@xs4all.nl]
%D \stoptyping
%D
%D A copy of a field is made as follows:
diff --git a/tex/context/base/mkiv/scrn-pag.mkvi b/tex/context/base/mkiv/scrn-pag.mkvi
index d96d8d3c1..7695443ad 100644
--- a/tex/context/base/mkiv/scrn-pag.mkvi
+++ b/tex/context/base/mkiv/scrn-pag.mkvi
@@ -203,11 +203,16 @@
paperheight \printpaperheight
\relax}
-\def\scrn_canvas_synchronize_simple_indeed
+\def\scrn_canvas_synchronize_set#1#2%
{\clf_setupcanvas
- paperwidth \printpaperwidth
- paperheight \printpaperheight
- \relax
+ paperwidth \dimexpr#1\relax
+ paperheight \dimexpr#2\relax
+ \relax}
+
+\let\scrn_canvas_synchronize_reset\scrn_canvas_synchronize_only
+
+\def\scrn_canvas_synchronize_simple_indeed
+ {\scrn_canvas_synchronize_only
%\global\let\scrn_canvas_synchronize_simple \relax
\global\let\scrn_canvas_synchronize_complex\relax}
diff --git a/tex/context/base/mkiv/spac-hor.mkiv b/tex/context/base/mkiv/spac-hor.mkiv
index 176b52e1f..ce747a202 100644
--- a/tex/context/base/mkiv/spac-hor.mkiv
+++ b/tex/context/base/mkiv/spac-hor.mkiv
@@ -680,6 +680,7 @@
\global \s_spac_narrower_middle \zeropoint
\global \s_spac_narrower_right \zeropoint\relax}
\installnarrowermethod \v!none {}
+\installnarrowermethod \v!reverse {} % never seen
\unexpanded\def\spac_narrower_start#1%
{\begingroup
@@ -693,19 +694,45 @@
\spac_narrower_start_apply{\narrowerparameter\v!default}%
\fi}
+\newskip\s_spac_narrower_left_last
+\newskip\s_spac_narrower_right_last
+\newconditional\s_spac_narrower_last_swap
+
\def\spac_narrower_start_apply#1%
{\narrowerparameter\c!before
\global\s_spac_narrower_left \zeropoint
\global\s_spac_narrower_right \zeropoint
\global\s_spac_narrower_middle\zeropoint
- \normalexpanded{\processcommalistwithparameters[#1]}\spac_narrower_initialize
- \advance\leftskip \dimexpr\s_spac_narrower_left +\s_spac_narrower_middle\relax
- \advance\rightskip\dimexpr\s_spac_narrower_right+\s_spac_narrower_middle\relax
+ \edef\askednarrower{#1}
+ \ifx\askednarrower\v!reverse
+ \ifconditional\s_spac_narrower_last_swap
+ \leftskip \s_spac_narrower_right_last
+ \rightskip\s_spac_narrower_left_last
+ \setfalse\s_spac_narrower_last_swap
+ \else
+ \leftskip \s_spac_narrower_left_last
+ \rightskip\s_spac_narrower_right_last
+ \settrue\s_spac_narrower_last_swap
+ \fi
+ \else
+ \normalexpanded{\processcommalistwithparameters[\askednarrower]}\spac_narrower_initialize
+ \advance\leftskip \dimexpr\s_spac_narrower_left +\s_spac_narrower_middle\relax
+ \advance\rightskip\dimexpr\s_spac_narrower_right+\s_spac_narrower_middle\relax
+ \fi
\seteffectivehsize}
\unexpanded\def\spac_narrower_stop
{\narrowerparameter\c!after
- \endgroup}
+ \normalexpanded{%
+ \endgroup
+ \s_spac_narrower_left_last \the\leftskip \relax
+ \s_spac_narrower_right_last\the\rightskip\relax
+ \ifconditional\s_spac_narrower_last_swap
+ \setfalse\s_spac_narrower_last_swap
+ \else
+ \settrue\s_spac_narrower_last_swap
+ \fi
+ }}
\unexpanded\def\startnarrower
{\dosingleempty\spac_narrower_start_basic}
diff --git a/tex/context/base/mkiv/spac-ver.mkiv b/tex/context/base/mkiv/spac-ver.mkiv
index a1bc0559f..b71e28219 100644
--- a/tex/context/base/mkiv/spac-ver.mkiv
+++ b/tex/context/base/mkiv/spac-ver.mkiv
@@ -2568,6 +2568,22 @@
\newcount\c_spac_vspacing_ignore_parskip
+% \setupwhitespace[line]
+% \setuphead[subject][after={\blank[packed]},style=\bfb]
+% \subject{foo}
+% test \par
+% test \par
+% \blank[packed] % \ignoreparskip
+% test \par
+% test \par
+% \ignoreparskip
+% test \par
+% test \par
+% \setuphead[subject][after={\blank[nowhite]},style=\bfb]
+% \subject{foo}
+% test \par
+% test \par
+
\unexpanded\def\ignoreparskip{\c_spac_vspacing_ignore_parskip\plusone}
\protect \endinput
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
index 319680a90..4bb82edcf 100644
--- a/tex/context/base/mkiv/status-files.pdf
+++ b/tex/context/base/mkiv/status-files.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index 767fa89ad..8deebb2ec 100644
--- a/tex/context/base/mkiv/status-lua.pdf
+++ b/tex/context/base/mkiv/status-lua.pdf
Binary files differ
diff --git a/tex/context/base/mkiv/strc-flt.mkvi b/tex/context/base/mkiv/strc-flt.mkvi
index 4c10e49e9..69881037e 100644
--- a/tex/context/base/mkiv/strc-flt.mkvi
+++ b/tex/context/base/mkiv/strc-flt.mkvi
@@ -486,10 +486,15 @@
\let\m_strc_floats_saved_userdata\empty
\let\currentfloatcaption\currentfloat}
+\let\askedfloatmethod \empty
+\let\askedfloatoptions\empty
+
\def\strc_floats_reset_variables
{\global\emptyfloatcaptionfalse
\global\nofloatcaptionfalse
- \global\nofloatnumberfalse}
+ \global\nofloatnumberfalse
+ \global\let\askedfloatmethod \empty
+ \global\let\askedfloatoptions\empty}
% place
@@ -520,22 +525,14 @@
\setupfloat[\c!spacebefore=\v!none,\c!spaceafter=\v!none]%
\to \c_floats_every_table_float
-\appendtoks
- \showmessage\m!floatblocks{14}\v!here
-\to \everyinitializeexport
-
-\def\strc_floats_set_checked_location#location%
- {\edef\floatlocation{#location}%
- \ifexporting \ifx\floatlocation\v!here \else
- \showmessage\m!floatblocks{15}{\floatlocation,\v!here}%
- \let\floatlocation\v!here
- \fi \fi}
+\ifdefined\dotagregisterfloat \else \let\dotagregisterfloat\gobbletwoarguments \fi
\def\strc_floats_place_indeed[#location][#reference]#caption%
{\strc_floats_reset_variables
- \strc_floats_set_checked_location{#location}%
+ \xdef\askedfloatoptions{#location}%
+ \edef\floatlocation{#location}%
\ifx\floatlocation\empty
- \edef\floatlocation{\floatparameter\c!default}% beware of a clash between alignment locations
+ \edef\floatlocation{\floatparameter\c!default}% beware of a clash between alignment locations
\fi
\ifintable
\the\c_floats_every_table_float
@@ -585,7 +582,7 @@
\setexpandedfloatparameter\c!bottomoffset{\floatcaptionparameter\c!bottomoffset}%
\setexpandedfloatparameter\c!freeregion {\floatcaptionparameter\c!freeregion}%
\def\m_strc_floats_saved_userdata{#2}%
- \strc_floats_set_checked_location{\floatcaptionparameter\c!location}%
+ \edef\floatlocation{\floatcaptionparameter\c!location}%
\setfloatcaptionparameter\c!location{\savedfloatlocation}% not expanded
\ifx\floatlocation\empty
\edef\floatlocation{\floatparameter\c!default}%
@@ -724,6 +721,7 @@
\strc_floats_check_extra_actions
\strc_floats_analyze_variables_two
\strc_floats_place_packaged_boxes
+ \dotagregisterfloat\askedfloatoptions\askedfloatmethod
\dostoptagged % tricky .... needs checking
% we need to carry over the par because of side floats
\global\d_page_sides_downshift \zeropoint
@@ -1082,11 +1080,6 @@
\unexpanded\def\installfloatmovement#1#2{\setvalue{\??floatmovement#1}{#2}}
-% \def\strc_floats_move_down#setting%
-% {\csname\??floatmovement
-% \ifcsname\??floatmovement#setting\endcsname#setting\fi
-% \endcsname}
-
\def\strc_floats_move_down#setting%
{\begincsname\??floatmovement#setting\endcsname}
@@ -1145,7 +1138,6 @@
% already be set at this point
\processcommacommand[\floatlocation]\strc_floats_check_extra_actions_step
\ifx\extrafloatlocation\empty \else
- % maybe not when exporting
\edef\floatlocation{\extrafloatlocation,\floatlocation}%
\setfloatmethodvariables\floatlocation
\fi}}
@@ -1267,7 +1259,7 @@
\global\floatwidth \wd\floatbox
\global\floatheight \ht\floatbox % forget about the depth
\global\floattextwidth\dimexpr\hsize-\floatwidth-\rootfloatparameter\c!margin\relax
- \strc_floats_set_checked_location\floatlocationmethod% to be sure .. why
+ \edef\floatlocation{\floatlocationmethod}% to be sure .. why
\doifelseinset\v!tall\floatlocationmethod
{\floattextheight\dimexpr\pagegoal-\pagetotal-\bigskipamount\relax % ugly, this bigskip
\ifdim\floattextheight>\textheight
@@ -2261,6 +2253,11 @@
\ifx\forcedfloatmethod\empty \else
\let\floatmethod\forcedfloatmethod
\fi
+\let\askedfloatmethod\floatmethod
+\ifexporting \ifx\askedfloatmethod\v!here \else
+ \showmessage\m!floatblocks{15}{\askedfloatmethod,\v!here}%
+ \let\floatlocation\v!here
+\fi \fi
% [] will go
\edef\floatlocationmethod{\floatmethod,\floatlocation}%
\csname\??floatmethods\currentoutputroutine:\floatmethod\endcsname
diff --git a/tex/context/base/mkiv/typo-duc.lua b/tex/context/base/mkiv/typo-duc.lua
index 3449b6904..520740190 100644
--- a/tex/context/base/mkiv/typo-duc.lua
+++ b/tex/context/base/mkiv/typo-duc.lua
@@ -570,7 +570,6 @@ local function resolve_weak(list,size,start,limit,orderbefore,orderafter)
-- W4: make separators number
-- if list.es or list.cs then
-- skip
--- if false then
if false then
for i=start+1,limit-1 do
local entry = list[i]
@@ -1087,9 +1086,7 @@ local function process(head,direction,only_one)
local list, size = build_list(head)
local baselevel, pardir, dirfound = get_baselevel(head,list,size,direction) -- we always have an inline dir node in context
if trace_details then
- if not dirfound then
- report_directions("no initial direction found, gambling")
- end
+ report_directions("analyze: direction %a, baselevel %a",dirfound and pardir or "unknown",baselevel or 1)
report_directions("before : %s",show_list(list,size,"original"))
end
resolve_explicit(list,size,baselevel)
diff --git a/tex/context/base/mkiv/util-sha.lua b/tex/context/base/mkiv/util-sha.lua
new file mode 100644
index 000000000..3e786a834
--- /dev/null
+++ b/tex/context/base/mkiv/util-sha.lua
@@ -0,0 +1,326 @@
+if not modules then modules = { } end modules ['util-sha'] = {
+ version = 1.001,
+ comment = "companion to luat-lib.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files",
+ comment2 = "derived from Wikipedia and Lua support websites",
+ comment3 = "due to bit operators this code only works in lua(tex) 5.3",
+}
+
+-- This doesn't work in luajittex ... maybe some day it will have bit operators too.
+-- I'm not really in the mood for making this module aware (by compiling the
+-- function depending on the engine that I use but I probably won't use luajittex in
+-- cases where I need this.)
+--
+-- Hm, it actually makes a case for the macro subsystem but we then also need to
+-- make an unpack/pack replacement ... too boring.
+--
+-- This code is derived from:
+--
+-- http://lua-users.org/wiki/SecureHashAlgorithmBw
+--
+-- which in turn was a 5.3 variant of a 5.2 implementation by Roberto but it also
+-- looks like a more or less direct translation of:
+--
+-- https://en.wikipedia.org/wiki/SHA-2
+--
+-- I optimized the code bit and added 512 support. For an explanation see the
+-- mentioned websites. We don't do chunks here as we only need it for hashing
+-- relatively small blobs (and even an image is not that large).
+--
+-- On short strings 256 seems faster than 512 while on a megabyte blob 512 wins
+-- from 256 (64 bit internals).
+
+local packstring, unpackstring = string.pack, string.unpack
+local unpack, setmetatable = unpack, setmetatable
+
+local constants256 = {
+ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
+ 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
+ 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
+ 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
+ 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
+ 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
+ 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
+ 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,
+}
+
+local constants512 = {
+ 0x428a2f98d728ae22, 0x7137449123ef65cd, 0xb5c0fbcfec4d3b2f, 0xe9b5dba58189dbbc, 0x3956c25bf348b538,
+ 0x59f111f1b605d019, 0x923f82a4af194f9b, 0xab1c5ed5da6d8118, 0xd807aa98a3030242, 0x12835b0145706fbe,
+ 0x243185be4ee4b28c, 0x550c7dc3d5ffb4e2, 0x72be5d74f27b896f, 0x80deb1fe3b1696b1, 0x9bdc06a725c71235,
+ 0xc19bf174cf692694, 0xe49b69c19ef14ad2, 0xefbe4786384f25e3, 0x0fc19dc68b8cd5b5, 0x240ca1cc77ac9c65,
+ 0x2de92c6f592b0275, 0x4a7484aa6ea6e483, 0x5cb0a9dcbd41fbd4, 0x76f988da831153b5, 0x983e5152ee66dfab,
+ 0xa831c66d2db43210, 0xb00327c898fb213f, 0xbf597fc7beef0ee4, 0xc6e00bf33da88fc2, 0xd5a79147930aa725,
+ 0x06ca6351e003826f, 0x142929670a0e6e70, 0x27b70a8546d22ffc, 0x2e1b21385c26c926, 0x4d2c6dfc5ac42aed,
+ 0x53380d139d95b3df, 0x650a73548baf63de, 0x766a0abb3c77b2a8, 0x81c2c92e47edaee6, 0x92722c851482353b,
+ 0xa2bfe8a14cf10364, 0xa81a664bbc423001, 0xc24b8b70d0f89791, 0xc76c51a30654be30, 0xd192e819d6ef5218,
+ 0xd69906245565a910, 0xf40e35855771202a, 0x106aa07032bbd1b8, 0x19a4c116b8d2d0c8, 0x1e376c085141ab53,
+ 0x2748774cdf8eeb99, 0x34b0bcb5e19b48a8, 0x391c0cb3c5c95a63, 0x4ed8aa4ae3418acb, 0x5b9cca4f7763e373,
+ 0x682e6ff3d6b2b8a3, 0x748f82ee5defb2fc, 0x78a5636f43172f60, 0x84c87814a1f0ab72, 0x8cc702081a6439ec,
+ 0x90befffa23631e28, 0xa4506cebde82bde9, 0xbef9a3f7b2c67915, 0xc67178f2e372532b, 0xca273eceea26619c,
+ 0xd186b8c721c0c207, 0xeada7dd6cde0eb1e, 0xf57d4f7fee6ed178, 0x06f067aa72176fba, 0x0a637dc5a2c898a6,
+ 0x113f9804bef90dae, 0x1b710b35131c471b, 0x28db77f523047d84, 0x32caab7b40c72493, 0x3c9ebe0a15c9bebc,
+ 0x431d67c49c100d4c, 0x4cc5d4becb3e42b6, 0x597f299cfc657e2a, 0x5fcb6fab3ad6faec, 0x6c44198c4a475817,
+}
+
+-- Not really needed, but more in tune with md5. In fact, as we use the mtxlib
+-- helpers I might as well assume more.
+
+local tohex, toHEX
+
+if lpeg then local lpegpatterns = lpeg.patterns if lpegpatterns then
+
+ local lpegmatch = lpeg.match
+ local bytestohex = lpegpatterns.bytestohex
+ local bytestoHEX = lpegpatterns.bytestoHEX
+
+ tohex = function(s) return lpegmatch(bytestohex,s) end
+ toHEX = function(s) return lpegmatch(bytestoHEX,s) end
+
+end end
+
+if not tohex then
+
+ local format, byte, gsub = string.format, string.byte, string.gsub
+
+ tohex = function(s) return (gsub(s,".",function(c) return format("%02X",byte(c)) end)) end
+ toHEX = function(s) return (gsub(s,".",function(c) return format("%02X",byte(c)) end)) end
+
+end
+
+local prepare = { }
+
+if utilities and utilities.strings then
+
+ local r = utilities.strings.newrepeater("\0")
+
+ prepare[256] = function(str,len)
+ return str .. "\128" .. r[-(1 + 8 + len) % 64] .. packstring(">I8", 8 * len)
+ end
+ prepare[512] = function(str,len)
+ return str .. "\128" .. r[-(1 + 16 + len) % 128] .. packstring(">I16", 8 * len)
+ end
+
+else
+
+ local rep = string.rep
+
+ prepare[256] = function(str,len)
+ return str .. "\128" .. rep("\0",-(1 + 8 + len) % 64) .. packstring(">I8", 8 * len)
+ end
+ prepare[512] = function(str,len)
+ return str .. "\128" .. rep("\0",-(1 + 16 + len) % 128) .. packstring(">I16", 8 * len)
+ end
+
+end
+
+prepare[224] = prepare[256]
+prepare[384] = prepare[512]
+
+local initialize = {
+ [224] = function(hash)
+ hash[1] = 0xc1059ed8 hash[2] = 0x367cd507
+ hash[3] = 0x3070dd17 hash[4] = 0xf70e5939
+ hash[5] = 0xffc00b31 hash[6] = 0x68581511
+ hash[7] = 0x64f98fa7 hash[8] = 0xbefa4fa4
+ return hash
+ end,
+ [256] = function(hash)
+ hash[1] = 0x6a09e667 hash[2] = 0xbb67ae85
+ hash[3] = 0x3c6ef372 hash[4] = 0xa54ff53a
+ hash[5] = 0x510e527f hash[6] = 0x9b05688c
+ hash[7] = 0x1f83d9ab hash[8] = 0x5be0cd19
+ return hash
+ end,
+ [384] = function(hash)
+ hash[1] = 0xcbbb9d5dc1059ed8 hash[2] = 0x629a292a367cd507
+ hash[3] = 0x9159015a3070dd17 hash[4] = 0x152fecd8f70e5939
+ hash[5] = 0x67332667ffc00b31 hash[6] = 0x8eb44a8768581511
+ hash[7] = 0xdb0c2e0d64f98fa7 hash[8] = 0x47b5481dbefa4fa4
+ return hash
+ end,
+ [512] = function(hash)
+ hash[1] = 0x6a09e667f3bcc908 hash[2] = 0xbb67ae8584caa73b
+ hash[3] = 0x3c6ef372fe94f82b hash[4] = 0xa54ff53a5f1d36f1
+ hash[5] = 0x510e527fade682d1 hash[6] = 0x9b05688c2b3e6c1f
+ hash[7] = 0x1f83d9abfb41bd6b hash[8] = 0x5be0cd19137e2179
+ return hash
+ end,
+}
+
+local digest = { }
+local list = { } -- some 5% faster
+
+digest[256] = function(str,i,hash)
+
+ for i=1,#str,64 do
+
+ -- local w = { unpackstring(">I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4",str,i) }
+
+ list[ 1], list[ 2], list[ 3], list[ 4], list[ 5], list[ 6], list[ 7], list[ 8],
+ list[ 9], list[10], list[11], list[12], list[13], list[14], list[15], list[16] =
+ unpackstring(">I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4",str,i)
+
+ for j=17,64 do
+ local v0 = list[j - 15]
+ local s0 = ((v0 >> 7) | (v0 << 25)) -- rrotate(v, 7)
+ ~ ((v0 >> 18) | (v0 << 14)) -- rrotate(v, 18)
+ ~ (v0 >> 3)
+ local v1 = list[j - 2]
+ local s1 = ((v1 >> 17) | (v1 << 15)) -- rrotate(v, 17)
+ ~ ((v1 >> 19) | (v1 << 13)) -- rrotate(v, 19)
+ ~ (v1 >> 10)
+ list[j] = (list[j - 16] + s0 + list[j - 7] + s1)
+ & 0xffffffff
+ end
+
+ local a, b, c, d, e, f, g, h = -- unpack(hash)
+ hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7], hash[8]
+
+ for i=1,64 do
+ local s0 = ((a >> 2) | (a << 30)) -- rrotate(a, 2)
+ ~ ((a >> 13) | (a << 19)) -- rrotate(a, 13)
+ ~ ((a >> 22) | (a << 10)) -- rrotate(a, 22)
+ local maj = (a & b) ~ (a & c) ~ (b & c)
+ local t2 = s0 + maj
+ local s1 = ((e >> 6) | (e << 26)) -- rrotate(e, 6)
+ ~ ((e >> 11) | (e << 21)) -- rrotate(e, 11)
+ ~ ((e >> 25) | (e << 7)) -- rrotate(e, 25)
+ local ch = (e & f)
+ ~ (~e & g)
+ local t1 = h + s1 + ch + constants256[i] + list[i]
+ h = g
+ g = f
+ f = e
+ e = (d + t1) & 0xffffffff
+ d = c
+ c = b
+ b = a
+ a = (t1 + t2) & 0xffffffff
+ end
+
+ hash[1] = (hash[1] + a) & 0xffffffff
+ hash[2] = (hash[2] + b) & 0xffffffff
+ hash[3] = (hash[3] + c) & 0xffffffff
+ hash[4] = (hash[4] + d) & 0xffffffff
+ hash[5] = (hash[5] + e) & 0xffffffff
+ hash[6] = (hash[6] + f) & 0xffffffff
+ hash[7] = (hash[7] + g) & 0xffffffff
+ hash[8] = (hash[8] + h) & 0xffffffff
+
+ end
+end
+
+digest[512] = function(str,i,hash)
+
+ for i=1,#str,128 do
+
+ -- local w = { unpackstring(">I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4I4",str,i) }
+
+ list[ 1], list[ 2], list[ 3], list[ 4], list[ 5], list[ 6], list[ 7], list[ 8],
+ list[ 9], list[10], list[11], list[12], list[13], list[14], list[15], list[16] =
+ unpackstring(">I8I8I8I8I8I8I8I8I8I8I8I8I8I8I8I8",str,i)
+
+ for j=17,80 do
+ local v0 = list[j - 15]
+ local s0 = ((v0 >> 1) | (v0 << 63)) -- rrotate(v, 1)
+ ~ ((v0 >> 8) | (v0 << 56)) -- rrotate(v, 8)
+ ~ (v0 >> 7)
+ local v1 = list[j - 2]
+ local s1 = ((v1 >> 19) | (v1 << 45)) -- rrotate(v, 19)
+ ~ ((v1 >> 61) | (v1 << 3)) -- rrotate(v, 61)
+ ~ (v1 >> 6)
+ list[j] = (list[j - 16] + s0 + list[j - 7] + s1)
+ -- & 0xffffffffffffffff
+ end
+
+ local a, b, c, d, e, f, g, h = -- unpack(hash)
+ hash[1], hash[2], hash[3], hash[4], hash[5], hash[6], hash[7], hash[8]
+
+ for i=1,80 do
+ local s0 = ((a >> 28) | (a << 36)) -- rrotate(a, 28)
+ ~ ((a >> 34) | (a << 30)) -- rrotate(a, 34)
+ ~ ((a >> 39) | (a << 25)) -- rrotate(a, 39)
+ local maj = (a & b) ~ (a & c) ~ (b & c)
+ local t2 = s0 + maj
+ local s1 = ((e >> 14) | (e << 50)) -- rrotate(e, 14)
+ ~ ((e >> 18) | (e << 46)) -- rrotate(e, 18)
+ ~ ((e >> 41) | (e << 23)) -- rrotate(e, 41)
+ local ch = (e & f)
+ ~ (~e & g)
+ local t1 = h + s1 + ch + constants512[i] + list[i]
+ h = g
+ g = f
+ f = e
+ e = (d + t1) -- & 0xffffffffffffffff
+ d = c
+ c = b
+ b = a
+ a = (t1 + t2) -- & 0xffffffffffffffff
+ end
+
+ hash[1] = (hash[1] + a) -- & 0xffffffffffffffff
+ hash[2] = (hash[2] + b) -- & 0xffffffffffffffff
+ hash[3] = (hash[3] + c) -- & 0xffffffffffffffff
+ hash[4] = (hash[4] + d) -- & 0xffffffffffffffff
+ hash[5] = (hash[5] + e) -- & 0xffffffffffffffff
+ hash[6] = (hash[6] + f) -- & 0xffffffffffffffff
+ hash[7] = (hash[7] + g) -- & 0xffffffffffffffff
+ hash[8] = (hash[8] + h) -- & 0xffffffffffffffff
+
+ end
+end
+
+digest[224] = digest[256]
+digest[384] = digest[512]
+
+local finalize = {
+ [224] = function(hash,tohex) return tohex(packstring(">I4I4I4I4I4I4I4", unpack(hash))) end, -- # 56
+ [256] = function(hash,tohex) return tohex(packstring(">I4I4I4I4I4I4I4I4",unpack(hash))) end, -- # 64
+ [384] = function(hash,tohex) return tohex(packstring(">I8I8I8I8I8I8", unpack(hash))) end, -- # 96
+ [512] = function(hash,tohex) return tohex(packstring(">I8I8I8I8I8I8I8I8",unpack(hash))) end, -- # 128
+}
+
+local hash = { }
+
+local function hashed(str,method,tohex)
+ local s = prepare[method](str,#str)
+ local h = initialize[method](hash)
+ digest[method](s,i,h)
+ return finalize[method](h,tohex)
+end
+
+local sha2 = {
+ hash224 = function(str) return hashed(str,224,tohex) end,
+ hash256 = function(str) return hashed(str,256,tohex) end,
+ hash384 = function(str) return hashed(str,384,tohex) end,
+ hash512 = function(str) return hashed(str,512,tohex) end,
+ HASH224 = function(str) return hashed(str,224,toHEX) end,
+ HASH256 = function(str) return hashed(str,256,toHEX) end,
+ HASH384 = function(str) return hashed(str,384,toHEX) end,
+ HASH512 = function(str) return hashed(str,512,toHEX) end,
+}
+
+-- local setmetatableindex = table.setmetatableindex
+--
+-- if setmetatableindex then
+-- sha2.hashed = setmetatableindex(function(t,k)
+-- local v = digest[k] and function(str) return hashed(str,k,tohex) end or false
+-- t[k] = v
+-- return v
+-- end)
+-- sha2.HASHED = setmetatableindex(function(t,k)
+-- local v = digest[k] and function(str) return hashed(str,k,toHEX) end or false
+-- t[k] = v
+-- return v
+-- end)
+-- end
+
+if utilities then
+ utilities.sha2 = sha2
+end
+
+return sha2
+
diff --git a/tex/context/base/mkiv/util-sql-imp-library.lua b/tex/context/base/mkiv/util-sql-imp-library.lua
index e16853612..a2b692e45 100644
--- a/tex/context/base/mkiv/util-sql-imp-library.lua
+++ b/tex/context/base/mkiv/util-sql-imp-library.lua
@@ -12,7 +12,7 @@ if not modules then modules = { } end modules ['util-sql-imp-library'] = {
-- we couldn't figure it out (some issue with adapting the table that is passes as first
-- argument in the fetch routine. Apart from this it looks like the mysql binding has some
-- efficiency issues (like creating a keys and types table for each row) but that could be
--- optimized. Anyhow, fecthing results can be done as follows:
+-- optimized. Anyhow, fetching results can be done as follows:
-- local function collect_1(r)
-- local t = { }
diff --git a/tex/context/base/mkiv/util-sql-loggers.lua b/tex/context/base/mkiv/util-sql-loggers.lua
index 7cf4f6175..b69e397d2 100644
--- a/tex/context/base/mkiv/util-sql-loggers.lua
+++ b/tex/context/base/mkiv/util-sql-loggers.lua
@@ -61,8 +61,7 @@ CREATE TABLE IF NOT EXISTS %basename% (
`data` longtext,
PRIMARY KEY (`id`),
UNIQUE KEY `id_unique_key` (`id`)
-)
-DEFAULT CHARSET = utf8 ;
+) DEFAULT CHARSET = utf8 ;
]]
local sqlite_template = [[
@@ -80,7 +79,7 @@ function loggers.createdb(presets,datatable)
local db = checkeddb(presets,datatable)
db.execute {
- template = (db.usedmethod == "sqlite" or db.usedmethod == "sqlffi") and sqlite_template or template,
+ template = db.usedmethod == "sqlite" and sqlite_template or template,
variables = {
basename = db.basename,
},
diff --git a/tex/context/base/mkiv/util-sql-logins.lua b/tex/context/base/mkiv/util-sql-logins.lua
index 9717a8175..dcb48fb35 100644
--- a/tex/context/base/mkiv/util-sql-logins.lua
+++ b/tex/context/base/mkiv/util-sql-logins.lua
@@ -34,22 +34,27 @@ end
logins.usedb = checkeddb
local template = [[
-CREATE TABLE
- `logins`
- (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(50) COLLATE utf8_bin NOT NULL,
- `time` int(11) DEFAULT '0',
- `n` int(11) DEFAULT '0',
- `state` int(11) DEFAULT '0',
- PRIMARY KEY (`id`),
- UNIQUE KEY `id_UNIQUE` (`id`),
- UNIQUE KEY `name_UNIQUE` (`name`)
- )
- ENGINE=InnoDB
- DEFAULT CHARSET=utf8
- COLLATE=utf8_bin
- COMMENT='state: 0=unset 1=known 2=unknown'
+ CREATE TABLE IF NOT EXISTS %basename% (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `name` varchar(50) NOT NULL,
+ `time` int(11) DEFAULT '0',
+ `n` int(11) DEFAULT '0',
+ `state` int(11) DEFAULT '0',
+
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `id_unique_index` (`id`),
+ UNIQUE KEY `name_unique_key` (`name`)
+ ) DEFAULT CHARSET = utf8 ;
+]]
+
+local sqlite_template = [[
+ CREATE TABLE IF NOT EXISTS %basename% (
+ `id` INTEGER NOT NULL AUTO_INCREMENT,
+ `name` TEXT NOT NULL,
+ `time` INTEGER DEFAULT '0',
+ `n` INTEGER DEFAULT '0',
+ `state` INTEGER DEFAULT '0'
+ ) ;
]]
function logins.createdb(presets,datatable)
@@ -57,7 +62,7 @@ function logins.createdb(presets,datatable)
local db = checkeddb(presets,datatable)
local data, keys = db.execute {
- template = template,
+ template = db.usedmethod == "sqlite" and sqlite_template or template,
variables = {
basename = db.basename,
},
diff --git a/tex/context/base/mkiv/util-sql-sessions.lua b/tex/context/base/mkiv/util-sql-sessions.lua
index 76bb91962..17cf66142 100644
--- a/tex/context/base/mkiv/util-sql-sessions.lua
+++ b/tex/context/base/mkiv/util-sql-sessions.lua
@@ -48,8 +48,16 @@ local template =[[
`created` int(11) NOT NULL,
`accessed` int(11) NOT NULL,
UNIQUE KEY `token_unique_key` (`token`)
- )
- DEFAULT CHARSET = utf8 ;
+ ) DEFAULT CHARSET = utf8 ;
+]]
+
+local sqlite_template =[[
+ CREATE TABLE IF NOT EXISTS %basename% (
+ `token` TEXT NOT NULL,
+ `data` TEXT NOT NULL,
+ `created` INTEGER DEFAULT '0',
+ `accessed` INTEGER DEFAULT '0'
+ ) ;
]]
function sessions.createdb(presets,datatable)
@@ -57,7 +65,7 @@ function sessions.createdb(presets,datatable)
local db = checkeddb(presets,datatable)
db.execute {
- template = template,
+ template = db.usedmethod == "sqlite" and sqlite_template or template,
variables = {
basename = db.basename,
},
diff --git a/tex/context/base/mkiv/util-sql-tickets.lua b/tex/context/base/mkiv/util-sql-tickets.lua
index 68e54a015..3258fb186 100644
--- a/tex/context/base/mkiv/util-sql-tickets.lua
+++ b/tex/context/base/mkiv/util-sql-tickets.lua
@@ -67,7 +67,7 @@ end
tickets.usedb = checkeddb
-local template =[[
+local template = [[
CREATE TABLE IF NOT EXISTS %basename% (
`id` int(11) NOT NULL AUTO_INCREMENT,
`token` varchar(50) NOT NULL,
@@ -83,8 +83,22 @@ local template =[[
PRIMARY KEY (`id`),
UNIQUE INDEX `id_unique_index` (`id` ASC),
KEY `token_unique_key` (`token`)
- )
- DEFAULT CHARSET = utf8 ;
+ ) DEFAULT CHARSET = utf8 ;
+]]
+
+local sqlite_template = [[
+ CREATE TABLE IF NOT EXISTS %basename% (
+ `id` TEXT NOT NULL AUTO_INCREMENT,
+ `token` TEXT NOT NULL,
+ `subtoken` INTEGER DEFAULT '0',
+ `created` INTEGER DEFAULT '0',
+ `accessed` INTEGER DEFAULT '0',
+ `category` INTEGER DEFAULT '0',
+ `status` INTEGER DEFAULT '0',
+ `usertoken` TEXT NOT NULL,
+ `data` TEXT NOT NULL,
+ `comment` TEXT NOT NULL
+ ) ;
]]
function tickets.createdb(presets,datatable)
@@ -92,7 +106,7 @@ function tickets.createdb(presets,datatable)
local db = checkeddb(presets,datatable)
local data, keys = db.execute {
- template = template,
+ template = db.usedmethod == "sqlite" and sqlite_template or template,
variables = {
basename = db.basename,
},
diff --git a/tex/context/base/mkiv/util-sql-users.lua b/tex/context/base/mkiv/util-sql-users.lua
index a1f433946..7204fb310 100644
--- a/tex/context/base/mkiv/util-sql-users.lua
+++ b/tex/context/base/mkiv/util-sql-users.lua
@@ -10,47 +10,77 @@ if not modules then modules = { } end modules ['util-sql-users'] = {
-- because it's easier to dirtribute this way. Eventually it will be documented
-- and the related scripts will show up as well.
--- local sql = sql or (utilities and utilities.sql) or require("util-sql")
--- local md5 = md5 or require("md5")
-
local sql = utilities.sql
-local format, upper, find, gsub, topattern = string.format, string.upper, string.find, string.gsub, string.topattern
-local sumhexa = md5.sumhexa
+local find, topattern = string.find, string.topattern
+local sumHEXA = md5.sumHEXA
local toboolean = string.toboolean
+local lpegmatch = lpeg.match
-local sql = utilities.sql
+local sql = require("util-sql") -- utilities.sql
local users = { }
sql.users = users
local trace_sql = false trackers.register("sql.users.trace", function(v) trace_sql = v end)
local report = logs.reporter("sql","users")
-local function encryptpassword(str)
+local split = lpeg.splitat(":")
+local valid = nil
+local hash = function(s) return "MD5:" .. sumHEXA(s) end
+
+if LUAVERSION >= 5.3 then
+
+ local sha2 = require("util-sha")
+
+ local HASH224 = sha2.HASH224
+ local HASH256 = sha2.HASH256
+ local HASH384 = sha2.HASH384
+ local HASH512 = sha2.HASH512
+
+ valid = {
+ MD5 = hash,
+ SHA224 = function(s) return "SHA224:" .. HASH224(s) end,
+ SHA256 = function(s) return "SHA256:" .. HASH256(s) end,
+ SHA384 = function(s) return "SHA384:" .. HASH384(s) end,
+ SHA512 = function(s) return "SHA512:" .. HASH512(s) end,
+ }
+
+else
+
+ valid = {
+ MD5 = hash,
+ SHA224 = hash,
+ SHA256 = hash,
+ SHA384 = hash,
+ SHA512 = hash,
+ }
+
+end
+
+local function encryptpassword(str,how)
if not str or str == "" then
return ""
- elseif find(str,"^MD5:") then
+ end
+ local prefix, rest = lpegmatch(split,str)
+ if prefix and rest and valid[prefix] then
return str
- else
- return upper(format("MD5:%s",sumhexa(str)))
end
+ return (how and valid[how] or valid.MD5)(str)
end
local function cleanuppassword(str)
- return (gsub(str,"^MD5:",""))
+ local prefix, rest = lpegmatch(split,str)
+ if prefix and rest and valid[prefix] then
+ return rest
+ end
+ return str
end
local function samepasswords(one,two)
if not one or not two then
return false
end
- if not find(one,"^MD5:") then
- one = encryptpassword(one)
- end
- if not find(two,"^MD5:") then
- two = encryptpassword(two)
- end
- return one == two
+ return encryptpassword(one) == encryptpassword(two)
end
local function validaddress(address,addresses)
@@ -64,7 +94,6 @@ local function validaddress(address,addresses)
end
end
-
users.encryptpassword = encryptpassword
users.cleanuppassword = cleanuppassword
users.samepasswords = samepasswords
@@ -103,13 +132,23 @@ users.groupnumbers = groupnumbers
-- password 'test':
--
-- INSERT insert into users (`name`,`password`,`group`,`enabled`) values ('...','MD5:098F6BCD4621D373CADE4E832627B4F6',1,1) ;
+--
+-- MD5:098F6BCD4621D373CADE4E832627B4F6
+-- SHA224:90A3ED9E32B2AAF4C61C410EB925426119E1A9DC53D4286ADE99A809
+-- SHA256:9F86D081884C7D659A2FEAA0C55AD015A3BF4F1B2B0B822CD15D6C15B0F00A08
+-- SHA384:768412320F7B0AA5812FCE428DC4706B3CAE50E02A64CAA16A782249BFE8EFC4B7EF1CCB126255D196047DFEDF17A0A9
+-- SHA512:EE26B0DD4AF7E749AA1A8EE3C10AE9923F618980772E473F8819A5D4940E0DB27AC185F8A0E1D5F84F88BC887FD67B143732C304CC5FA9AD8E6F57F50028A8FF
-local template =[[
+-- old values (a name can have utf and a password a long hash):
+--
+-- name 80, fullname 80, password 50
+
+local template = [[
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(80) NOT NULL,
- `fullname` varchar(80) NOT NULL,
- `password` varchar(50) DEFAULT NULL,
+ `name` varchar(100) NOT NULL,
+ `fullname` varchar(100) NOT NULL,
+ `password` varchar(200) DEFAULT NULL,
`group` int(11) NOT NULL,
`enabled` int(11) DEFAULT '1',
`email` varchar(80) DEFAULT NULL,
@@ -121,6 +160,21 @@ local template =[[
) DEFAULT CHARSET = utf8 ;
]]
+local sqlite_template = [[
+ CREATE TABLE `users` (
+ `id` INTEGER PRIMARY KEY AUTOINCREMENT,
+ `name` TEXT NOT NULL,
+ `fullname` TEXT NOT NULL,
+ `password` TEXT DEFAULT NULL,
+ `group` INTEGER NOT NULL,
+ `enabled` INTEGER DEFAULT '1',
+ `email` TEXT DEFAULT NULL,
+ `address` TEXT DEFAULT NULL,
+ `theme` TEXT DEFAULT NULL,
+ `data` TEXT DEFAULT NULL
+ ) ;
+]]
+
local converter, fields = sql.makeconverter {
{ name = "id", type = "number" },
{ name = "name", type = "string" },
@@ -139,7 +193,7 @@ function users.createdb(presets,datatable)
local db = checkeddb(presets,datatable)
db.execute {
- template = template,
+ template = db.usedmethod == "sqlite" and sqlite_template or template,
variables = {
basename = db.basename,
},
diff --git a/tex/context/base/mkiv/util-str.lua b/tex/context/base/mkiv/util-str.lua
index 52ecf71ad..9da0c6a2f 100644
--- a/tex/context/base/mkiv/util-str.lua
+++ b/tex/context/base/mkiv/util-str.lua
@@ -646,7 +646,9 @@ end
local format_q = function()
n = n + 1
- return format("(a%s and format('%%q',a%s) or '')",n,n) -- goodie: nil check (maybe separate lpeg, not faster)
+ -- lua 5.3 has a different q than lua 5.2 (which does a tostring on numbers)
+ -- return format("(a%s ~= nil and format('%%q',a%s) or '')",n,n)
+ return format("(a%s ~= nil and format('%%q',tostring(a%s)) or '')",n,n)
end
local format_Q = function() -- can be optimized
@@ -1000,7 +1002,7 @@ local builder = Cs { "start",
["o"] = (prefix_any * P("o")) / format_o, -- %o => regular %o (octal)
--
["S"] = (prefix_any * P("S")) / format_S, -- %S => %s (tostring)
- ["Q"] = (prefix_any * P("Q")) / format_S, -- %Q => %q (tostring)
+ ["Q"] = (prefix_any * P("Q")) / format_Q, -- %Q => %q (tostring)
["N"] = (prefix_any * P("N")) / format_N, -- %N => tonumber (strips leading zeros)
["k"] = (prefix_sub * P("k")) / format_k, -- %k => like f but with n.m
["c"] = (prefix_any * P("c")) / format_c, -- %c => utf character (extension to regular)
diff --git a/tex/context/fonts/mkiv/type-imp-texgyre.mkiv b/tex/context/fonts/mkiv/type-imp-texgyre.mkiv
index a7c2d06be..2bec4c2a8 100644
--- a/tex/context/fonts/mkiv/type-imp-texgyre.mkiv
+++ b/tex/context/fonts/mkiv/type-imp-texgyre.mkiv
@@ -14,6 +14,10 @@
%D There are some weird ones that are never used .. all these Caps ... we can better
%D split them into pagella-caps etc.
+\definefontfeature
+ [mathcollapseitalics]
+ [collapseitalics=yes]
+
\starttypescriptcollection[texgyre]
\definetypescriptprefix [f:pagella] [pagella]
diff --git a/tex/context/interface/mkii/keys-cs.xml b/tex/context/interface/mkii/keys-cs.xml
index 6a3d0801f..521393c17 100644
--- a/tex/context/interface/mkii/keys-cs.xml
+++ b/tex/context/interface/mkii/keys-cs.xml
@@ -1083,6 +1083,7 @@
<cd:constant name='preview' value='nahled'/>
<cd:constant name='previous' value='predchozi'/>
<cd:constant name='previousnumber' value='predchozicislo'/>
+ <cd:constant name='print' value='print'/>
<cd:constant name='printable' value='tisknutelne'/>
<cd:constant name='process' value='process'/>
<cd:constant name='profile' value='profile'/>
diff --git a/tex/context/interface/mkii/keys-en.xml b/tex/context/interface/mkii/keys-en.xml
index a5cd2bd98..dccff3a98 100644
--- a/tex/context/interface/mkii/keys-en.xml
+++ b/tex/context/interface/mkii/keys-en.xml
@@ -1083,6 +1083,7 @@
<cd:constant name='preview' value='preview'/>
<cd:constant name='previous' value='previous'/>
<cd:constant name='previousnumber' value='previousnumber'/>
+ <cd:constant name='print' value='print'/>
<cd:constant name='printable' value='printable'/>
<cd:constant name='process' value='process'/>
<cd:constant name='profile' value='profile'/>
diff --git a/tex/context/interface/mkii/keys-fr.xml b/tex/context/interface/mkii/keys-fr.xml
index 36d875232..ab256770c 100644
--- a/tex/context/interface/mkii/keys-fr.xml
+++ b/tex/context/interface/mkii/keys-fr.xml
@@ -188,6 +188,7 @@
<cd:variable name='extremestretch' value='extremestretch'/>
<cd:variable name='fact' value='fait'/>
<cd:variable name='february' value='fevrier'/>
+ <cd:variable name='field' value='field'/>
<cd:variable name='figure' value='figure'/>
<cd:variable name='figures' value='figures'/>
<cd:variable name='file' value='fichier'/>
@@ -855,6 +856,7 @@
<cd:constant name='headerstate' value='etatentete'/>
<cd:constant name='headlabel' value='etiquettetete'/>
<cd:constant name='headnumber' value='numerotete'/>
+ <cd:constant name='headseparator' value='headseparator'/>
<cd:constant name='headstyle' value='styletete'/>
<cd:constant name='height' value='hauteur'/>
<cd:constant name='hfactor' value='facteurhauteur'/>
@@ -1081,6 +1083,7 @@
<cd:constant name='preview' value='previsualisation'/>
<cd:constant name='previous' value='precedent'/>
<cd:constant name='previousnumber' value='numeroprecedent'/>
+ <cd:constant name='print' value='print'/>
<cd:constant name='printable' value='editable'/>
<cd:constant name='process' value='process'/>
<cd:constant name='profile' value='profile'/>
@@ -1166,8 +1169,10 @@
<cd:constant name='sidemethod' value='sidemethod'/>
<cd:constant name='sidespaceafter' value='espacelateralapres'/>
<cd:constant name='sidespacebefore' value='espacelateralavant'/>
+ <cd:constant name='sidespaceinbetween' value='sidespaceinbetween'/>
<cd:constant name='sidethreshold' value='sidethreshold'/>
<cd:constant name='sign' value='signe'/>
+ <cd:constant name='simplecommand' value='simplecommand'/>
<cd:constant name='size' value='dimension'/>
<cd:constant name='slantedfeatures' value='slantedfeatures'/>
<cd:constant name='slantedfont' value='slantedfont'/>
diff --git a/tex/context/interface/mkiv/context-en.xml b/tex/context/interface/mkiv/context-en.xml
index bc8e96fbf..4cfb3c7fe 100644
--- a/tex/context/interface/mkiv/context-en.xml
+++ b/tex/context/interface/mkiv/context-en.xml
@@ -24278,6 +24278,7 @@
<cd:constant method="factor" prefix="cd:number" type="middle"/>
<cd:constant method="factor" prefix="cd:number" type="right"/>
<cd:constant type="reset"/>
+ <cd:constant type="reverse"/>
</cd:keywords>
</cd:arguments>
</cd:command>
@@ -24294,6 +24295,7 @@
<cd:constant method="factor" prefix="cd:number" type="middle"/>
<cd:constant method="factor" prefix="cd:number" type="right"/>
<cd:constant type="reset"/>
+ <cd:constant type="reverse"/>
</cd:keywords>
</cd:arguments>
</cd:command>
@@ -24320,6 +24322,7 @@
<cd:constant method="factor" prefix="cd:number" type="middle"/>
<cd:constant method="factor" prefix="cd:number" type="right"/>
<cd:constant type="reset"/>
+ <cd:constant type="reverse"/>
</cd:keywords>
</cd:arguments>
</cd:command>
@@ -24336,6 +24339,7 @@
<cd:constant method="factor" prefix="cd:number" type="middle"/>
<cd:constant method="factor" prefix="cd:number" type="right"/>
<cd:constant type="reset"/>
+ <cd:constant type="reverse"/>
</cd:keywords>
</cd:arguments>
</cd:command>
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index c53f0ae43..bdcfefbb0 100644
--- a/tex/context/interface/mkiv/i-context.pdf
+++ b/tex/context/interface/mkiv/i-context.pdf
Binary files differ
diff --git a/tex/context/interface/mkiv/i-narrow.xml b/tex/context/interface/mkiv/i-narrow.xml
index f38f515a7..5133b6302 100644
--- a/tex/context/interface/mkiv/i-narrow.xml
+++ b/tex/context/interface/mkiv/i-narrow.xml
@@ -56,6 +56,7 @@
<cd:constant type="middle" prefix="cd:number" method="factor"/>
<cd:constant type="right" prefix="cd:number" method="factor"/>
<cd:constant type="reset"/>
+ <cd:constant type="reverse"/>
</cd:keywords>
</cd:arguments>
</cd:command>
@@ -73,7 +74,8 @@
<cd:constant type="middle" prefix="cd:number" method="factor"/>
<cd:constant type="right" prefix="cd:number" method="factor"/>
<cd:constant type="reset"/>
- </cd:keywords>
+ <cd:constant type="reverse"/>
+ </cd:keywords>
</cd:arguments>
</cd:command>
@@ -97,7 +99,8 @@
<cd:constant type="middle" prefix="cd:number" method="factor"/>
<cd:constant type="right" prefix="cd:number" method="factor"/>
<cd:constant type="reset"/>
- </cd:keywords>
+ <cd:constant type="reverse"/>
+ </cd:keywords>
</cd:arguments>
</cd:command>
@@ -114,8 +117,9 @@
<cd:constant type="middle" prefix="cd:number" method="factor"/>
<cd:constant type="right" prefix="cd:number" method="factor"/>
<cd:constant type="reset"/>
- </cd:keywords>
+ <cd:constant type="reverse"/>
+ </cd:keywords>
</cd:arguments>
</cd:command>
-</cd:interface> \ No newline at end of file
+</cd:interface>
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index 39d5fb89d..644b9336e 100644
--- a/tex/context/interface/mkiv/i-readme.pdf
+++ b/tex/context/interface/mkiv/i-readme.pdf
Binary files differ
diff --git a/tex/context/modules/common/s-abbreviations-logos.tex b/tex/context/modules/common/s-abbreviations-logos.tex
new file mode 100644
index 000000000..f1966f544
--- /dev/null
+++ b/tex/context/modules/common/s-abbreviations-logos.tex
@@ -0,0 +1,340 @@
+%D \module
+%D [ file=s-abbrevations-logos.tex, % was: s-abr-01
+%D version=1996.01.01,
+%D title=\CONTEXT\ Style File,
+%D subtitle=General Abbreviated Logos,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\startmodule[abbreviations-logos]
+
+\logo [MKI] {MkI} % joke
+\logo [MKII] {MkII}
+\logo [MKIII] {MkIII} % joke
+\logo [MKIV] {MkIV}
+\logo [MKVI] {MkVI}
+\logo [MKIX] {MkIX}
+\logo [MKXI] {MkXI}
+\logo [MKIC] {MkIC}
+\logo [MKCI] {MkCI}
+\logo [MPII] {MpII}
+\logo [MPIV] {MpIV}
+
+\logo [ACROBAT] {Acro\-bat}
+\logo [AFM] {afm}
+\logo [AI] {ai}
+\logo [ALEPH] {Aleph} % {\mathematics{\aleph}}
+\logo [ALGOL] {ALGOL}
+\logo [AMS] {ams}
+\logo [AMSLATEX] {\AmSLaTeX}
+\logo [AMSTEX] {\AmSTeX}
+\logo [ANSI] {ansi}
+\logo [APA] {apa}
+\logo [API] {api}
+\logo [ARABTEX] {Arab\TeXsuffix}
+\logo [ASCII] {ascii}
+\logo [ASCIIMATH] {AsciiMath}
+\logo [ASCIITEX] {ascii\TeXsuffix}
+\logo [BACHOTEX] {Bacho\TeXsuffix}
+\logo [BIBTEX] {bib\TeXsuffix}
+\logo [BLUESKY] {BlueSky}
+\logo [BMP] {bmp}
+\logo [BSD] {bsd}
+\logo [CALCMATH] {CalcMath}
+\logo [CCODE] {C}
+\logo [CD] {cd}
+\logo [CDROM] {cdrom}
+\logo [CID] {cid}
+\logo [CJK] {cjk}
+\logo [CLD] {cld}
+\logo [CLD] {cld}
+\logo [CMR] {cmr}
+\logo [CMYK] {cmyk}
+\logo [CNC] {cnc}
+\logo [CODHOST] {CodHost}
+\logo [CONTEXT] {\ConTeXt}
+\logo [CONTEXTGROUP] {\ConTeXt\ Group}
+\logo [CONTEXTWIKI] {\ConTeXt\ Wiki}
+\logo [CPLUSPLUS] {C\high{++}}
+\logo [CPU] {cpu}
+\logo [CSS] {css}
+\logo [CTAN] {ctan}
+\logo [CTXTOOLS] {ctxtools}
+\logo [CWEB] {cweb}
+\logo [DAC] {dac}
+\logo [DECTEN] {dec-10}
+\logo [DISTILLER] {distiller}
+\logo [DNA] {dna}
+\logo [DPI] {dpi}
+\logo [DRATEX] {Dra\TeXsuffix}
+\logo [DSC] {dsc}
+\logo [DTD] {dtd}
+\logo [DTK] {dtk}
+\logo [DTP] {dtp}
+\logo [DVD] {dvd}
+\logo [DVI] {dvi}
+\logo [DVIPDFM] {dvipdfm}
+\logo [DVIPDFMX] {dvipdfmx}
+\logo [DVIPOS] {dvipos}
+\logo [DVIPS] {dvips}
+\logo [DVIPSONE] {dvipsone}
+\logo [DVISCR] {dviscr}
+\logo [DVIWINDO] {dviwindo}
+\logo [EBCDIC] {ebcdic}
+\logo [EC] {ec}
+\logo [EIFFEL] {Eiffel}
+\logo [EMACS] {emacs}
+\logo [EMTEX] {em\TeXsuffix}
+\logo [ENCODING] {enc}
+\logo [ENCTEX] {enc\TeXsuffix}
+\logo [EPS] {eps}
+\logo [EPUB] {ePub}
+\logo [ETEX] {\eTeX}
+\logo [EUROBACHOTEX] {EuroBacho\TeXsuffix}
+\logo [EUROMATH] {EuroMath}
+\logo [EUROTEX] {Euro\TeXsuffix}
+\logo [EXAMPLE] {eXaMpLe}
+\logo [EXAMPLED] {exampled}
+\logo [EXAMPLEQ] {exampleq}
+\logo [EXAMPLER] {exampler}
+\logo [EXAMPLET] {examplet}
+\logo [EXAMPLEX] {examplex}
+\logo [EXIMPLE] {eXiMpLe}
+\logo [FAQ] {faq}
+\logo [FDF] {fdf}
+\logo [FFI] {ffi}
+%logo [FGA] {fga}
+%logo [FGBBS] {fgbbs}
+\logo [FLAC] {flac}
+\logo [FONTFORGE] {FontForge}
+\logo [FOXET] {foXet}
+\logo [FPTEX] {fp\TeXsuffix}
+\logo [FREEBSD] {FreeBSD}
+\logo [FTP] {ftp}
+\logo [GCC] {gcc}
+\logo [GHOSTSCRIPT] {Ghost\-script}
+\logo [GHOSTVIEW] {Ghost\-view}
+\logo [GIF] {gif}
+\logo [GNU] {gnu}
+\logo [GNUPLOT] {gnuplot}
+\logo [GS] {Ghost\-Script}
+\logo [GUST] {Gust}
+\logo [GWTEX] {gw\TeXsuffix}
+\logo [HSB] {hsb} % ?
+\logo [HSV] {hsv}
+\logo [HTML] {html}
+\logo [HTTP] {http}
+\logo [HTTPS] {https}
+\logo [HZ] {hz}
+\logo [IBM] {ibm}
+\logo [IMAGEMAGICK] {ImageMagick}
+\logo [INITEX] {ini\TeXsuffix}
+\logo [INRSTEX] {inrs\TeXsuffix}
+\logo [IO] {io}
+\logo [IRCNET] {IRCnet}
+\logo [ISO] {iso}
+\logo [JAVA] {Java}
+\logo [JAVASCRIPT] {Java\-Script}
+\logo [JBIG] {jbig}
+\logo [JPEG] {jpeg}
+\logo [JPG] {jpg}
+\logo [JSON] {json}
+\logo [KPATHSEA] {kpathsea}
+\logo [KPSE] {kpse}
+\logo [KPSEWHICH] {kpsewhich}
+\logo [KVM] {kvm}
+\logo [LAMSTEX] {\LamSTeX}
+\logo [LATEX] {\LaTeX}
+\logo [LATEXTE] {\LaTeX2e}
+\logo [LATEXTN] {\LaTeX2.09}
+\logo [LCD] {lcd}
+\logo [LINUX] {linux}
+\logo [LISP] {Lisp}
+\logo [LMX] {lmx}
+\logo [LPEG] {lpeg}
+\logo [LUA] {Lua}
+\logo [LUAJIT] {LuaJIT}
+\logo [LUAJITTEX] {Luajit\TeXsuffix}
+\logo [LUATEX] {Lua\TeXsuffix}
+\logo [LUATOOLS] {luatools}
+\logo [MACOSX] {MacOSX}
+\logo [MACROTEX] {Macro\TeXsuffix}
+\logo [MAKEMPY] {MakeMPY}
+\logo [MAPPING] {map}
+\logo [MAPS] {Maps}
+\logo [MATHML] {MathML}
+\logo [METAFONT] {\MetaFont}
+\logo [METAFUN] {\MetaFun}
+\logo [METAPOST] {\MetaPost}
+\logo [METATEX] {Meta\TeXsuffix}
+\logo [METATYPE] {MetaType1}
+\logo [MICROSOFT] {Microsoft}
+\logo [MIKTEX] {Mik\TeXsuffix}
+\logo [MINGW] {MingW}
+\logo [MKTEXLSR] {mktexlsr}
+\logo [MLBIBTEX] {MLbib\TeXsuffix}
+\logo [MLTEX] {ml\TeXsuffix}
+\logo [MODULA] {Modula}
+\logo [MOV] {mov}
+\logo [MPEG] {mpeg}
+\logo [MPLIB] {mplib}
+\logo [MPS] {mps}
+\logo [MPTOPDF] {mptopdf}
+\logo [MSDOS] {msdos}
+\logo [MSWINDOWS] {MS~Windows}
+\logo [MSWORD] {MS~Word}
+\logo [MSEXCEL] {MS~Excel}
+\logo [MTXRUN] {mtxrun}
+\logo [MTXTOOLS] {mtxtools}
+\logo [MYSQL] {MySQL}
+\logo [NETPBM] {NetPBM}
+\logo [NTG] {ntg}
+\logo [NTS] {nts}
+\logo [NGINX] {nginx}
+\logo [OFM] {ofm}
+\logo [OMEGA] {Omega}
+\logo [OPENMATH] {OpenMath}
+\logo [OPENTYPE] {OpenType}
+\logo [OPI] {opi}
+\logo [OTEX] {Oriental \TeXsuffix}
+\logo [OTF] {otf}
+\logo [OTP] {otp}
+\logo [OVF] {ovf}
+\logo [PASCAL] {Pascal}
+\logo [PCTEX] {pc\TeXsuffix}
+\logo [PDF] {pdf}
+\logo [PDFETEX] {pdfe\TeXsuffix}
+\logo [PDFTEX] {pdf\TeXsuffix}
+\logo [PDFTOOLS] {pdftools}
+\logo [PDFTOPS] {pdftops}
+\logo [PERL] {Perl}
+\logo [PERLTK] {Perl/Tk}
+\logo [PFA] {pfa}
+\logo [PFB] {pfb}
+\logo [PICTEX] {\PiCTeX}
+\logo [PK] {pk}
+\logo [PLAIN] {Plain}
+\logo [PNG] {png}
+\logo [POSIX] {posix}
+\logo [POSTSCRIPT] {Post\-Script}
+\logo [PPCHTEX] {\PPCHTeX}
+\logo [PRAGMA] {Pragma ADE}
+\logo [PRESS] {press}
+\logo [PRIFIL] {prifil}
+\logo [PS] {Post\-Script}
+\logo [PSCHECK] {pscheck}
+\logo [PSTOEDIT] {pstoedit}
+\logo [PSTOPAGE] {pstopage}
+\logo [PSTOPDF] {pstopdf}
+\logo [PSTRICKS] {pstricks}
+\logo [RAID] {raid}
+\logo [RAM] {ram}
+\logo [RCA] {RCA}
+\logo [READER] {Acro\-bat Reader}
+\logo [RELAXNG] {Relax\kern.125emNG}
+\logo [RGB] {rgb}
+\logo [RLXTOOLS] {rlxtools}
+\logo [RUBY] {Ruby}
+\logo [RSYNC] {Rsync}
+\logo [SCITE] {SciTE}
+\logo [SGML] {sgml}
+\logo [SI] {si}
+\logo [SQL] {sql}
+\logo [SSD] {ssd}
+\logo [STIX] {Stix}
+\logo [SUMATRAPDF] {SumatraPDF}
+\logo [SVG] {svg}
+\logo [SVN] {svn}
+\logo [SWIG] {swig}
+\logo [SWIGLIB] {SwigLib}
+\logo [SYNCTEX] {Sync\TeX}
+\logo [TABLE] {\TaBlE}
+\logo [TCPIP] {tcp/ip}
+\logo [TDS] {tds} % no sc te
+\logo [TEI] {tei} % no sc te
+\logo [TETEX] {te\TeXsuffix} % no sc te
+\logo [TEX] {\TeX}
+\logo [TEXADRES] {\TeXprefix adress}
+\logo [TEXBASE] {\TeXprefix base}
+\logo [TEXEDIT] {\TeXprefix edit}
+\logo [TEXEXEC] {\TeXprefix exec}
+\logo [TEXFONT] {\TeXprefix font}
+\logo [TEXFORM] {\TeXprefix form}
+\logo [TEXGYRE] {\TeX\ Gyre}
+\logo [TEXLIVE] {\TeXprefix Live}
+\logo [TEXLUA] {\TeXprefix Lua}
+\logo [TEXMF] {texmf}
+\logo [TEXMFSTART] {texmfstart}
+\logo [TEXNL] {tex-nl}
+\logo [TEXSHOW] {\TeXprefix show}
+\logo [TEXSPELL] {\TeXprefix spell}
+\logo [TEXSYNC] {texsync}
+\logo [TEXTMATE] {TextMate}
+\logo [TEXTOOLS] {\TeXprefix tools}
+\logo [TEXUTIL] {\TeXprefix util}
+\logo [TEXWORK] {\TeXprefix work}
+\logo [TEXWORKS] {\TeXprefix works}
+\logo [TEXXET] {\TeX\XeT} \def\XeT{XeT}
+\logo [TFM] {tfm}
+\logo [THREED] {3D}
+\logo [TIF] {tif}
+\logo [TIFF] {tiff}
+\logo [TIFFINFO] {tiffinfo}
+\logo [TIFFTAGS] {tifftags}
+\logo [TMFTOOLS] {tmftools}
+\logo [TPIC] {tpic}
+\logo [TPM] {tpm}
+\logo [TRUETYPE] {TrueType}
+\logo [TTC] {ttc}
+\logo [TTF] {ttf}
+\logo [TUG] {tug}
+\logo [TUGBOAT] {Tug\-Boat}
+\logo [TUGNEWS] {Tug\-News}
+\logo [TYPEONE] {Type1}
+\logo [UCS] {ucs}
+\logo [UNICODE] {Uni\-code}
+\logo [UNIX] {Unix}
+\logo [URI] {uri}
+\logo [URL] {url}
+\logo [USA] {usa}
+\logo [USB] {usb}
+\logo [USENET] {usenet}
+\logo [UTF] {utf}
+\logo [VAX] {vax}
+\logo [VF] {vf}
+\logo [VMWARE] {VMWare}
+\logo [WDT] {wdt}
+\logo [WEB] {web}
+\logo [WEBC] {web2c}
+\logo [WIKI] {Wiki}
+\logo [WINDOWS] {Windows}
+\logo [WINNT] {WinNT}
+\logo [WINNX] {Win9x}
+\logo [WTHREEC] {W3C}
+\logo [WWW] {www}
+\logo [WYSIWYG] {wysiwyg}
+\logo [XDVI] {Xdvi}
+\logo [XETEX] {\XeTeX}
+\logo [XFDF] {xfdf}
+\logo [XHTML] {xhtml}
+\logo [XINDY] {Xindy}
+\logo [XITS] {Xits}
+\logo [XML] {xml}
+\logo [XMLTOOLS] {xmltools}
+\logo [XPATH] {xpath}
+\logo [XPDFETEX] {xpdfe\TeXsuffix}
+\logo [XSL] {xsl}
+\logo [XSLFO] {xsl-fo}
+\logo [XSLT] {xslt}
+\logo [XSLTPROC] {xsltproc}
+\logo [XYPIC] {XYPIC} % wrong logo
+\logo [YandY] {y\&y}
+\logo [YOUTUBE] {YouTube}
+\logo [ZIP] {zip}
+
+\stopmodule
diff --git a/tex/context/modules/common/s-abbreviations-mixed.mkiv b/tex/context/modules/common/s-abbreviations-mixed.mkiv
new file mode 100644
index 000000000..f7b2121d0
--- /dev/null
+++ b/tex/context/modules/common/s-abbreviations-mixed.mkiv
@@ -0,0 +1,28 @@
+%D \module
+%D [ file= s-abbreviations-mixed, % was: s-abr-04
+%D version=1996.01.01,
+%D title=\CONTEXT\ Style File,
+%D subtitle=General Abbreviations Mixed,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\setupsorting
+ [logo]
+ [\c!style=\font_style_pseudoMixedCapped]
+
+\protect
+
+\startmodule[abbreviations-mixed]
+
+\usemodule[abbreviations-logos]
+\usemodule[abbreviations-extras]
+
+\stopmodule
+
diff --git a/tex/context/modules/common/s-abbreviations-pseudocaps.mkiv b/tex/context/modules/common/s-abbreviations-pseudocaps.mkiv
new file mode 100644
index 000000000..fa8606a7b
--- /dev/null
+++ b/tex/context/modules/common/s-abbreviations-pseudocaps.mkiv
@@ -0,0 +1,30 @@
+%D \module
+%D [ file= s-abbreviations-pseudocaps, % was: s-abr-01
+%D version=1996.01.01,
+%D title=\CONTEXT\ Style File,
+%D subtitle=General Abbreviations Pseudocaps,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\setupsorting
+ [logo]
+ [\c!style=\v!capital]
+
+\setupcapitals
+ [\c!title=\v!no]
+
+\protect
+
+\startmodule[abbreviations-pseudocaps]
+
+\usemodule[abbreviations-logos]
+\usemodule[abbreviations-extras]
+
+\stopmodule
diff --git a/tex/context/modules/common/s-abbreviations-smallcaps.mkiv b/tex/context/modules/common/s-abbreviations-smallcaps.mkiv
new file mode 100644
index 000000000..2ce86ca33
--- /dev/null
+++ b/tex/context/modules/common/s-abbreviations-smallcaps.mkiv
@@ -0,0 +1,31 @@
+%D \module
+%D [ file= s-abbreviations-smallcaps, % was: s-abr-02
+%D version=1996.01.01,
+%D title=\CONTEXT\ Style File,
+%D subtitle=General Abbreviations Smallcaps,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\setupsorting
+ [logo]
+ [\c!style=\v!smallcaps]
+
+\setupcapitals
+ [\c!title=\v!no]
+
+\protect
+
+\startmodule[abbreviations-smallcaps]
+
+\usemodule[abbreviations-logos]
+\usemodule[abbreviations-extras]
+
+\stopmodule
+
diff --git a/tex/context/modules/common/s-abbreviations-words.mkiv b/tex/context/modules/common/s-abbreviations-words.mkiv
new file mode 100644
index 000000000..2b7d7cedc
--- /dev/null
+++ b/tex/context/modules/common/s-abbreviations-words.mkiv
@@ -0,0 +1,28 @@
+%D \module
+%D [ file= s-abbreviations-words, % was: s-abr-32
+%D version=1998.08.10,
+%D title=\CONTEXT\ Style File,
+%D subtitle=General Abbreviations Words,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+\unprotect
+
+\setupsorting
+ [logo]
+ [\c!style=\v!WORD]
+
+\protect
+
+\startmodule[abbreviations-words]
+
+\usemodule[abbreviations-logos]
+\usemodule[abbreviations-extras]
+
+\stopmodule
+
diff --git a/tex/context/modules/common/s-faq-01.tex b/tex/context/modules/common/s-faq-01.tex
index f6ee3ce06..e031d79d5 100644
--- a/tex/context/modules/common/s-faq-01.tex
+++ b/tex/context/modules/common/s-faq-01.tex
@@ -8,8 +8,8 @@
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\usemodule[faq-00]
@@ -25,7 +25,7 @@
width=fit,
footer=0pt,
bottomdistance=12pt,
- bottom=18pt]
+ bottom=18pt]
\setupinteractionscreen
[width=fit,
@@ -152,7 +152,7 @@
\blank[3*big]
\midaligned{\tta \ListOfFAQ}
\vfill
- \midaligned{\tta pragma@wxs.nl}
+ \midaligned{\tta pragma@xs4all.nl}
\blank[3*big]
\stopstandardmakeup}
@@ -187,7 +187,7 @@
\def\EndFAQ
{\stopframedtext
- \egroup
+ \egroup
\button
[color=,contrastcolor=,frame=overlay,offset=overlay]
{\copy0}
@@ -205,7 +205,7 @@
\startuniqueMPgraphic{Frame}
path p ; p := unitsquare xscaled \overlaywidth yscaled \overlayheight ;
- pickup pencircle scaled 2pt ;
+ pickup pencircle scaled 2pt ;
fill p withcolor \MPcolor{\overlaycolor} ;
draw p withcolor \MPcolor{\overlaylinecolor} ;
\stopuniqueMPgraphic
diff --git a/tex/context/modules/common/s-faq-02.tex b/tex/context/modules/common/s-faq-02.tex
index 92aa1eca2..c39ae1046 100644
--- a/tex/context/modules/common/s-faq-02.tex
+++ b/tex/context/modules/common/s-faq-02.tex
@@ -8,8 +8,8 @@
%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
-%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
-%C details.
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
\usemodule[faq-00]
@@ -37,7 +37,7 @@
\blank[3*big]
\midaligned{\tta \ListOfFAQ}
\vfill
- \midaligned{\tta pragma@wxs.nl}
+ \midaligned{\tta pragma@xs4all.nl}
\blank[3*big]
\stopstandardmakeup}
diff --git a/tex/context/modules/mkiv/m-scite.mkiv b/tex/context/modules/mkiv/m-scite.mkiv
index 12b54b9ac..48f1022ad 100644
--- a/tex/context/modules/mkiv/m-scite.mkiv
+++ b/tex/context/modules/mkiv/m-scite.mkiv
@@ -294,7 +294,8 @@ visualizers.register("btx", visualizer)
visualizers.register("web", visualizer)
visualizers.register("cpp", visualizer)
visualizers.register("txt", visualizer)
------------.register("sql", visualizer)
+visualizers.register("bnf", visualizer)
+visualizers.register("sql", visualizer)
\stopluacode
@@ -306,6 +307,8 @@ visualizers.register("txt", visualizer)
\definetyping[CPP] [option=web]
\definetyping[WEB] [option=web]
\definetyping[TXT] [option=txt]
+\definetyping[BNF] [option=bnf] % I might use this in the metafun manual.
+\definetyping[SQL] [option=sql] % To be tested in an upcoming manual.
\definetyping[NONE][option=none]
% This is a preliminary interface.
diff --git a/tex/context/modules/mkiv/s-fonts-variable.mkiv b/tex/context/modules/mkiv/s-fonts-variable.mkiv
index 5c9d53d33..d1bf8b69d 100644
--- a/tex/context/modules/mkiv/s-fonts-variable.mkiv
+++ b/tex/context/modules/mkiv/s-fonts-variable.mkiv
@@ -107,4 +107,7 @@
\showfontvariations
[font=file:bahnschrift.ttf]
+ % \showfontvariations
+ % [font=file:sitka.ttc]
+
\stoptext
diff --git a/tex/context/modules/mkiv/x-lmx-demo.mkiv b/tex/context/modules/mkiv/x-lmx-demo.mkiv
new file mode 100644
index 000000000..619af97e0
--- /dev/null
+++ b/tex/context/modules/mkiv/x-lmx-demo.mkiv
@@ -0,0 +1,143 @@
+% last page less markup
+
+\usemodule
+ [article]
+
+\setupbottomtexts
+ [\directsetup{document:comment}]
+
+\setuplayout
+ [bottom=1cm]
+
+\setupbottom
+ [style=\small\tt]
+
+\usemodule
+ [lmx-html]
+
+% \startxmlsetups exa:variables
+%
+% \xmlfilter{#1}{/exa:variable/command(exa:variable)}
+%
+% % todo: fontkerns
+%
+% \xmldoif {#1} {/exa:variable[@name='bodyfont']} {
+% \setupbodyfont
+% [\xmltext{#1}{/exa:variable[@name='bodyfont']}]
+% }
+% \xmldoif {#1} {/exa:variable[@name='cutmarks' and text()='yes']} {
+% \setuppapersize
+% [A4]
+% [oversized]
+% \setuplayout
+% [marking=on,
+% location=middle]
+% }
+% \xmldoif {#1} {/exa:variable[@name='spelling' and text()='yes']} {
+% % \loadspellchecklist[en][spell-en.txt]
+% % \setupspellchecking[state=start,method=1]
+% }
+% \xmldoif {#1} {/exa:variable[@name='frame' and text()='yes']} {
+% \showframe
+% }
+% \xmldoif {#1} {/exa:variable[@name='markup' and text()='yes']} {
+% \showmakeup
+% }
+% \xmldoif {#1} {/exa:variable[@name='request' and text()='yes']} {
+% \enablemode[showrequest]
+% }
+%
+% \stopxmlsetups
+
+\startxmlsetups exa:variable:cutmarks
+ \xmldoif {#1} {.[text() = 'yes']} {
+ \setuppapersize
+ [A4]
+ [oversized]
+ \setuplayout
+ [marking=on,
+ location=middle]
+ }
+\stopxmlsetups
+
+\startxmlsetups exa:variable:bodyfont
+ \setupbodyfont
+ [\xmltext{#1}{.}]
+\stopxmlsetups
+
+\startxmlsetups exa:variable:frame
+ \xmldoif {#1} {.[text() = 'yes']} {
+ \showframe
+ }
+\stopxmlsetups
+
+\startxmlsetups exa:variable:markup
+ \xmldoif {#1} {.[text() = 'yes']} {
+ \showmakeup
+ }
+\stopxmlsetups
+
+\startxmlsetups exa:variable:request
+ \xmldoif {#1} {.[text() = 'yes']} {
+ \enablemode[showrequest]
+ }
+\stopxmlsetups
+
+\startxmlsetups exa:variable
+ \xmlsetup{#1}{exa:variable:\xmlatt{#1}{name}}
+\stopxmlsetups
+
+\startxmlsetups exa:variables
+ \xmlfilter{#1}{/exa:variable/command(exa:variable)}
+\stopxmlsetups
+
+\startsetups document:comment
+ \xmlfilter{main}{/exa:selection/exa:variables/exa:variable[@name='comment']/html()}
+\stopsetups
+
+\startxmlsetups exa:entry
+
+ \startchapter[title=\xmlatt{#1}{title}]
+ \samplefile{\xmlatt{#1}{id}}
+ \stopchapter
+
+\stopxmlsetups
+
+\startxmlsetups exa:selection
+
+ \xmlfirst{#1}{/exa:variables}
+
+ \starttitle[title={Contents}]
+ \placelist[chapter][criterium=all]
+ \stoptitle
+
+ \xmlfilter{#1}{/exa:selectors/exa:selector/exa:tree/exa:entry/exa:entry/command(exa:entry)}
+
+\stopxmlsetups
+
+\startxmlsetups xml:request
+ \xmlsetsetup {#1} {
+ exa:variables|exa:selection
+ } {exa:*}
+\stopxmlsetups
+
+\xmlregistersetup{xml:request}
+
+\starttext
+
+ \xmlprocess{main}{\inputfilename}{}
+
+ \page
+
+ \doifelsemode {showrequest} {
+
+ \usemodule[scite]
+
+ \start
+ \switchtobodyfont[small]
+ \scitefile[\inputfilename]
+ \stop
+
+ }
+
+\stoptext
diff --git a/tex/context/modules/mkiv/x-lmx-html.mkiv b/tex/context/modules/mkiv/x-lmx-html.mkiv
new file mode 100644
index 000000000..3195ef40e
--- /dev/null
+++ b/tex/context/modules/mkiv/x-lmx-html.mkiv
@@ -0,0 +1,122 @@
+%D \module
+%D [ file=x-lmx-html,
+%D version=2018.03.10,
+%D title=\CONTEXT\ Modules,
+%D subtitle=Simple LMX HTML rendering (from text fields),
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D This is old code that we used in several places so it qualifies as a
+%D proper module. It is means for generating simple \HTML\ from filled
+%D in forms. It's not a general purpose \HTML\ rendering.
+
+\startmodule[lmx-html]
+
+\startxmlsetups lmx:html:setup
+ \xmlsetsetup{#1}{*}{lmx:html:*}
+ \xmlflush{#1}
+\stopxmlsetups
+
+\startxmlsetups lmx:html:ul
+ \startitemize[packed]
+ \xmlflush{#1}
+ \stopitemize
+\stopxmlsetups
+
+\startxmlsetups lmx:html:ol
+ \startitemize[packed,n]
+ \xmlflush{#1}
+ \stopitemize
+\stopxmlsetups
+
+\startxmlsetups lmx:html:li
+ \startitem
+ \xmlflush{#1}
+ \stopitem
+\stopxmlsetups
+
+\startxmlsetups lmx:html:p
+ \xmlflush{#1}\par
+\stopxmlsetups
+
+\startxmlsetups lmx:html:br
+ \par
+\stopxmlsetups
+
+\startxmlsetups lmx:html:a
+ \dontleavehmode
+ \begingroup
+ \tttf
+ \xmldoifelsetext {#1} {.} {
+ \goto{\hyphenatedurl{\xmlflush{#1}}}[url(\xmlatt{#1}{href})]
+ } {
+ \goto{\hyphenatedurl{\xmlatt{#1}{href}}}[url(\xmlatt{#1}{href})]
+ }
+ \endgroup
+\stopxmlsetups
+
+\startxmlsetups lmx:html:em
+ \dontleavehmode
+ \begingroup\em\xmlflush{#1}\endgroup
+\stopxmlsetups
+
+\startxmlsetups lmx:html:b
+ \dontleavehmode
+ \begingroup\bf\xmlflush{#1}\endgroup
+\stopxmlsetups
+
+\startxmlsetups lmx:html:i
+ \dontleavehmode
+ \begingroup\it\xmlflush{#1}\endgroup
+\stopxmlsetups
+
+\startxmlsetups lmx:html:strong
+ \dontleavehmode
+ \begingroup\bf\xmlflush{#1}\endgroup
+\stopxmlsetups
+
+\startxmlsetups lmx:html:tt
+ \dontleavehmode
+ \begingroup\tt\xmlflush{#1}\endgroup
+\stopxmlsetups
+
+% \startxmlsetups lmx:html:span
+% \dontleavehmode
+% \ctxcommand{doifelse(string.find([[ \xmlatt{#1}{style} ]],"underline"))} {
+% \underbar{\xmlflush{#1}}
+% } {
+% \xmlflush{#1}
+% }
+% \stopxmlsetups
+
+\xmlmapvalue{text-decoration}{underline}{\directsetbar{underbar}}
+\xmlmapvalue{text-decoration}{overline} {\directsetbar{overbar}}
+
+\startxmlsetups lmx:html:span
+ \dontleavehmode
+ \begingroup
+ \xmlcssmappedstylevalue{#1}{text-decoration}{text-decoration}
+ \xmlflush{#1}
+ \endgroup
+\stopxmlsetups
+
+\startxmlsetups lmx:html:html
+ \xmlflush{#1}% should not be needed but we self tag .. needs checking
+\stopxmlsetups
+
+\startluacode
+ local texfinalizers = xml.finalizers.tex
+
+ function texfinalizers.html(collected,setup)
+ texfinalizers.xml(collected,"html",setup)
+ end
+\stopluacode
+
+% \xmlfilter{...}{/.../html()}
+
+\stopmodule
diff --git a/tex/context/sample/common/samples.tex b/tex/context/sample/common/samples.tex
index bf2cf4cfd..a2ffcf088 100644
--- a/tex/context/sample/common/samples.tex
+++ b/tex/context/sample/common/samples.tex
@@ -17,7 +17,7 @@ used in testing bibliographic references and citations.
\NC reich.tex \NC Steve Reich \NC City Life (1995) \NC \NR
\NC materie.tex \NC Louis Andriessen \NC De Materie \NC \NR
\NC douglas.tex \NC Douglas R. Hofstadter \NC \NC \NR
-\NC dawkins.tex \NC Dawkins \NC \NC \NR
+\NC dawkins.tex \NC Richard Dawkins \NC \NC \NR
\NC ward.tex \NC Peter D. Ward \NC The Life and Death of Planet Earth \NC \NR
\NC zapf.tex \NC Hermann Zapf \NC About micro-typography and the hz-program,
Electronic Publishing, vol. 6(3),
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index b8aa715ed..de4458dda 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
-- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua
-- parent file : c:/data/develop/context/sources/luatex-fonts.lua
--- merge date : 03/10/18 14:52:21
+-- merge date : 03/21/18 09:16:30
do -- begin closure to overcome local limits and interference
@@ -126,6 +126,8 @@ end
local loaded=package.loaded
if not loaded["socket"] then loaded["socket"]=loaded["socket.core"] end
if not loaded["mime"] then loaded["mime"]=loaded["mime.core"] end
+if not socket.mime then socket.mime=package.loaded["mime"] end
+if not loaded["socket.mime"] then loaded["socket.mime"]=socket.mime end
if not loaded["socket.http"] then loaded["socket.http"]=socket.http end
if not loaded["socket.ftp"] then loaded["socket.ftp"]=socket.ftp end
if not loaded["socket.smtp"] then loaded["socket.smtp"]=socket.smtp end
@@ -1974,10 +1976,10 @@ function table.reversed(t)
return tt
end
end
-function table.reverse(t)
+function table.reverse(t)
if t then
local n=#t
- for i=1,floor(n/2) do
+ for i=1,floor(n/2) do
local j=n-i+1
t[i],t[j]=t[j],t[i]
end
@@ -4122,7 +4124,7 @@ local format_left=function(f)
end
local format_q=function()
n=n+1
- return format("(a%s and format('%%q',a%s) or '')",n,n)
+ return format("(a%s ~= nil and format('%%q',tostring(a%s)) or '')",n,n)
end
local format_Q=function()
n=n+1
@@ -4393,7 +4395,7 @@ local builder=Cs { "start",
["X"]=(prefix_any*P("X"))/format_X,
["o"]=(prefix_any*P("o"))/format_o,
["S"]=(prefix_any*P("S"))/format_S,
- ["Q"]=(prefix_any*P("Q"))/format_S,
+ ["Q"]=(prefix_any*P("Q"))/format_Q,
["N"]=(prefix_any*P("N"))/format_N,
["k"]=(prefix_sub*P("k"))/format_k,
["c"]=(prefix_any*P("c"))/format_c,
@@ -21206,6 +21208,7 @@ if not nodes.properties then return end
local next,rawget,tonumber=next,rawget,tonumber
local fastcopy=table.fastcopy
local registertracker=trackers.register
+local registerdirective=directives.register
local trace_injections=false registertracker("fonts.injections",function(v) trace_injections=v end)
local trace_marks=false registertracker("fonts.injections.marks",function(v) trace_marks=v end)
local trace_cursive=false registertracker("fonts.injections.cursive",function(v) trace_cursive=v end)
@@ -22159,64 +22162,15 @@ local function inject_everything(head,where)
showoffset(n,true)
end
end
- local base=nil
while current do
local next=getnext(current)
local char,id=ischar(current)
if char then
local p=rawget(properties,current)
- if hascursives then
- if not p then
- local m=fontmarks[getfont(current)]
- if m and m[char] then
- if base then
- p={ injections={ markbasenode=base } }
- nofmarks=nofmarks+1
- marks[nofmarks]=current
- properties[current]=p
- hasmarks=true
- end
- else
- base=current
- end
- end
- end
if p then
local i=p.injections
- if hascursives then
- if not i then
- local m=fontmarks[getfont(current)]
- if m and m[char] then
- if base then
- i={ markbasenode=base }
- nofmarks=nofmarks+1
- marks[nofmarks]=current
- p.injections=i
- hasmarks=true
- end
- else
- base=current
- end
- end
- end
if i then
local pm=i.markbasenode
- if hascursives then
- if not pm then
- local m=fontmarks[getfont(current)]
- if m and m[char] then
- if base then
- pm=base
- i.markbasenode=pm
- hasmarks=true
- end
- else
- base=current
- end
- else
- base=current
- end
- end
if pm then
nofmarks=nofmarks+1
marks[nofmarks]=current
@@ -22487,7 +22441,6 @@ local function inject_everything(head,where)
else
prevglyph=nil
prevdisc=nil
-base=nil
end
prev=current
current=next