ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Questions about Scite lexers
@ 2016-04-13 14:37 Nicola
  2016-04-13 15:39 ` Hans Hagen
  0 siblings, 1 reply; 8+ messages in thread
From: Nicola @ 2016-04-13 14:37 UTC (permalink / raw)
  To: ntg-context

I'm trying to define a custom scite lexer for a toy language I'm using. 
So far, I've copied a lexer from the distribution, changed its name and 
keywords, and it's all fine. I have a few questions, though:

1) my custom scite-context-lexer-xxxx.lua is found only if I put it in 
the distribution. It there a way to have it in my project's folder 
instead?

2) How do I customize colors?

3) Is it possible to embed TeX commands in \startscite..\stopscite 
environments, like /BTEX../ETEX in built-in typing?

4) Are scite lexers documented somewhere besides the source code?

5) May I rely on this feature to be stable?

6) It is my understanding that pret-xxx.lua files are obsolete. Is it 
correct? (If so, it would be nice to update the wiki to reflect that).

To be clear, I'm not interested in using the Scite application. I just 
need to typeset formatted verbatim code. The vim module is fantastic 
and I already use it, but there are cases where I need a syntax not 
supported by Vim (and I'd rather avoid defining it on the Vim side) 
and/or need to embed TeX commands (anywhere, not only in comments).

Nicola


___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Questions about Scite lexers
  2016-04-13 14:37 Questions about Scite lexers Nicola
@ 2016-04-13 15:39 ` Hans Hagen
  2016-04-13 17:25   ` Nicola
  2016-04-13 17:51   ` Alan BRASLAU
  0 siblings, 2 replies; 8+ messages in thread
From: Hans Hagen @ 2016-04-13 15:39 UTC (permalink / raw)
  To: ntg-context

On 4/13/2016 4:37 PM, Nicola wrote:
> I'm trying to define a custom scite lexer for a toy language I'm using.
> So far, I've copied a lexer from the distribution, changed its name and
> keywords, and it's all fine. I have a few questions, though:
>
> 1) my custom scite-context-lexer-xxxx.lua is found only if I put it in
> the distribution. It there a way to have it in my project's folder instead?

currently not but i can make that an option (fallback)

> 2) How do I customize colors?

for that i need to change a load command

> 3) Is it possible to embed TeX commands in \startscite..\stopscite
> environments, like /BTEX../ETEX in built-in typing?

hm, i suppose one can add the parsing of /BTEX .. /ETEX to the lexer and 
then intercept it but it's not built in (formatted comment might make 
sense)

> 4) Are scite lexers documented somewhere besides the source code?

no

> 5) May I rely on this feature to be stable?

yes (i use it myself)

> 6) It is my understanding that pret-xxx.lua files are obsolete. Is it
> correct? (If so, it would be nice to update the wiki to reflect that).

no, they are not obsolete (the scite lexers are often also syntax 
checkers so they are more strict) ... the pret files are more or less 
working in the same way (they date from before scite got that kind of 
lexers)

> To be clear, I'm not interested in using the Scite application. I just
> need to typeset formatted verbatim code. The vim module is fantastic and
> I already use it, but there are cases where I need a syntax not
> supported by Vim (and I'd rather avoid defining it on the Vim side)
> and/or need to embed TeX commands (anywhere, not only in comments).
>
> Nicola
>
>
> ___________________________________________________________________________________
>
> 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
> ___________________________________________________________________________________


-- 

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Questions about Scite lexers
  2016-04-13 15:39 ` Hans Hagen
@ 2016-04-13 17:25   ` Nicola
  2016-04-13 17:31     ` Wolfgang Schuster
  2016-04-13 17:51   ` Alan BRASLAU
  1 sibling, 1 reply; 8+ messages in thread
From: Nicola @ 2016-04-13 17:25 UTC (permalink / raw)
  To: ntg-context

On 2016-04-13 15:39:57 +0000, Hans Hagen said:
> 
>> 6) It is my understanding that pret-xxx.lua files are obsolete. Is it
>> correct? (If so, it would be nice to update the wiki to reflect that).
> 
> no, they are not obsolete (the scite lexers are often also syntax
> checkers so they are more strict) ... the pret files are more or less
> working in the same way (they date from before scite got that kind of
> lexers)

Thanks for your answers. I'd like to go with \definetyping then, because
I need /BTEX../ETEX. I have found an old document of mine, which uses a
(slightly customized) pret-c.lua, located inside the project's folder.
It compiles, but I don't get syntax highlighting. Is it because pret-c
is not searched in the project's directory? (According to
http://wiki.contextgarden.net/Verbatim#Pretty_printing the file should
be found.) This is a minimal version:

\setupinteraction  [state=start]
\setupcolors       [state=start]
\setuptyping       [option=color]
\definetyping      [C][option=C, tab=4]
\definecolor       [Ccomment][darkblue]
\definetyping      [CPP]
                   [option=C,tab=2,
                   bodyfont=small]
\starttext
\startC
int main() { return 0; } // Comment
\stopC
\startCPP
int main() { return 0; } // Comment
\stopCPP
\stoptext

Nicola


___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Questions about Scite lexers
  2016-04-13 17:25   ` Nicola
@ 2016-04-13 17:31     ` Wolfgang Schuster
  0 siblings, 0 replies; 8+ messages in thread
From: Wolfgang Schuster @ 2016-04-13 17:31 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 535 bytes --]

> Nicola <mailto:nvitacolonna@gmail.com>
> 13. April 2016 um 19:25
>
>
> Thanks for your answers. I'd like to go with \definetyping then, because
> I need /BTEX../ETEX. I have found an old document of mine, which uses a
> (slightly customized) pret-c.lua, located inside the project's folder.
> It compiles, but I don't get syntax highlighting. Is it because pret-c
> is not searched in the project's directory?
The names of the files has changed and you have to look into 
buff-imp-xxx.mkiv|lua
for the syntax highlighters.

Wolfgang

[-- Attachment #1.2: Type: text/html, Size: 1504 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Questions about Scite lexers
  2016-04-13 15:39 ` Hans Hagen
  2016-04-13 17:25   ` Nicola
@ 2016-04-13 17:51   ` Alan BRASLAU
  1 sibling, 0 replies; 8+ messages in thread
From: Alan BRASLAU @ 2016-04-13 17:51 UTC (permalink / raw)
  To: Hans Hagen; +Cc: ntg-context

On Wed, 13 Apr 2016 17:39:57 +0200
Hans Hagen <pragma@wxs.nl> wrote:

> > 5) May I rely on this feature to be stable?  
> 
> yes (i use it myself)

The following is slightly off-topic of the present thread...

Hans, we finally understood while at the ConTeXt conference at
Nasbinals that your syntax highlighting depend on a lexer that requires
an external library for the scite editor. This library is available for
Windows so you have no problem using this feature (not the formatting
highlighting feature in ConTeXt but the editor highlighting). However,
the libraries will require some work to port them to other systems, and
we failed in our short effort to simply compile it.

My question to the mailing list is where should we be going for this?
I see several options:
1) work further on porting the lua lexer library to scite on other
systems, and/or
2) work on porting Hans' lua rules to other editors, i.e. vim (and
emacs, for those so inclined).

It would be nice to have synchronization between our editors'
highlighting and that formatted by Context.

Alan
___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Questions about Scite lexers
       [not found] <mailman.448.1460568766.1989.ntg-context@ntg.nl>
@ 2016-04-13 20:39 ` Christoph Reller
  2016-04-14  5:10   ` Christoph Reller
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Reller @ 2016-04-13 20:39 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 713 bytes --]

Nicola <nvitacolonna@gmail.com> wrote on Wed., 13. Apr. 2016 19:36:

>
> I have found an old document of mine, which uses a
> (slightly customized) pret-c.lua, located inside the project's folder.
> It compiles, but I don't get syntax highlighting. Is it because pret-c
> is not searched in the project's directory?
>

Alternatively you can set the TEXMF_LOCAL environment variable to some
directory where your "private" texmf-tree resides. Note that after this you
have to run
    context --generate
in order for context to find the modules in your texmf-tree.
Also note that the compilation logfile written by context tells you what
modules have been found in which locations.

I hope this helps,

Christoph

>

[-- Attachment #1.2: Type: text/html, Size: 1269 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Questions about Scite lexers
  2016-04-13 20:39 ` Christoph Reller
@ 2016-04-14  5:10   ` Christoph Reller
  2016-04-14 17:49     ` Nicola
  0 siblings, 1 reply; 8+ messages in thread
From: Christoph Reller @ 2016-04-14  5:10 UTC (permalink / raw)
  To: ntg-context; +Cc: nvitacolonna


[-- Attachment #1.1: Type: text/plain, Size: 932 bytes --]

On Wed, Apr 13, 2016 at 10:39 PM Christoph Reller <
christoph.reller@gmail.com> wrote:

> Nicola <nvitacolonna@gmail.com> wrote on Wed., 13. Apr. 2016 19:36:
>
>>
>> I have found an old document of mine, which uses a
>> (slightly customized) pret-c.lua, located inside the project's folder.
>> It compiles, but I don't get syntax highlighting. Is it because pret-c
>> is not searched in the project's directory?
>>
>
> Alternatively you can set the TEXMF_LOCAL environment variable to some
> directory where your "private" texmf-tree resides. Note that after this you
> have to run
>     context --generate
> in order for context to find the modules in your texmf-tree.
> Also note that the compilation logfile written by context tells you what
> modules have been found in which locations.
>
> I hope this helps,
>
> Christoph
>

Sorry, the environment variable should be named TEXMFLOCAL, without the
underscore
Cheers,
Christoph

[-- Attachment #1.2: Type: text/html, Size: 1616 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Questions about Scite lexers
  2016-04-14  5:10   ` Christoph Reller
@ 2016-04-14 17:49     ` Nicola
  0 siblings, 0 replies; 8+ messages in thread
From: Nicola @ 2016-04-14 17:49 UTC (permalink / raw)
  To: ntg-context

On 2016-04-14 05:10:18 +0000, Christoph Reller said:

> On Wed, Apr 13, 2016 at 10:39 PM Christoph Reller 
> <christoph.reller@gmail.com> wrote:
> Nicola <nvitacolonna@gmail.com> wrote on Wed., 13. Apr. 2016 19:36:
> 
> I have found an old document of mine, which uses a
> (slightly customized) pret-c.lua, located inside the project's folder.
> It compiles, but I don't get syntax highlighting. Is it because pret-c
> is not searched in the project's directory? 
> 
> Alternatively you can set the TEXMF_LOCAL environment variable to some 
> directory where your "private" texmf-tree resides. Note that after this 
> you have to run
>     context --generate
> in order for context to find the modules in your texmf-tree.
> Also note that the compilation logfile written by context tells you 
> what modules have been found in which locations.
> 
> I hope this helps,
> 
> Christoph
> 
> Sorry, the environment variable should be named TEXMFLOCAL, without the 
> underscore

Thanks for all the suggestions. I will experiment a bit, and come back 
to the mailing list for further questions.

Nicola


___________________________________________________________________________________
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
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-04-14 17:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-13 14:37 Questions about Scite lexers Nicola
2016-04-13 15:39 ` Hans Hagen
2016-04-13 17:25   ` Nicola
2016-04-13 17:31     ` Wolfgang Schuster
2016-04-13 17:51   ` Alan BRASLAU
     [not found] <mailman.448.1460568766.1989.ntg-context@ntg.nl>
2016-04-13 20:39 ` Christoph Reller
2016-04-14  5:10   ` Christoph Reller
2016-04-14 17:49     ` Nicola

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).