# HG changeset patch # User Luc Teirlinck # Date 1132009553 0 # Node ID 4b798da1bc619052bccb9950f444648543668e39 # Parent 17486c85326e85830a9d3e78aecb4690c29f5ea5 (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. diff -r 17486c85326e -r 4b798da1bc61 lisp/emacs-lisp/derived.el --- a/lisp/emacs-lisp/derived.el Mon Nov 14 22:30:35 2005 +0000 +++ b/lisp/emacs-lisp/derived.el Mon Nov 14 23:05:53 2005 +0000 @@ -194,7 +194,12 @@ 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)))