/[emacs]/emacs/lisp/textmodes/tex-mode.el
ViewVC logotype

Diff of /emacs/lisp/textmodes/tex-mode.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.123.2.10 by miles, Wed Oct 6 05:23:58 2004 UTC revision 1.123.2.11 by miles, Mon Oct 25 04:19:43 2004 UTC
# Line 500  An alternative value is \" . \", if you Line 500  An alternative value is \" . \", if you
500           1 font-lock-function-name-face))))           1 font-lock-function-name-face))))
501    "Subdued expressions to highlight in TeX modes.")    "Subdued expressions to highlight in TeX modes.")
502    
503    (defun tex-font-lock-append-prop (prop)
504      (unless (memq (get-text-property (match-end 1) 'face)
505                    '(font-lock-comment-face tex-verbatim-face))
506        prop))
507    
508  (defconst tex-font-lock-keywords-2  (defconst tex-font-lock-keywords-2
509    (append tex-font-lock-keywords-1    (append tex-font-lock-keywords-1
510     (eval-when-compile     (eval-when-compile
# Line 553  An alternative value is \" . \", if you Line 558  An alternative value is \" . \", if you
558          ;;          ;;
559          ;; Font environments.  It seems a bit dubious to use `bold' etc. faces          ;; Font environments.  It seems a bit dubious to use `bold' etc. faces
560          ;; since we might not be able to display those fonts.          ;; since we might not be able to display those fonts.
561          (list (concat slash bold " *" arg) 2 '(quote bold) 'append)          (list (concat slash bold " *" arg) 2
562          (list (concat slash italic " *" arg) 2 '(quote italic) 'append)                '(tex-font-lock-append-prop 'bold) 'append)
563            (list (concat slash italic " *" arg) 2
564                  '(tex-font-lock-append-prop 'italic) 'append)
565          ;; (list (concat slash type arg) 2 '(quote bold-italic) 'append)          ;; (list (concat slash type arg) 2 '(quote bold-italic) 'append)
566          ;;          ;;
567          ;; Old-style bf/em/it/sl.  Stop at `\\' and un-escaped `&', for tables.          ;; Old-style bf/em/it/sl.  Stop at `\\' and un-escaped `&', for tables.
568          (list (concat "\\\\\\(em\\|it\\|sl\\)\\>" args)          (list (concat "\\\\\\(em\\|it\\|sl\\)\\>" args)
569                2 '(quote italic) 'append)                2 '(tex-font-lock-append-prop 'italic) 'append)
570          ;; This is separate from the previous one because of cases like          ;; This is separate from the previous one because of cases like
571          ;; {\em foo {\bf bar} bla} where both match.          ;; {\em foo {\bf bar} bla} where both match.
572          (list (concat "\\\\bf\\>" args) 1 '(quote bold) 'append)))))          (list (concat "\\\\\\(bf\\)\\>" args)
573                  2 '(tex-font-lock-append-prop 'bold) 'append)))))
574     "Gaudy expressions to highlight in TeX modes.")     "Gaudy expressions to highlight in TeX modes.")
575    
576  (defun tex-font-lock-suscript (pos)  (defun tex-font-lock-suscript (pos)
# Line 604  An alternative value is \" . \", if you Line 612  An alternative value is \" . \", if you
612  (defvar tex-font-lock-syntactic-keywords  (defvar tex-font-lock-syntactic-keywords
613    (let ((verbs (regexp-opt tex-verbatim-environments t)))    (let ((verbs (regexp-opt tex-verbatim-environments t)))
614      `((,(concat "^\\\\begin *{" verbs "}.*\\(\n\\)") 2 "|")      `((,(concat "^\\\\begin *{" verbs "}.*\\(\n\\)") 2 "|")
615        (,(concat "^\\\\end *{" verbs "}\\(.?\\)") 2        ;; Technically, we'd like to put the "|" property on the \n preceding
616         (unless (<= (match-beginning 0) (point-min))        ;; the \end, but this would have 2 disadvantages:
617           (put-text-property (1- (match-beginning 0)) (match-beginning 0)        ;; 1 - it's wrong if the verbatim env is empty (the same \n is used to
618                              'syntax-table (string-to-syntax "|"))        ;;     start and end the fenced-string).
619           "<"))        ;; 2 - font-lock considers the preceding \n as being part of the
620          ;;     preceding line, so things gets screwed every time the previous
621          ;;     line is re-font-locked on its own.
622          (,(concat "^\\(\\\\\\)end *{" verbs "}\\(.?\\)") (1 "|") (3 "<"))
623        ;; ("^\\(\\\\\\)begin *{comment}" 1 "< b")        ;; ("^\\(\\\\\\)begin *{comment}" 1 "< b")
624        ;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b")        ;; ("^\\\\end *{comment}.*\\(\n\\)" 1 "> b")
625        ("\\\\verb\\**\\([^a-z@*]\\)" 1 "\""))))        ("\\\\verb\\**\\([^a-z@*]\\)" 1 "\""))))

Legend:
Removed from v.1.123.2.10  
changed lines
  Added in v.1.123.2.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26