diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-05-16 00:15:04 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2015-05-16 00:15:04 +0200 |
commit | b55577d0998160c0174e250b542016ecd6ca9056 (patch) | |
tree | 27093212d5ca3e6ffe4ae434c3ec094233ed37ba /tex/context/base/strc-blk.lua | |
parent | 624cbb5da392e9403984dd1cf368c0d408b1c2a8 (diff) | |
download | context-b55577d0998160c0174e250b542016ecd6ca9056.tar.gz |
2015-05-15 23:06:00
Diffstat (limited to 'tex/context/base/strc-blk.lua')
-rw-r--r-- | tex/context/base/strc-blk.lua | 31 |
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" } } |