From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/51226 Path: news.gmane.org!not-for-mail From: Matthijs Kooijman Newsgroups: gmane.comp.tex.context Subject: [PATCH] Add begin_of_buffer and end_of_buffer hooks for lua pretty printers Date: Thu, 11 Jun 2009 17:47:18 +0200 Message-ID: <20090611154718.GD1611@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="===============0154210727==" X-Trace: ger.gmane.org 1244735290 15620 80.91.229.12 (11 Jun 2009 15:48:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 11 Jun 2009 15:48:10 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Thu Jun 11 17:48:08 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 1MEmVc-0000ca-LV for gctc-ntg-context-518@m.gmane.org; Thu, 11 Jun 2009 17:48:08 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 968521FB71; Thu, 11 Jun 2009 17:48:07 +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 27503-01; Thu, 11 Jun 2009 17:47:29 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 79BE91FAD7; Thu, 11 Jun 2009 17:47:29 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6B99D1FAD7 for ; Thu, 11 Jun 2009 17:47:28 +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 27502-01 for ; Thu, 11 Jun 2009 17:47:19 +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 981341FA2B for ; Thu, 11 Jun 2009 17:47:19 +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 n5BFlIZM018464 for ; Thu, 11 Jun 2009 17:47:19 +0200 Original-Received: from matthijs by katherina.student.utwente.nl with local (Exim 4.69) (envelope-from ) id 1MEmUo-0002zI-Bu for ntg-context@ntg.nl; Thu, 11 Jun 2009 17:47:18 +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: 241622844 - b437feb3c42d - 20090611 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:51226 Archived-At: --===============0154210727== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="CUfgB8w4ZwR/yMy5" Content-Disposition: inline --CUfgB8w4ZwR/yMy5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, while working on a custom pretty printer, I was having the need to keep some state variables for the duration of one buffer, and reset them again for the next buffer. With the current hooks a pretty printer has available, this is not possible, since you never know what the first and last lines are. The attached patch adds two new hooks, begin_of_buffer and end_of_buffer, which will be called when typing a buffer or a file (e.g. \typebuffer or \typefile). They are not called for typing a phrase (e.g. \type). Is this patch acceptable for inclusion? Gr. Matthijs --CUfgB8w4ZwR/yMy5 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) iEYEARECAAYFAkoxJwYACgkQz0nQ5oovr7zotQCgn93cNXfOvANlAYofH5yPGNmy HdIAoLZ4oU3Bu1zUU3koeECRFqRoH9qt =/xyn -----END PGP SIGNATURE----- --CUfgB8w4ZwR/yMy5-- --===============0154210727== 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 ___________________________________________________________________________________ --===============0154210727==--