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 |
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 |
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 |