From: Lars Ingebrigtsen Date: Mon, 10 Aug 2020 14:26:34 +0000 (+0200) Subject: Fix fontification of outdated TeX form X-Git-Tag: emacs-28.0.90~6707 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dcce2b57bb91d490787dffd437b61196f1029b41;p=emacs.git 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$ --- 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 ;;