]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix fontification of outdated TeX form
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 10 Aug 2020 14:26:34 +0000 (16:26 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 10 Aug 2020 14:26:34 +0000 (16:26 +0200)
* 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

index e3d5759579a8cce67f8379bb1247719a92fbdd55..a905d148009603c25fbd7eed27670ef07eaa3af9 100644 (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
        ;;