On Fri, 27 Dec 2002, joachim(a)schlosser.info wrote:
> The latex function
> \documentclass[a4paper,12pt,parskip,DIV8]{scrartcl}
> should fontify with \documentclass in the keyword-face, the options in
> variable-name-face and the {text} in function-name-face.
I hope you enjoyed Christmas. In the meantime, if you remember the issue
about options not being highlighted in LaTeX mode, I had time to test your
function
> (defun describe-face-at-point (&optional point)
> "Return face used at point."
> (interactive)
> (let ((face (get-char-property (or point (point)) 'face)))
> (if (listp face)
> (progn
> (message (format "Full value: %s" (prin1-to-string face)))
> (setq face (car face))))
> (hyper-describe-face face)))
For keywords, such as "documentclass" or "usepackage", it correctly
prints
out the face name, although there is a strange warning that I cannot exactly
interpret.
`font-lock-keyword-face' (buffer: thomasevangelium.ltx, mode:
LaTeX)
Variable:
value: font-lock-keyword-face
This variable should not be set.
It is present only for horrid FSF compatibility reasons.
The corresponding face should be set using `edit-faces' or the
`set-face-*' functions.
for the strange warning, if you are talking about the 'horrid fsf' comment
This is nothing more than the doc string on the variable
font-lock-keyword-face, which apparently only exists for some sort of
horrid reason:
(defvar font-lock-keyword-face 'font-lock-keyword-face
"This variable should not be set.
It is present only for horrid FSF compatibility reasons.
The corresponding face should be set using `edit-faces' or the
`set-face-*' functions.")
In other words, don't set the variable if you want to customize the face.
Now, when marking e.g. "a4paper", where it should print
"variable-name-face", the result is "Sorry, nothing to describe". I
have no
clue, why.
And, when marking "scrartcl", where it should be
"function-name-face", the
result ist also "Sorry, nothing to describe".
If it says "nothing to describe" then the object is shown in
the regular old default font, and not being shown in
function-name-face.
In order to get the fancier latex font-lock handling you have to either do
(add-hook 'LaTeX-mode-hook 'font-latex-setup)
(add-hook 'latex-mode-hook 'font-latex-setup)
or just (require 'font-latex) in your .emacs.
-jeff