1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Fix fontification of outdated TeX form

* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-2): End the
expression before the terminating $ in constructions like $\it
identifiername$
(bug#28277). This avoids italicising the final $ character.

This fixes the final $ of the final test case here:

$foo$
\textit{foo}
{\it foo}
$\mathit{identifiername}$
$\textit{identifiername}$
${\it identifiername}$
$\it identifiername$
This commit is contained in:
Lars Ingebrigtsen 2020-08-10 16:26:34 +02:00
parent 170faae31b
commit dcce2b57bb

View file

@ -593,7 +593,7 @@ An alternative value is \" . \", if you use a font with a narrow period."
;; Miscellany.
(slash "\\\\")
(opt " *\\(\\[[^]]*\\] *\\)*")
(args "\\(\\(?:[^{}&\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")
(args "\\(\\(?:[^${}&\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")
(arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)"))
(list
;;