changeset 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 af54a2524ad6
children e04cbee893bc
files lisp/textmodes/tex-mode.el
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/tex-mode.el	Fri Feb 15 13:59:05 2002 +0000
+++ b/lisp/textmodes/tex-mode.el	Fri Feb 15 17:06:03 2002 +0000
@@ -1,6 +1,6 @@
 ;;; tex-mode.el --- TeX, LaTeX, and SliTeX mode commands
 
-;; Copyright (C) 1985, 86, 89, 92, 94, 95, 96, 97, 98, 1999
+;; Copyright (C) 1985, 86, 89, 92, 94, 95, 96, 97, 98, 1999, 2002
 ;;       Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -497,12 +497,12 @@
 			t))
 	    ;;
 	    ;; Names of commands that should be fontified.
-	    (specials (regexp-opt
-		       '("\\" "\\*" ;; "-"
-			 "linebreak" "nolinebreak" "pagebreak" "nopagebreak"
-			 "newline" "newpage" "clearpage" "cleardoublepage"
-			 "displaybreak" "allowdisplaybreaks" "enlargethispage")
-		       t))
+	    (specials-1 (regexp-opt '("\\" "\\*") t)) ;; "-"
+	    (specials-2 (regexp-opt
+			 '("linebreak" "nolinebreak" "pagebreak" "nopagebreak"
+			   "newline" "newpage" "clearpage" "cleardoublepage"
+			   "displaybreak" "allowdisplaybreaks"
+			   "enlargethispage") t))
 	    (general "\\([a-zA-Z@]+\\**\\|[^ \t\n]\\)")
 	    ;;
 	    ;; Miscellany.
@@ -521,7 +521,9 @@
 	      'font-lock-string-face)
 	;;
 	;; Command names, special and general.
-	(cons (concat slash specials) 'font-lock-warning-face)
+	(cons (concat slash specials-1) 'font-lock-warning-face)
+	(list (concat "\\(" slash specials-2 "\\)\\([^a-zA-Z@]\\|\\'\\)")
+	      1 'font-lock-warning-face)
 	(concat slash general)
 	;;
 	;; Font environments.  It seems a bit dubious to use `bold' etc. faces