diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/typo-brk.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/typo-brk.lua | 46 |
1 files changed, 39 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/context/base/typo-brk.lua b/Master/texmf-dist/tex/context/base/typo-brk.lua index f9a65c6ba4c..a9d775856b4 100644 --- a/Master/texmf-dist/tex/context/base/typo-brk.lua +++ b/Master/texmf-dist/tex/context/base/typo-brk.lua @@ -53,6 +53,8 @@ local tasks = nodes.tasks local v_reset = interfaces.variables.reset +local implement = interfaces.implement + local new_penalty = nodepool.penalty local new_glue = nodepool.glue local new_disc = nodepool.disc @@ -107,7 +109,8 @@ methods[2] = function(head,start) -- ( => (- local tmp head, start, tmp = remove_node(head,start) head, start = insert_node_before(head,start,new_disc()) - setfield(start,"attr",copy_nodelist(getfield(tmp,"attr"))) -- just a copy will do + -- setfield(start,"attr",copy_nodelist(getfield(tmp,"attr"))) -- just a copy will do + setfield(start,"attr",getfield(tmp,"attr")) setfield(start,"replace",tmp) local tmp = copy_node(tmp) local hyphen = copy_node(tmp) @@ -125,7 +128,8 @@ methods[3] = function(head,start) -- ) => -) local tmp head, start, tmp = remove_node(head,start) head, start = insert_node_before(head,start,new_disc()) - setfield(start,"attr",copy_nodelist(getfield(tmp,"attr"))) -- just a copy will do + -- setfield(start,"attr",copy_nodelist(getfield(tmp,"attr"))) -- just a copy will do + setfield(start,"attr",getfield(tmp,"attr")) setfield(start,"replace",tmp) local tmp = copy_node(tmp) local hyphen = copy_node(tmp) @@ -143,7 +147,8 @@ methods[4] = function(head,start) -- - => - - - local tmp head, start, tmp = remove_node(head,start) head, start = insert_node_before(head,start,new_disc()) - setfield(start,"attr",copy_nodelist(getfield(tmp,"attr"))) -- just a copy will do + -- setfield(start,"attr",copy_nodelist(getfield(tmp,"attr"))) -- just a copy will do + setfield(start,"attr",getfield(tmp,"attr")) setfield(start,"pre",copy_node(tmp)) setfield(start,"post",copy_node(tmp)) setfield(start,"replace",tmp) @@ -171,7 +176,8 @@ methods[5] = function(head,start,settings) -- x => p q r if middle then setfield(start,"replace",(tonodes(tostring(middle),font,attr))) end - setfield(start,"attr",copy_nodelist(attr)) -- todo: critical only -- just a copy will do + -- setfield(start,"attr",copy_nodelist(attr)) -- todo: critical only -- just a copy will do + setfield(start,"attr",attr) -- todo: critical only -- just a copy will do free_node(tmp) insert_break(head,start,10000,10000) end @@ -315,6 +321,32 @@ end -- interface -commands.definebreakpoints = breakpoints.define -commands.definebreakpoint = breakpoints.setreplacement -commands.setbreakpoints = breakpoints.set +implement { + name = "definebreakpoints", + actions = breakpoints.define, + arguments = "string" +} + +implement { + name = "definebreakpoint", + actions = breakpoints.setreplacement, + arguments = { + "string", + "string", + "string", + { + { "type", "integer" }, + { "nleft" }, + { "nright" }, + { "right" }, + { "left" }, + { "middle" }, + } + } +} + +implement { + name = "setbreakpoints", + actions = breakpoints.set, + arguments = "string" +} |