From dcce2b57bb91d490787dffd437b61196f1029b41 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 10 Aug 2020 16:26:34 +0200 Subject: [PATCH] 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$ --- lisp/textmodes/tex-mode.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index e3d5759579a..a905d148009 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -593,7 +593,7 @@ An alternative value is \" . \", if you use a font with a narrow period." ;; Miscellany. (slash "\\\\") (opt " *\\(\\[[^]]*\\] *\\)*") - (args "\\(\\(?:[^{}&\\]+\\|\\\\.\\|{[^}]*}\\)+\\)") + (args "\\(\\(?:[^${}&\\]+\\|\\\\.\\|{[^}]*}\\)+\\)") (arg "{\\(\\(?:[^{}\\]+\\|\\\\.\\|{[^}]*}\\)+\\)")) (list ;; -- 2.39.5