changeset 66872:4b798da1bc61

(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.
author Luc Teirlinck <teirllm@auburn.edu>
date Mon, 14 Nov 2005 23:05:53 +0000
parents 17486c85326e
children 2e4874786ab4
files lisp/emacs-lisp/derived.el
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)))