emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/doc/lispref modes.texi


From: Chong Yidong
Subject: [Emacs-diffs] emacs/doc/lispref modes.texi
Date: Sat, 28 Mar 2009 13:38:56 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      09/03/28 13:38:56

Modified files:
        doc/lispref    : modes.texi 

Log message:
        (Major Mode Conventions): Note that specialness is inherited.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/doc/lispref/modes.texi?cvsroot=emacs&r1=1.11&r2=1.12

Patches:
Index: modes.texi
===================================================================
RCS file: /sources/emacs/emacs/doc/lispref/modes.texi,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -b -r1.11 -r1.12
--- modes.texi  20 Feb 2009 12:36:52 -0000      1.11
+++ modes.texi  28 Mar 2009 13:38:55 -0000      1.12
@@ -157,13 +157,13 @@
 changing major modes) won't delete it from the hook variable's local
 value.
 
-It is best to design your hook functions so that the order in which they
-are executed does not matter.  Any dependence on the order is ``asking
-for trouble.''  However, the order is predictable: normally,
+It is best to design your hook functions so that the order in which
+they are executed does not matter.  Any dependence on the order is
+asking for trouble.  However, the order is predictable: normally,
 @var{function} goes at the front of the hook list, so it will be
-executed first (barring another @code{add-hook} call).  If the optional
-argument @var{append} is address@hidden, the new hook function goes at
-the end of the hook list and will be executed last.
+executed first (barring another @code{add-hook} call).  If the
+optional argument @var{append} is address@hidden, the new hook
+function goes at the end of the hook list and will be executed last.
 
 @code{add-hook} can handle the cases where @var{hook} is void or its
 value is a single function; it sets or changes the value to a list of
@@ -231,11 +231,11 @@
   If the new mode is similar to an old one, it is often unwise to
 modify the old one to serve two purposes, since it may become harder
 to use and maintain.  Instead, copy and rename an existing major mode
-definition and alter the copy---or use @code{define-derived-mode} to
-define a @dfn{derived mode} (@pxref{Derived Modes}).  For example,
-Rmail Edit mode is a major mode that is very similar to Text mode
-except that it provides two additional commands.  Its definition is
-distinct from that of Text mode, but uses that of Text mode.
+definition and alter the copy---or use the @code{define-derived-mode}
+macro to define a @dfn{derived mode} (@pxref{Derived Modes}).  For
+example, Rmail Edit mode is a major mode that is very similar to Text
+mode except that it provides two additional commands.  Its definition
+is distinct from that of Text mode, but uses that of Text mode.
 
   Even if the new mode is not an obvious derivative of any other mode,
 it is convenient to use @code{define-derived-mode} with a @code{nil}
@@ -460,9 +460,9 @@
 The major mode command may start by calling some other major mode
 command (called the @dfn{parent mode}) and then alter some of its
 settings.  A mode that does this is called a @dfn{derived mode}.  The
-recommended way to define one is to use @code{define-derived-mode},
-but this is not required.  Such a mode should call the parent mode
-command inside a @code{delay-mode-hooks} form.  (Using
+recommended way to define one is to use the @code{define-derived-mode}
+macro, but this is not required.  Such a mode should call the parent
+mode command inside a @code{delay-mode-hooks} form.  (Using
 @code{define-derived-mode} does this automatically.)  @xref{Derived
 Modes}, and @ref{Mode Hooks}.
 
@@ -488,6 +488,12 @@
 @code{default-major-mode} is @code{nil}.  Modes such as Dired, Rmail,
 and Buffer List use this feature.
 
+The @code{define-derived-mode} macro automatically marks the derived
+mode as special if the parent mode is special.  The special mode
address@hidden provides a convenient parent for other special
+modes to inherit from; it sets @code{buffer-read-only} to @code{t},
+and does nothing else.
+
 @item
 If you want to make the new mode the default for files with certain
 recognizable names, add an element to @code{auto-mode-alist} to select




reply via email to

[Prev in Thread] Current Thread [Next in Thread]