From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80653 Path: news.gmane.org!not-for-mail From: "H. van der Meer" Newsgroups: gmane.comp.tex.context Subject: What is changed? Date: Mon, 4 Feb 2013 19:11:15 +0100 Message-ID: <854E6F7F-CD3D-44F7-A5EF-FE16250FBD6C@uva.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1360001481 2271 80.91.229.3 (4 Feb 2013 18:11:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Feb 2013 18:11:21 +0000 (UTC) To: ConTeXt NTG Original-X-From: ntg-context-bounces@ntg.nl Mon Feb 04 19:11:42 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 1U2QW5-00080O-3l for gctc-ntg-context-518@m.gmane.org; Mon, 04 Feb 2013 19:11:41 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 73C9410246; Mon, 4 Feb 2013 19:11:22 +0100 (CET) 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 7Op-+qkwyoNx; Mon, 4 Feb 2013 19:11:19 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 8D73310215; Mon, 4 Feb 2013 19:11:19 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0A75710215 for ; Mon, 4 Feb 2013 19:11:18 +0100 (CET) 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 GAj7zA4NgrDN for ; Mon, 4 Feb 2013 19:11:17 +0100 (CET) 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 ECE661020C for ; Mon, 4 Feb 2013 19:11:16 +0100 (CET) Original-Received: from ezel.ic.uva.nl (ezel.ic.uva.nl [146.50.108.158]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r14IBGPG008778 for ; Mon, 4 Feb 2013 19:11:16 +0100 Original-Received: from elhalyn-ethernet.fritz.box (a82-95-102-36.adsl.xs4all.nl [82.95.102.36]) (authenticated bits=0) by ezel.ic.uva.nl (8.13.8/8.13.8) with ESMTP id r14IBGM8010660 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Mon, 4 Feb 2013 19:11:16 +0100 X-Mailer: Apple Mail (2.1499) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=146.50.108.158; country=NL; latitude=52.5000; longitude=5.7500; http://maps.google.com/maps?q=52.5000,5.7500&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 0QIUibgvT - 9f7e08451dc2 - 20130204 (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:80653 Archived-At: The following worked without a hitch: \def\IsNilReturn#1{\edef\tmp{#1}\doifelse{\tmp}{nil}{\color[red]{ERROR}}{\tmp}} \def\formatDuration#1{\ctxlua{ local s = string.gsub("#1","\%D","") local d = tostring(hvdm.time:match(s)) tex.print(string.sub(d,1,2) ~= "0:" and d or string.sub(d,3)) }} \def\FormatDuration#1{\IsNilReturn{\formatDuration{#1}}} Called by something like \FormatDuration{11929} (meaning: 1 hour 19 minutes 29 seconds) Now I get an error in ConTeXt ver: 2013.01.27 21:24 MKIV fmt: 2013.1.28 int: english/english ! LuaTeX error [string "\directlua "]:1: invalid escape sequence near '\%'. \formatDuration ...0:" and d or string.sub(d,3)) } \IsNilReturn #1->\edef \tmp {#1 }\doifelse {\tmp }{nil}{\color [red]{ERROR}}{... Whereas in a previous Context all went well: ConTeXt ver: 2012.05.30 11:26 MKIV fmt: 2013.2.4 int: english/english What did change? Why? And how to repair? Hans van der Meer ___________________________________________________________________________________ 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 ___________________________________________________________________________________