diff options
author | Simon Marshall <simon@gnu.org> | 1995-08-10 15:24:09 +0000 |
---|---|---|
committer | Simon Marshall <simon@gnu.org> | 1995-08-10 15:24:09 +0000 |
commit | b0a27ffd603e90db59799c4ed33a09eb880d7677 (patch) | |
tree | c0a3c9cfbd7c764baf07caeb637fd774b9a64add /lisp/help.el | |
parent | 7dc785a4708b2e3e0e41b18aee39a420e7d642d2 (diff) | |
download | emacs-b0a27ffd603e90db59799c4ed33a09eb880d7677.tar.gz |
Added Font Lock mode support.
Diffstat (limited to 'lisp/help.el')
-rw-r--r-- | lisp/help.el | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lisp/help.el b/lisp/help.el index c51c027863c..96e2b19d7b9 100644 --- a/lisp/help.el +++ b/lisp/help.el @@ -89,6 +89,25 @@ (define-key help-map "q" 'help-quit) +(defvar help-font-lock-keywords + (let ((name-char "[-+a-zA-Z0-9_*]") (sym-char "[-+a-zA-Z0-9_:*]")) + (list + ;; + ;; The symbol itself. + (list (concat "\\`\\(" name-char "+\\)\\(:\\)?") + '(1 (if (match-beginning 2) + font-lock-function-name-face + font-lock-variable-name-face) + nil t)) + ;; + ;; Words inside `' which tend to be symbol names. + (list (concat "`\\(" sym-char sym-char "+\\)'") + 1 'font-lock-reference-face t) + ;; + ;; CLisp `:' keywords as references. + (list (concat "\\<:" sym-char "+\\>") 0 font-lock-reference-face t))) + "Default expressions to highlight in Help mode.") + (defun help-mode () "Major mode for viewing help text. Entry to this mode runs the normal hook `help-mode-hook'. @@ -99,6 +118,8 @@ Commands: (use-local-map help-mode-map) (setq mode-name "Help") (setq major-mode 'help-mode) + (make-local-variable 'font-lock-defaults) + (setq font-lock-defaults '(help-font-lock-keywords)) (run-hooks 'help-mode-hook)) (defun help-quit () |