Hans Hagen wrote:
> Say that I patch a macro :
> 
> \unprotected \def\dolijstelement#1#2#3#4#5#6% pas op: wordt ook elders
> gedefinieerd
>    {\doiftoclevelelse[#5]
>       {\def\currentlist{#1}%
>        \ifundefined{\??li\currentlist\c!huidige}\else
>          \doif{#3}\currentheadnumber
>            {\edef\currentlist{\getvalue{\??li\currentlist\c!huidige}}}%
>        \fi
>        \dodolijstelement\currentlist{#2}{#3}{#4}{#5}{#6}}
>       {}}
> 
> (this assumes a version where \currentheadnumber is known)
> etc.

After considerable hacking, I got this to work!  It didn't work as written
for various reasons, mainly having to do (as far as I could tell) with the
order in which things are expanded, and the \ifundefined ... \else ... \fi
confusing TeX about \if...\fi nesting.  Anyway, the most serious problem
was that \currentheadnumber expands to a single number, but argument #3
is usually something like 1.2 or 1.2.3, the details depending on the level
and the "stopper".  I can hack around this problem in specific cases but
I don't have a general solution yet.  One plan would be to expand
\headnumber[#1] and compare it with #3, but \headnumber (or rather
\kopnummer) seems to be protected from expansion in eTeX.

I may be the only one voting for it, but I do think this would be a nifty
feature of ConTeXt.

-- Miller Maley

Reply via email to