# HG changeset patch # User Richard M. Stallman # Date 781523698 0 # Node ID 1c9b8b3971a07dd70ce6bda1f0cb95eeef8b39d8 # Parent 45228a0f6b78da9dcbc1df11b0862cdb6fd9536c (outline-font-lock-keywords): New variable. (outline-mode): Set font-lock-keywords locally. diff -r 45228a0f6b78 -r 1c9b8b3971a0 lisp/textmodes/ooutline.el --- a/lisp/textmodes/ooutline.el Fri Oct 07 09:53:28 1994 +0000 +++ b/lisp/textmodes/ooutline.el Fri Oct 07 09:54:58 1994 +0000 @@ -134,6 +134,20 @@ (setq minor-mode-alist (append minor-mode-alist (list '(outline-minor-mode " Outl"))))) +(defvar outline-font-lock-keywords + '(;; Highlight headings according to the level. + ("^\\(\\*+\\)[ \t]*\\(.+\\)?[ \t]*$" + (1 font-lock-string-face) + (2 (let ((len (- (match-end 1) (match-beginning 1)))) + (or (cdr (assq len '((1 . font-lock-function-name-face) + (2 . font-lock-keyword-face) + (3 . font-lock-comment-face)))) + font-lock-variable-name-face)) + nil t)) + ;; Highight citations of the form [1] and [Mar94]. + ("\\[\\([A-Z][A-Za-z]+\\)*[0-9]+\\]" . font-lock-type-face)) + "Additional expressions to highlight in Outline mode.") + ;;;###autoload (defun outline-mode () "Set major mode for editing outlines with selective display. @@ -192,6 +206,8 @@ (make-local-variable 'paragraph-separate) (setq paragraph-separate (concat paragraph-separate "\\|^\\(" outline-regexp "\\)")) + (make-local-variable 'font-lock-keywords) + (setq font-lock-keywords outline-font-lock-keywords) (make-local-variable 'change-major-mode-hook) (add-hook 'change-major-mode-hook 'show-all) (run-hooks 'text-mode-hook 'outline-mode-hook))