ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
Cc: Nikolai Weibull <work@rawuncut.elitemail.org>
Subject: Re: some highlighted \type-ing
Date: Wed, 7 Sep 2005 16:53:31 +0200	[thread overview]
Message-ID: <6faad9f0050907075370287cab@mail.gmail.com> (raw)
In-Reply-To: <431EB45A.7010207@elvenkind.com>

Taco Hoekwater wrote:
> Mojca Miklavec wrote:
> 
> It needs a bit longer definition of \typeTEX. The next def seems
> to do it.
> 
>    \def\typeTEX
>       {\bgroup
>        \def\processinlineverbatim##1%
>          {\processingverbatimtrue
>           \localcatcodestrue
>           \def\endofverbatimcommand{\TEXendofcommand##1}%
>           \bgroup
>           \aftergroup\endofverbatimcommand
>           \futurelet\next\doprocessinlineverbatim}%
>        \initializetyping{TEX}%
>        \startverbatimcolor
>        \processinlineverbatim\egroup }

Thank you, this works better (not that I understand what it does ;)

But, I finally understand why I was confused yesterday.

    \setupcolors[state=start]
    \setuptype[option=TEX]
    \type{\a}

does nothing (and this was what I first tried and thought that this is
not supported yet; non-existing options never raise an error anyway).

But today I tried:
    \setuptype[option=TEX]
    \type{\ab[cd]} % [ and ] are highlighted
    \type{\a\b\c} % only \b and \c highlighted
    \type+\ab[cd]{ef} %+ % everything highlighted OK

So, if the first (bug/feature?) gets fixed and the bugfix that stops
green highlighting after \type is applied, it would be much cleaner to
define:

\definetype[RAW]   [\c!option=RAW]
\definetype[MP]    [\c!option=MP]
...
\definetype[XML]   [\c!option=XML]

(as counterparts to \definetyping) than keeping those lenghty
definitions for each file type separately.

Btw: in the meantime (I last tried it in April) a bug that prevented
typing |, _ or \ (I don't remember which one exactly) after the first
position got fixed. Whenever that happened and whoever did it: thank
you very much!


Taco, you sent some patch for XML syntax highlighting some time ago.

I don't know if you fixed this one as well:
    <!-- some text -->
The both minus signs in "-->" are highlighted wrong as well. The code
inside <!-- ... --> is gray, but it would be great to have both
delimiters highligted as "comment" as well.



I'm thinking about piping the code to vim, letting the vim process it
and return something like
    \highlight[Conditional]{if}\highlight[Delimiter]{(}\highlight[Identifier]{i}
...
One should modify the 2html.vim file (vim can already nicely transform
the highlighted code into HTML, so ConTeXt shouldn't be so difficult).
Vim already has over 400 sytax file definitions (probably equivalent
to some hundred thousans lines of syntax definitions in ConTeXt).
Well, I don't know (yet) how to do it, but if someone on the list has
more experience with vim, please feel free to contribute.

Mojca

  reply	other threads:[~2005-09-07 14:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-06 15:26 Mojca Miklavec
2005-09-06 15:40 ` Taco Hoekwater
2005-09-06 16:01   ` Mojca Miklavec
2005-09-06 16:21     ` Taco Hoekwater
2005-09-07  9:35     ` Taco Hoekwater
2005-09-07 14:53       ` Mojca Miklavec [this message]
2005-09-07 16:13         ` Nikolai Weibull
2005-09-08  9:55         ` Taco Hoekwater
2005-09-08 11:25           ` Adobe reader 7.0.1 for linux luigi.scarso
2005-09-08 12:05             ` Taco Hoekwater
2005-09-08 13:41             ` Hans Hagen
2005-09-06 16:36   ` some highlighted \type-ing Hans Hagen
2005-09-07 15:27     ` Mojca Miklavec

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=6faad9f0050907075370287cab@mail.gmail.com \
    --to=mojca.miklavec.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    --cc=work@rawuncut.elitemail.org \
    /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).