Hello Hraban,

have a look into the TUC file to find out, what's going on. I'm sure, Hans would come with a more efficient approach, but this works here. Especially the abbreviation table is probably stored on the fly somewhere, not only in the TUC file and the table could be stored once.

Change definition to:

\def\Abk#1{\ctxlua{WriteToIndex("#1")}{\sc\lowercase{#1}}}

Add lua code to preamble:

\startluacode
function WriteToIndex (abbr)
-- test, if table exits already
if structures.synonyms.collected["abbreviation"] then
    local abbreviation_entries_table = structures.synonyms.collected["abbreviation"]["entries"]
    local abbreviation = abbr
    local meaning = ""
    for i=1,#abbreviation_entries_table do
       local def = abbreviation_entries_table[i]["definition"]
       if def["synonym"] == abbreviation then
           meaning = def["meaning"]
       end
    end
    context.Sach(meaning .. " (" .. abbreviation .. ")")
end
end
\stopluacode

Abbreviation isn't used then (no \infull), so you need criterium=all to display the list:
\setupsynonyms [abbreviation] [textstyle=normal,criterium=all]

Complete example attached.

Regards,
Jano


On 24 September 2017 at 00:45, Henning Hraban Ramm <texml@fiee.net> wrote:
So, in extension of my previous question:
I’m combining abbreviations and registers (index).
My author wants organizations listed with full name and abbreviation, and I try to avoid many verbose entries in the text.

If I use \infull within \index, entries get sorted at i – probably a problem of expansion. How can I solve this?

\Sach[\infull{ADN}]{\infull{ADN} (ADN)} doesn’t help.

-----

\mainlanguage[de]
\setupsynonyms [abbreviation] [textstyle=normal]

\abbreviation{Abt.}{Abteilung}
\abbreviation{ADN}{Allgemeiner Deutscher Nachrichtendienst}
\abbreviation{AFL}{American Federation of Labor}
\abbreviation{ANC}{African National Congress}
\abbreviation{AV}{Auslandsvertretung}
\abbreviation{BArch}{Bundesarchiv}

\defineregister[Sach][
  pagestyle=normal,
  compress=yes,
  indicator=no,
]
\setupregister[Sach][style=normal]

\def\Abk#1{\Sach{\infull{#1} (#1)}{\sc\lowercase{#1}}}
%\def\qAbk#1{\Sach{\infull{#1} (#1)}}


\starttext
\section{Intro}
\Sach{Abenteuer}\Sach{Abba}\Sach{Alliteration}
\Sach{Berta}\Sach{Cäsar}\Sach[Context]{\CONTEXT}\Sach{COBOL}\Sach{Cäsium}
\Sach{Igel}\Sach{Jagertee}\Sach{Humboldt}\Sach{infulk}\Sach{infulm}

\Abk{ADN}, \Abk{ANC}, \Abk{AV}

\section{Abkürzungen}
\placelistofabbreviations %[criterium=all]

\section{Sachregister}
\placeregister[Sach]

%\infull{AV}
%\infull{AFL}

\stoptext

-----

Greetlings, Hraban
---
http://www.fiee.net
http://wiki.contextgarden.net
GPG Key ID 1C9B22FD

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________