summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/node-par.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2018-07-27 19:41:15 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2018-07-27 19:41:15 +0200
commitb61d5dd3555e906b21601ff75b3268c0f359283e (patch)
treed46b07daf1c26c0fc7d7254d3f0e1515e9ed36a8 /tex/context/base/mkiv/node-par.lua
parent1add40ac787d36d3bd40e196aea752dff2cfb769 (diff)
downloadcontext-b61d5dd3555e906b21601ff75b3268c0f359283e.tar.gz
2018-07-27 19:21:00
Diffstat (limited to 'tex/context/base/mkiv/node-par.lua')
-rw-r--r--tex/context/base/mkiv/node-par.lua47
1 files changed, 38 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/node-par.lua b/tex/context/base/mkiv/node-par.lua
index bcb4621c9..56741e765 100644
--- a/tex/context/base/mkiv/node-par.lua
+++ b/tex/context/base/mkiv/node-par.lua
@@ -9,19 +9,48 @@ if not modules then modules = { } end modules ['node-par'] = {
local starttiming = statistics.starttiming
local stoptiming = statistics.stoptiming
-local actions = nodes.tasks.actions("everypar")
+local sequencers = utilities.sequencers
--- this one is called a lot!
+-- This are called a lot!
+
+if LUATEXFUNCTIONALITY > 6857 then
+
+ local actions = nodes.tasks.actions("everypar")
+
+ local function everypar(head)
+ starttiming(builders)
+ head = actions(head)
+ stoptiming(builders)
+ return head
+ end
+
+ callbacks.register("insert_local_par",everypar,"after paragraph start")
-local function everypar(head)
- starttiming(builders)
- head = actions(head)
- stoptiming(builders)
- return head
end
-if LUATEXFUNCTIONALITY > 6857 then
+if LUATEXFUNCTIONALITY > 6870 then
+
+ local actions = sequencers.new {
+ name = "newgraf",
+ arguments = "mode,indented",
+ returnvalues = "indented",
+ results = "indented",
+ }
+
+ sequencers.appendgroup(actions,"before") -- user
+ sequencers.appendgroup(actions,"system") -- private
+ sequencers.appendgroup(actions,"after" ) -- user
+
+ local function newgraf(mode,indented)
+ local runner = actions.runner
+ if runner then
+ starttiming(builders)
+ indent = runner(mode,indented)
+ stoptiming(builders)
+ end
+ return indented
+ end
- callbacks.register("insert_local_par",everypar,"paragraph start")
+ callbacks.register("new_graf",newgraf,"before paragraph start")
end