From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/88025 Path: news.gmane.org!not-for-mail From: "Jan Tosovsky" Newsgroups: gmane.comp.tex.context Subject: Re: Testing the param value Date: Sun, 6 Jul 2014 22:58:13 +0200 Message-ID: <4486.54947472296$1404680329@news.gmane.org> References: <53b8103b.e25cb40a.6b65.fffffdcaSMTPIN_ADDED_BROKEN@mx.google.com> <6FA27DE9-4FEC-4E85-9ABA-1914F06BBD19@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1404680329 753 80.91.229.3 (6 Jul 2014 20:58:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 6 Jul 2014 20:58:49 +0000 (UTC) To: "'mailing list for ConTeXt users'" Original-X-From: ntg-context-bounces@ntg.nl Sun Jul 06 22:58:43 2014 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([5.39.185.229]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X3tWE-00065B-3M for gctc-ntg-context-518@m.gmane.org; Sun, 06 Jul 2014 22:58:42 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6B80F10211 for ; Sun, 6 Jul 2014 22:58: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 jHRdVVRuH2if for ; Sun, 6 Jul 2014 22:58:41 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 7BB2210224 for ; Sun, 6 Jul 2014 22:58:33 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id E8F6B101E8 for ; Sun, 6 Jul 2014 22:58:29 +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 Yo8GW4wqD1Xw for ; Sun, 6 Jul 2014 22:58:27 +0200 (CEST) Original-Received: from filter4-til.mf.surf.net (filter4-til.mf.surf.net [194.171.167.220]) by balder.ntg.nl (Postfix) with ESMTP id E2167101E3 for ; Sun, 6 Jul 2014 22:58:15 +0200 (CEST) Original-Received: from fep28.mx.upcmail.net (fep28.mx.upcmail.net [62.179.121.48]) by filter4-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id s66KwEa4029753 for ; Sun, 6 Jul 2014 22:58:15 +0200 Original-Received: from edge02.upcmail.net ([192.168.13.237]) by viefep28-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20140706205813.LEVZ5444.viefep28-int.chello.at@edge02.upcmail.net> for ; Sun, 6 Jul 2014 22:58:13 +0200 Original-Received: from emk ([89.176.206.64]) by edge02.upcmail.net with edge id P8yD1o00c1PtkGR028yDbZ; Sun, 06 Jul 2014 22:58:13 +0200 X-SourceIP: 89.176.206.64 In-Reply-To: <6FA27DE9-4FEC-4E85-9ABA-1914F06BBD19@gmail.com> X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac+Yc5JJGcGUkBaCRfm2b0cxB4/LIQA5z5gw Content-Language: cs X-Bayes-Prob: 0.0001 (Score 0, tokens from: ntg-context@ntg.nl, base:default, @@RPTN) X-CanIt-Geo: ip=62.179.121.48; country=AT; latitude=47.3333; longitude=13.3333; http://maps.google.com/maps?q=47.3333,13.3333&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0VMn8WenD - f0e9f0a3df5c - 20140706 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.220 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:88025 Archived-At: On 2014-07-05 Wolfgang Schuster wrote: > Am 05.07.2014 um 16:47 schrieb Jan Tosovsky: > > > I am hacking the context index entry rendering... ;-) > > ... but I am stuck with a simple comparison > > > > How can I test the given entry if it equals to the specified one? > > > > The following code has no effect. > > > > \unexpanded\def\defaultregisterentry#1#2#3#4% > > % #1:processor #2:internal #3:seeindex #4:word > > {\def\currentregisterpageindex{#2}% > > % start hacking > > \def\myword{#4}% > > \ifx\myword{My Primary} > > \column % do something > > \fi > > % stop hacking > > \strc_register_injector_process > > ... > > > > What is the proper syntax? > > > This should be possible without hacks but without a example I can't > provide more than a simple example code. > > \newconditional\IndexState > > \define[1]\IndexInternalCommand > > {\doifelse{#1}{MyPrimary}{\global\settrue\IndexState}{\global\setfalse\ > IndexState}#1} > > \define[1]\IndexCommand > {\setfalse\IndexState > \setbox\scratchbox\hbox{#1}% > \ifconditional\IndexState > \column > \fi > \box\nextbox} > > \setupregister > [index] > [ textcommand=\IndexCommand, > deeptextcommand=\IndexInternalCommand] > Thanks, it looks promising even I am quite lost in this logic :-) Do I understand correctly that the IndexState is a global boolean which is set either to true or false when deeptextcommand is processed and when textcommand is called, it works with this pre-filled variable? {\setfalse\IndexState % why this? A default value? \setbox\scratchbox\hbox{#1}% \box\nextbox} % what do these two do? I am asking as #1 is consumed somehow and there is just a page reference in the result index. But that break (\column) works correctly. I've encountered mising words when comparing hashed params directly. Like if they are read once, they are not available any more. This was the reason why I used a helper 'myword' variable in my hack. But I've just written that code analogically to some other conditions found in the sources without proper knowledge what exactly it does. Regards, Jan ___________________________________________________________________________________ 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 ___________________________________________________________________________________