Commit 9adfcd0b authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

Improve documentation of `special' modes.

 doc/lispref/modes.texi (Major Mode Conventions): Improve the documentation
 of `mode-class' `special' modes.
parent 10862873
2011-08-16 Eli Zaretskii <eliz@gnu.org> 2011-08-16 Eli Zaretskii <eliz@gnu.org>
* modes.texi (Major Mode Conventions): Improve the documentation
of `mode-class' `special' modes.
* nonascii.texi (Character Properties): Document the `mirroring' * nonascii.texi (Character Properties): Document the `mirroring'
property. Add index entries. property. Add index entries.
......
...@@ -505,21 +505,26 @@ this mode to any other major mode, this mode can set up a buffer-local ...@@ -505,21 +505,26 @@ this mode to any other major mode, this mode can set up a buffer-local
value for @code{change-major-mode-hook} (@pxref{Creating Buffer-Local}). value for @code{change-major-mode-hook} (@pxref{Creating Buffer-Local}).
@item @item
If this mode is appropriate only for specially-prepared text, then the If this mode is appropriate only for specially-prepared text produced by
major mode command symbol should have a property named @code{mode-class} the mode itself (rather than by the user typing at the keyboard or by an
with value @code{special}, put on as follows: external file), then the major mode command symbol should have a
property named @code{mode-class} with value @code{special}, put on as
follows:
@kindex mode-class @r{(property)} @kindex mode-class @r{(property)}
@cindex @code{special} @cindex @code{special} modes
@example @example
(put 'funny-mode 'mode-class 'special) (put 'funny-mode 'mode-class 'special)
@end example @end example
@noindent @noindent
This tells Emacs that new buffers created while the current buffer is This tells Emacs that new buffers created while the current buffer is in
in Funny mode should not inherit Funny mode, in case the default value Funny mode should not be put in Funny mode, even though the default
of @code{major-mode} is @code{nil}. Modes such as Dired, Rmail, value of @code{major-mode} is @code{nil}. By default, the value of
and Buffer List use this feature. @code{nil} for @code{major-mode} means to use the current buffer's major
mode when creating new buffers (@pxref{Auto Major Mode}), but with such
@code{special} modes, Fundamental mode is used instead. Modes such as
Dired, Rmail, and Buffer List use this feature.
The @code{define-derived-mode} macro automatically marks the derived The @code{define-derived-mode} macro automatically marks the derived
mode as special if the parent mode is special. The special mode mode as special if the parent mode is special. The special mode
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment