Mercurial > emacs
changeset 38200:6c286c714f74
(Major Mode Conventions): Say not to change meaning of RET, and not to
set user preferences. Say that there is a general imperative to
preserve uniformity even in ways not mentioned here.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Tue, 26 Jun 2001 13:18:26 +0000 |
parents | 01e8262e28af |
children | 303d358eaac7 |
files | lispref/modes.texi |
diffstat | 1 files changed, 23 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lispref/modes.texi Tue Jun 26 13:13:11 2001 +0000 +++ b/lispref/modes.texi Tue Jun 26 13:18:26 2001 +0000 @@ -99,7 +99,14 @@ The code for existing major modes follows various coding conventions, including conventions for local keymap and syntax table initialization, global names, and hooks. Please follow these conventions when you -define a new major mode: +define a new major mode. + + This list of conventions is only partial, because each major mode +should aim for consistency in general with other Emacs major modes. +This makes Emacs as a whole more coherent. It is impossible to list +here all the possible points where this issue might come up; if the +Emacs developers point out an area where your major mode deviates from +the usual conventions, please make it compatible. @itemize @bullet @item @@ -142,6 +149,13 @@ of it if the name is long). @xref{Coding Conventions}. @item +In a major mode for editing some kind of structured text, such as a +programming language, indentation of text according to structure is +probably useful. So the mode should set @code{indent-line-function} +to a suitable function, and probably customize other variables +for indentation. + +@item @cindex keymaps in modes The major mode should usually have its own keymap, which is used as the local keymap in all buffers in that mode. The major mode command should @@ -176,8 +190,14 @@ @item Major modes must not define @key{RET} to do anything other than insert a newline. The command to insert a newline and then indent is -@kbd{C-j}. These conventions are supposed to be uniform for all -modes; please keep them that way. +@kbd{C-j}. Please keep this distinction uniform for all major modes. + +@item +Major modes should not alter options that are primary a matter of user +preference, such as whether Auto-Fill mode is enabled. Leave this to +each user to decide. However, a major mode should customize other +variables so that Auto-Fill mode will work usefully @emph{if} the user +decides to use it. @item @cindex syntax tables in modes