From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64330 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: colors for pretty-printing Date: Tue, 07 Dec 2010 14:48:44 +0100 Message-ID: <4CFE3B3C.6020901@wxs.nl> References: <20101203081711.GA5447@micropit.couberia.bzh> <27ce4c9b-5e21-4df4-91b5-af4bbbb550c6@email.android.com> <20101203213121.GA6937@micropit.couberia.bzh> <4CF9634B.1030605@wxs.nl> <4CF9A816.1080800@nibua-r.org> <4CFAF3A5.5030405@nibua-r.org> <4CFCA4BA.1010609@wxs.nl> <20101206140427.GB29676@micropit.couberia.bzh> <4CFD3FB6.6000207@nibua-r.org> <20101207112502.GA10103@micropit.couberia.bzh> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15"; Format="flowed" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291729840 28680 80.91.229.12 (7 Dec 2010 13:50:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 7 Dec 2010 13:50:40 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Dec 07 14:50:36 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 1PPxwB-0001ay-S5 for gctc-ntg-context-518@m.gmane.org; Tue, 07 Dec 2010 14:50:35 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3E462CA91C; Tue, 7 Dec 2010 14:50:33 +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 487ZBQc6bkIG; Tue, 7 Dec 2010 14:50:26 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 78AB5CA918; Tue, 7 Dec 2010 14:50:26 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6A1F3CA91A for ; Tue, 7 Dec 2010 14:49:02 +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 adPH2kML6Lmp for ; Tue, 7 Dec 2010 14:48:56 +0100 (CET) Original-Received: from filter1-nij.mf.surf.net (filter1-nij.mf.surf.net [195.169.124.152]) by balder.ntg.nl (Postfix) with ESMTP id C5F77CA8E2 for ; Tue, 7 Dec 2010 14:48:53 +0100 (CET) Original-Received: from smtp.ziggozakelijk.nl (D57D1DA2.static.ziggozakelijk.nl [213.125.29.162]) by filter1-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oB7DmqsJ025066 for ; Tue, 7 Dec 2010 14:48:53 +0100 X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by pragma-net.nl (SurgeMail 4.3g4) with ESMTP id 18767-1713362 for multiple; Tue, 07 Dec 2010 14:44:02 +0100 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.12) Gecko/20101027 Lightning/1.0b2 Thunderbird/3.1.6 ThunderBrowse/3.3.4 In-Reply-To: X-Authenticated-User: hagen@controller-9 X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=213.125.29.162; country=NL; region=11; city=Den Haag; latitude=52.0833; longitude=4.3000; http://maps.google.com/maps?q=52.0833,4.3000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 07DEdMQsr - 91b5c79ff6a1 - 20101207 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.152 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:64330 Archived-At: On 7-12-2010 2:29, Aditya Mahajan wrote: > On Tue, 7 Dec 2010, Peter M=FCnster wrote: > >> On Mon, Dec 06 2010, Renaud AUBIN wrote: >>> >>> Concerning the color abstraction patch, one needs just to overload >>> Ccomment, Cpreproc, Cstring, Ctype, Ckeyword, Cname and Cfuncnbound to >>> use custom color scheme. >> >> You don't need that. There is already a standard interface for color >> and style >> configuration. Example: >> >> \setupstartstop[CSnippetComment][color=3Dblue] >> >> So you can simplify t-pretty-c.mkiv: >> >> \unprotect >> >> \setupcolor[ema] >> >> \definestartstop >> [CSnippetName] >> [\c!color=3Ddarkgoldenrod, >> \c!style=3D] > > I have not looked into the new verbatim code yet, but I have been > thinking about a similar interface for a new module that uses external > programs for syntax highlighting (sort of a superset of t-vim that will > allow one to use other programs like pgyments, etc.). it all boils down hooking in a parser then: \startluacode local function parser(s) local s =3D somexternalthing(s) -- feedback s end visualizers.register("myparser", { parser =3D parser }) \stopluacode \starttyping[option=3Dmyparser] .... \stoptyping > Why are you using a C prefix for all environments? Isn't it better to > use a syntax like this: > > \startsetups[verbatim:C] > \definestartstop[SnippetName][color=3D...,style=3D...] > \definestartstop[string][color=3D...,style=3D...] > .... > \stopsetups > > and then pass setups=3Dverbatim:C to an appropriate \setup... command. > That will make it easy to share the same syntax highlighting between > different languages. it's hard to come up with common names for characteristics for all those = languages but at some point we can have a set predefined as default btw, startstop can inherit (now): \definestartstop [MetapostSnippet] [DefaultSnippet] etc so there is no need for setups ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________