summaryrefslogtreecommitdiff
path: root/tex/context/base/strc-blk.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/strc-blk.lua')
-rw-r--r--tex/context/base/strc-blk.lua31
1 files changed, 19 insertions, 12 deletions
diff --git a/tex/context/base/strc-blk.lua b/tex/context/base/strc-blk.lua
index 935b6c061..0ababcfc0 100644
--- a/tex/context/base/strc-blk.lua
+++ b/tex/context/base/strc-blk.lua
@@ -16,6 +16,8 @@ local allocate = utilities.storage.allocate
local context = context
local commands = commands
+local implement = interfaces.implement
+
local structures = structures
structures.blocks = structures.blocks or { }
@@ -78,13 +80,19 @@ end
function blocks.select(state,name,tag,criterium)
criterium = criterium or "text"
- if find(tag,"=") then tag = "" end
- local names = settings_to_set(name)
- local all = tag == ""
- local tags = not all and settings_to_set(tag)
- local hide = state == "process"
- local n = sections.numberatdepth(criterium)
- local result = lists.filtercollected("all", criterium, n, collected, { })
+ if find(tag,"=",1,true) then
+ tag = ""
+ end
+ local names = settings_to_set(name)
+ local all = tag == ""
+ local tags = not all and settings_to_set(tag)
+ local hide = state == "process"
+ local result = lists.filter {
+ names = "all",
+ criterium = criterium,
+ number = sections.numberatdepth(criterium), -- not needed
+ collected = collected,
+ }
for i=1,#result do
local ri = result[i]
local metadata = ri.metadata
@@ -148,8 +156,7 @@ end
-- interface
-
-commands.definestructureblock = blocks.define
-commands.savestructureblock = blocks.save
-commands.selectstructureblock = blocks.select
-commands.setstructureblockstate = blocks.setstate
+implement { name = "definestructureblock", actions = blocks.define, arguments = "string" }
+implement { name = "savestructureblock", actions = blocks.save, arguments = { "string", "string" ,"string" } }
+implement { name = "selectstructureblock", actions = blocks.select, arguments = { "string", "string" ,"string", "string" } }
+implement { name = "setstructureblockstate", actions = blocks.setstate, arguments = { "string", "string" ,"string" } }