ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@googlemail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Stange behavior of \startluacode
Date: Sun, 3 Oct 2010 11:02:02 +0200	[thread overview]
Message-ID: <2135C917-84F5-408C-AFB0-9B89246E5909@gmail.com> (raw)
In-Reply-To: <AANLkTimxwO48Tr8+Q0V6rSc7vdw9qcUXa5oRKgYhr8Kt@mail.gmail.com>


Am 03.10.2010 um 10:28 schrieb luigi scarso:

>> Bug or limitation?
> Limitation, but it should be doable to remedy in TeX.

Possible but is it worth the effort, when you start with “--” the percent should also behave like in Lua etc.

\starttext

\bgroup\obeylines
\gdef\texcomment#1
  {}
\egroup

\bgroup
\let\letterhyphen=-
\catcode`-=13
\unexpanded\def-{\futurelet\next\doscanhyphen}
\def\doscanhyphen
  {\ifx\next-
     \expandafter\texcomment
   \else
     \expandafter\letterhyphen
   \fi}
\obeylines
text
text
% foo
- foo 1
-- foo 2
\normalexpanded{- foo 1}
\normalexpanded{-- foo 2}
text
\egroup

\stoptext

Wolfgang

___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2010-10-03  9:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-02 23:46 Aditya Mahajan
2010-10-03  6:30 ` Wolfgang Schuster
2010-10-03  6:33 ` Wolfgang Schuster
2010-10-04  7:17   ` Procházka Lukáš Ing. - Pontex s. r. o.
2010-10-04  7:19   ` Procházka Lukáš Ing. - Pontex s. r. o.
2010-10-04  8:00     ` Hans Hagen
2010-10-03  8:28 ` luigi scarso
2010-10-03  9:02   ` Wolfgang Schuster [this message]
2010-10-03  9:12     ` Wolfgang Schuster
2010-10-03 10:32 ` Hans Hagen
2010-10-05 23:36   ` Aditya Mahajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2135C917-84F5-408C-AFB0-9B89246E5909@gmail.com \
    --to=schuster.wolfgang@googlemail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).