emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 4d4c73d: Improve tex fontification of quoted strings


From: Lars Ingebrigtsen
Subject: master 4d4c73d: Improve tex fontification of quoted strings
Date: Sat, 29 May 2021 07:46:15 -0400 (EDT)

branch: master
commit 4d4c73da5a0aa4233b1dcdcf7db068fc79db6513
Author: Keith David Bershatsky <esq@lawlist.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/textmodes/tex-mode.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 8d7f459..a805c89 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]