changeset 102766:0862f6b10c6b

(Derived Modes): Note that define-derive-mode sets the mode-class property.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 28 Mar 2009 13:49:57 +0000
parents 7d96b18494ca
children f0522c5e7271
files doc/lispref/modes.texi
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/doc/lispref/modes.texi	Sat Mar 28 13:49:50 2009 +0000
+++ b/doc/lispref/modes.texi	Sat Mar 28 13:49:57 2009 +0000
@@ -738,7 +738,7 @@
 one.  An easy way to do this is to use @code{define-derived-mode}.
 
 @defmac define-derived-mode variant parent name docstring keyword-args@dots{} body@dots{}
-This construct defines @var{variant} as a major mode command, using
+This macro defines @var{variant} as a major mode command, using
 @var{name} as the string form of the mode name.  @var{variant} and
 @var{parent} should be unquoted symbols.
 
@@ -776,6 +776,12 @@
 evaluates the forms in @var{body} after setting up all its usual
 overrides, just before running the mode hooks.
 
+If @var{parent} has a non-@code{nil} @code{mode-class} symbol
+property, then @code{define-derived-mode} sets the @code{mode-class}
+property of @var{variant} to the same value.  This ensures, for
+example, that if @var{parent} is a special mode, then @var{variant} is
+also a special mode (@pxref{Major Mode Conventions}).
+
 You can also specify @code{nil} for @var{parent}.  This gives the new
 mode no parent.  Then @code{define-derived-mode} behaves as described
 above, but, of course, omits all actions connected with @var{parent}.