Commit 156680e2 authored by Luc Teirlinck's avatar Luc Teirlinck
Browse files

(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.
parent 2d10b62b
......@@ -194,7 +194,12 @@ See Info node `(elisp)Derived Modes' for more details."
parent child docstring syntax abbrev))
(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.)"
(defvar ,map (make-sparse-keymap))
,(if declare-syntax
`(defvar ,syntax (make-syntax-table)))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment