Description
Steps to reproduce:
First, create a simple test.tex
file with content
\documentclass{article}
\begin{document}
Here is math: $x^2$.
\end{document}
- In a fresh emacs session, open
test.tex
- Turn on xenops-mode:
M-x xenops-mode
- Put cursor inside the math:
$x^2$
- Move cursor outside the math
- Nothing happens (expected: math would render)
However, the following works as expected
- In a fresh emacs session, open
test.tex
- Turn on xenops-mode:
M-x xenops-mode RET
M-x font-lock-update RET
- Put cursor inside the math:
$x^2$
- Move cursor outside the math
- Yay! The math renders!
Step 3 can be replaced with many alternatives that indirectly will cause the buffer to be refontified, e.g., saving, editing, etc.
As far as I can tell, this is because during activation, xenops-mode
adds some font-lock keywords that should trigger rendering on cursor moving using cursor-sensor-mode
, but it doesn't actually cause these new font-lock keywords to be "applied."
I imagine this can be fixed by explicitly calling font-lock-fontify-buffer
when mode is activated.
This is easy enough to work around, but it caused a lot of confusion for me when I followed the tutorial, which at one point suggests that the user open a file, turn on xenops-mode
, move the cursor in and out of math, and see a render result.
Activity