From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/51136 Path: news.gmane.org!not-for-mail From: Mohamed Bana Newsgroups: gmane.comp.tex.context Subject: Re: Verbatim / prettyprinting in mkIV Date: Mon, 08 Jun 2009 13:16:50 +0100 Message-ID: <4A2D0132.5090501@googlemail.com> References: <20090608114621.GB12271@katherina.student.utwente.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1244463461 23902 80.91.229.12 (8 Jun 2009 12:17:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Jun 2009 12:17:41 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 08 14:17:39 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1MDdnH-00024x-CN for gctc-ntg-context-518@m.gmane.org; Mon, 08 Jun 2009 14:17:39 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 799AA1FC77; Mon, 8 Jun 2009 14:17:37 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 14524-05; Mon, 8 Jun 2009 14:17:02 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 260AC1FC7C; Mon, 8 Jun 2009 14:17:02 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1347C1FC7C for ; Mon, 8 Jun 2009 14:17:00 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 16624-01 for ; Mon, 8 Jun 2009 14:16:52 +0200 (CEST) Original-Received: from filter2-til.mf.surf.net (filter2-til.mf.surf.net [194.171.167.218]) by ronja.ntg.nl (Postfix) with ESMTP id A158B1FC77 for ; Mon, 8 Jun 2009 14:16:52 +0200 (CEST) Original-Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.152]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n58CGpYE021158 for ; Mon, 8 Jun 2009 14:16:52 +0200 Original-Received: by fg-out-1718.google.com with SMTP id l27so640008fgb.8 for ; Mon, 08 Jun 2009 05:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=zRnv34YyH4Zja8+tcFNqxmODdPbzbSNx8WDQi34/KOg=; b=uHhsFcKp9P0OXSS48OQ3MRHas60kbOzGLNZ7wMR4TyaMXtUEALVzmqb/szNjEAlTrS 8avkJen98hIuHNBZSmP+mXvGWq2+OtWZR5MU+nd7ZjoApW1jgRjuTaJ3TwQCFGKDq6/E xnwph5KVtN69BPWYoV+tdWb7GZ4P116C0BZs4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=WXmCyAibgM0KzCSELV9kC8GQ1mAcomfuFaps8uE1lcObomaOiFkBZ8TYZfaUquoWSx NGgp78mzX6nzVA4T7nYQNb4SZBf29zbN4uXndMRZY9wOzbeOS1MER/8k43Xdw0XPRS4H dykRTe9HxKvTyLIiBOclx9iKAE+K+RKUf2xTg= Original-Received: by 10.86.51.10 with SMTP id y10mr7208339fgy.9.1244463411588; Mon, 08 Jun 2009 05:16:51 -0700 (PDT) Original-Received: from ?192.168.1.65? (87-194-191-26.bethere.co.uk [87.194.191.26]) by mx.google.com with ESMTPS id e11sm16155fga.1.2009.06.08.05.16.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Jun 2009 05:16:50 -0700 (PDT) User-Agent: Thunderbird 2.0.0.21 (X11/20090409) In-Reply-To: <20090608114621.GB12271@katherina.student.utwente.nl> X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=72.14.220.152; 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: 239271294 - 7aeb14397f44 - 20090608 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.218 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 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 X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:51136 Archived-At: the author of the latex 'listing' package showed some interest in porting the code to ConTeXt. Perhaps someone could contact him. Matthijs Kooijman wrote: > Hi all, > > I've been struggling with verbatim printing in MkIV for a while now and found > some confusing things. I did finally get things working, but after quite some > effort. I'd like to hear if my conclusions are correct, perhaps I can put them > on the wiki then. > > I was trying to set up some custom pretty printing scripts, using lua (since > I'd rather not learn complete tex scripting :-p). Looking at the files in > /usr/share/texmf/tex/context/base and the wiki (Verbatim_text talks about > verb-foo.tex files), I created a file called verb-foo.lua. I put this beside > my document at first, and then in /usr/share/texmf/tex/context/base when it > did not work, but neither worked. I tried setting things up as follows: > > \installprettytype [FOO] [FOO] > \definetyping[FOO][option=FOO] > > \startFOO > blub > \stopFOO > > Trying to trace the code, I worked out things should work as follows: > > \installprettytype sets the "evalue" \??ty\??tyFOO to point at FOO > \definetyping call \setupprettiesintypeFOO, which finds looks up the above > evalue, finds FOO and then turns that into verb-foo and calls > \ctxloadluafile{verb-foo}{}. This sets up the buffers.visualizers.foo value in > lua. When actually starting a typing environment, dodotypeA or dodotypeD call > buffers.hooks.flush_line, which in turn calls > buffers.visualizers.foo.flush_line. > > The above didn't happen for me, so I tried manually loading the lua file using > \ctxloadluafile{verb-foo}{}. After this, things started working for some reason. > > When looking closer and installing some \writestatus lines in core-ver.mkiv, I > found that \setupprettiesintype was never actually called! Closer inspection > showed that the entire core-ver.mkiv is never loaded when running "context > --make". However, there is a second file, buff-ver.mkiv which closely > resembles core-ver.mkiv and which is loaded. An important difference, however, > is that buff-ver loads pret-foo instead of verb-foo (or rather, uses the value > of \f!prettyprefix, which is set to "pret-" in mult-sys.tex). > > Renaming my lua file to pret-foo.lua made context find it exactly as it > should, also when putting the file next to the main document. > > So, my main question was, are the verb-*.lua and core-ver.text files still > used in any way? I just checked the minimals tree, and found out they have > been removed already (but I didn't have -d in my rsync commandline to actually > remove them). Looking at the previous version I was running (2009.05.20 beta) > it seems that this change was actually pretty recent, so I mostly created this > confusing situation by upgrading today (because my verbatim file was not > properly loaded). I'm not so sure why it was not working before then, but at > least it is working now. > > Heh, this is what you get when you write an email while you are still trying > things out. All this buildup to get to a question, when the question is not > even relevant. As for another relevant question: Is my analysis of how things > are supposed to work correct? Then I might put something like it on the wiki. > > Also, it seems that \ctxloadluafile does not give an error when the file was > not found. If it would have, things would probably have been a lot easier. Is > there any compelling reason to make it fail silently? > > Gr. > > Matthijs > > > ------------------------------------------------------------------------ > > ___________________________________________________________________________________ > 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 > ___________________________________________________________________________________ ___________________________________________________________________________________ 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 ___________________________________________________________________________________