From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/6286 Path: main.gmane.org!not-for-mail From: "F. Miller Maley" Newsgroups: gmane.comp.tex.context Subject: Re: Distinguished item in \placelist? Date: Fri, 07 Dec 2001 01:20:42 -0500 Sender: owner-ntg-context@let.uu.nl Message-ID: <3C105FB0.9BD5779D@idaccr.org> References: <5.1.0.14.1.20011203105421.02f070a8@server-1> Reply-To: maley@idaccr.org NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035396818 9119 80.91.224.250 (23 Oct 2002 18:13:38 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 18:13:38 +0000 (UTC) Original-To: ntg-context@ntg.nl Xref: main.gmane.org gmane.comp.tex.context:6286 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:6286 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