From 0b8282fb089cd770062f5dfcd4d3d2d5884c10d0 Mon Sep 17 00:00:00 2001
From: Hans Hagen <pragma@wxs.nl>
Date: Thu, 24 Jan 2013 10:07:00 +0100
Subject: beta 2013.01.24 10:07

---
 tex/context/base/char-def.lua                      |   4 +
 tex/context/base/cont-new.mkii                     |   2 +-
 tex/context/base/cont-new.mkiv                     |   2 +-
 tex/context/base/context-version.pdf               | Bin 4126 -> 4123 bytes
 tex/context/base/context-version.png               | Bin 40256 -> 39926 bytes
 tex/context/base/context.mkii                      |   2 +-
 tex/context/base/context.mkiv                      |   2 +-
 tex/context/base/enco-ini.mkiv                     |   4 +-
 tex/context/base/math-ext.lua                      | 123 +++++++++++++--------
 tex/context/base/math-ttv.lua                      |  22 ++--
 tex/context/base/node-ini.lua                      |  28 +++--
 tex/context/base/scrn-wid.mkvi                     |   1 +
 tex/context/base/status-files.pdf                  | Bin 24739 -> 24720 bytes
 tex/context/base/status-lua.pdf                    | Bin 208538 -> 208506 bytes
 tex/context/base/x-res-01.mkiv                     |   5 +-
 tex/context/sample/d-res-01.xml                    |  50 +++++++++
 tex/generic/context/luatex/luatex-fonts-merged.lua |   2 +-
 17 files changed, 170 insertions(+), 77 deletions(-)
 create mode 100644 tex/context/sample/d-res-01.xml

(limited to 'tex')

diff --git a/tex/context/base/char-def.lua b/tex/context/base/char-def.lua
index 118fbc701..940e3208a 100644
--- a/tex/context/base/char-def.lua
+++ b/tex/context/base/char-def.lua
@@ -7972,6 +7972,8 @@ characters.data={
   direction="nsm",
   linebreak="cm",
   mathstretch="h",
+  mathclass="topaccent",
+  mathname="widehat",
   unicodeslot=0x0302,
  },
  {
@@ -7982,6 +7984,8 @@ characters.data={
   direction="nsm",
   linebreak="cm",
   mathstretch="h",
+  mathclass="topaccent",
+  mathname="widetilde",
   unicodeslot=0x0303,
  },
  {
diff --git a/tex/context/base/cont-new.mkii b/tex/context/base/cont-new.mkii
index f29e6f3a5..f6eb3500b 100644
--- a/tex/context/base/cont-new.mkii
+++ b/tex/context/base/cont-new.mkii
@@ -11,7 +11,7 @@
 %C therefore copyrighted by \PRAGMA. See mreadme.pdf for
 %C details.
 
-\newcontextversion{2013.01.23 14:45}
+\newcontextversion{2013.01.24 10:07}
 
 %D This file is loaded at runtime, thereby providing an
 %D excellent place for hacks, patches, extensions and new
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv
index e64ecf579..1c5857a94 100644
--- a/tex/context/base/cont-new.mkiv
+++ b/tex/context/base/cont-new.mkiv
@@ -11,7 +11,7 @@
 %C therefore copyrighted by \PRAGMA. See mreadme.pdf for
 %C details.
 
-\newcontextversion{2013.01.23 14:45}
+\newcontextversion{2013.01.24 10:07}
 
 %D This file is loaded at runtime, thereby providing an excellent place for
 %D hacks, patches, extensions and new features.
diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf
index a5a233b18..d6eb39e6a 100644
Binary files a/tex/context/base/context-version.pdf and b/tex/context/base/context-version.pdf differ
diff --git a/tex/context/base/context-version.png b/tex/context/base/context-version.png
index c0a4665a7..855af435f 100644
Binary files a/tex/context/base/context-version.png and b/tex/context/base/context-version.png differ
diff --git a/tex/context/base/context.mkii b/tex/context/base/context.mkii
index 24ef33d05..cd74f1876 100644
--- a/tex/context/base/context.mkii
+++ b/tex/context/base/context.mkii
@@ -20,7 +20,7 @@
 %D your styles an modules.
 
 \edef\contextformat {\jobname}
-\edef\contextversion{2013.01.23 14:45}
+\edef\contextversion{2013.01.24 10:07}
 
 %D For those who want to use this:
 
diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv
index f0feaa1a6..4c516968d 100644
--- a/tex/context/base/context.mkiv
+++ b/tex/context/base/context.mkiv
@@ -25,7 +25,7 @@
 %D up and the dependencies are more consistent.
 
 \edef\contextformat {\jobname}
-\edef\contextversion{2013.01.23 14:45}
+\edef\contextversion{2013.01.24 10:07}
 
 %D For those who want to use this:
 
diff --git a/tex/context/base/enco-ini.mkiv b/tex/context/base/enco-ini.mkiv
index 3b0cbc9fc..77fcbe483 100644
--- a/tex/context/base/enco-ini.mkiv
+++ b/tex/context/base/enco-ini.mkiv
@@ -156,8 +156,8 @@
 \definemathaccent hat       \mathhat
 \definemathaccent vec       \mathvec
 \definemathaccent dot       \mathdot
-\definemathaccent widetilde \mathwidetilde
-\definemathaccent widehat   \mathwidehat
+% \definemathaccent widetilde \mathwidetilde
+% \definemathaccent widehat   \mathwidehat
 
 % from enco-com:
 
diff --git a/tex/context/base/math-ext.lua b/tex/context/base/math-ext.lua
index 047543970..a3133d07a 100644
--- a/tex/context/base/math-ext.lua
+++ b/tex/context/base/math-ext.lua
@@ -8,6 +8,8 @@ if not modules then modules = { } end modules ['math-ext'] = {
 
 local trace_virtual = false trackers.register("math.virtual", function(v) trace_virtual = v end)
 
+local basename = file.basename
+
 local mathematics = mathematics
 local characters  = characters
 
@@ -41,33 +43,60 @@ function extras.copy(target,original)
         local extrachar = characters[unicode]
         local nextinsize = extradesc.nextinsize
         if nextinsize then
-            for i=1,#nextinsize do
-                local nextslot = nextinsize[i]
-                local nextbase = characters[nextslot]
-                if nextbase then
-                    local nextnext = nextbase and nextbase.next
-                    if nextnext then
-                        local nextchar = characters[nextnext]
-                        if nextchar then
-                            if trace_virtual then
-                                report_math("extra U+%05X in %s at %s maps on U+%05X (class: %s, name: %s)",unicode,
-                                    file.basename(properties.fullname),parameters.size,nextslot,extradesc.mathclass or "?",extradesc.mathname or "?")
-                            end
-                            characters[unicode] = nextchar
-                            break
-                        end
+            local first = 1
+            local charused = unicode
+            if not extrachar then
+                for i=1,#nextinsize do
+                    local slot = nextinsize[i]
+                    extrachar = characters[slot]
+                    if extrachar then
+                        characters[unicode] = extrachar
+                        first = i + 1
+                        charused = slot
+                        break
                     end
                 end
             end
-            if not characters[unicode] then -- can be set in previous loop
-                for i=1,#nextinsize do
+            if not extrachar then
+                if trace_virtual then
+                    report_math("extra U+%05X in %s at is not mapped (class: %s, name: %s)",
+                        unicode,basename(properties.fullname),parameters.size,
+                        extradesc.mathclass or "?", extradesc.mathname or "?")
+                end
+            elseif not extrachar.next then
+                local nextused = false
+                for i=first,#nextinsize do
                     local nextslot = nextinsize[i]
                     local nextbase = characters[nextslot]
                     if nextbase then
-                        characters[unicode] = nextbase -- still ok?
-                        break
+                        local nextnext = nextbase and nextbase.next
+                        if nextnext then
+                            local nextchar = characters[nextnext]
+                            if nextchar then
+                                extrachar.next = nextchar
+                                nextused = nextslot
+                                break
+                            end
+                        end
+                    end
+                end
+                if trace_virtual then
+                    if nextused then
+                        report_math("extra U+%05X in %s at %s maps onto U+%05X (class: %s, name: %s) with next U+%05X",
+                            unicode,basename(properties.fullname),parameters.size,charused,
+                            extradesc.mathclass or "?",extradesc.mathname or "?", nextused)
+                    else
+                        report_math("extra U+%05X in %s at %s maps onto U+%05X (class: %s, name: %s) with no next",
+                            unicode,basename(properties.fullname),parameters.size,charused,
+                            extradesc.mathclass or "?",extradesc.mathname or "?")
                     end
                 end
+            else
+                if trace_virtual then
+                    report_math("extra U+%05X in %s at %s maps onto U+%05X (class: %s, name: %s)", -- own next
+                        unicode,basename(properties.fullname),parameters.size,charused,
+                        extradesc.mathclass or "?",extradesc.mathname or "?")
+                end
             end
         end
     end
@@ -75,40 +104,40 @@ end
 
 utilities.sequencers.appendaction(mathactions,"system","mathematics.extras.copy")
 
--- 0xFE302 -- 0xFE320 for accents
-
-extras.add(0xFE302, {
-    category="mn",
-    description="WIDE MATHEMATICAL HAT",
-    direction="nsm",
-    linebreak="cm",
-    mathclass="accent",
-    mathname="widehat",
-    mathstretch="h",
-    unicodeslot=0xFE302,
-    nextinsize={ 0x00302, 0x0005E },
-} )
-
-extras.add(0xFE303, {
-    category="mn",
-    cjkwd="a",
-    description="WIDE MATHEMATICAL TILDE",
-    direction="nsm",
-    linebreak="cm",
-    mathclass="accent",
-    mathname="widetilde",
-    mathstretch="h",
-    unicodeslot=0xFE303,
-    nextinsize={ 0x00303, 0x0007E },
-} )
+-- 0xFE302 -- 0xFE320 for accents (gone with new lm/gyre)
+--
+-- extras.add(0xFE302, {
+--     category="mn",
+--     description="WIDE MATHEMATICAL HAT",
+--     direction="nsm",
+--     linebreak="cm",
+--     mathclass="topaccent",
+--     mathname="widehat",
+--     mathstretch="h",
+--     unicodeslot=0xFE302,
+--     nextinsize={ 0x00302, 0x0005E },
+-- } )
+--
+-- extras.add(0xFE303, {
+--     category="mn",
+--     cjkwd="a",
+--     description="WIDE MATHEMATICAL TILDE",
+--     direction="nsm",
+--     linebreak="cm",
+--     mathclass="topaccent",
+--     mathname="widetilde",
+--     mathstretch="h",
+--     unicodeslot=0xFE303,
+--     nextinsize={ 0x00303, 0x0007E },
+-- } )
 
 -- 0xFE321 -- 0xFE340 for missing characters
 
 extras.add(0xFE321, {
     category="sm",
     description="MATHEMATICAL SHORT BAR",
---  direction="on",
---  linebreak="nu",
+ -- direction="on",
+ -- linebreak="nu",
     mathclass="relation",
     mathname="mapstochar",
     unicodeslot=0xFE321,
diff --git a/tex/context/base/math-ttv.lua b/tex/context/base/math-ttv.lua
index 74f8a2a7b..9e86ca975 100644
--- a/tex/context/base/math-ttv.lua
+++ b/tex/context/base/math-ttv.lua
@@ -29,16 +29,16 @@ mathencodings["large-to-small"] = {
     [0x027E8] = 0x0A, -- <
     [0x027E9] = 0x0B, -- >
     [0x0007C] = 0x0C, -- |
---~ [0x0]     = 0x0D, -- lVert rVert Vert
---  [0x0002F] = 0x0E, -- /
+ -- [0x0]     = 0x0D, -- lVert rVert Vert
+ -- [0x0002F] = 0x0E, -- /
     [0x0005C] = 0x0F, -- \
---~ [0x0]     = 0x3A, -- lgroup
---~ [0x0]     = 0x3B, -- rgroup
---~ [0x0]     = 0x3C, -- arrowvert
---~ [0x0]     = 0x3D, -- Arrowvert
+ -- [0x0]     = 0x3A, -- lgroup
+ -- [0x0]     = 0x3B, -- rgroup
+ -- [0x0]     = 0x3C, -- arrowvert
+ -- [0x0]     = 0x3D, -- Arrowvert
     [0x02195] = 0x3F, -- updownarrow
---~ [0x0]     = 0x40, -- lmoustache
---~ [0x0]     = 0x41, -- rmoustache
+ -- [0x0]     = 0x40, -- lmoustache
+ -- [0x0]     = 0x41, -- rmoustache
     [0x0221A] = 0x70, -- sqrt
     [0x021D5] = 0x77, -- Updownarrow
     [0x02191] = 0x78, -- uparrow
@@ -50,8 +50,10 @@ mathencodings["large-to-small"] = {
     [0x02211] = 0x58, -- sum
     [0x0222B] = 0x5A, -- intop
     [0x0222E] = 0x49, -- ointop
-    [0xFE302] = 0x62, -- widehat
-    [0xFE303] = 0x65, -- widetilde
+ -- [0xFE302] = 0x62, -- widehat
+ -- [0xFE303] = 0x65, -- widetilde
+    [0x00302] = 0x62, -- widehat
+    [0x00303] = 0x65, -- widetilde
     [0x022C0] = 0x5E, -- bigwedge
     [0x022C1] = 0x5F, -- bigvee
     [0x022C2] = 0x5C, -- bigcap
diff --git a/tex/context/base/node-ini.lua b/tex/context/base/node-ini.lua
index 7f33a0149..74a039cf5 100644
--- a/tex/context/base/node-ini.lua
+++ b/tex/context/base/node-ini.lua
@@ -156,6 +156,11 @@ local fillcodes = allocate {
     [4] = "filll",
 }
 
+local margincodes = allocate {
+    [0] = "left",
+    [1] = "right",
+}
+
 local function simplified(t)
     local r = { }
     for k, v in next, t do
@@ -167,16 +172,17 @@ end
 local nodecodes = simplified(node.types())
 local whatcodes = simplified(node.whatsits())
 
-skipcodes     = allocate(swapped(skipcodes,    skipcodes ))
-noadcodes     = allocate(swapped(noadcodes,    noadcodes ))
-nodecodes     = allocate(swapped(nodecodes,    nodecodes ))
-whatcodes     = allocate(swapped(whatcodes,    whatcodes ))
-listcodes     = allocate(swapped(listcodes,    listcodes ))
-glyphcodes    = allocate(swapped(glyphcodes,   glyphcodes))
-kerncodes     = allocate(swapped(kerncodes,    kerncodes ))
-penaltycodes  = allocate(swapped(penaltycodes, penaltycodes))
-mathcodes     = allocate(swapped(mathcodes,    mathcodes ))
-fillcodes     = allocate(swapped(fillcodes,    fillcodes ))
+skipcodes    = allocate(swapped(skipcodes,skipcodes))
+noadcodes    = allocate(swapped(noadcodes,noadcodes))
+nodecodes    = allocate(swapped(nodecodes,nodecodes))
+whatcodes    = allocate(swapped(whatcodes,whatcodes))
+listcodes    = allocate(swapped(listcodes,listcodes))
+glyphcodes   = allocate(swapped(glyphcodes,glyphcodes))
+kerncodes    = allocate(swapped(kerncodes,kerncodes))
+penaltycodes = allocate(swapped(penaltycodes,penaltycodes))
+mathcodes    = allocate(swapped(mathcodes,mathcodes))
+fillcodes    = allocate(swapped(fillcodes,fillcodes))
+margincodes  = allocate(swapped(margincodes,margincodes))
 
 nodes.skipcodes    = skipcodes  nodes.gluecodes    = skipcodes -- more official
 nodes.noadcodes    = noadcodes
@@ -188,6 +194,7 @@ nodes.kerncodes    = kerncodes
 nodes.penaltycodes = kerncodes
 nodes.mathcodes    = mathcodes
 nodes.fillcodes    = fillcodes
+nodes.margincodes  = margincodes
 
 listcodes.row              = listcodes.alignment
 listcodes.column           = listcodes.alignment
@@ -204,6 +211,7 @@ nodes.codes = allocate {
     whatsit = whatcodes,
     math    = mathnodes,
     noad    = noadcodes,
+    margin  = margincodes,
 }
 
 function nodes.showcodes()
diff --git a/tex/context/base/scrn-wid.mkvi b/tex/context/base/scrn-wid.mkvi
index 9b3f0cb78..917050c54 100644
--- a/tex/context/base/scrn-wid.mkvi
+++ b/tex/context/base/scrn-wid.mkvi
@@ -235,6 +235,7 @@
 \setvalue{\??attachmentlocation\v!rightmargin}{\inrightmargin}
 \setvalue{\??attachmentlocation\v!high       }{\high}
 \setvalue{\??attachmentlocation\v!none       }{\scrn_attachment_collect}
+%setvalue{\??attachmentlocation\v!text       }{\gobblenextargument} % gobbles the box
 
 \def\scrn_attachment_collect#content%
   {\global\setbox\b_scrn_attachment_collect\hbox\bgroup
diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf
index 5455a5ac3..96c69f619 100644
Binary files a/tex/context/base/status-files.pdf and b/tex/context/base/status-files.pdf differ
diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf
index 24852ed56..5c9fd38ca 100644
Binary files a/tex/context/base/status-lua.pdf and b/tex/context/base/status-lua.pdf differ
diff --git a/tex/context/base/x-res-01.mkiv b/tex/context/base/x-res-01.mkiv
index 0ebb8933d..4931b5650 100644
--- a/tex/context/base/x-res-01.mkiv
+++ b/tex/context/base/x-res-01.mkiv
@@ -53,7 +53,6 @@
 
 \defineregister
   [figureindex]
-  [figureindices]
 
 \setupregister
   [figureindex]
@@ -135,8 +134,8 @@
 \setupbodyfont
   [tt,10pt]
 
-\definesymbol     [attachment] [{\strut\bf\color[darkred]{\jobname.xml}}]
-\setupattachments [symbol=attachment,alternative=]
+\definesymbol     [attachment] [{\strut\bf\color[darkred]{\inputfilename}}] % jobname.xml}}]
+\setupattachments [symbol=attachment,alternative=,location=text]
 \useattachment    [datafile] [\inputfilename]
 
 \xmlloadonly{main}{\inputfilename}{}
diff --git a/tex/context/sample/d-res-01.xml b/tex/context/sample/d-res-01.xml
new file mode 100644
index 000000000..23f22cc32
--- /dev/null
+++ b/tex/context/sample/d-res-01.xml
@@ -0,0 +1,50 @@
+<!-- DOCTYPE figurelibrary SYSTEM "x-res-00.xsd" -->
+
+<rl:library xmlns:rl="x-res-00.xsd" language="nl">
+
+  <rl:description>
+    <rl:organization>PRAGMA ADE</rl:organization>
+    <rl:project>context</rl:project>
+    <rl:product>figure demo</rl:product>
+    <rl:comment>This file demonstrates how to use the ConTeXt
+      figure base macros.</rl:comment>
+  </rl:description>
+
+  <rl:instance>
+    <rl:label>part of a dutch cow</rl:label>
+    <rl:original>a simple dutch cow</rl:original>
+    <rl:manipulation>
+      <rl:viewport width="2cm" height="2cm" hoffset="2cm" voffset="2cm"/>
+      <rl:background r=".8"/>
+    </rl:manipulation>
+  </rl:instance>
+
+  <rl:resource>
+    <rl:label>a simple dutch cow</rl:label>
+    <rl:file>cow.pdf</rl:file>
+    <rl:copyright>who knows</rl:copyright>
+    <rl:comment>This is just an example graphic.</rl:comment>
+    <rl:status>unknown</rl:status>
+  </rl:resource>
+
+  <rl:resource>
+    <rl:label>mill in hasselt</rl:label>
+    <rl:file>mill.png</rl:file>
+    <rl:copyright>johan jonker</rl:copyright>
+    <rl:comment>A Dutch mill.</rl:comment>
+    <rl:status>unknown</rl:status>
+  </rl:resource>
+
+  <rl:resource>
+    <rl:label>another simple dutch cow</rl:label>
+    <rl:file>cow.pdf</rl:file>
+    <rl:copyright>Who Kowns</rl:copyright>
+    <rl:comment>Again some demo graphic.</rl:comment>
+    <rl:status>obsolete</rl:status>
+    <rl:manipulation>
+      <rl:viewport width="2cm" height="2cm" hoffset="2cm" voffset="2cm"/>
+      <rl:background s=".8"/>
+    </rl:manipulation>
+  </rl:resource>
+
+</rl:library>
diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua
index f1d7f6de0..2e719bfa8 100644
--- a/tex/generic/context/luatex/luatex-fonts-merged.lua
+++ b/tex/generic/context/luatex/luatex-fonts-merged.lua
@@ -1,6 +1,6 @@
 -- merged file : luatex-fonts-merged.lua
 -- parent file : luatex-fonts.lua
--- merge date  : 01/23/13 14:45:22
+-- merge date  : 01/24/13 10:07:12
 
 do -- begin closure to overcome local limits and interference
 
-- 
cgit v1.2.3