From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/50758 Path: news.gmane.org!not-for-mail From: luigi scarso Newsgroups: gmane.comp.tex.context Subject: Re: defineremapper as default (in style file) Date: Mon, 25 May 2009 12:24:47 +0200 Message-ID: References: <4A16EADB.9060209@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0558144453==" X-Trace: ger.gmane.org 1243247306 18188 80.91.229.12 (25 May 2009 10:28:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 25 May 2009 10:28:26 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon May 25 12:28:19 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 1M8XPb-0008Ht-Ef for gctc-ntg-context-518@m.gmane.org; Mon, 25 May 2009 12:28:07 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2143A1FE15; Mon, 25 May 2009 12:28:05 +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 32742-04-7; Mon, 25 May 2009 12:26:58 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1482F1FD59; Mon, 25 May 2009 12:26:58 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 187061FD59 for ; Mon, 25 May 2009 12:26:57 +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 28315-06-13 for ; Mon, 25 May 2009 12:25:47 +0200 (CEST) Original-Received: from filter2-ams.mf.surf.net (filter2-ams.mf.surf.net [192.87.102.70]) by ronja.ntg.nl (Postfix) with ESMTP id A82741FCD7 for ; Mon, 25 May 2009 12:24:48 +0200 (CEST) Original-Received: from mail-ew0-f180.google.com (mail-ew0-f180.google.com [209.85.219.180]) by filter2-ams.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n4PAOluH005821 for ; Mon, 25 May 2009 12:24:47 +0200 Original-Received: by ewy28 with SMTP id 28so3040218ewy.2 for ; Mon, 25 May 2009 03:24:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=1sHMH8+uj6jg24OYCXgyfkhSPJhZ6Jh9EOpRAavXcEo=; b=nmqintWvTVeV/Ygt1Oks9Xf3BPf0jQ26iH0hDmAia61/islL+lhYXdIEFjJJffq4P5 uSee7Py7Ad/aLvgruEoZT/KJrBIeFWdi9NiEei45NypziECgbrkO6ZRk44JpOKH1BeJw jx8wllRf2i1R0gDwnJtWUqWjt77/lLKPYkDpo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=nTXBX5XrGkYSdkjZM/zw2YJpvmQK2nNOKjGfoAXL71+AGd5jPdxIq4e6cKXM1tJQRh GZXD3MA2xO0t72wPiPfpXbq6LHYIzuYKIzqbX288TiYJNtTzkZCkBDsQ5IJBhtWIlTnO DyO5W4fzJmC/jNyEBh6vfCbe1jhmR1DNZ1Usk= Original-Received: by 10.216.0.79 with SMTP id 57mr1546616wea.48.1243247087090; Mon, 25 May 2009 03:24:47 -0700 (PDT) In-Reply-To: X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.219.180; 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: 231132862 - d553a099d722 - 20090525 X-Scanned-By: CanIt (www . roaringpenguin . com) on 192.87.102.70 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:50758 Archived-At: --===============0558144453== Content-Type: multipart/alternative; boundary=001485f631e0fe7dd6046aba042c --001485f631e0fe7dd6046aba042c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Mon, May 25, 2009 at 12:18 PM, Peter M=C3=BCnster wrot= e: > On Mon, 25 May 2009, luigi scarso wrote: > > > I think the point is this : > > in some situations one find useful to convert things like =E2=80=A2 in = macros > like > > \item . > > Of course, it can be done with preprocessing , or with some ad-hoc > macros in > > lua code , etc > > So, apart \remapcharacter, are there any other safe ways to "remap > character" > > ? > > Wolfgang mentioned the method with active character. > And there is also this one: > > \startluacode > function my_replace(line) > return line:gsub('=E2=80=A2 ', '\\item ') > end > callback.register('process_input_buffer', my_replace) > \stopluacode > \starttext > \startitemize > =E2=80=A2 bla > =E2=80=A2 bla > =E2=80=A2 bla > \stopitemize > \stoptext > > I like the latter one, because it permits also replacing whole words and > much more. But you need to be careful, see also: > http://archive.contextgarden.net/message/20080404.200709.454e4740.en.html > ;) > > This is what I mean . --=20 luigi --001485f631e0fe7dd6046aba042c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

On Mon, May 25, 2009 at 12:18 PM, Peter = M=C3=BCnster <pmlis= ts@free.fr> wrote:
On Mon, 25 May 2009, luigi scarso wrote:

> I think the point is this :
> in some situations one find useful to convert things like =E2=80=A2 in= macros like
> \item .
> Of course, it can be done with=C2=A0 preprocessing , or with some ad-h= oc macros in
> lua code , etc
> So, apart \remapcharacter, are there=C2=A0 any other safe ways to &quo= t;remap character"
> ?

Wolfgang mentioned the method with active character.
And there is also this one:

\startluacode
function my_replace(line)
=C2=A0 =C2=A0 =C2=A0 =C2=A0return line:gsub('=E2=80=A2 ', '\\i= tem ')
end
callback.register('process_input_buffer', my_replace)
\stopluacode
\starttext
\startitemize
=E2=80=A2 bla
=E2=80=A2 bla
=E2=80=A2 bla
\stopitemize
\stoptext

I like the latter one, because it permits also replacing whole words and much more. But you need to be careful, see also:
http://archive.contextgarden.net/message/20080= 404.200709.454e4740.en.html
;)


This is what I mean .

--
luigi
<= br> --001485f631e0fe7dd6046aba042c-- --===============0558144453== 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 ___________________________________________________________________________________ --===============0558144453==--