/[emacs]/emacs/lispref/modes.texi
ViewVC logotype

Diff of /emacs/lispref/modes.texi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.99 by lute, Fri Apr 29 13:02:54 2005 UTC revision 1.100 by lute, Thu May 12 13:20:56 2005 UTC
# Line 71  it is convenient to use @code{define-der Line 71  it is convenient to use @code{define-der
71  parent argument, since it automatically enforces the most important  parent argument, since it automatically enforces the most important
72  coding conventions for you.  coding conventions for you.
73    
 @findex define-generic-mode  
74    For a very simple programming language major mode that handles    For a very simple programming language major mode that handles
75  comments and fontification, you can use @code{define-generic-mode}  comments and fontification, you can use @code{define-generic-mode}.
76  in @file{generic.el}.  @xref{Generic Modes}.
77    
78    Rmail Edit mode offers an example of changing the major mode    Rmail Edit mode offers an example of changing the major mode
79  temporarily for a buffer, so it can be edited in a different way (with  temporarily for a buffer, so it can be edited in a different way (with
# Line 873  configuration files.  To define a generi Line 872  configuration files.  To define a generi
872  @code{define-generic-mode}.  See the file @file{generic-x.el} for some  @code{define-generic-mode}.  See the file @file{generic-x.el} for some
873  examples of the use of @code{define-generic-mode}.  examples of the use of @code{define-generic-mode}.
874    
875  @defmac define-generic-mode mode comment-list keyword-list font-lock-list auto-mode-list function-list &optional docstring &rest custom-keyword-args  @defmac define-generic-mode mode comment-list keyword-list font-lock-list auto-mode-list function-list &optional docstring
876  This macro creates a new generic mode.  The argument @var{mode} (an  This macro creates a new generic mode.  The argument @var{mode} (an
877  unquoted symbol) is the major mode command.  The optional argument  unquoted symbol) is the major mode command.  The optional argument
878  @var{docstring} is the documentation for the mode command.  If you do  @var{docstring} is the documentation for the mode command.  If you do
# Line 902  when Emacs runs the macro expansion. Line 901  when Emacs runs the macro expansion.
901    
902  @var{function-list} is a list of functions to call to do some  @var{function-list} is a list of functions to call to do some
903  additional setup.  The mode command calls these functions just before  additional setup.  The mode command calls these functions just before
904  it runs the mode hook.  it runs the mode hook variable @code{@var{mode}-hook}.
   
 The optional @var{custom-keyword-args} are pairs of keywords and  
 values to include in the generated @code{defcustom} form for the mode  
 hook variable @code{@var{mode}-hook}.  The default value for the  
 @samp{:group} keyword is @var{mode} with the final @samp{-mode} (if  
 any) removed.  Don't use this default group name unless you have  
 written a @code{defgroup} to define that group properly (@pxref{Group  
 Definitions}).  You can specify keyword arguments without specifying a  
 docstring.  
905  @end defmac  @end defmac
906    
907  @node Mode Hooks  @node Mode Hooks

Legend:
Removed from v.1.99  
changed lines
  Added in v.1.100

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26