summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/derived.el
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2003-07-23 00:00:13 +0000
committerGlenn Morris <rgm@gnu.org>2003-07-23 00:00:13 +0000
commit8d11b45098f6adc5165ca9a397075d40cda145f9 (patch)
treea545182a1052b09354b4a0d9981b4885edabe0bd /lisp/emacs-lisp/derived.el
parent95c2e3e4f3138762c1aa5a0c1bfc0eee8943c0da (diff)
downloademacs-8d11b45098f6adc5165ca9a397075d40cda145f9.tar.gz
emacs-8d11b45098f6adc5165ca9a397075d40cda145f9.tar.bz2
emacs-8d11b45098f6adc5165ca9a397075d40cda145f9.zip
(define-derived-mode): Mention hook in doc string. Defvar the derived
hook.
Diffstat (limited to 'lisp/emacs-lisp/derived.el')
-rw-r--r--lisp/emacs-lisp/derived.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/derived.el b/lisp/emacs-lisp/derived.el
index 8d152f391bc..4aa85290801 100644
--- a/lisp/emacs-lisp/derived.el
+++ b/lisp/emacs-lisp/derived.el
@@ -155,7 +155,10 @@ the parent, and then sets the variable `case-fold-search' to nil:
(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 @@ been generated automatically, with a reference to the keymap."
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)))