# HG changeset patch # User Richard M. Stallman # Date 821810274 0 # Node ID 649ead749232ba82ffa8b0ec2d8ba6c11d8eb1b8 # Parent b1bc0f5d8cf3b03d6e5856d633a92ee51a5c58c7 (bibtex-font-lock-keywords, bibtex-mode): Use word-syntax in patterns. (bibtex-font-lock-keywords): Allow a more relaxed format of the buffer and use more appropriate faces. diff -r b1bc0f5d8cf3 -r 649ead749232 lisp/textmodes/bibtex.el --- a/lisp/textmodes/bibtex.el Tue Jan 16 13:14:12 1996 +0000 +++ b/lisp/textmodes/bibtex.el Tue Jan 16 16:37:54 1996 +0000 @@ -411,20 +411,17 @@ (defvar bibtex-font-lock-keywords (list - "^@[A-Za-z]*[({]" - ;; reference type - '("^\\([ \t]*OPT[A-Za-z_-][A-Za-z0-9_-]*\\)[ \t]*=" + '("\\(^@\\sw+\\)[ \t]*[({][ \t]*\\([^ \t\n,]*\\)" + (1 font-lock-keyword-face) (2 font-lock-reference-face)) + ;; reference type and reference label + '("^[ \t]*\\(OPT\\sw+\\)[ \t]*=" 1 font-lock-comment-face) - ;; optional field names - '("^\\([ \t]*[A-Za-z_-][A-Za-z0-9_-]*\\)[ \t]*=" - 1 font-lock-function-name-face) + ;; optional field names (treated as comments) + '("^[ \t]*\\(\\sw+\\)[ \t]*=" + 1 font-lock-variable-name-face) ;; field names - '("^@[A-Za-z]*[({]\\([^\n,]*\\)," - 1 font-lock-string-face) - ;; reference labels ) - "*Fonts to use in BibTeX mode") - + "*Default expressions to highlight in BibTeX mode.") ;; Syntax Table, Keybindings and BibTeX Entry List (defvar bibtex-mode-syntax-table @@ -1385,7 +1382,8 @@ (auto-fill-mode 1) (setq auto-fill-function 'bibtex-auto-fill-function) (set (make-local-variable 'font-lock-defaults) - '(bibtex-font-lock-keywords nil t ((?$ . "\"")))) + '(bibtex-font-lock-keywords + nil t ((?_ . "w") (?- . "w") (?$ . "\"")))) (run-hooks 'bibtex-mode-hook)) (defun bibtex-entry (entry-type &optional required optional)