From 5909b271448e37ba6f71de4b754d1dab6be6875d Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 24 Jan 2022 15:19:38 +0100 Subject: [PATCH] Fix \href{a_b} in tex-mode * lisp/textmodes/tex-mode.el (tex-font-lock-keywords-2): Fontify href parameters like constants so that _ aren't fontified like subscripts. --- lisp/textmodes/tex-mode.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 1925d93d93a..f41cc2c15ed 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -578,6 +578,9 @@ An alternative value is \" . \", if you use a font with a narrow period." ;; "caption" "footnote" "footnotemark" "footnotetext" ) t)) + (file-like (regexp-opt + '("href" "ProvidesFile") + t)) ;; ;; Names of commands that should be fontified. (specials-1 (regexp-opt '("\\" "\\*") t)) ;; "-" @@ -598,6 +601,8 @@ An alternative value is \" . \", if you use a font with a narrow period." ;; ;; Citation args. (list (concat slash citations opt arg) 3 'font-lock-constant-face) + ;; File-like args. + (list (concat slash file-like opt arg) 3 'font-lock-constant-face) ;; ;; Text between `` quotes ''. (list (concat (regexp-opt '("``" "\"<" "\"`" "<<" "«") t) -- 2.39.2