From: Keith David Bershatsky Date: Sat, 29 May 2021 11:45:59 +0000 (+0200) Subject: Improve tex fontification of quoted strings X-Git-Tag: emacs-28.0.90~2276 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4d4c73da5a0aa4233b1dcdcf7db068fc79db6513;p=emacs.git 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). --- diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 8d7f459190b..a805c8952fd 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -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)