diff options
| author | Simon Marshall | 1995-08-10 15:24:09 +0000 |
|---|---|---|
| committer | Simon Marshall | 1995-08-10 15:24:09 +0000 |
| commit | 507fb916e928957b5e8c1224cf39c8a9959e478b (patch) | |
| tree | 1d63933a3153a7337a2390260a3445444d0fa153 | |
| parent | 32fad956742b98f51c080641995de86aaad1bc4f (diff) | |
| download | emacs-507fb916e928957b5e8c1224cf39c8a9959e478b.tar.gz emacs-507fb916e928957b5e8c1224cf39c8a9959e478b.zip | |
Added Font Lock mode support.
| -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 @@ | |||
| 89 | 89 | ||
| 90 | (define-key help-map "q" 'help-quit) | 90 | (define-key help-map "q" 'help-quit) |
| 91 | 91 | ||
| 92 | (defvar help-font-lock-keywords | ||
| 93 | (let ((name-char "[-+a-zA-Z0-9_*]") (sym-char "[-+a-zA-Z0-9_:*]")) | ||
| 94 | (list | ||
| 95 | ;; | ||
| 96 | ;; The symbol itself. | ||
| 97 | (list (concat "\\`\\(" name-char "+\\)\\(:\\)?") | ||
| 98 | '(1 (if (match-beginning 2) | ||
| 99 | font-lock-function-name-face | ||
| 100 | font-lock-variable-name-face) | ||
| 101 | nil t)) | ||
| 102 | ;; | ||
| 103 | ;; Words inside `' which tend to be symbol names. | ||
| 104 | (list (concat "`\\(" sym-char sym-char "+\\)'") | ||
| 105 | 1 'font-lock-reference-face t) | ||
| 106 | ;; | ||
| 107 | ;; CLisp `:' keywords as references. | ||
| 108 | (list (concat "\\<:" sym-char "+\\>") 0 font-lock-reference-face t))) | ||
| 109 | "Default expressions to highlight in Help mode.") | ||
| 110 | |||
| 92 | (defun help-mode () | 111 | (defun help-mode () |
| 93 | "Major mode for viewing help text. | 112 | "Major mode for viewing help text. |
| 94 | Entry to this mode runs the normal hook `help-mode-hook'. | 113 | Entry to this mode runs the normal hook `help-mode-hook'. |
| @@ -99,6 +118,8 @@ Commands: | |||
| 99 | (use-local-map help-mode-map) | 118 | (use-local-map help-mode-map) |
| 100 | (setq mode-name "Help") | 119 | (setq mode-name "Help") |
| 101 | (setq major-mode 'help-mode) | 120 | (setq major-mode 'help-mode) |
| 121 | (make-local-variable 'font-lock-defaults) | ||
| 122 | (setq font-lock-defaults '(help-font-lock-keywords)) | ||
| 102 | (run-hooks 'help-mode-hook)) | 123 | (run-hooks 'help-mode-hook)) |
| 103 | 124 | ||
| 104 | (defun help-quit () | 125 | (defun help-quit () |