diff options
author | Marius <mariausol@gmail.com> | 2010-08-14 15:54:19 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2010-08-14 15:54:19 +0300 |
commit | 39e30629c15ae4a899532d84c4abea127f2847a6 (patch) | |
tree | ce9007341b23338cc6d73dad028f307c78dcb0ed /tex/context/base/strc-not.lua | |
parent | 83a331fff83ac18314885a39e959ca0c10f316f7 (diff) | |
download | context-39e30629c15ae4a899532d84c4abea127f2847a6.tar.gz |
stable 2010.07.30 11:35
Diffstat (limited to 'tex/context/base/strc-not.lua')
-rw-r--r-- | tex/context/base/strc-not.lua | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/tex/context/base/strc-not.lua b/tex/context/base/strc-not.lua index 1e761d657..466bc7a03 100644 --- a/tex/context/base/strc-not.lua +++ b/tex/context/base/strc-not.lua @@ -84,7 +84,8 @@ nodes.getn = getn -- we could make a special enhancer function notes.listindex(tag,n) - return notedata[tag][n] + local ndt = notedata[tag] + return ndt and ndt[n] end function notes.define(tag,kind,number) @@ -98,9 +99,10 @@ function notes.save(tag,newkind) if trace_notes then report_notes("saving state of '%s': %s -> %s",tag,state.kind,newkind or state.kind) end - state.saved = notedata[tag] + state.saveddata = notedata[tag] state.savedkind = state.kind state.kind = newkind or state.kind + state.saved = true notedata[tag] = { } end end @@ -111,9 +113,10 @@ function notes.restore(tag,forcedstate) if trace_notes then report_notes("restoring state of '%s': %s -> %s",tag,state.kind,state.savedkind) end - state.saved = nil + notedata[tag] = state.saveddata state.kind = forcedstate or state.savedkind - notedata[tag] = state.saved + state.saveddata = nil + state.saved = false end end @@ -249,13 +252,17 @@ function notes.postpone() end end -function notes.setsymbolpage(tag,n) - local l = notes.listindex(tag,n) - local p = texcount.realpageno - if trace_notes then - report_notes("note %s of '%s' with list index %s gets page %s",n,tag,l,p) +function notes.setsymbolpage(tag,n,l) + local l = l or notes.listindex(tag,n) + if l then + local p = texcount.realpageno + if trace_notes then + report_notes("note %s of '%s' with list index %s gets page %s",n,tag,l,p) + end + lists.cached[l].references.symbolpage = p + else + report_notes("internal error: note %s of '%s' is not initialized",n,tag) end - lists.cached[l].references.symbolpage = p end function notes.getsymbolpage(tag,n) |