# HG changeset patch # User Richard M. Stallman # Date 781524349 0 # Node ID 798467725c8dca85c438ec1caa4c94fea8e812e6 # Parent c4fa081b416ebe94a878bb22dd72709d29b18b33 (texinfo-font-lock-keywords): New variable. (texinfo-mode): Set font-lock-keywords locally. diff -r c4fa081b416e -r 798467725c8d lisp/textmodes/texinfo.el --- a/lisp/textmodes/texinfo.el Fri Oct 07 10:04:06 1994 +0000 +++ b/lisp/textmodes/texinfo.el Fri Oct 07 10:05:49 1994 +0000 @@ -196,6 +196,20 @@ (modify-syntax-entry ?} "){" texinfo-mode-syntax-table) (modify-syntax-entry ?\' "w" texinfo-mode-syntax-table)) +(defvar texinfo-font-lock-keywords + (list + "@\\(@\\|[^}\t \n{]+\\)" ;commands + '("^\\(@c\\|@comment\\)[ \t].*$" . font-lock-comment-face) ;comments + '("^\\(*.*\\)[\t ]*$" 1 font-lock-function-name-face t) ;menu items + '("@\\(emph\\|strong\\|b\\|i\\){\\([^}]+\\)" 2 font-lock-comment-face t) + '("@\\(file\\|kbd\\|key\\){\\([^}]+\\)" 2 font-lock-string-face t) + '("@\\(samp\\|code\\|var\\){\\([^}]+\\)" 2 font-lock-function-name-face t) + '("@\\(xref\\|pxref\\){\\([^}]+\\)" 2 font-lock-keyword-face t) + '("@end *\\([a-zA-Z0-9]+\\)[ \t]*$" 1 font-lock-function-name-face t) + '("@item \\(.*\\)$" 1 font-lock-function-name-face t) + '("\\$\\([^$]*\\)\\$" 1 font-lock-string-face t) + ) + "Additional expressions to highlight in TeXinfo mode.") ;;; Keybindings (defvar texinfo-mode-map nil) @@ -371,6 +385,8 @@ (setq comment-start-skip "@c +") (make-local-variable 'words-include-escapes) (setq words-include-escapes t) + (make-local-variable 'font-lock-keywords) + (setq font-lock-keywords texinfo-font-lock-keywords) (make-local-variable 'tex-start-of-header) (setq tex-start-of-header "%**start") (make-local-variable 'tex-end-of-header)