From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/62677 Path: news.gmane.org!not-for-mail From: Tad Ashlock Newsgroups: gmane.comp.tex.context Subject: What is the replacement for the 'stop_run' callback? Date: Sun, 17 Oct 2010 08:06:16 -0600 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1958588698==" X-Trace: dough.gmane.org 1287324399 25846 80.91.229.12 (17 Oct 2010 14:06:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 17 Oct 2010 14:06:39 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Sun Oct 17 16:06:38 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P7Tsi-0006Uf-Lh for gctc-ntg-context-518@m.gmane.org; Sun, 17 Oct 2010 16:06:36 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 62C1FCA762; Sun, 17 Oct 2010 16:06:35 +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 2zRu56pqhj1Z; Sun, 17 Oct 2010 16:06:31 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9EDEECA75A; Sun, 17 Oct 2010 16:06:31 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8F100CA75A for ; Sun, 17 Oct 2010 16:06: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 uKLMvio7t+Fm for ; Sun, 17 Oct 2010 16:06:17 +0200 (CEST) Original-Received: from filter1-ams.mf.surf.net (filter1-ams.mf.surf.net [192.87.102.69]) by balder.ntg.nl (Postfix) with ESMTP id D0DC9CA758 for ; Sun, 17 Oct 2010 16:06:17 +0200 (CEST) Original-Received: from mail-wy0-f169.google.com (mail-wy0-f169.google.com [74.125.82.169]) by filter1-ams.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id o9HE6GOT025053 for ; Sun, 17 Oct 2010 16:06:17 +0200 Original-Received: by wyf28 with SMTP id 28so2703993wyf.14 for ; Sun, 17 Oct 2010 07:06:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=AlDagsawWmPv1xRKZ/MK1aPjzRtaBNokFroaXdUv3+0=; b=bZiZAHrHQEr+ndYIyulZgf7QbEbJk6oYbZO5Y6g9twjmqkwvgPSRYp0yTtOLABb31G D8PwAs0kPorrDE93kZeRy2d0rQ6x3m+XCDgjieFN5/xMwXPq1xW16AlS2JdLM0Hw0shQ YhqAKEOigOSX8LMjXjfsevqqLdDgbmKKj6Eu8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=LGtX2U9xIfj9LSRMf+hUJ7ZGvvmuPw9DaPeaNyw+pP9bQSuwMcFhORy11GBNp/lAve AOyAJrr96p6Q8TKAMvqvCy8JfWHi2AIu/xkX7y8MKaDth+ZTq1fOgfqnAuaY9o5Jb23m DH9hMndN/knDfoTztPjp7fiWxoMEbdbQzebq0= Original-Received: by 10.227.155.10 with SMTP id q10mr3422821wbw.92.1287324376595; Sun, 17 Oct 2010 07:06:16 -0700 (PDT) Original-Received: by 10.227.127.81 with HTTP; Sun, 17 Oct 2010 07:06:16 -0700 (PDT) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.82.169; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 06DjO6hx4 - c1bfd2f2ff88 - 20101017 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.69 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:62677 Archived-At: --===============1958588698== Content-Type: multipart/alternative; boundary=0016367fade52d7c970492d090a7 --0016367fade52d7c970492d090a7 Content-Type: text/plain; charset=ISO-8859-1 Hi All, I'm trying to update a ConTeXt module of mine. It does some data gathering during the ConTeXt run, and then processes it after the run is complete. This used to work last year: local id, err = callback.register('stop_run', new_stop_run_function) But now err is set to "callback 'stop_run' is frozen (actions performed at the end of a run)". I see from the mailing list archive that registering user callbacks was disallowed in February of this year (2010). I also saw some advice for installing other new user processing (like 'pre_linebreak_filter'), but no general advice for adapting to the lack of callbacks. ( http://archive.contextgarden.net/message/20100219.130524.b3857a0a.en.html) After trying various approaches for a couple of hours, I'm calling for help. :) Here's what I ended up with: \startluacode print('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TEST1') local function after_run (head, groupcode) print('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TEST2') return head, true end nodes.tasks.appendaction('finalizers','after','after_run') \stopluacode \starttext \input knuth \stoptext In the output, I see the TEST1 line, but not the TEST2 line. I don't know what "head" and "groupcode" are, but those seem to be the expected parameters for an action. I don't know why it returns "head, true", but that was recommended in a posting ( http://archive.contextgarden.net/message/20100410.005025.76ac9efd.en.html). I have no idea if 'finalizers' is the right parameter, but I didn't see any others that looked like it could be synonymous with 'stop_run'. --0016367fade52d7c970492d090a7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi All,

I'm trying to update a ConTeXt module of min= e. =A0It does some data gathering during the ConTeXt run, and then processe= s it after the run is complete. =A0This used to work last year:
local id, err =3D callback.register('stop_run', new_stop= _run_function)

But now err is set to "c= allback 'stop_run' is frozen (actions performed at the end of a run= )".

I see from the mailing list archive that registering us= er callbacks was disallowed in February of this year (2010). =A0I also saw = some advice for installing other new user processing (like 'pre_linebre= ak_filter'), but no general advice for adapting to the lack of callback= s. =A0(http://archive.contextgarden.net/message/20100219.130524.= b3857a0a.en.html)

After trying various approaches for a couple of hours, = I'm calling for help. :)

Here's what I end= ed up with:

\startluacode
print('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% TEST1')
local = function after_run (head, groupcode)
=A0=A0 =A0print('%%%%%%%= %%%%%%%%%%%%%%%%%%%%%%%%%%%% TEST2')
=A0=A0 =A0return head, t= rue
end
nodes.tasks.appendaction('finalizers','after= ','after_run')
\stopluacode
\starttext
\input knuth
\stoptext

In th= e output, I see the TEST1 line, but not the TEST2 line.

I don't know what "head" and "groupc= ode" are, but those seem to be the expected parameters for an action. = =A0I don't know why it returns "head, true", but that was rec= ommended in a posting (http://archive.contextgarden.net/message/= 20100410.005025.76ac9efd.en.html).

I have no idea if 'finalizers' is the right par= ameter, but I didn't see any others that looked like it could be synony= mous with 'stop_run'.

--0016367fade52d7c970492d090a7-- --===============1958588698== 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 ___________________________________________________________________________________ --===============1958588698==--