From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/78291 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: Strange bug with reversed itemize Date: Fri, 14 Sep 2012 18:06:22 -0400 (EDT) Message-ID: References: <123393FA-6BA3-473D-BD6A-55DEE1BC4466@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-674763876-1347660383=:4289" X-Trace: ger.gmane.org 1347660286 13454 80.91.229.3 (14 Sep 2012 22:04:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 14 Sep 2012 22:04:46 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Sep 15 00:04:50 2012 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TCe0H-0007gH-K3 for gctc-ntg-context-518@m.gmane.org; Sat, 15 Sep 2012 00:04:49 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 753CC10203; Sat, 15 Sep 2012 00:04:45 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id By0BAWDAb2zY; Sat, 15 Sep 2012 00:04:43 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 79628101F8; Sat, 15 Sep 2012 00:04:43 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 69220101F8 for ; Sat, 15 Sep 2012 00:04:41 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id aperHdn8BCG0 for ; Sat, 15 Sep 2012 00:04:39 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by balder.ntg.nl (Postfix) with ESMTP id D73B1101F6 for ; Sat, 15 Sep 2012 00:04:39 +0200 (CEST) Original-Received: from hellskitchen.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.82]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id q8EM4bhs022840 for ; Sat, 15 Sep 2012 00:04:38 +0200 Original-Received: FROM Decentralized.ECE.McGill.CA (Decentralized.ECE.McGill.CA [132.206.69.142]) By hellskitchen.mr.itd.umich.edu ID 5053A9F3.E3B67.28847 ; Authuser adityam; 14 Sep 2012 18:04:36 EDT In-Reply-To: <123393FA-6BA3-473D-BD6A-55DEE1BC4466@gmail.com> User-Agent: Alpine 2.02 (LNX 1266 2009-07-14) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=141.211.14.82; country=US; region=MI; city=Ann Arbor; postalcode=48109; latitude=42.2923; longitude=-83.7145; metrocode=505; areacode=734; http://maps.google.com/maps?q=42.2923,-83.7145&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QHXa4BrR - a73f53f29335 - 20120915 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.14 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:78291 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-674763876-1347660383=:4289 Content-Type: TEXT/PLAIN; charset=windows-1252; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 14 Sep 2012, Wolfgang Schuster wrote: > > Am 14.09.2012 um 00:36 schrieb Aditya Mahajan : > >> I have been able to isolate the bug to the update on 2012.07.09; specifi= cally to this commit. >> >> http://repo.or.cz/w/context.git/blobdiff/6f124794f7dc253f8b83f2517c26ce1= 7e50d66ff..refs/heads/origin:/tex/context/base/strc-num.mkiv >> >> If I replace the current version of strc-num.mkiv with the version from = 2012.07.09: >> http://repo.or.cz/w/context.git/blob_plain/6f124794f7dc253f8b83f2517c26c= e17e50d66ff:/tex/context/base/strc-num.mkiv >> >> then the numbering is correct. >> >> However, I cannot figure out what is causing the bug in that change. > > Part of the problem is this code block: > > \def\strc_counters_check_setup#1% does it have to happen here? > {% this can be done at the lua end / a bit messy here ... todo ... > \ifcsname\??counter#1\c!number\endcsname > \doifelsevalue {\??counter#1\c!number}{#1} {\letbeundefined{\??c= ounter#1\c!number}}% > {\doifvaluenothing{\??counter#1\c!number} {\letbeundefined{\??c= ounter#1\c!number}}}% > \fi > \ifcsname\??counter#1\c!number\endcsname > % it's a clone > \else > \edef\currentcounterlevel{\thenamedcounterlevel{#1}}% > \edef\p_start{\counterparameter{#1}\c!start}% > \ctxcommand{checkcountersetup("#1",\currentcounterlevel,\ifx\p_start\= empty0\else\number\p_start\fi,"\counterparameter{#1}\c!state")}% > \fi} > > ConTeXt uses \p_start to store the current value of the start parameter. > When you set now a value for start in \setuppagenumber the value is kept > in \p_start (because there are no groups). When you start now the itemize > environment the same code is loaded and the start parameter (which hasn= =92t > been set yet) expands to a very stupid default value which is by another > helper function. > > \def\strc_counter_setup_using_parameter#1#2% name \someparameter > {\edef\p_start{#2\c!start}% > \setupcounter > [#1] > [ \c!start=3D\ifx\p_start\empty0\else\number\p_start\fi, > ... > \c!numbersegments=3D#2\c!numbersegments]} > > > As you can see here the start parameter expands to \p_start when it isn= =92t empty > what is the case here and because of this you get a wrong value for the i= tem numbers. Thanks for the diagnosis. What will be a good way to fix this? I think=20 that \expanded{\setupcounter[#1][\c!start=3D\ifx\p_start\empty0\else\number\p_st= art\fi.,...]} should work (but I haven't tested it yet). Aditya --0-674763876-1347660383=:4289 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --0-674763876-1347660383=:4289--