diff options
| author | Luc Teirlinck | 2005-11-14 23:05:53 +0000 |
|---|---|---|
| committer | Luc Teirlinck | 2005-11-14 23:05:53 +0000 |
| commit | 156680e2dfb90f458c2b69024ba2c455d4ce5bb2 (patch) | |
| tree | 996380882ff6f19e5f72c975802f595aa85fe43d | |
| parent | 2d10b62be6e272ceefdfa7d4516f0d8a73781c47 (diff) | |
| download | emacs-156680e2dfb90f458c2b69024ba2c455d4ce5bb2.tar.gz emacs-156680e2dfb90f458c2b69024ba2c455d4ce5bb2.zip | |
(define-derived-mode): Remove defvar for mode hook. (It conflicted
with defcustoms for some mode hooks.) Use the `variable-documentation'
property to give the mode hook a docstring and expand that docstring.
| -rw-r--r-- | lisp/emacs-lisp/derived.el | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el index 8e1f79f95ee..e595ff92a39 100644 --- a/lisp/emacs-lisp/derived.el +++ b/lisp/emacs-lisp/derived.el | |||
| @@ -194,7 +194,12 @@ See Info node `(elisp)Derived Modes' for more details." | |||
| 194 | parent child docstring syntax abbrev)) | 194 | parent child docstring syntax abbrev)) |
| 195 | 195 | ||
| 196 | `(progn | 196 | `(progn |
| 197 | (defvar ,hook nil ,(format "Hook run when entering %s mode." name)) | 197 | (unless (get ',hook 'variable-documentation) |
| 198 | (put ',hook 'variable-documentation | ||
| 199 | ,(format "Hook run when entering %s mode. | ||
| 200 | No problems result if this variable is not bound. | ||
| 201 | `add-hook' automatically binds it. (This is true for all hook variables.)" | ||
| 202 | name))) | ||
| 198 | (defvar ,map (make-sparse-keymap)) | 203 | (defvar ,map (make-sparse-keymap)) |
| 199 | ,(if declare-syntax | 204 | ,(if declare-syntax |
| 200 | `(defvar ,syntax (make-syntax-table))) | 205 | `(defvar ,syntax (make-syntax-table))) |