Improve tex fontification of quoted strings

* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-2): Fontify
``text like this'' that has an apostrophe correctly (bug#16881).
This commit is contained in:
Keith David Bershatsky 2021-05-29 13:45:59 +02:00 committed by Lars Ingebrigtsen
parent e3fc16fd71
commit 4d4c73da5a

View file

@ -599,11 +599,13 @@ 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)
;;
;; Text between `` quotes ''.
(cons (concat (regexp-opt '("``" "\"<" "\"`" "<<" "«") t)
"[^'\">{]+" ;a bit pessimistic
(regexp-opt '("''" "\">" "\"'" ">>" "»") t))
'font-lock-string-face)
;; Text between `` quotes ''.
(list (concat (regexp-opt '("``" "\"<" "\"`" "<<" "«") t)
"\\(\\(.\\|\n\\)+?\\)"
(regexp-opt `("''" "\">" "\"'" ">>" "»") t))
'(1 font-lock-keyword-face)
'(2 font-lock-string-face)
'(4 font-lock-keyword-face))
;;
;; Command names, special and general.
(cons (concat slash specials-1) 'font-lock-warning-face)