Commit e0dbfecc authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(Major Mode Conventions): Discuss rebinding of standard key bindings.

parent 5106fd70
...@@ -188,16 +188,24 @@ The key sequences bound in a major mode keymap should usually start with ...@@ -188,16 +188,24 @@ The key sequences bound in a major mode keymap should usually start with
characters are reserved for minor modes, and ordinary letters are characters are reserved for minor modes, and ordinary letters are
reserved for users. reserved for users.
It is reasonable for a major mode to rebind a key sequence with a A major mode can also rebind the keys @kbd{M-n}, @kbd{M-p} and
standard meaning, if it implements a command that does ``the same job'' @kbd{M-s}. The bindings for @kbd{M-n} and @kbd{M-p} should normally
in a way that fits the major mode better. For example, a major mode for be some kind of ``moving forward and backward,'' but this does not
editing a programming language might redefine @kbd{C-M-a} to ``move to necessarily mean cursor motion.
the beginning of a function'' in a way that works better for that
language. It is legitimate for a major mode to rebind a standard key sequence if
it provides a command that does ``the same job'' in a way better
Major modes such as Dired or Rmail that do not allow self-insertion of suited to the text this mode is used for. For example, a major mode
text can reasonably redefine letters and other printing characters as for editing a programming language might redefine @kbd{C-M-a} to
editing commands. Dired and Rmail both do this. ``move to the beginning of a function'' in a way that works better for
that language.
It is also legitimate for a major mode to rebind a standard key
sequence whose standard meaning is rarely useful in that mode. For
instance, minibuffer modes rebind @kbd{M-r}, whose standard meaning is
rarely of any use in the minibuffer. Major modes such as Dired or
Rmail that do not allow self-insertion of text can reasonably redefine
letters and other printing characters as special commands.
@item @item
Major modes must not define @key{RET} to do anything other than insert Major modes must not define @key{RET} to do anything other than insert
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment