aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman1996-01-16 16:37:54 +0000
committerRichard M. Stallman1996-01-16 16:37:54 +0000
commit27abea5aa836b9db229111db776059e658c7eb99 (patch)
treeab67d21b98b563659d266eccbd90cd69decb4491
parent75632953039ca1674d0c306c5ef472cd9f54c20c (diff)
downloademacs-27abea5aa836b9db229111db776059e658c7eb99.tar.gz
emacs-27abea5aa836b9db229111db776059e658c7eb99.zip
(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.
-rw-r--r--lisp/textmodes/bibtex.el22
1 files changed, 10 insertions, 12 deletions
diff --git a/lisp/textmodes/bibtex.el b/lisp/textmodes/bibtex.el
index 844cc8c3207..575da9418ba 100644
--- a/lisp/textmodes/bibtex.el
+++ b/lisp/textmodes/bibtex.el
@@ -411,20 +411,17 @@ See the documentation of function bibtex-generate-autokey for further detail.")
411 411
412(defvar bibtex-font-lock-keywords 412(defvar bibtex-font-lock-keywords
413 (list 413 (list
414 "^@[A-Za-z]*[({]" 414 '("\\(^@\\sw+\\)[ \t]*[({][ \t]*\\([^ \t\n,]*\\)"
415 ;; reference type 415 (1 font-lock-keyword-face) (2 font-lock-reference-face))
416 '("^\\([ \t]*OPT[A-Za-z_-][A-Za-z0-9_-]*\\)[ \t]*=" 416 ;; reference type and reference label
417 '("^[ \t]*\\(OPT\\sw+\\)[ \t]*="
417 1 font-lock-comment-face) 418 1 font-lock-comment-face)
418 ;; optional field names 419 ;; optional field names (treated as comments)
419 '("^\\([ \t]*[A-Za-z_-][A-Za-z0-9_-]*\\)[ \t]*=" 420 '("^[ \t]*\\(\\sw+\\)[ \t]*="
420 1 font-lock-function-name-face) 421 1 font-lock-variable-name-face)
421 ;; field names 422 ;; field names
422 '("^@[A-Za-z]*[({]\\([^\n,]*\\),"
423 1 font-lock-string-face)
424 ;; reference labels
425 ) 423 )
426 "*Fonts to use in BibTeX mode") 424 "*Default expressions to highlight in BibTeX mode.")
427
428 425
429;; Syntax Table, Keybindings and BibTeX Entry List 426;; Syntax Table, Keybindings and BibTeX Entry List
430(defvar bibtex-mode-syntax-table 427(defvar bibtex-mode-syntax-table
@@ -1385,7 +1382,8 @@ non-nil."
1385 (auto-fill-mode 1) 1382 (auto-fill-mode 1)
1386 (setq auto-fill-function 'bibtex-auto-fill-function) 1383 (setq auto-fill-function 'bibtex-auto-fill-function)
1387 (set (make-local-variable 'font-lock-defaults) 1384 (set (make-local-variable 'font-lock-defaults)
1388 '(bibtex-font-lock-keywords nil t ((?$ . "\"")))) 1385 '(bibtex-font-lock-keywords
1386 nil t ((?_ . "w") (?- . "w") (?$ . "\""))))
1389 (run-hooks 'bibtex-mode-hook)) 1387 (run-hooks 'bibtex-mode-hook))
1390 1388
1391(defun bibtex-entry (entry-type &optional required optional) 1389(defun bibtex-entry (entry-type &optional required optional)