[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/textmodes/tex-mode.el [emacs-unicode
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/textmodes/tex-mode.el [emacs-unicode-2] |
Date: |
Thu, 14 Oct 2004 05:15:22 -0400 |
Index: emacs/lisp/textmodes/tex-mode.el
diff -c emacs/lisp/textmodes/tex-mode.el:1.137.2.6
emacs/lisp/textmodes/tex-mode.el:1.137.2.7
*** emacs/lisp/textmodes/tex-mode.el:1.137.2.6 Mon Oct 4 01:04:18 2004
--- emacs/lisp/textmodes/tex-mode.el Thu Oct 14 08:50:06 2004
***************
*** 500,505 ****
--- 500,510 ----
1 font-lock-function-name-face))))
"Subdued expressions to highlight in TeX modes.")
+ (defun tex-font-lock-append-prop (prop)
+ (unless (memq (get-text-property (match-end 1) 'face)
+ '(font-lock-comment-face tex-verbatim-face))
+ prop))
+
(defconst tex-font-lock-keywords-2
(append tex-font-lock-keywords-1
(eval-when-compile
***************
*** 553,568 ****
;;
;; Font environments. It seems a bit dubious to use `bold' etc. faces
;; since we might not be able to display those fonts.
! (list (concat slash bold " *" arg) 2 '(quote bold) 'append)
! (list (concat slash italic " *" arg) 2 '(quote italic) 'append)
;; (list (concat slash type arg) 2 '(quote bold-italic) 'append)
;;
;; Old-style bf/em/it/sl. Stop at `\\' and un-escaped `&', for tables.
(list (concat "\\\\\\(em\\|it\\|sl\\)\\>" args)
! 2 '(quote italic) 'append)
;; This is separate from the previous one because of cases like
;; {\em foo {\bf bar} bla} where both match.
! (list (concat "\\\\bf\\>" args) 1 '(quote bold) 'append)))))
"Gaudy expressions to highlight in TeX modes.")
(defun tex-font-lock-suscript (pos)
--- 558,576 ----
;;
;; Font environments. It seems a bit dubious to use `bold' etc. faces
;; since we might not be able to display those fonts.
! (list (concat slash bold " *" arg) 2
! '(tex-font-lock-append-prop 'bold) 'append)
! (list (concat slash italic " *" arg) 2
! '(tex-font-lock-append-prop 'italic) 'append)
;; (list (concat slash type arg) 2 '(quote bold-italic) 'append)
;;
;; Old-style bf/em/it/sl. Stop at `\\' and un-escaped `&', for tables.
(list (concat "\\\\\\(em\\|it\\|sl\\)\\>" args)
! 2 '(tex-font-lock-append-prop 'italic) 'append)
;; This is separate from the previous one because of cases like
;; {\em foo {\bf bar} bla} where both match.
! (list (concat "\\\\\\(bf\\)\\>" args)
! 2 '(tex-font-lock-append-prop 'bold) 'append)))))
"Gaudy expressions to highlight in TeX modes.")
(defun tex-font-lock-suscript (pos)
***************
*** 604,614 ****
(defvar tex-font-lock-syntactic-keywords
(let ((verbs (regexp-opt tex-verbatim-environments t)))
`((,(concat "^\\\\begin *{" verbs "}.*\\(\n\\)") 2 "|")
! (,(concat "^\\\\end *{" verbs "}\\(.?\\)") 2
! (unless (<= (match-beginning 0) (point-min))
! (put-text-property (1- (match-beginning 0)) (match-beginning 0)
! 'syntax-table (string-to-syntax "|"))
! "<"))
;; ("^\\(\\\\\\)begin *{comment}" 1 "< b")
;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b")
("\\\\verb\\**\\(address@hidden)" 1 "\""))))
--- 612,625 ----
(defvar tex-font-lock-syntactic-keywords
(let ((verbs (regexp-opt tex-verbatim-environments t)))
`((,(concat "^\\\\begin *{" verbs "}.*\\(\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
! ;; start and end the fenced-string).
! ;; 2 - font-lock considers the preceding \n as being part of the
! ;; preceding line, so things gets screwed every time the previous
! ;; line is re-font-locked on its own.
! (,(concat "^\\(\\\\\\)end *{" verbs "}\\(.?\\)") (1 "|") (3 "<"))
;; ("^\\(\\\\\\)begin *{comment}" 1 "< b")
;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b")
("\\\\verb\\**\\(address@hidden)" 1 "\""))))