From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/80286 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Vim module - different settings for inline and block code Date: Wed, 16 Jan 2013 16:02:09 +0100 Message-ID: References: <20130116145139.GB29592@homerow> 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="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1358348549 20028 80.91.229.3 (16 Jan 2013 15:02:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Jan 2013 15:02:29 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 16 16:02:47 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 1TvUVo-0001YE-L8 for gctc-ntg-context-518@m.gmane.org; Wed, 16 Jan 2013 16:02:44 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 3C938101F2; Wed, 16 Jan 2013 16:02:28 +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 O94w25RMsGg4; Wed, 16 Jan 2013 16:02:22 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [IPv6:::1]) by balder.ntg.nl (Postfix) with ESMTP id 8B9EE101E5; Wed, 16 Jan 2013 16:02:22 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id D40E1101E5 for ; Wed, 16 Jan 2013 16:02:21 +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 7BojGso2Kfji for ; Wed, 16 Jan 2013 16:02:20 +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 E1BAD101E2 for ; Wed, 16 Jan 2013 16:02:20 +0100 (CET) Original-Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by filter2-ams.mf.surf.net (8.14.3/8.14.3/Debian-9.4) with ESMTP id r0GF2BHP027921 for ; Wed, 16 Jan 2013 16:02:18 +0100 Original-Received: by mail-bk0-f54.google.com with SMTP id je9so741377bkc.41 for ; Wed, 16 Jan 2013 07:02:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; bh=eYASn5Gd8MN6DNI12YeSspWpcUzphik2u0dXqCzz3xk=; b=eV+MAp0c91R4bJZqEhaCCCEACWHPLI3QfEVRgKLnWinoVW08Bc9DwQHFzhwNXtughW bD730M5cu5XbreQp0vdiDVvOk5/2SJsleecwwZ4Ou25XyyOExX4mrxFOwEtOjr688yaS 4VuP6aeXRmfKWcbqGKLBMwVGzWmCNdn0L6vcfO+CbvccKakg7Duv1ZJugx96hTng1f2z DEG5h5Zo6tvvmb1eXBD7PzY/1Ro/ILgLbl+g8i9YaB8iwSKFZ6XEonrMeIlmIJP9398A f0NaZfONtZk4JvJRElOifsWwtWtnbTuvAB7qnIbMAVNg1YGeJrjzdEoc7Vmy/RqetpJS Wv4A== X-Received: by 10.204.3.211 with SMTP id 19mr433160bko.99.1358348531228; Wed, 16 Jan 2013 07:02:11 -0800 (PST) Original-Received: from keima.localdomain (nrbg-4dbe4ec1.pool.mediaWays.net. [77.190.78.193]) by mx.google.com with ESMTPS id f24sm15794386bkv.7.2013.01.16.07.02.10 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 16 Jan 2013 07:02:10 -0800 (PST) In-Reply-To: <20130116145139.GB29592@homerow> X-Mailer: Apple Mail (2.1499) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.214.54; 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: 0QIMD2bxm - 157a38012e85 - 20130116 (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:80286 Archived-At: Am 16.01.2013 um 15:51 schrieb Marco Patzer : > Hi, > = > I need different settings for code in inline and block mode. See the > following example: > = > \usemodule [vim] > \definetextbackground [C] [location=3Dtext] > \definevimtyping [C] > [syntax=3Dc, > before=3D{\starttextbackground[C]}, > after=3D\stoptextbackground, > margin=3D2em] > = > \starttext > = > This is C: \inlineC{int foo();}. \blank > \startC > int foo(){ > return 0; > } > \stopC > = > \stoptext > = > Inline code needs =93location=3Dtext=94, block code on the other hand > needs =93location=3Dparagraph=94 as text background setting. Sure, I can > create two environments =93Cinline=94 and =93Cblock=94, but that feels > clumsy. > = > What's the proper way to set up different backgrounds for inline > and block code? You can try this (untested): \definetextbackground[InlineBackground][location=3Dtext] \definetextbackground[DisplayBackground][location=3Dparagraph] \definevimytping [C] [=85, before=3D{\ifhmode\startInlineBackground\else\startDisplayBackground\fi}, after=3D{\ifhmode\stopInlineBackground\else\stopDisplayBackground\fi}, =85] You could also ask Aditya to use different keys for display (e.g. before/af= tter) and inline (e.g. left/right) code blocks. Wolfgang ___________________________________________________________________________= ________ 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 ___________________________________________________________________________= ________