From 10589ad4c4acc186e582d2a7afcc45f4ef1c2515 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Thu, 8 Dec 2011 17:00:03 +0100 Subject: macros for conditional expansion (needed e.g. in (lazy) indices) --- tex/context/third/transliterator/t-transliterator.mkiv | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'tex') diff --git a/tex/context/third/transliterator/t-transliterator.mkiv b/tex/context/third/transliterator/t-transliterator.mkiv index 2ff4736..e9510e0 100644 --- a/tex/context/third/transliterator/t-transliterator.mkiv +++ b/tex/context/third/transliterator/t-transliterator.mkiv @@ -146,18 +146,17 @@ \unexpanded\def\transliterate{\dosingleempty\dotransliterate} -\def\expandabletransliterate[#1]#2{% +\def\expandabletransliterate#1{% %\bgroup %\setuptransliterate[#1]% %\language[\transliterateparameter{hyphenate}]% \ctxlua{ thirddata.translit.deficient_font = "\transliterateparameter{deficient_font}" - thirddata.translit.transliterate("\transliterateparameter{mode}","#2") + thirddata.translit.transliterate("\transliterateparameter{mode}","#1") }% %\egroup% } - \unexpanded\def\starttransliterate{% \bgroup% \dosingleempty\dostarttransliterate% @@ -174,6 +173,16 @@ \egroup% } +\newconditional\transliterate_useexpanded \setfalse\transliterate_useexpanded + +\def\transliterate_conditional[#1]#2{% + \ifconditional\transliterate_useexpanded + \transliterate[#1]{#2}% + \else + \expandabletransliterate{#2}% + \fi% +} + \protect \endinput % vim:ft=context -- cgit v1.2.3