changeset 52026:a1c58b19ec8a

(define-derived-mode): Mention hook in doc string. Defvar the derived hook.
author Glenn Morris <rgm@gnu.org>
date Wed, 23 Jul 2003 00:00:13 +0000
parents 1f5618861979
children 7a8f8df10a26
files lisp/emacs-lisp/derived.el
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/emacs-lisp/derived.el	Tue Jul 22 23:59:35 2003 +0000
+++ b/lisp/emacs-lisp/derived.el	Wed Jul 23 00:00:13 2003 +0000
@@ -155,7 +155,10 @@
     (setq case-fold-search nil))
 
 Note that if the documentation string had been left out, it would have
-been generated automatically, with a reference to the keymap."
+been generated automatically, with a reference to the keymap.
+
+The new mode runs the hook constructed by the function
+`derived-mode-hook-name'."
   (declare (debug (&define name symbolp sexp [&optional stringp]
 			   [&rest keywordp sexp] def-body)))
 
@@ -187,6 +190,7 @@
 		     parent child docstring syntax abbrev))
 
     `(progn
+       (defvar ,hook nil ,(format "Hook run when entering %s mode." name))
        (defvar ,map (make-sparse-keymap))
        ,(if declare-syntax
 	    `(defvar ,syntax (make-syntax-table)))