comparison lisp/textmodes/tex-mode.el @ 43307:7acf4e4617be

(tex-font-lock-keywords-2): Require non-letter after specials.
author Andreas Schwab <schwab@suse.de>
date Fri, 15 Feb 2002 17:06:03 +0000
parents 253f761ad37b
children f8e3c1819848
comparison
equal deleted inserted replaced
43306:af54a2524ad6 43307:7acf4e4617be
1 ;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands 1 ;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands
2 2
3 ;; Copyright (C) 1985, 86, 89, 92, 94, 95, 96, 97, 98, 1999 3 ;; Copyright (C) 1985, 86, 89, 92, 94, 95, 96, 97, 98, 1999, 2002
4 ;; Free Software Foundation, Inc. 4 ;; Free Software Foundation, Inc.
5 5
6 ;; Maintainer: FSF 6 ;; Maintainer: FSF
7 ;; Keywords: tex 7 ;; Keywords: tex
8 8
495 ;; "caption" "footnote" "footnotemark" "footnotetext" 495 ;; "caption" "footnote" "footnotemark" "footnotetext"
496 ) 496 )
497 t)) 497 t))
498 ;; 498 ;;
499 ;; Names of commands that should be fontified. 499 ;; Names of commands that should be fontified.
500 (specials (regexp-opt 500 (specials-1 (regexp-opt '("\\" "\\*") t)) ;; "-"
501 '("\\" "\\*" ;; "-" 501 (specials-2 (regexp-opt
502 "linebreak" "nolinebreak" "pagebreak" "nopagebreak" 502 '("linebreak" "nolinebreak" "pagebreak" "nopagebreak"
503 "newline" "newpage" "clearpage" "cleardoublepage" 503 "newline" "newpage" "clearpage" "cleardoublepage"
504 "displaybreak" "allowdisplaybreaks" "enlargethispage") 504 "displaybreak" "allowdisplaybreaks"
505 t)) 505 "enlargethispage") t))
506 (general "\\([a-zA-Z@]+\\**\\|[^ \t\n]\\)") 506 (general "\\([a-zA-Z@]+\\**\\|[^ \t\n]\\)")
507 ;; 507 ;;
508 ;; Miscellany. 508 ;; Miscellany.
509 (slash "\\\\") 509 (slash "\\\\")
510 (opt " *\\(\\[[^]]*\\] *\\)*") 510 (opt " *\\(\\[[^]]*\\] *\\)*")
519 "[^'\">]+" ;a bit pessimistic 519 "[^'\">]+" ;a bit pessimistic
520 (regexp-opt `("''" "\">" "\"'" ">>" "") t)) 520 (regexp-opt `("''" "\">" "\"'" ">>" "") t))
521 'font-lock-string-face) 521 'font-lock-string-face)
522 ;; 522 ;;
523 ;; Command names, special and general. 523 ;; Command names, special and general.
524 (cons (concat slash specials) 'font-lock-warning-face) 524 (cons (concat slash specials-1) 'font-lock-warning-face)
525 (list (concat "\\(" slash specials-2 "\\)\\([^a-zA-Z@]\\|\\'\\)")
526 1 'font-lock-warning-face)
525 (concat slash general) 527 (concat slash general)
526 ;; 528 ;;
527 ;; Font environments. It seems a bit dubious to use `bold' etc. faces 529 ;; Font environments. It seems a bit dubious to use `bold' etc. faces
528 ;; since we might not be able to display those fonts. 530 ;; since we might not be able to display those fonts.
529 (list (concat slash bold " *" arg) 2 '(quote bold) 'append) 531 (list (concat slash bold " *" arg) 2 '(quote bold) 'append)