emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/textmodes/tex-mode.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/textmodes/tex-mode.el,v
Date: Mon, 16 Jul 2007 18:38:06 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/07/16 18:38:06

Index: textmodes/tex-mode.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/textmodes/tex-mode.el,v
retrieving revision 1.187
retrieving revision 1.188
diff -u -b -r1.187 -r1.188
--- textmodes/tex-mode.el       9 Jul 2007 19:14:47 -0000       1.187
+++ textmodes/tex-mode.el       16 Jul 2007 18:38:04 -0000      1.188
@@ -637,10 +637,13 @@
 
 (defvar tex-verbatim-environments
   '("verbatim" "verbatim*"))
+(put 'tex-verbatim-environments 'safe-local-variable
+     (lambda (x) (require 'cl) (every 'stringp x)))
 
 (defvar tex-font-lock-syntactic-keywords
-  (let ((verbs (regexp-opt tex-verbatim-environments t)))
-    `((,(concat "^\\\\begin *{" verbs "}.*\\(\n\\)") 2 "|")
+  '((eval . `(,(concat "^\\\\begin *{"
+                       (regexp-opt tex-verbatim-environments t)
+                       "}.*\\(\n\\)") 2 "|"))
       ;; Technically, we'd like to put the "|" property on the \n preceding
       ;; the \end, but this would have 2 disadvantages:
       ;; 1 - it's wrong if the verbatim env is empty (the same \n is used to
@@ -650,13 +653,15 @@
       ;;     line is re-font-locked on its own.
       ;; There's a hack in tex-font-lock-keywords-1 to remove the verbatim
       ;; face from the \ but C-M-f still jumps to the wrong spot :-(  --Stef
-      (,(concat "^\\(\\\\\\)end *{" verbs "}\\(.?\\)") (1 "|") (3 "<"))
+    (eval . `(,(concat "^\\(\\\\\\)end *{"
+                       (regexp-opt tex-verbatim-environments t)
+                       "}\\(.?\\)") (1 "|") (3 "<")))
       ;; ("^\\(\\\\\\)begin *{comment}" 1 "< b")
       ;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b")
       ("\\\\verb\\**\\(address@hidden)"
        ;; Do it last, because it uses syntax-ppss which needs the
        ;; syntax-table properties of previous entries.
-       1 (tex-font-lock-verb (match-end 1))))))
+     1 (tex-font-lock-verb (match-end 1)))))
 
 (defun tex-font-lock-unfontify-region (beg end)
   (font-lock-default-unfontify-region beg end)




reply via email to

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