Re: context coloring leaks out of verbatim environment

Ralf Angeli <[email protected]>
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
[Redirecting to the mailing list.]

* Ulrich Scholz (2005-03-01) writes:

>> If you want to test with `-no-site-file' you have to start Emacs with
>> `emacs -q -no-site-file' and without providing a file name at the
>> command line.  When Emacs is running you do `M-: (require 'tex-site)
>> RET' and `M-x global-font-lock-mode RET'.  _After_ that you can load a
>> LaTeX file.
>
> I did as you told.
>
> `emacs -q -no-site-file' without providing a file name
> `M-: (require 'tex-site) RET'
> `M-x global-font-lock-mode RET'
>
> Then I loaded the file given below.
>
> And the coloring leaks if I press <space> in the line of \end{verbatim}
> (before the losing '}').  Lines further down are affected if either they are
> in the same paragraph as \end{verbatim} (without empty line inbetween) or they
> are edited.

Why would you want to add a space there?

> The coloring becomes correct again if I 
> - press return at the beginning of \end{verbatim}.  I can safely remove that  
>   extra line without messing up the coloring 

It will not stay like this very long because the fontification code
will only match the string "<start of line>\end{verbatim}<end of line>".

> - remove the extra space and the space was entered in the middle of
>   \end{verbatim} (e.g., \end{ver batim}).  This does not work if the space is
>   the first character in the line. 

Yes, because the syntax is not correct.  AFAIK verbatim environments
have to start in the first column.

> The test file:
> --
> \documentclass{article}
> \begin{document}
> \begin{verbatim}
>  1 prove(F) :- Time1 is cputime, make_matrix(F,M), prove(M,1),
>  2             Time2 is cputime, Time is Time2-Time1, print(Time).
> \end{verbatim}
> \end{document}

Okay, I played with it and if one uses
"<start of line>\end{verbatim}<end of line>" syntax highlighting will
get back to normal sooner or later.  And you already know that you can
force it by doing `M-x font-lock-fontify-buffer RET'.

So I am afraid that I cannot do much about it.  It is not a bug in
AUCTeX.  You could try a CVS Emacs which updates fontification faster
and more reliable.

-- 
Ralf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.