From 6a68bb9d4e7e8454b031143b9cd14edf3702a68d Mon Sep 17 00:00:00 2001
From: Hans Hagen <pragma@wxs.nl>
Date: Sat, 19 May 2018 22:19:19 +0200
Subject: 2018-05-19 21:51:00

---
 tex/context/base/mkii/cont-new.mkii                |   2 +-
 tex/context/base/mkii/context.mkii                 |   2 +-
 tex/context/base/mkiv/cont-new.mkiv                |   2 +-
 tex/context/base/mkiv/context.mkiv                 |   2 +-
 tex/context/base/mkiv/font-ini.mkvi                |  10 +-
 tex/context/base/mkiv/font-ots.lua                 |  17 ++++
 tex/context/base/mkiv/lang-txt.lua                 |  20 ++--
 tex/context/base/mkiv/math-noa.lua                 |  26 ++---
 tex/context/base/mkiv/mlib-run.lua                 |   9 +-
 tex/context/base/mkiv/mult-prm.lua                 |   1 +
 tex/context/base/mkiv/status-files.log             |  38 +++++++
 tex/context/base/mkiv/status-files.pdf             | Bin 26170 -> 0 bytes
 tex/context/base/mkiv/status-lua.pdf               | Bin 257465 -> 257460 bytes
 tex/context/base/mkiv/strc-reg.lua                 |   1 -
 tex/context/base/mkiv/strc-reg.mkiv                |   4 +-
 tex/context/base/mkiv/strc-ren.mkiv                |   6 +-
 tex/context/base/mkiv/syst-ini.mkiv                |   1 +
 tex/context/base/mkiv/type-ini.mkvi                |   2 +-
 tex/context/interface/mkiv/i-context.pdf           | Bin 847897 -> 848019 bytes
 tex/context/interface/mkiv/i-readme.pdf            | Bin 61081 -> 61079 bytes
 tex/context/modules/mkiv/s-present-steps.mkiv      | 113 ++++++++++++++++-----
 tex/generic/context/luatex/luatex-fonts-merged.lua |  18 +++-
 22 files changed, 207 insertions(+), 67 deletions(-)
 create mode 100644 tex/context/base/mkiv/status-files.log
 delete mode 100644 tex/context/base/mkiv/status-files.pdf

(limited to 'tex')

diff --git a/tex/context/base/mkii/cont-new.mkii b/tex/context/base/mkii/cont-new.mkii
index 2755bb353..6dfacb773 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.05.17 18:32}
+\newcontextversion{2018.05.19 21:46}
 
 %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 4da8bf733..a1e07e038 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.05.17 18:32}
+\edef\contextversion{2018.05.19 21:46}
 
 %D For those who want to use this:
 
diff --git a/tex/context/base/mkiv/cont-new.mkiv b/tex/context/base/mkiv/cont-new.mkiv
index 96d10f671..241534cbb 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.05.17 18:32}
+\newcontextversion{2018.05.19 21:46}
 
 %D This file is loaded at runtime, thereby providing an excellent place for
 %D hacks, patches, extensions and new features.
diff --git a/tex/context/base/mkiv/context.mkiv b/tex/context/base/mkiv/context.mkiv
index 90cd02142..12e208391 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.05.17 18:32}
+\edef\contextversion{2018.05.19 21:46}
 \edef\contextkind   {beta}
 
 %D For those who want to use this:
diff --git a/tex/context/base/mkiv/font-ini.mkvi b/tex/context/base/mkiv/font-ini.mkvi
index 703181571..6bb5c2eaa 100644
--- a/tex/context/base/mkiv/font-ini.mkvi
+++ b/tex/context/base/mkiv/font-ini.mkvi
@@ -583,8 +583,7 @@
 \def\font_basics_define_fontstyle[#commands][#style]% style: rm ss tt ...
   {\ifcsname\??fontstyleknown#style\endcsname \else % can be delayed till used (cg, hw)
      \font_helpers_register_style{#style}%
-     % todo: toksapp
-     \t_font_style_commands\expandafter{\the\t_font_style_commands\m_font_style_command{#style}}%
+     \toksapp\t_font_style_commands{\m_font_style_command{#style}}%
    \fi
    \processcommalist[#commands]{\font_basics_define_fontstyle_indeed{#style}}}
 
@@ -595,17 +594,14 @@
 \unexpanded\def\definefontsize[#size]%
   {\ifcsname\??fontsizeknown#size\endcsname \else
      \font_helpers_register_size{#size}%
-     \t_font_size_commands\expandafter{\the\t_font_size_commands
-       \m_font_size_command{#size}}%
+     \toksapp\t_font_size_commands{\m_font_size_command{#size}}%
    \fi
    \font_helpers_check_fontname_combinations}
 
 \unexpanded\def\definefontalternative[#alternative]%
   {\ifcsname\??fontalternativeknown#alternative\endcsname \else
      \font_helpers_register_alternative{#alternative}%
-     % todo: toksapp
-     \t_font_alternative_commands\expandafter{\the\t_font_alternative_commands
-       \m_font_alternative_command{#alternative}}%
+     \toksapp\t_font_alternative_commands{\m_font_alternative_command{#alternative}}%
    \fi
    \font_helpers_check_fontname_combinations}
 
diff --git a/tex/context/base/mkiv/font-ots.lua b/tex/context/base/mkiv/font-ots.lua
index faee293f6..abe4caea4 100644
--- a/tex/context/base/mkiv/font-ots.lua
+++ b/tex/context/base/mkiv/font-ots.lua
@@ -4200,9 +4200,26 @@ end
 local plugins = { }
 otf.plugins   = plugins
 
+local report  = logs.reporter("fonts")
+
 function otf.registerplugin(name,f)
     if type(name) == "string" and type(f) == "function" then
         plugins[name] = { name, f }
+        report()
+        report("plugin %a has been loaded, please be aware of possible side effects",name)
+        report()
+        if logs.pushtarget then
+            logs.pushtarget("log")
+        end
+        report("Plugins are not officially supported unless stated otherwise. This is because")
+        report("they bypass the regular font handling and therefore some features in ConTeXt")
+        report("(especially those related to fonts) might not work as expected or might not work")
+        report("at all. Some plugins are for testing and development only and might change")
+        report("whenever we feel the need for it.")
+        report()
+        if logs.poptarget then
+            logs.poptarget()
+        end
     end
 end
 
diff --git a/tex/context/base/mkiv/lang-txt.lua b/tex/context/base/mkiv/lang-txt.lua
index b1f50bc80..780d28d0d 100644
--- a/tex/context/base/mkiv/lang-txt.lua
+++ b/tex/context/base/mkiv/lang-txt.lua
@@ -615,28 +615,28 @@ data.labels={
    ["labels"]={
     ["af"]="",
     ["ca"]="",
-    ["cs"]="a",
+    ["cs"]=" a ",
     ["da"]="",
-    ["de"]="und",
-    ["en"]="and",
-    ["es"]="y",
+    ["de"]=" und ",
+    ["en"]=" and ",
+    ["es"]=" y ",
     ["fi"]="",
     ["fr"]="",
     ["gr"]="",
-    ["hr"]="i",
-    ["hu"]="és",
+    ["hr"]=" i ",
+    ["hu"]=" és ",
     ["it"]="",
     ["la"]="",
     ["lt"]="",
     ["nb"]="",
-    ["nl"]="en",
+    ["nl"]=" en ",
     ["nn"]="",
-    ["pe"]="و",
-    ["pl"]="i",
+    ["pe"]=" و ",
+    ["pl"]=" i ",
     ["pt"]="",
     ["ro"]="",
     ["ru"]="",
-    ["sk"]="a",
+    ["sk"]=" a ",
     ["sl"]="",
     ["sv"]="",
     ["tk"]="",
diff --git a/tex/context/base/mkiv/math-noa.lua b/tex/context/base/mkiv/math-noa.lua
index bb0817d9a..1fca63e23 100644
--- a/tex/context/base/mkiv/math-noa.lua
+++ b/tex/context/base/mkiv/math-noa.lua
@@ -592,7 +592,7 @@ do
 
     function handlers.families(head,style,penalties)
         processnoads(head,families,"families")
-        return true
+        return true -- not needed
     end
 
 end
@@ -717,7 +717,7 @@ do
 
     function handlers.relocate(head,style,penalties)
         processnoads(head,relocate,"relocate")
-        return true
+        return true -- not needed
     end
 
 end
@@ -751,7 +751,7 @@ do
 
     function handlers.render(head,style,penalties)
         processnoads(head,render,"render")
-        return true
+        return true -- not needed
     end
 
 end
@@ -813,7 +813,7 @@ do
 
     function handlers.resize(head,style,penalties)
         processnoads(head,resize,"resize")
-        return true
+        return true -- not needed
     end
 
 end
@@ -1137,7 +1137,7 @@ do
 
     function handlers.unscript(head,style,penalties)
         processnoads(head,unscript,"unscript")
-        return true
+        return true -- not needed
     end
 
 end
@@ -1376,7 +1376,7 @@ do
 
     function handlers.alternates(head,style,penalties)
         processnoads(head,alternate,"alternate")
-        return true
+        return true -- not needed
     end
 
 end
@@ -1514,7 +1514,7 @@ do
 
     function handlers.italics(head,style,penalties)
         processnoads(head,italics,"italics")
-        return true
+        return true -- not needed
     end
 
     local enable = function()
@@ -1643,7 +1643,7 @@ do
 
     function handlers.kernpairs(head,style,penalties)
         processnoads(head,kernpairs,"kernpairs")
-        return true
+        return true -- not needed
     end
 
 end
@@ -1756,7 +1756,7 @@ do
 
     function noads.handlers.collapse(head,style,penalties)
         processnoads(head,collapse,"collapse")
-        return true
+        return true -- not needed
     end
 
     local enable = function()
@@ -1904,7 +1904,7 @@ do
 
     function noads.handlers.fixscripts(head,style,penalties)
         processnoads(head,fixscripts,"fixscripts")
-        return true
+        return true -- not needed
     end
 
 end
@@ -1968,7 +1968,7 @@ do
 
     function handlers.variants(head,style,penalties)
         processnoads(head,variants,"unicode variant")
-        return true
+        return true -- not needed
     end
 
 end
@@ -2008,7 +2008,7 @@ do
 
     function handlers.classes(head,style,penalties)
         processnoads(head,classes,"classes")
-        return true
+        return true -- not needed
     end
 
     registertracker("math.classes",function(v)
@@ -2169,7 +2169,7 @@ do
 
     function handlers.domains(head,style,penalties)
         processnoads(head,domains,"domains")
-        return true
+        return true -- not needed
     end
 
 end
diff --git a/tex/context/base/mkiv/mlib-run.lua b/tex/context/base/mkiv/mlib-run.lua
index 18bc7e4da..d1d76eb36 100644
--- a/tex/context/base/mkiv/mlib-run.lua
+++ b/tex/context/base/mkiv/mlib-run.lua
@@ -39,6 +39,7 @@ local P = lpeg.P
 
 local trace_graphics   = false  trackers.register("metapost.graphics",   function(v) trace_graphics   = v end)
 local trace_tracingall = false  trackers.register("metapost.tracingall", function(v) trace_tracingall = v end)
+local trace_btexetex   = false  trackers.register("metapost.btexetex",   function(v) trace_btexetex   = v end)
 
 local report_metapost = logs.reporter("metapost")
 local texerrormessage = logs.texerrormessage
@@ -212,9 +213,13 @@ local f_textext = formatters[ [[rawtextext("%s")]] ]
 
 function metapost.maketext(s,mode)
     if mode and mode == 1 then
-     -- report_metapost("ignoring verbatimtex: %s",s)
+        if trace_btexetex then
+            report_metapost("ignoring verbatimtex: [[%s]]",s)
+        end
     else
-     -- report_metapost("handling btex ... etex: %s",s)
+        if trace_btexetex then
+            report_metapost("handling btex ... etex: [[%s]]",s)
+        end
         s = gsub(s,'"','"&ditto&"')
         return f_textext(s)
     end
diff --git a/tex/context/base/mkiv/mult-prm.lua b/tex/context/base/mkiv/mult-prm.lua
index 4d067f432..86806d113 100644
--- a/tex/context/base/mkiv/mult-prm.lua
+++ b/tex/context/base/mkiv/mult-prm.lua
@@ -296,6 +296,7 @@ return {
   "mathdirection",
   "mathdisplayskipmode",
   "matheqnogapstep",
+  "mathflattenmode",
   "mathitalicsmode",
   "mathnolimitsmode",
   "mathoption",
diff --git a/tex/context/base/mkiv/status-files.log b/tex/context/base/mkiv/status-files.log
new file mode 100644
index 000000000..076bf6bb6
--- /dev/null
+++ b/tex/context/base/mkiv/status-files.log
@@ -0,0 +1,38 @@
+open source     > level 1, order 1, name 'cont-yes.mkiv'
+system          > 
+system          > ConTeXt  ver: 2018.05.19 21:46 MKIV beta  fmt: 2018.5.19  int: english/english
+system          > 
+system          > 'cont-new.mkiv' loaded
+open source     > level 2, order 2, name 'cont-new.mkiv'
+system          > beware: some patches loaded from cont-new.mkiv
+close source    > level 2, order 2, name 'cont-new.mkiv'
+system          > 'cont-loc.mkiv' loaded
+open source     > level 2, order 3, name 'c:/data/develop/context/sources/cont-loc.mkiv'
+system          > beware: enabling timing (for testing)
+system          > beware: enabling subpages
+system          > beware: wiping package.path
+system          > beware: testing mixed columns replacement
+system          > beware: testing new columnset code
+open source     > level 3, order 4, name 'page-cst.mkiv'
+loading         > ConTeXt Page Macros / Page Grids
+resolvers       > lua > loading file 'page-cst.lua' succeeded
+close source    > level 3, order 4, name 'page-cst.mkiv'
+close source    > level 2, order 4, name 'c:/data/develop/context/sources/cont-loc.mkiv'
+system          > 'cont-exp.mkiv' loaded
+interface       > macros > processed mkvi file 'c:/data/develop/context/sources/cont-exp.mkiv', delta 40
+interface       > macros > processed mkvi file 'c:/data/develop/context/sources/cont-exp.mkiv', delta 0
+open source     > level 2, order 5, name 'c:/data/develop/context/sources/cont-exp.mkiv'
+system          > beware: math flattening patches loaded from cont-exp.mkiv
+system          > beware: toks appending patches loaded from cont-exp.mkiv
+system          > beware: direction patches loaded from cont-exp.mkiv
+close source    > level 2, order 5, name 'c:/data/develop/context/sources/cont-exp.mkiv'
+system          > files > jobname 's-inf-01', input 'c:/data/develop/tex-context/tex/texmf-context/tex/context/modules/mkiv/s-inf-01.mkvi', result 'status-files.pdf'
+fonts           > latin modern fonts are not preloaded
+languages       > language 'en' is active
+interface       > macros > processed mkvi file 'c:/data/develop/tex-context/tex/texmf-context/tex/context/modules/mkiv/s-inf-01.mkvi', delta 138
+interface       > macros > processed mkvi file 'c:/data/develop/tex-context/tex/texmf-context/tex/context/modules/mkiv/s-inf-01.mkvi', delta 0
+open source     > level 2, order 6, name 'c:/data/develop/tex-context/tex/texmf-context/tex/context/modules/mkiv/s-inf-01.mkvi'
+fonts           > preloading latin modern fonts (second stage)
+fonts           > 'fallback modern-designsize rm 12pt' is loaded
+backend         > xmp > using file 'lpdf-pdx.xml'
+! error:  (nodes): attempt to free an impossible node 56385222
\ No newline at end of file
diff --git a/tex/context/base/mkiv/status-files.pdf b/tex/context/base/mkiv/status-files.pdf
deleted file mode 100644
index d147c9a94..000000000
Binary files a/tex/context/base/mkiv/status-files.pdf and /dev/null differ
diff --git a/tex/context/base/mkiv/status-lua.pdf b/tex/context/base/mkiv/status-lua.pdf
index cf702a8ea..a11b5c957 100644
Binary files a/tex/context/base/mkiv/status-lua.pdf and b/tex/context/base/mkiv/status-lua.pdf differ
diff --git a/tex/context/base/mkiv/strc-reg.lua b/tex/context/base/mkiv/strc-reg.lua
index 2c667fba3..b4d660c2b 100644
--- a/tex/context/base/mkiv/strc-reg.lua
+++ b/tex/context/base/mkiv/strc-reg.lua
@@ -47,7 +47,6 @@ local v_last               = variables.last
 local v_text               = variables.text
 
 local context              = context
-local commands             = commands
 
 local implement            = interfaces.implement
 
diff --git a/tex/context/base/mkiv/strc-reg.mkiv b/tex/context/base/mkiv/strc-reg.mkiv
index 81acb1cf3..ac8e35913 100644
--- a/tex/context/base/mkiv/strc-reg.mkiv
+++ b/tex/context/base/mkiv/strc-reg.mkiv
@@ -938,7 +938,9 @@
    \fi\fi}
 
 \unexpanded\def\defaultregisterseeword#1#2#3#4#5#6% i n #3:processor #4:internal #5:seeindex #6:word
-  {\registerpageseparator
+  {\ifnum#1=\plusone
+     \registerpageseparator
+   \fi
    \global\setconstant\c_strc_registers_page_state\plustwo
    \def\currentregisterpageindex{#4}%
    \dostarttagged\t!registersee\empty
diff --git a/tex/context/base/mkiv/strc-ren.mkiv b/tex/context/base/mkiv/strc-ren.mkiv
index 9db2f23e9..66dcf6ed1 100644
--- a/tex/context/base/mkiv/strc-ren.mkiv
+++ b/tex/context/base/mkiv/strc-ren.mkiv
@@ -325,7 +325,9 @@
      % kind of special, we want to snap heads also according to local specs local
      \setbox\b_strc_rendering_head\hbox
        {\hskip\dimexpr\d_strc_rendering_local_leftoffset+\headparameter\c!margin\relax
-        \box\b_strc_rendering_head}%
+        \box\b_strc_rendering_head
+        \getheadsyncs % a latelua why not in the box
+        }%
      \ifgridsnapping
        \applygridmethod
          {\headparameter\c!grid}%
@@ -345,7 +347,7 @@
        \nointerlineskip
        \dosomebreak\nobreak
      \fi
-     \getheadsyncs % a latelua, why not in the box
+%      \getheadsyncs % a latelua why not in the box
    \else
      % somehow this goes ok even when we push in the margin probably because we gobble pars
      % in the process of collecting index entries etc
diff --git a/tex/context/base/mkiv/syst-ini.mkiv b/tex/context/base/mkiv/syst-ini.mkiv
index ee8663293..c4cc2002a 100644
--- a/tex/context/base/mkiv/syst-ini.mkiv
+++ b/tex/context/base/mkiv/syst-ini.mkiv
@@ -1256,6 +1256,7 @@
 \ifdefined\automaticdiscretionary \else \def\automaticdiscretionary{\Uchar\exhyphenchar} \fi
 
 \ifdefined\mathpenaltiesmode      \else \newcount\mathpenaltiesmode \fi
+\ifdefined\mathflattenmode        \else \newcount\mathflattenmode   \fi
 \ifdefined\prebinoppenalty        \else \newcount\prebinoppenalty   \fi
 \ifdefined\prerelpenalty          \else \newcount\prerelpenalty     \fi
 
diff --git a/tex/context/base/mkiv/type-ini.mkvi b/tex/context/base/mkiv/type-ini.mkvi
index 186a4682a..cb9e5f160 100644
--- a/tex/context/base/mkiv/type-ini.mkvi
+++ b/tex/context/base/mkiv/type-ini.mkvi
@@ -294,7 +294,7 @@
 \def\font_typescripts_start_gobble#definitions\stoptypescript{}
 
 \def\font_typescripts_start_document#definitions\stoptypescript
-  {\c_font_typescripts_document\expandafter{\the\c_font_typescripts_document\starttypescript#definitions\stoptypescript}}
+  {\toksapp\c_font_typescripts_document{\starttypescript#definitions\stoptypescript}}
 
 \def\font_typescripts_start_process % could be a faster \doifelsenextoptionalif needed
   {\let\typescriptone  \m_font_typescripts_one
diff --git a/tex/context/interface/mkiv/i-context.pdf b/tex/context/interface/mkiv/i-context.pdf
index 961c0092d..5668dc50a 100644
Binary files a/tex/context/interface/mkiv/i-context.pdf and b/tex/context/interface/mkiv/i-context.pdf differ
diff --git a/tex/context/interface/mkiv/i-readme.pdf b/tex/context/interface/mkiv/i-readme.pdf
index 086858cb9..40ebc7cd2 100644
Binary files a/tex/context/interface/mkiv/i-readme.pdf and b/tex/context/interface/mkiv/i-readme.pdf differ
diff --git a/tex/context/modules/mkiv/s-present-steps.mkiv b/tex/context/modules/mkiv/s-present-steps.mkiv
index dbfabf9cd..432650a5e 100644
--- a/tex/context/modules/mkiv/s-present-steps.mkiv
+++ b/tex/context/modules/mkiv/s-present-steps.mkiv
@@ -32,20 +32,18 @@ function steps.startsteps(buffername)
     name = buffername
 end
 
-function steps.startstep(str)
-    settings = utilities.parsers.settings_to_hash(str)
-end
-
-function steps.stopstep()
-    settings.content = buffers.getcontent(name)
-    data[#data+1] = settings
-end
-
 function steps.stopsteps()
+    local n = 0
     for i=1,#data do
-        for j=1,i do
-            local step = data[j]
-            if step then
+        local state = "once"
+        local done  = 0
+        while true do
+            context.startprocessingsteps()
+            for j=1,i do
+                local step    = data[j]
+                local nested  = step.nested
+                local content = step.content
+                local last    = (i == #data) and (j == i) and 1 or 0
                 local option = step.option
                 local flush  = true
                 if option == interfaces.variables["title"] then
@@ -58,37 +56,94 @@ function steps.stopsteps()
                     end
                 end
                 if flush then
-                    context(function()
-                        buffers.assign("step",step.content)
-                        context.processstep("step",set,j,i)
-                    end)
+                    if j < i or nested == 0 then
+                        context(function()
+                            buffers.assign("step",content)
+                            context.processstep("step",i,0,last)
+                         -- context.writestatus("step a",string.formatters["%i %i %i"](i,0,last))
+                        end)
+                        state = "done"
+                    else
+                        done = done + 1
+                        local d = done
+                        context(function()
+                            buffers.assign("step",content)
+                            context.processstep("step",i,d,last)
+                         -- context.writestatus("step b",string.formatters["%i %i %i"](i,d,last))
+                        end)
+                        if done == nested then
+                            state = "done"
+                            n = n + nested
+                        else
+                            state = "busy"
+                        end
+                    end
                 end
             end
+            context.stopprocessingsteps()
+            if state == "done" then
+                break
+            end
         end
     end
 end
 
+function steps.startstep(str)
+    settings = utilities.parsers.settings_to_hash(str)
+end
+
+function steps.stopstep()
+    settings.content = buffers.getcontent(name)
+    settings.nested  = tonumber(settings.n) or 0
+    data[#data+1] = settings
+end
+
+function steps.startsubstep(str)
+    local d = data[#data]
+    d.nested = d.nested + 1
+end
+
+function steps.stopsubstep()
+end
+
 \stopluacode
 
 \definebuffer
   [step]
 
-\def\currentstep{0}
+\def\currentstep   {0}
+\def\currentsubstep{0}
+
+\unexpanded\def\startprocessingsteps
+  {\global\wantedsubstep\zerocount}
+
+\unexpanded\def\stopprocessingsteps
+  {}
 
 \unexpanded\def\processstep#1#2#3#4%
   {\par
-   \edef\currentstep{#4}%
-   \ifnum#3=#4\relax
+   \edef\currentstep   {#2}%
+   \edef\currentsubstep{#3}%
+   \ifcase#4\relax
       \setupreferencing[prefix=#2:#3]
       \getbuffer[#1]%
-      \page
+      \par
    \else
+      \setupreferencing[prefix=]
       \getbuffer[#1]%
-      \par
+      \page
    \fi}
 
 \let\normalstartstep\startstep
 
+\newcount\wantedsubstep
+
+\unexpanded\def\startsteps
+  {\ctxlua{moduledata.steps.startsteps("\thedefinedbuffer{step}")}}
+
+\unexpanded\def\stopsteps
+  {\ctxlua{moduledata.steps.stopsteps()}}
+
 \unexpanded\def\startstep
   {\dosingleempty\startstepindeed}
 
@@ -99,11 +154,19 @@ end
 \unexpanded\def\stopstep
   {\ctxlua{moduledata.steps.stopstep()}}
 
-\unexpanded\def\startsteps
-  {\ctxlua{moduledata.steps.startsteps("\thedefinedbuffer{step}")}}
+\let\stopsubstep\relax
 
-\unexpanded\def\stopsteps
-  {\ctxlua{moduledata.steps.stopsteps()}}
+\unexpanded\def\startsubstep#1\stopsubstep
+  {\ctxlua{moduledata.steps.startsubstep()}%
+   \ifcase\currentsubstep\relax
+     #1%
+   \else
+     \global\advance\wantedsubstep\plusone
+     \ifnum\currentsubstep>\wantedsubstep\else
+       #1%
+     \fi
+   \fi
+   \ctxlua{moduledata.steps.stopsubstep()}}
 
 \stopmodule
 
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index bba070be4..5e43f0026 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  : 05/17/18 18:32:09
+-- merge date  : 05/19/18 21:46:20
 
 do -- begin closure to overcome local limits and interference
 
@@ -27729,9 +27729,25 @@ do
 end
 local plugins={}
 otf.plugins=plugins
+local report=logs.reporter("fonts")
 function otf.registerplugin(name,f)
   if type(name)=="string" and type(f)=="function" then
     plugins[name]={ name,f }
+    report()
+    report("plugin %a has been loaded, please be aware of possible side effects",name)
+    report()
+    if logs.pushtarget then
+      logs.pushtarget("log")
+    end
+    report("Plugins are not officially supported unless stated otherwise. This is because")
+    report("they bypass the regular font handling and therefore some features in ConTeXt")
+    report("(especially those related to fonts) might not work as expected or might not work")
+    report("at all. Some plugins are for testing and development only and might change")
+    report("whenever we feel the need for it.")
+    report()
+    if logs.poptarget then
+      logs.poptarget()
+    end
   end
 end
 function otf.plugininitializer(tfmdata,value)
-- 
cgit v1.2.3