1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-25 07:28:20 +00:00

(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.
This commit is contained in:
Luc Teirlinck 2005-11-14 23:05:53 +00:00
parent 2d10b62be6
commit 156680e2df

View File

@ -194,7 +194,12 @@ See Info node `(elisp)Derived Modes' for more details."
parent child docstring syntax abbrev))
`(progn
(defvar ,hook nil ,(format "Hook run when entering %s mode." name))
(unless (get ',hook 'variable-documentation)
(put ',hook 'variable-documentation
,(format "Hook run when entering %s mode.
No problems result if this variable is not bound.
`add-hook' automatically binds it. (This is true for all hook variables.)"
name)))
(defvar ,map (make-sparse-keymap))
,(if declare-syntax
`(defvar ,syntax (make-syntax-table)))