emacs-pretest-bug
[Top][All Lists]

## Re: [tex-mode.el] Fontification in verbatim

 From: Stefan Subject: Re: [tex-mode.el] Fontification in verbatim Date: Sun, 10 Oct 2004 13:16:12 -0400 User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin)

>>> Suppose you have the following LaTeX file:
>>
>>> \documentclass{article}
>>> \begin{document}
>>> Here is some text
>>> \begin{verbatim}
>>> \textbf{
>>> \end{verbatim}
>>> and here the text goes on.
>>> \end{document}
>>
>>> A whole lot of text after the \textbf{ will be fontified bold.  Other
>>> examples can easily be constructed.
>>
>> I've just installed a change which should fix this particular problem.

> After the change the "end" in "\end{verbatim}" does not get fontified
> anymore and the "\" in "\end" has the face tex-verbatim-face'.

Yes, although this is unrelated.
This is due to the fact that I indeed now use the \ as the
"end-of-verbatim" character.  I used to use the preceding \n but it's very
unreliable, as the comment in the code explains:

;; Technically, we'd like to put the "|" property on the \n preceding
;; the \end, but this would have 2 disadvantages:
;; 1 - it's wrong if the verbatim env is empty (the same \n is used to
;;     start and end the fenced-string).
;; 2 - font-lock considers the preceding \n as being part of the
;;     preceding line, so things gets screwed every time the previous
;;     line is re-font-locked on its own.

-- Stefan

`