diff options
author | Richard M. Stallman <rms@gnu.org> | 2001-06-26 13:18:26 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 2001-06-26 13:18:26 +0000 |
commit | 008c5e266f154a207b7ad13b26cf7c1ec2f24254 (patch) | |
tree | 13ed811510e465b5ce0570b572b327e637df0898 /lispref | |
parent | 4b827f5d6c0a51e87ec3e08ac289cbcdc0200cc2 (diff) | |
download | emacs-008c5e266f154a207b7ad13b26cf7c1ec2f24254.tar.gz |
(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.
Diffstat (limited to 'lispref')
-rw-r--r-- | lispref/modes.texi | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/lispref/modes.texi b/lispref/modes.texi index 9f41e024135..b855f7e0eca 100644 --- a/lispref/modes.texi +++ b/lispref/modes.texi @@ -99,7 +99,14 @@ Fundamental mode. Rmail mode is a complicated and specialized mode. 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 @@ have names that start with the major mode name (or with an abbreviation 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 @@ editing commands. Dired and Rmail both do this. @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 |