From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/58014 Path: news.gmane.org!not-for-mail From: "Wolfgang Werners-Lucchini" Newsgroups: gmane.comp.tex.context Subject: Re: callback.register Date: Fri, 09 Apr 2010 20:11:05 +0200 Message-ID: <4BBF89D9.24711.1EFBCFF@wwl.musensturm.de> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1270836570 9913 80.91.229.12 (9 Apr 2010 18:09:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Apr 2010 18:09:30 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Fri Apr 09 20:09:26 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 1O0Idy-0002HM-6z for gctc-ntg-context-518@m.gmane.org; Fri, 09 Apr 2010 20:09:26 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 69204C9C8A; Fri, 9 Apr 2010 20:09:25 +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 YsV5BYfOg3Hc; Fri, 9 Apr 2010 20:09:12 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 81527C9C8F; Fri, 9 Apr 2010 20:09:12 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 8B0D9C9C8F for ; Fri, 9 Apr 2010 20:09:11 +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 RTyLj4jwAZvx for ; Fri, 9 Apr 2010 20:09:00 +0200 (CEST) Original-Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by balder.ntg.nl (Postfix) with ESMTP id CFACAC9C8A for ; Fri, 9 Apr 2010 20:09:00 +0200 (CEST) Original-Received: from [192.168.178.23] (p4FC79461.dip0.t-ipconnect.de [79.199.148.97]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0MXTda-1O2xfZ3yNC-00WVZE; Fri, 09 Apr 2010 20:09:00 +0200 Priority: normal In-reply-to: X-mailer: Pegasus Mail for Windows (4.41, DE v4.41 R1) Content-description: Mail message body X-Provags-ID: V01U2FsdGVkX18TYCHsgSanVmgrvzBzfmYaHbcf9h/qXdejZIS Oup68saW+mGNBXvn5WLGYNWe1Z6pzpQB73ny+e4+dioJ3jF0u8 MqXwvQJnzwhCvPZso+TuA== 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:58014 Archived-At: > Hello, > > Here a patch for luat-cbk.lua: > > function callbacks.register(name,func,freeze) > if frozen[name] then > if trace_callbacks then > frozenmessage("registering",name) > end > return nil, name .. " is frozen" > elseif freeze then > frozen[name] = (type(freeze) == "string" and freeze) or > "registered" > return register_callback(name,func) > else > return register_callback(name,func) > end > end > > function callback.register(name,func) -- original > if frozen[name] then > if trace_callbacks then > frozenmessage("registering",name) > end > return nil, name .. " is frozen" > else > return register_callback(name,func) > end > end > > (Untested...) > > Cheers, Peter and function callbacks.report() local list = callback.list() for name, func in table.sortedpairs(list) do local str = frozen[name] if str then logs.report("callbacks","%s: %s -> %s",state(name),name,str) else logs.report("callbacks","%s: %s",state(name),name) end end end Wolfgang ___________________________________________________________________________________ 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 ___________________________________________________________________________________