From: Luc Teirlinck Date: Mon, 14 Nov 2005 23:05:53 +0000 (+0000) Subject: (define-derived-mode): Remove defvar for mode hook. (It conflicted X-Git-Tag: emacs-pretest-22.0.90~5902 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=156680e2dfb90f458c2b69024ba2c455d4ce5bb2;p=emacs.git (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 --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." 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)))