]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve tex fontification of quoted strings
authorKeith David Bershatsky <esq@lawlist.com>
Sat, 29 May 2021 11:45:59 +0000 (13:45 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sat, 29 May 2021 11:45:59 +0000 (13:45 +0200)
* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-2): Fontify
``text like this'' that has an apostrophe correctly (bug#16881).

lisp/textmodes/tex-mode.el

index 8d7f459190b235332e1ce65b7d7a868e0e57a161..a805c8952fd23561dbd70bd521d9416fdd3eff1c 100644 (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)