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.
This commit is contained in:
Lars Ingebrigtsen 2022-01-24 15:19:38 +01:00
parent 8c37b9042e
commit 5909b27144

View file

@ -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)