Discussion:
Problem with original Emacs LaTeX font lock scheme
August Karlstrom
2005-03-08 02:13:03 UTC
Permalink
I have set `TeX-install-font-lock' to the symbol `tex-font-setup', but
only strings and comments are fontified. Both `global-font-lock-mode'
and `font-lock-maximum-decoration' is `t'. Any clues?

Emacs : GNU Emacs 21.3.1 (i386-redhat-linux-gnu, X toolkit, Xaw3d
scroll bars)
of 2005-02-04 on bugs.build.redhat.com
Package: AUCTeX 11.55

current state:
==============
(setq
window-system 'x
LaTeX-version "2e"
TeX-style-path '("style/" "auto/" "/usr/share/emacs/site-
lisp/auctex/style/"
"/usr/local/var/auctex/")
TeX-auto-save nil
TeX-parse-self nil
TeX-master t
)
--
August
Ralf Angeli
2005-03-08 08:51:07 UTC
Permalink
Post by August Karlstrom
I have set `TeX-install-font-lock' to the symbol `tex-font-setup', but
only strings and comments are fontified. Both `global-font-lock-mode'
and `font-lock-maximum-decoration' is `t'. Any clues?
Emacs : GNU Emacs 21.3.1 (i386-redhat-linux-gnu, X toolkit, Xaw3d
scroll bars)
of 2005-02-04 on bugs.build.redhat.com
Package: AUCTeX 11.55
No problem here with Emacs 21.3 or CVS Emacs. Do you get any error
messages in the *Messages* buffer? To make these more visible you
could start Emacs with --debug-init and/or put
`(setq debug-on-error t)' as the first line into your init file.
--
Ralf
August Karlstrom
2005-03-08 15:52:14 UTC
Permalink
Post by Ralf Angeli
Post by August Karlstrom
I have set `TeX-install-font-lock' to the symbol `tex-font-setup', but
only strings and comments are fontified. Both `global-font-lock-mode'
and `font-lock-maximum-decoration' is `t'. Any clues?
Emacs : GNU Emacs 21.3.1 (i386-redhat-linux-gnu, X toolkit, Xaw3d
scroll bars)
of 2005-02-04 on bugs.build.redhat.com
Package: AUCTeX 11.55
No problem here with Emacs 21.3 or CVS Emacs. Do you get any error
messages in the *Messages* buffer? To make these more visible you
could start Emacs with --debug-init and/or put
`(setq debug-on-error t)' as the first line into your init file.
Yes, here is the contents of the *Messages* buffer after I have issued
`emacs --debug-init test.tex &'.

(emacs --debug-init test.tex)
Loading disp-table...done
Loading tool-bar...done
Loading image...done
Loading tooltip...done
Loading /usr/share/emacs/site-lisp/site-start.d/lang-coding-systems-
init.el (source)...
Loading encoded-kb...done
Loading /usr/share/emacs/site-lisp/site-start.d/lang-coding-systems-
init.el (source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/php-mode-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/po-mode-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/psgml-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/python-mode-init.el
(source)...done
Loading /usr/share/emacs/site-lisp/site-start.d/rpm-spec-mode-init.el
(source)...done
Loading regexp-opt...done
Loading mwheel...done
Loading pc-select...done
Loading delsel...done
Loading server...done
Loading loadhist...done
Loading /usr/share/emacs/21.3/lisp/emacs-lisp/regexp-opt...done
For information about the GNU Project and its goals, type C-h C-p.
Loading tex...
Loading mule-util...done
Loading /usr/libexec/emacs/21.3/i386-redhat-linux/fns-21.3.1.el
(source)...done
Loading advice...done
Loading tex...done
Loading latex...done
Loading tex-font...done
Loading easy-mmode...done
Applying style hooks... done
Updating section menu...
Updating environment menu...
Sorting environment...
Removing duplicates... done
Updating modify environment menu...
Updating...done
Error during redisplay: (error No match 3 in highlight (3 font-lock-
function-name-face keep)) [2 times]
--
August
Ralf Angeli
2005-03-08 16:14:55 UTC
Permalink
Post by August Karlstrom
Post by Ralf Angeli
Post by August Karlstrom
I have set `TeX-install-font-lock' to the symbol `tex-font-setup', but
only strings and comments are fontified. Both `global-font-lock-mode'
and `font-lock-maximum-decoration' is `t'. Any clues?
[...]
Post by August Karlstrom
Post by Ralf Angeli
No problem here with Emacs 21.3 or CVS Emacs. Do you get any error
messages in the *Messages* buffer? To make these more visible you
could start Emacs with --debug-init and/or put
`(setq debug-on-error t)' as the first line into your init file.
Yes, here is the contents of the *Messages* buffer after I have issued
`emacs --debug-init test.tex &'.
[...]
Post by August Karlstrom
Error during redisplay: (error No match 3 in highlight (3 font-lock-
function-name-face keep)) [2 times]
It looks like there is something is this buffer which matches the
following regular expression but does not have a match in the third
group (at least this is how I understand the error message).

"\\\\\\(begin\\|chapter\\|end\\|new\\(?:command\\|environment\\|theorem\\)\\|par\\(?:agraph\\|t\\)\\|renewcommand\\|s\\(?:ection\\|ub\\(?:paragraph\\|s\\(?:ection\\|ub\\(?:paragraph\\|section\\)\\)\\)\\)\\|title\\)\\*? *\\(\\[[^]]*\\] *\\)*{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"

Could you please send me the file where this happens? In case this is
not possible, you can try to reduce the file to a simple test case
with the help of the regular expression above. As you can see it
matches mostly sectioning commands, like \chapter, \section,
\paragraph etc. as well as stuff like \begin, \end, \newcommand etc.
--
Ralf
August Karlstrom
2005-03-08 17:36:09 UTC
Permalink
Post by Ralf Angeli
Post by August Karlstrom
Post by Ralf Angeli
Post by August Karlstrom
I have set `TeX-install-font-lock' to the symbol `tex-font-setup', but
only strings and comments are fontified. Both `global-font-lock-mode'
and `font-lock-maximum-decoration' is `t'. Any clues?
[...]
Post by August Karlstrom
Post by Ralf Angeli
No problem here with Emacs 21.3 or CVS Emacs. Do you get any error
messages in the *Messages* buffer? To make these more visible you
could start Emacs with --debug-init and/or put
`(setq debug-on-error t)' as the first line into your init file.
Yes, here is the contents of the *Messages* buffer after I have issued
`emacs --debug-init test.tex &'.
[...]
Post by August Karlstrom
Error during redisplay: (error No match 3 in highlight (3 font-lock-
function-name-face keep)) [2 times]
It looks like there is something is this buffer which matches the
following regular expression but does not have a match in the third
group (at least this is how I understand the error message).
"\\\\\\(begin\\|chapter\\|end\\|new\\(?:command\\|environment\\|theorem\\)\\|par\\(?:agraph\\|t\\)\\|renewcommand\\|s\\(?:ection\\|ub\\(?:paragraph\\|s\\(?:ection\\|ub\\(?:paragraph\\|section\\)\\)\\)\\)\\|title\\)\\*? *\\(\\[[^]]*\\] *\\)*{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"
Could you please send me the file where this happens? In case this is
not possible, you can try to reduce the file to a simple test case
with the help of the regular expression above. As you can see it
matches mostly sectioning commands, like \chapter, \section,
\paragraph etc. as well as stuff like \begin, \end, \newcommand etc.
The file test.tex contains

\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[swedish]{babel}
\usepackage{nopageno}

\begin{document}

Some text\ldots{}

\end{document}
--
August
Ralf Angeli
2005-03-08 17:55:37 UTC
Permalink
Post by August Karlstrom
Post by Ralf Angeli
Post by August Karlstrom
Error during redisplay: (error No match 3 in highlight (3 font-lock-
function-name-face keep)) [2 times]
It looks like there is something is this buffer which matches the
following regular expression but does not have a match in the third
group (at least this is how I understand the error message).
"\\\\\\(begin\\|chapter\\|end\\|new\\(?:command\\|environment\\|theorem\\)\\|par\\(?:agraph\\|t\\)\\|renewcommand\\|s\\(?:ection\\|ub\\(?:paragraph\\|s\\(?:ection\\|ub\\(?:paragraph\\|section\\)\\)\\)\\)\\|title\\)\\*? *\\(\\[[^]]*\\] *\\)*{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"
Could you please send me the file where this happens? In case this is
not possible, you can try to reduce the file to a simple test case
with the help of the regular expression above. As you can see it
matches mostly sectioning commands, like \chapter, \section,
\paragraph etc. as well as stuff like \begin, \end, \newcommand etc.
The file test.tex contains
\documentclass[a4paper,11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[swedish]{babel}
\usepackage{nopageno}
\begin{document}
Some text\ldots{}
\end{document}
Hm, this is working fine here with Emacs 21.3.

Do you get the same error if you start Emacs with

emacs -q -no-site-file

(don't specify a file on the command line), copy the following lines
into the *scratch* buffer,

(require 'tex-site)
(setq TeX-install-font-lock 'tex-font-setup)
(global-font-lock-mode 1)

type `M-x eval-buffer RET' and then load the LaTeX file?
--
Ralf
Ralf Angeli
2005-03-08 19:02:15 UTC
Permalink
Post by Ralf Angeli
Hm, this is working fine here with Emacs 21.3.
Do you get the same error if you start Emacs with
emacs -q -no-site-file
(don't specify a file on the command line), copy the following lines
into the *scratch* buffer,
(require 'tex-site)
(setq TeX-install-font-lock 'tex-font-setup)
(global-font-lock-mode 1)
type `M-x eval-buffer RET' and then load the LaTeX file?
Unfortunately I get the same result even when I follow your
instructions.
I'm terribly sorry, but then I am at my wits' end. I don't know what
causes the problem for you. Can somebody else on the list reproduce
this? Is your Emacs patched somehow?
In the buffer LaTeX commands are sometimes temporarily
fontified (in a kind of unpredictable way) when it's being modified. For
instance, if i delete the `n' in `\begin{document}' then `\begi' gets
fontified (in `font-lock-keyword-face'), but if I then run `font-lock-
fontify-buffer' the fontification is cleared. Comments and inline math
is correctly fontified.
Comments and inline math are highlighted by using the syntax of their
start and end tags (" and $). Most of the other stuff is highlighted
by using regular expressions. It seems that the syntax-based
highlighting can still be done even if the regexp-based highlighting
fails.
--
Ralf
Reiner Steib
2005-03-08 19:41:46 UTC
Permalink
Post by Ralf Angeli
Post by Ralf Angeli
emacs -q -no-site-file
[...]
Post by Ralf Angeli
Post by Ralf Angeli
(require 'tex-site)
(setq TeX-install-font-lock 'tex-font-setup)
(global-font-lock-mode 1)
type `M-x eval-buffer RET' and then load the LaTeX file?
Unfortunately I get the same result even when I follow your
instructions.
I'm terribly sorry, but then I am at my wits' end. I don't know what
causes the problem for you.
Maybe load-path shadows or similar?
Post by Ralf Angeli
Can somebody else on the list reproduce this?
I get no errors and correct fontification when following your steps
with Emacs 21.4 and AUCTeX 11.55.

Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
August Karlstrom
2005-03-08 22:30:21 UTC
Permalink
Post by Ralf Angeli
I'm terribly sorry, but then I am at my wits' end. I don't know what
causes the problem for you. Can somebody else on the list reproduce
this? Is your Emacs patched somehow?
Thanks anyway. My Emacs is not patched, I use the standard Emacs
(21.3.1) that comes with Fedora Core 3.
--
August
August Karlstrom
2005-03-08 18:37:55 UTC
Permalink
Post by Ralf Angeli
Hm, this is working fine here with Emacs 21.3.
Do you get the same error if you start Emacs with
emacs -q -no-site-file
(don't specify a file on the command line), copy the following lines
into the *scratch* buffer,
(require 'tex-site)
(setq TeX-install-font-lock 'tex-font-setup)
(global-font-lock-mode 1)
type `M-x eval-buffer RET' and then load the LaTeX file?
Unfortunately I get the same result even when I follow your
instructions. In the buffer LaTeX commands are sometimes temporarily
fontified (in a kind of unpredictable way) when it's being modified. For
instance, if i delete the `n' in `\begin{document}' then `\begi' gets
fontified (in `font-lock-keyword-face'), but if I then run `font-lock-
fontify-buffer' the fontification is cleared. Comments and inline math
is correctly fontified.
--
August
Loading...