From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/51133 Path: news.gmane.org!not-for-mail From: Matthijs Kooijman Newsgroups: gmane.comp.tex.context Subject: Verbatim / prettyprinting in mkIV Date: Mon, 8 Jun 2009 13:46:21 +0200 Message-ID: <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: multipart/mixed; boundary="===============1813916564==" X-Trace: ger.gmane.org 1244461639 18014 80.91.229.12 (8 Jun 2009 11:47:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 8 Jun 2009 11:47:19 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 08 13:47:14 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 1MDdJq-0006cW-65 for gctc-ntg-context-518@m.gmane.org; Mon, 08 Jun 2009 13:47:14 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1C3561FCBD; Mon, 8 Jun 2009 13:47:13 +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 10071-08-3; Mon, 8 Jun 2009 13:46:38 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id CF52D1FCCE; Mon, 8 Jun 2009 13:46:37 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6529E1FCDF for ; Mon, 8 Jun 2009 13:46:36 +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 13646-04-2 for ; Mon, 8 Jun 2009 13:46:22 +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 8ECDA1FC7C for ; Mon, 8 Jun 2009 13:46:22 +0200 (CEST) Original-Received: from katherina.student.utwente.nl (katherina.student.utwente.nl [130.89.168.160]) by filter2-til.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n58BkL1n019877 for ; Mon, 8 Jun 2009 13:46:21 +0200 Original-Received: from matthijs by katherina.student.utwente.nl with local (Exim 4.69) (envelope-from ) id 1MDdIz-0005dX-Cw for ntg-context@ntg.nl; Mon, 08 Jun 2009 13:46:21 +0200 Mail-Followup-To: ntg-context@ntg.nl X-PGP-Fingerprint: 7F6A 9F44 2820 18E2 18DE 24AA CF49 D0E6 8A2F AFBC X-PGP-Key: http://katherina.student.utwente.nl/~matthijs/gpg_pubkey.asc User-Agent: Mutt/1.5.18 (2008-05-17) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=130.89.168.160; country=NL; region=15; city=Enschede; latitude=52.2167; longitude=6.9000; http://maps.google.com/maps?q=52.2167,6.9000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 239240608 - 093cb5fc4ba2 - 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:51133 Archived-At: --===============1813916564== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="WhfpMioaduB5tiZL" Content-Disposition: inline --WhfpMioaduB5tiZL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --WhfpMioaduB5tiZL Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkos+g0ACgkQz0nQ5oovr7w1VQCfRzEIJ4DHYgk5iZsMpr0cYxF4 GHUAoNdekVcFpmA2ZU8Fp/DU33t4KNQv =91qI -----END PGP SIGNATURE----- --WhfpMioaduB5tiZL-- --===============1813916564== 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1813916564==--