From: Lars Ingebrigtsen Date: Mon, 24 Jan 2022 14:19:38 +0000 (+0100) Subject: Fix \href{a_b} in tex-mode X-Git-Tag: emacs-29.0.90~2788 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5909b271448e37ba6f71de4b754d1dab6be6875d;p=emacs.git 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. --- 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)