Re: weird LaTeX highlighting in updated vim6.4

2006-04-12 Thread Luis A. Florit
* El 12/04/06 a las  8:53, Charles E Campbell Jr chamullaba:

> > >> I've always had some special highlighting for TeX
> > >>files. For example, I have the following syn for "$$":
> > >>
> > >>hi dollars cterm=bold ctermfg=7 ctermbg=4 guifg=white guibg=blue
> > >>syn match dollars /\(\$\$\|\\\[\|\\\]\)/
> > >> 
> > >>
> > ...
> > But your (and Benji's) solution gives rise to another problem:
> > If I add containedin=ALL, or containedin=texDocZone, the "$$" 
> > are properly highlighted, but then 80% of the "}" in the 
> > manuscript are highlighted like errors, white over red (??!!).
> > 
> > Another problem that I have (but this one I always had) is that
> > the highlighting of the "$$" destroys the normal highlighting 
> > of the math zone, and errors appear inside the $$ ... $$. 
> > But I assume it has to do with the contained-contains stuff.
> > 
> > I tried, then:
> > 
> > hi dolares cterm=bold ctermfg=7 ctermbg=4 guifg=white guibg=blue
> > syn match dolares contained /\(\$\$\|\\\[\|\\\]\)/ containedin=ALL
> > 
> > but, still, the two problems persist: 80% of the "}" are marked
> > as errors, and the syntax inside the $$ ... $$ is destroyed.
> > 
> > Do you have a suggestion? I really don't get how this works.
> > 
> > 
> 
> Look into syntax/tex.vim.  The $$ ... $$ is recognized as a texMathZoneY 
> (normally).
> Now, your syntax item (dolares) occurs later, so it has priority; hence, 
> the texMathZoneY
> is bypassed by your extra syntax.
> 
> What you've wanted is to change the  highlighting of $$.  Currently, the 
> texMathZoneY uses
> Delimiter for the highlighting of the $$s.  Now, I haven't tested this, 
> but one way to do this is
> to overwrite the texMathZoneY:
> 
>  syn clear texMathZoneY
>   syn region texMathZoneYmatchgroup=Delimiter start="\$\$" 
> matchgroup=Delimiter end="\$\$" end="%stopzone\>"keepend
> [EMAIL PROTECTED]
> 
> This clears the texMathZoneY and then re-installs it.  It does have a 
> high priority (because its being done
> most recently) but I don't think that should be a problem.  Now, change 
> the "Delimiter" to "dolares".   Include
> your dolares highlighting specification.   Finally, put it into  
> after/syntax/tex.vim (so that it gets loaded after
> usual syntax/tex.vim highlighting for ft=tex files).  I think that'll do it!

Ok, motivated by what you said about the syntax folding, I solved
my problem, by adding this:

syn clear texDocZone
syn clear texSectionZone
syn clear texSubSectionZone
syn clear texSubSubSectionZone
syn clear texParaZone
syn clear texChapterZone

Now everything works fine (since I don't use syntax folding).
I think this somehow broke the containedin option.

Thanks!

L.


Re: weird LaTeX highlighting in updated vim6.4

2006-04-12 Thread Luis A. Florit
* El 12/04/06 a las  8:53, Charles E Campbell Jr chamullaba:

> Luis A. Florit wrote:
>
> > >> I've always had some special highlighting for TeX
> > >>files. For example, I have the following syn for "$$":
> > >>
> > >>hi dollars cterm=bold ctermfg=7 ctermbg=4 guifg=white guibg=blue
> > >>syn match dollars /\(\$\$\|\\\[\|\\\]\)/
> > >>
> > >>
> > ...
> > But your (and Benji's) solution gives rise to another problem:
> > If I add containedin=ALL, or containedin=texDocZone, the "$$"
> > are properly highlighted, but then 80% of the "}" in the
> > manuscript are highlighted like errors, white over red (??!!).
> >
> > Another problem that I have (but this one I always had) is that
> > the highlighting of the "$$" destroys the normal highlighting
> > of the math zone, and errors appear inside the $$ ... $$.
> > But I assume it has to do with the contained-contains stuff.
> >
> > I tried, then:
> >
> > hi dolares cterm=bold ctermfg=7 ctermbg=4 guifg=white guibg=blue
> > syn match dolares contained /\(\$\$\|\\\[\|\\\]\)/ containedin=ALL
> >
> > but, still, the two problems persist: 80% of the "}" are marked
> > as errors, and the syntax inside the $$ ... $$ is destroyed.
> >
> > Do you have a suggestion? I really don't get how this works.
> >
> >
>
> Look into syntax/tex.vim. The $$ ... $$ is recognized as
> a texMathZoneY (normally). Now, your syntax item (dolares) occurs
> later, so it has priority; hence, the texMathZoneY is bypassed by
> your extra syntax.

Got it!

> What you've wanted is to change the highlighting of $$. Currently,
> the texMathZoneY uses Delimiter for the highlighting of the $$s.
> Now, I haven't tested this, but one way to do this is to overwrite
> the texMathZoneY:
>
>  syn clear texMathZoneY
> syn region texMathZoneY matchgroup=Delimiter start="\$\$"
> matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend
> [EMAIL PROTECTED]
>
> This clears the texMathZoneY and then re-installs it. It does have
> a high priority (because its being done most recently) but I don't
> think that should be a problem. Now, change the "Delimiter" to
> "dolares". Include your dolares highlighting specification. Finally,
> put it into after/syntax/tex.vim (so that it gets loaded after usual
> syntax/tex.vim highlighting for ft=tex files). I think that'll do it!

Indeed!
Now $$ is highlighted as I wanted, and the syntax preserved inside.
No "containedin=..." needed.

However (why there is always a however?), the other problem persists.
I want to highlight, say, the beginning and end of proofs, and my old 
highlighting does nothing:

  hi proof cterm=bold ctermfg=black ctermbg=cyan guifg=black guibg=cyan
  syn match proof /\(\\\(begin{\|end{\)\?proof[}]\?\)\|\(\\qed\)/

Adding "containedin=" highlights the patterns, BUT then that
also highlights most "}" as errors (this sounds like a bug in the
highlighting syntax to me...)

If the file after/syntax/tex.vim only contains this two lines

  hi proof cterm=bold ctermfg=black ctermbg=cyan guifg=black guibg=cyan
  syn match proof /\\qed/ containedin=ALL

then most "}" are highlighted as errors. I can grab the screen and 
post it on my webpage if needed. The "containedin=ALL" seems to
have some problem.

Thanks a lot!!

L.



Re: weird LaTeX highlighting in updated vim6.4

2006-04-12 Thread Charles E Campbell Jr

Luis A. Florit wrote:


* El 11/04/06 a las  9:58, Charles E Campbell Jr chamullaba:

 


Luis A. Florit wrote:

   


 I've always had some special highlighting for TeX
files. For example, I have the following syn for "$$":

hi dollars cterm=bold ctermfg=7 ctermbg=4 guifg=white guibg=blue
syn match dollars /\(\$\$\|\\\[\|\\\]\)/
 


...
But your (and Benji's) solution gives rise to another problem:
If I add containedin=ALL, or containedin=texDocZone, the "$$" 
are properly highlighted, but then 80% of the "}" in the 
manuscript are highlighted like errors, white over red (??!!).


Another problem that I have (but this one I always had) is that
the highlighting of the "$$" destroys the normal highlighting 
of the math zone, and errors appear inside the $$ ... $$. 
But I assume it has to do with the contained-contains stuff.


I tried, then:

hi dolares cterm=bold ctermfg=7 ctermbg=4 guifg=white guibg=blue
syn match dolares contained /\(\$\$\|\\\[\|\\\]\)/ containedin=ALL

but, still, the two problems persist: 80% of the "}" are marked
as errors, and the syntax inside the $$ ... $$ is destroyed.

Do you have a suggestion? I really don't get how this works.
 



Look into syntax/tex.vim.  The $$ ... $$ is recognized as a texMathZoneY 
(normally).
Now, your syntax item (dolares) occurs later, so it has priority; hence, 
the texMathZoneY

is bypassed by your extra syntax.

What you've wanted is to change the  highlighting of $$.  Currently, the 
texMathZoneY uses
Delimiter for the highlighting of the $$s.  Now, I haven't tested this, 
but one way to do this is

to overwrite the texMathZoneY:

 syn clear texMathZoneY
  syn region texMathZoneYmatchgroup=Delimiter start="\$\$" 
matchgroup=Delimiter end="\$\$" end="%stopzone\>"keepend
[EMAIL PROTECTED]


This clears the texMathZoneY and then re-installs it.  It does have a 
high priority (because its being done
most recently) but I don't think that should be a problem.  Now, change 
the "Delimiter" to "dolares".   Include
your dolares highlighting specification.   Finally, put it into  
after/syntax/tex.vim (so that it gets loaded after

usual syntax/tex.vim highlighting for ft=tex files).  I think that'll do it!

Regards,
Chip Campbell



Re: weird LaTeX highlighting in updated vim6.4

2006-04-11 Thread Luis A. Florit
* El 11/04/06 a las  9:58, Charles E Campbell Jr chamullaba:

> Luis A. Florit wrote:
> 
> > Hi all,
> > 
> >   I've always had some special highlighting for TeX
> > files. For example, I have the following syn for "$$":
> > 
> > hi dollars cterm=bold ctermfg=7 ctermbg=4 guifg=white guibg=blue
> > syn match dollars /\(\$\$\|\\\[\|\\\]\)/
> > 
> > It always worked nicely, but since I upgraded to FC5,
> > and then from vim6.3 to vim6.4, the highlighting only
> > works BEFORE the '\begin{document}', and not after
> > (not very useful...). This persist even if I remove
> > my .vimrc, or my .vim directory, so it is some new
> > problem with version 6.4.
> > 
> >   Any idea about what is happening??
> 
> As Benji F said, you'll need to get it contained (at least in 
> texDocZone).  containedin=ALL
> should work, but it will of course then be contained in all groups, 
> including comments.
> 
> The texDocZone group was set up to facilitate syntax-based folding.

I understand.
I tried a lot to make syntax-based folding in 6.3, and I gave up...
marked folding is much faster, anyway, and trivial.
I like coward solutions... :)

But your (and Benji's) solution gives rise to another problem:
If I add containedin=ALL, or containedin=texDocZone, the "$$" 
are properly highlighted, but then 80% of the "}" in the 
manuscript are highlighted like errors, white over red (??!!).

Another problem that I have (but this one I always had) is that
the highlighting of the "$$" destroys the normal highlighting 
of the math zone, and errors appear inside the $$ ... $$. 
But I assume it has to do with the contained-contains stuff.

I tried, then:

hi dolares cterm=bold ctermfg=7 ctermbg=4 guifg=white guibg=blue
syn match dolares contained /\(\$\$\|\\\[\|\\\]\)/ containedin=ALL

but, still, the two problems persist: 80% of the "}" are marked
as errors, and the syntax inside the $$ ... $$ is destroyed.

Do you have a suggestion? I really don't get how this works.

Thanks for your patience...

Cheers,

Luis.



Re: weird LaTeX highlighting in updated vim6.4

2006-04-11 Thread Luis A. Florit
Benji,

* El 10/04/06 a las 23:01, Benji Fisher chamullaba:

> On Mon, Apr 10, 2006 at 11:06:12PM -0300, Luis A. Florit wrote:
> > Hi all,
> > 
> > I've always had some special highlighting for TeX
> > files. For example, I have the following syn for "$$":
> > 
> > hi dollars cterm=bold ctermfg=7 ctermbg=4 guifg=white guibg=blue
> > syn match dollars /\(\$\$\|\\\[\|\\\]\)/
> > 
> > It always worked nicely, but since I upgraded to FC5,
> > and then from vim6.3 to vim6.4, the highlighting only
> > works BEFORE the '\begin{document}', and not after
> > (not very useful...). This persist even if I remove
> > my .vimrc, or my .vim directory, so it is some new
> > problem with version 6.4.
> > 
> > Any idea about what is happening??
> > 
> > Thanks a lot,
> > 
> > Luis.
> 
> Probably your $$ occurs inside some syntax region, so it is not
> recognized. A simple fix might be to add "containedin=ALL" to
> the "syn match" line.
>
> :help containedin

Almost!
If I do that, they are propperly highlighted, but then all 
the "}" in the manuscript are then highlighted as errors (??!!).

What changed in tex.vim? It worked so nicely in Vim 6.3...

 From Charles:

> As Benji F said, you'll need to get it contained (at least in
> texDocZone).  containedin=ALL
> should work, but it will of course then be contained in all groups,
> including comments.
> 
> The texDocZone group was set up to facilitate syntax-based folding.

Has the same side effect...
 
> > PS:
> > BTW, we are receiving a several spam and virus from vim mailing list.
> > Not that matters a lot to me, with Linux, SpamAssassin and Clamav,
> > but for windows users... The strange thing is that I needed to change
> > my "From " first header through sendmail to be able to post in Vim
> > mailing list: the most strict list I belong, and the only one with SPAM.
> > Perhaps some tunning needed?
> > 
> > Thanks again.  L.
> 
> Since there was a big problem with the mail servers a few weeks
> ago, I think the plan is to move the lists to a new server ASAP after
> vim 7.0 is released. I expect some tuning (tunning?) to take place
> then.

Good!

Thanks,

Luis.



Re: weird LaTeX highlighting in updated vim6.4

2006-04-11 Thread Charles E Campbell Jr

Luis A. Florit wrote:


Hi all,

   I've always had some special highlighting for TeX
files. For example, I have the following syn for "$$":

hi dollars cterm=bold ctermfg=7 ctermbg=4 guifg=white guibg=blue
syn match dollars /\(\$\$\|\\\[\|\\\]\)/

It always worked nicely, but since I upgraded to FC5,
and then from vim6.3 to vim6.4, the highlighting only
works BEFORE the '\begin{document}', and not after
(not very useful...). This persist even if I remove
my .vimrc, or my .vim directory, so it is some new
problem with version 6.4.

   Any idea about what is happening??
 

As Benji F said, you'll need to get it contained (at least in 
texDocZone).  containedin=ALL
should work, but it will of course then be contained in all groups, 
including comments.


The texDocZone group was set up to facilitate syntax-based folding.

Regards,
Chip Campbell



Re: weird LaTeX highlighting in updated vim6.4

2006-04-10 Thread Benji Fisher
On Mon, Apr 10, 2006 at 11:06:12PM -0300, Luis A. Florit wrote:
> Hi all,
> 
> I've always had some special highlighting for TeX
> files. For example, I have the following syn for "$$":
> 
> hi dollars cterm=bold ctermfg=7 ctermbg=4 guifg=white guibg=blue
> syn match dollars /\(\$\$\|\\\[\|\\\]\)/
> 
> It always worked nicely, but since I upgraded to FC5,
> and then from vim6.3 to vim6.4, the highlighting only
> works BEFORE the '\begin{document}', and not after
> (not very useful...). This persist even if I remove
> my .vimrc, or my .vim directory, so it is some new
> problem with version 6.4.
> 
> Any idea about what is happening??
> 
> Thanks a lot,
> 
> Luis.

 Probably your $$ occurs inside some syntax region, so it is not
recognized.  A simple fix might be to add "containedin=ALL" to the "syn
match" line.

:help containedin

> PS:
> BTW, we are receiving a several spam and virus from vim mailing list.
> Not that matters a lot to me, with Linux, SpamAssassin and Clamav,
> but for windows users... The strange thing is that I needed to change
> my "From " first header through sendmail to be able to post in Vim
> mailing list: the most strict list I belong, and the only one with SPAM.
> Perhaps some tunning needed?
> 
> Thanks again.  L.

 Since there was a big problem with the mail servers a few weeks
ago, I think the plan is to move the lists to a new server ASAP after
vim 7.0 is released.  I expect some tuning (tunning?) to take place
then.

HTH --Benji Fisher