2007/12/3, Hans Hagen <[EMAIL PROTECTED]>:
> Wolfgang Schuster wrote:
> > 2007/12/3, Peter Münster <[EMAIL PROTECTED]>:
> >> Hello,
> >>
> >> I get unexpected output with this test-file:
> >>
> >> % engine=luatex
> >> \definesynonyms[test][tests]
> >> \test{testOne}{first test}
> >> \test{testTwo}{second test}
> >> \starttext
> >> \testOne
> >> \placelistoftests
> >> \stoptext
> >>
> >> I would expect:
> >>
> >> testOne
> >> testOne     first test
> >>
> >> but I get:
> >>
> >> testOne
> >> test        testOne
> >>
> >> (Perhaps a problem with parameter numbers #1, #2 etc. ?)
> >>
> >> Cheers, Peter
> >
> > Hi Peter,
> >
> > this is a bug in the mkiv sorting macros, I posted a similiar message
> > a few days ago but got no answer.
>
> \def\mksavesortedlistentry#1#2#3#4% class key entry meaning
>
> {\immediatewriteutilitytua{ti(js['#1'],{'e','#2',\!!bs#3\!!es,\!!bs#4\!!es})}}
>
> seems to work

this line should be

\def\mksavesortedlistentry#1#2#3#4% class key entry meaning
  
{\immediatewriteutilitytua{table.insert(js['#1'],{'e','#1',\!!bs#2\!!es,\!!bs#3\!!es})}}

but there is also a big in core-syn.lua

the following works for me, the order is "key, value" and not "value, key".

I patched this at the moment in my format files and the output of
the synonym table is now correct :-)

function job.loadsortedlist(class)
    if job.sortedlists[class] then
        if not sorters.list.data[class] then
            sorters.list.data[class] = {
                language = 'en',
                entries  = { },
                flush    = function(s) tex.sprint(tex.ctxcatcodes,s) end,
                sorted   = false,
                class    = class
            }
            local entries = sorters.list.data[class].entries
            for k,v in ipairs(job.sortedlists[class]) do
                if v[1] == 'l' then -- language
                    sorters.list.data[class].language = v[2]
                else
                    entries[#entries+1] = {
                        v[1],               -- kind (e)
                        { { v[2], v[3] } }, -- key, entry
                        v[4]                -- optional meaning
                    }
                end
            end
        end
        sorters.list.process(sorters.list.data[class])
    end
end

Wolfgang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to