Discussion:
context coloring leaks out of verbatim environment
Ulrich Scholz
2005-02-18 15:58:41 UTC
Permalink
Remember to cover the basics, that is, what you expected to happen and
what in fact did happen.

If the bug (or problem) is triggered by a specific (La)TeX
file, you should try to produce a minimal sample file showing the
problem and include it in your report.

Your bug report will be posted to the AUCTeX mailing list.


OK, open the following in Emacs; bring cursor in the line with
\end{verbatim}; press return; press delete. Then the context coloring leaks
out of the verbatim environment.

\documentclass{article}

\begin{document}

\begin{verbatim}
test
\end{verbatim}
\end{document}


Emacs : GNU Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2004-10-16 on raven, modified by Debian
Package: AUCTeX 11.55

current state:
==============
(setq
window-system 'x
LaTeX-version "2e"
TeX-style-path '("style/" "auto/"
"/home/scholzuh/Forschung/Literatur/BibTeX/style/"
"/home/scholzuh/LaTeX/Inputs/style/"
"/home/scholzuh/Privat/Bewerbungen/Bilder/style/"
"/home/scholzuh/Privat/Bewerbungen/Unterlagen/style/"
"/home/scholzuh/Forschung/Papers/Include-Files-Papers/style/" "/home/scholzuh/Forschung/Literatur/BibTeX/auto/" "/home/scholzuh/LaTeX/Inputs/auto/" "/home/scholzuh/Privat/Bewerbungen/Bilder/auto/" "/home/scholzuh/Privat/Bewerbungen/Unterlagen/auto/" "/home/scholzuh/Forschung/Papers/Include-Files-Papers/auto/" "/usr/share/emacs21/site-lisp/auctex/style/" "/var/lib/auctex/emacs21/")
TeX-auto-save nil
TeX-parse-self nil
TeX-master t
)
--
Ulrich Scholz

***@informatik.tu-darmstadt.de
http://www.intellektik.informatik.tu-darmstadt.de/~scholz/
Ralf Angeli
2005-02-18 16:27:09 UTC
Permalink
Post by Ulrich Scholz
OK, open the following in Emacs; bring cursor in the line with
\end{verbatim}; press return; press delete. Then the context coloring leaks
out of the verbatim environment.
Hm, I cannot reproduce your problem with a vanilla Emacs 21.3 and
vanilla AUCTeX 11.55. I checked this by starting Emacs with `emacs -q
-no-site-file', then typing `M-: (require 'tex-site) RET' and `M-x
global-font-lock-mode RET'. After that I opened a new LaTeX file and
copied your example into it. After typing RET and backspace several
times both at the start and end of the line with "\end{verbatim}"
syntax highlighting is still fine.

Could this be a problem with the Emacs or AUCTeX versions provided by
Debian? Which I doubt, but maybe somebody could check.

BTW, you don't have parsing enabled as described on the first page of
AUCTeX's manual. You should do that if you want to get the full
functionality of AUCTeX.
--
Ralf
Ralf Angeli
2005-02-19 08:46:19 UTC
Permalink
Post by Ralf Angeli
Post by Ulrich Scholz
OK, open the following in Emacs; bring cursor in the line with
\end{verbatim}; press return; press delete. Then the context coloring leaks
out of the verbatim environment.
Hm, I cannot reproduce your problem with a vanilla Emacs 21.3 and
vanilla AUCTeX 11.55. I checked this by starting Emacs with `emacs -q
-no-site-file', then typing `M-: (require 'tex-site) RET' and `M-x
global-font-lock-mode RET'. After that I opened a new LaTeX file and
copied your example into it. After typing RET and backspace several
times both at the start and end of the line with "\end{verbatim}"
syntax highlighting is still fine.
Ulrich, do see the same problem in case you carry out the steps
described above? Does the syntax highlighting get back to normal if
you type `M-x font-lock-fontify-buffer RET'?
--
Ralf
Ralf Angeli
2005-02-21 18:35:36 UTC
Permalink
[Redirecting to the mailing list.]
Post by Ralf Angeli
Ulrich, do see the same problem in case you carry out the steps
described above? Does the syntax highlighting get back to normal if
you type `M-x font-lock-fontify-buffer RET'?
`M-x font-lock-fontify-buffer RET' brings the coloring back into a normal
state. As the problem only occurs only if I change the last line of the
verbatim environment, this command helps a lot.
Then font-lock "just" has some problems updating the buffer after a
change.
Sorry, I didn't have the time to test your suggestion of starting Emacs with
`emacs -q -no-site-file'. I'll try that soon.
This would be interesting as it would allow to judge if there is
something in your site/user configuration which changes or leads to
changes in font-lock behavior.
--
Ralf
Ralf Angeli
2005-02-25 13:56:01 UTC
Permalink
[Redirecting to the mailing list. Please keep that in Cc with future
replies.]
Post by Ralf Angeli
I checked this by starting Emacs with `emacs -q
-no-site-file', then typing `M-: (require 'tex-site) RET' and `M-x
global-font-lock-mode RET'.
Ulrich, do see the same problem in case you carry out the steps
described above?
With these steps, the coloring does not leak. But actually, the verbatim
environment is not colored at all. In other words, the coloring of the file
differs between using my .gnu-emacs-custom and not using it. So I guess the
problem is on my side.
Are you sure that the commands above succeeded? If tex-site.el is not
found, you will end up with Emacs' own LaTeX mode. And your
description of the resulting fontification very much looks like this.
Is there still a "LaTeX" menu?
Post by Ralf Angeli
BTW, you don't have parsing enabled as described on the first page of
AUCTeX's manual. You should do that if you want to get the full
functionality of AUCTeX.
I added the lines
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(setq-default TeX-master nil)
to my .gnu-emacs-custom but my problem is still there
The suggestion was unrelated to the problem.
--
Ralf
Ulrich Scholz
2005-02-28 10:48:51 UTC
Permalink
Post by Ralf Angeli
Post by Ralf Angeli
I checked this by starting Emacs with `emacs -q
-no-site-file', then typing `M-: (require 'tex-site) RET' and `M-x
global-font-lock-mode RET'.
With these steps, the coloring does not leak. But actually, the verbatim
environment is not colored at all.
Are you sure that the commands above succeeded? If tex-site.el is not
found, you will end up with Emacs' own LaTeX mode. And your
description of the resulting fontification very much looks like this.
Is there still a "LaTeX" menu?
You are right: I don't get the LaTeX menu but the TeX one. But typing `M-:
(require 'tex-site) RET' does not yield an error. Currently, I don't know how
to use auctex instead "by hand".

Actually, analyzing the .emacs, .gnu-emacs, and .gnu-emacs-custom of my
account is quite hard for me. My debian system has several site-lisp
directories and a huge load path. I'm quite confused.

Uli



/usr/local/share/emacs/site-lisp
/usr/local/share/emacs/21.3/site-lisp
/usr/share/emacs/site-lisp/
/usr/share/emacs/21.3/site-lisp (link to ../../emacs21/site-lisp)
/usr/share/emacs21/site-lisp

load-path's value is
("/usr/share/emacs21/site-lisp/auctex/images" "/usr/share/emacs21/site-lisp/auctex" "/etc/emacs21" "/etc/emacs" "/usr/local/share/emacs/21.3/site-lisp" "/usr/local/share/emacs/site-lisp" "/usr/share/emacs/21.3/site-lisp" "/usr/share/emacs/21.3/site-lisp/a2ps" "/usr/share/emacs/21.3/site-lisp/apel" "/usr/share/emacs/21.3/site-lisp/auctex" "/usr/share/emacs/21.3/site-lisp/debian-el" "/usr/share/emacs/21.3/site-lisp/devscripts-el" "/usr/share/emacs/21.3/site-lisp/dictionaries-common" "/usr/share/emacs/21.3/site-lisp/dpkg-dev-el" "/usr/share/emacs/21.3/site-lisp/elserv" "/usr/share/emacs/21.3/site-lisp/emacs-wiki" "/usr/share/emacs/21.3/site-lisp/flim" "/usr/share/emacs/21.3/site-lisp/preview-latex" "/usr/share/emacs/21.3/site-lisp/semi" "/usr/share/emacs/site-lisp" "/usr/share/emacs/21.3/leim" "/usr/share/emacs/21.3/lisp" "/usr/share/emacs/21.3/lisp/toolbar" "/usr/share/emacs/21.3/lisp/textmodes" "/usr/share/emacs/21.3/lisp/progmodes" "/usr/share/emacs/21.3/lisp/play" "/usr/share/emacs/21.3/lisp/obsolete" "/usr/share/emacs/21.3/lisp/net" "/usr/share/emacs/21.3/lisp/mail" "/usr/share/emacs/21.3/lisp/language" "/usr/share/emacs/21.3/lisp/international" "/usr/share/emacs/21.3/lisp/gnus" "/usr/share/emacs/21.3/lisp/eshell" "/usr/share/emacs/21.3/lisp/emulation" "/usr/share/emacs/21.3/lisp/emacs-lisp" "/usr/share/emacs/21.3/lisp/calendar")



Uli
--
Ulrich Scholz

***@informatik.tu-darmstadt.de
http://www.intellektik.informatik.tu-darmstadt.de/~scholz/
Ralf Angeli
2005-02-28 12:41:00 UTC
Permalink
Post by Ulrich Scholz
Post by Ralf Angeli
Post by Ralf Angeli
I checked this by starting Emacs with `emacs -q
-no-site-file', then typing `M-: (require 'tex-site) RET' and `M-x
global-font-lock-mode RET'.
With these steps, the coloring does not leak. But actually, the verbatim
environment is not colored at all.
Are you sure that the commands above succeeded? If tex-site.el is not
found, you will end up with Emacs' own LaTeX mode. And your
description of the resulting fontification very much looks like this.
Is there still a "LaTeX" menu?
(require 'tex-site) RET' does not yield an error. Currently, I don't know how
to use auctex instead "by hand".
Actually, analyzing the .emacs, .gnu-emacs, and .gnu-emacs-custom of my
account is quite hard for me. My debian system has several site-lisp
directories and a huge load path. I'm quite confused.
Hm, you could try it by starting Emacs with `emacs -q' which will at
least inhibit your user init file from being loaded while still
loading the site init file (which obviously sets some Debian-specific
defaults).

But I am a bit stumped that requiring tex-site and loading a LaTeX
file after that did not result in an error. Do you have several
AUCTeX installations?
--
Ralf
Ulrich Scholz
2005-02-28 15:46:43 UTC
Permalink
Post by Ralf Angeli
Hm, you could try it by starting Emacs with `emacs -q' which will at
least inhibit your user init file from being loaded while still
loading the site init file (which obviously sets some Debian-specific
defaults).
OK, after `emacs -q file.tex' I get the LaTeX menu. Then I did `M-: (require
'tex-site)' and `M-x global-font-lock-mode RET'. The coloring appears and
does not leak.

If I find time the next week I try to track down the problematic portion of my
initialization files.
Post by Ralf Angeli
But I am a bit stumped that requiring tex-site and loading a LaTeX
file after that did not result in an error. Do you have several
AUCTeX installations?
Not that I know of. How do I check this? I used the standard Debian tools to
install emacs.

Uli
--
Ulrich Scholz

***@informatik.tu-darmstadt.de
http://www.intellektik.informatik.tu-darmstadt.de/~scholz/
Ralf Angeli
2005-02-28 16:01:53 UTC
Permalink
Post by Ulrich Scholz
Post by Ralf Angeli
Hm, you could try it by starting Emacs with `emacs -q' which will at
least inhibit your user init file from being loaded while still
loading the site init file (which obviously sets some Debian-specific
defaults).
OK, after `emacs -q file.tex' I get the LaTeX menu.
Uh, did you do the same with `emacs -q -no-site-file'? That means,
did you specify the file name on the command line as well? Then it is
obvious why you did not get into AUCTeX's LaTeX mode because it did
not have a chance to associate itself with .tex files.

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.
Post by Ulrich Scholz
Then I did `M-: (require
'tex-site)'
You seem to have told the Debian package to load AUCTeX via the site
init file if you get a "LaTeX" menu right away. In this case the
require statement does not do anything.
Post by Ulrich Scholz
and `M-x global-font-lock-mode RET'. The coloring appears and
does not leak.
If I find time the next week I try to track down the problematic portion of my
initialization files.
Post by Ralf Angeli
But I am a bit stumped that requiring tex-site and loading a LaTeX
file after that did not result in an error. Do you have several
AUCTeX installations?
Not that I know of. How do I check this? I used the standard Debian tools to
install emacs.
Usually you can check stuff like this with `M-x list-load-path-shadows
RET'. But AFAICS it is not necessary in your case. The cause that
you got presented with Emacs' built-in LaTeX mode was that you
specified a file name on the command line and did not give AUCTeX the
chance to be loaded. And because AUCTeX seems to be installed
correctly, the `(require 'tex-site)' did not result in an error.
--
Ralf
Ralf Angeli
2005-03-01 09:49:37 UTC
Permalink
[Redirecting to the mailing list.]
Post by Ralf Angeli
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.
--
\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
Frank Küster
2005-02-18 16:31:57 UTC
Permalink
Post by Ulrich Scholz
OK, open the following in Emacs; bring cursor in the line with
\end{verbatim}; press return; press delete. Then the context coloring leaks
out of the verbatim environment.
I have a related bug report. Just look at

Loading Image...

The third line is colored as if it were commented. In fact it was
previously commented, but either I switched comments with the line
above, or I copied the line, added the "my", and uncommented it.



Emacs : GNU Emacs 21.3.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2005-02-04 on trouble, modified by Debian
Package: AUCTeX 11.55

current state:
==============
(setq
window-system 'x
LaTeX-version "2e"
TeX-style-path '("style/" "auto/" "/home/frank/texmf/tex/latex/style/" "/home/frank/texmf/tex/latex/auto/"
"/usr/share/emacs21/site-lisp/auctex/style/" "/var/lib/auctex/emacs21/" "/home/frank/.auctex-styles/"
"/home/frank/.auctex-styles/" "/home/frank/.auctex-styles/" "/home/frank/.auctex-styles/")
TeX-auto-save t
TeX-parse-self t
TeX-master t
)
--
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer
Ralf Angeli
2005-02-18 17:00:26 UTC
Permalink
Post by Frank Küster
Post by Ulrich Scholz
OK, open the following in Emacs; bring cursor in the line with
\end{verbatim}; press return; press delete. Then the context coloring leaks
out of the verbatim environment.
I have a related bug report.
Does that mean you can confirm the problem Ulrich reported?
Post by Frank Küster
Just look at
http://www.kuesterei.ch/auctex-colors2.gif
The third line is colored as if it were commented. In fact it was
previously commented, but either I switched comments with the line
above, or I copied the line, added the "my", and uncommented it.
Using the following file as an example and doing the procedure to
start Emacs described earlier I can see this upon commenting and
uncommenting the second \usepackage line several times. Then
highlighting can get stuck. But this is nothing an `M-x
font-lock-fontify-buffer RET' should not be able to fix. And in CVS
Emacs the problem seems to be fixed.

\documentclass{article}
% \usepackage[separate]{ochem}
\usepackage[separate]{myochem}
% \usepackage{ochem}
\usepackage{mathpazo,helvet}
\begin{document}
\end{document}
--
Ralf
Frank Küster
2005-02-18 18:14:39 UTC
Permalink
Post by Ralf Angeli
Post by Frank Küster
Post by Ulrich Scholz
OK, open the following in Emacs; bring cursor in the line with
\end{verbatim}; press return; press delete. Then the context coloring leaks
out of the verbatim environment.
I have a related bug report.
Does that mean you can confirm the problem Ulrich reported?
No, excuse me. I was so eager I could take this opportunity to report
my long-planned bug that I didn't even think that it might not be
reproducible anywhere.

I tried, now, and when playing around, I once had the \end{verbatim}
line colored in verbatim color for a short time, but after a second or
less it was automatically colored correctly.
Post by Ralf Angeli
font-lock-fontify-buffer RET' should not be able to fix. And in CVS
Emacs the problem seems to be fixed.
Fine.

Regards, Frank
--
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer
Loading...