From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/82815 Path: news.gmane.org!not-for-mail From: "Lance Larsen" Newsgroups: gmane.comp.tex.context Subject: Re: How to hack the lua files Date: Fri, 7 Jun 2013 07:00:14 -0600 Message-ID: <51b1d960.e7e6440a.3048.09fa@mx.google.com> References: 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 1370610046 3952 80.91.229.3 (7 Jun 2013 13:00:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 7 Jun 2013 13:00:46 +0000 (UTC) To: Original-X-From: ntg-context-bounces@ntg.nl Fri Jun 07 15:00:48 2013 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 1UkwHa-0006hB-0b for gctc-ntg-context-518@m.gmane.org; Fri, 07 Jun 2013 15:00:42 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 64CBD101EB; Fri, 7 Jun 2013 15:00: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 YnGp4LbdDd4L; Fri, 7 Jun 2013 15:00:39 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 5BE8C101E7; Fri, 7 Jun 2013 15:00:39 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 10769101E7 for ; Fri, 7 Jun 2013 15:00:38 +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 XLmLiNWaopx4 for ; Fri, 7 Jun 2013 15:00:36 +0200 (CEST) Original-Received: from filter3-til.mf.surf.net (filter3-til.mf.surf.net [194.171.167.219]) by balder.ntg.nl (Postfix) with ESMTP id 98FBE101E6 for ; Fri, 7 Jun 2013 15:00:26 +0200 (CEST) Original-Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) by filter3-til.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r57D0Ir1028674 for ; Fri, 7 Jun 2013 15:00:19 +0200 Original-Received: by mail-pa0-f48.google.com with SMTP id kp12so923729pab.35 for ; Fri, 07 Jun 2013 06:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:references:in-reply-to:subject:date:message-id:mime-version :content-type:content-transfer-encoding:x-mailer:thread-index :content-language; bh=TLrHjt+InYagHpTEE6q/kzqh0rStwC2BrHkQ8cuaB30=; b=z6Os3CiHL6aQRPpnB/SO5c4B7yEliNZYyOWayWFcf9GvnyJhWl5Rkby+8UgF0zD0oX 6yfHd6DWjboS9lMCr6SrV+GD2ZynsozmGL+vRgaw8sJuPM5Z+a2KfIzwr/TwevSMe1tg jPgWANIeGbgpHepxCU0ynvx5RNyyQsP6gZXCtkxNP9QCSXA8/MP22mXLPBfrpj1c4Rig yiP7cvzQ+31WlEV+E4497wiOGfIt1iMJgAZfdskBbWpAwTq5s+7PngY1BqRUAdcDsNbi TRc0BvfMQeiMsuwEwkNV3sIjp28AKsGAFubxHAt/NaghtITheRLHuAOltXuE59fNqBr7 p6qg== X-Received: by 10.68.230.195 with SMTP id ta3mr43023035pbc.60.1370610017915; Fri, 07 Jun 2013 06:00:17 -0700 (PDT) Original-Received: from CNU238C3KT (107-1-187-170-ip-static.hfc.comcastbusiness.net. [107.1.187.170]) by mx.google.com with ESMTPSA id tb7sm77526694pbc.14.2013.06.07.06.00.16 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 07 Jun 2013 06:00:16 -0700 (PDT) In-Reply-To: X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac5jUFqqTZJmGx0vRGm8vGKXzU0sEAAKXOKw Content-Language: en-us X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=2607:f8b0:400e:c03::230; country=US X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06JJp0ie2 - 10f1ae59d62a - 20130607 (trained as not-spam) X-Scanned-By: CanIt (www . roaringpenguin . com) 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:82815 Archived-At: If I modify a core lua file how do I remake the format file? Is this something that is done from mtxrun.exe? I would certainly prefer to use a hook rather than modifying a core file, but how do I identify the hooks that are available? Is there a list of hooks that are available, or a standard way that hooks are called from the context code so that I can look for an appropriate hook? Where do I place my hook scripts? Is there a guide that is available that might get me started? What I trying to do is map equation references to the equation number generated by context. So for example, if I have an equation: \placeformula \startformula \NC F = m a \NC \NR[eq:newtonslaw] \stopformula I need a way to log the fact that 'eq:newton' became something like equation (2.3). I hoped there was a tracker that printed this out (maybe there is, but I haven't found it). So I thought maybe I could find where equation numbers are defined by context and add a tracker. The code in 'strc-ref.mkvi' and 'strc-ref.lua' looked promising. Incidentally, is this where equation numbers are created, or should I be looking in another file? Is there a lua function that gets called consistently around the time equation numbers are defined where the equation reference (i.e. eq:newtonslaw) and the associated equation number are both available and could be logged? I tried adding a new tracker in strc-ref.lua to see if I could narrow down where the labels are created, but my tracker did not seem to work. Therefore, I identified a tracker that was working and tried to modify the output slightly only to find that this did not work either. It is not clear to me at present how context loads the lua files. I hoped that it loaded these directly, so that changes would take effect immediately. -Lance Larsen ------------------------------ On 6/7/2013 1:20 AM, Lance Larsen wrote: > I have a version of context standalone installed, and I am trying to > add some functionality I need to strc-ref.lua. As a simple test to see > if modifying the file was working, I enabled the > ?structures.referencing.identifying? tracker and verified that I was > getting messages from this tracker in the log. I then modified the log > statement in strc-ref.lua and processed the document again. The > changes I made to the lua file did not seem to be active. I verified > that there is only one log statement that matches the output I am > seeing. Why would my lua code change not be active? Is the lua code > cached somehow? (I am running this from windows if that matters). > > The code I modified is under the path: > > context\tex\texmf-context\tex\context\base\ strc-ref.lua if you patch files that way you need to remake the format file I don't know what you patch, but changing something in a core file is no guarantee for the future. It's not a problem to add functionality (lots of hooks for that) but best do that in a local module that gets loaded at runtime then. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ------------------------------ ____________________________________________________________________________ _______ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ____________________________________________________________________________ _______ End of ntg-context Digest, Vol 108, Issue 19 ******************************************** ___________________________________________________________________________________ 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 ___________________________________________________________________________________