[net.emacs] Proposal for key bindings, version 2

dick@tjalk.UUCP (Dick Grune) (05/15/86)

Thank you all for your remarks, criticisms and general interest in our
proposal for recommended key bindings for emacses.  We have tried to
incorporate them and still (or "therefore") get a consistent body, which
we present herewith.  The general set-up has remained the same, but many
details have been changed, and much of the rationale has been touched up.

			Dick Grune		dick@vu44.UUCP
			Sjoerd Mullender	sjoerd@vu44.UUCP

----------------------------------------------------------------
1. INTRODUCTION

At this moment we, the authors, have at our disposal 7 emacses, all
slightly or more than slightly different in their key bindings, enough
to confuse novice and expert alike.  Emacs's great strength, its
programmability, turns into a weakness and chaos rages.  In an
attempt to bring some order into this chaos we have drawn up the
complete lists of initial key bindings of each emacs (i.e. the
bindings the unsuspecting user gets when he just calls the specific
emacs) and printed them side by side, on a virtual piece of paper,
210 columns wide.  Upon examination, patterns began to emerge, and
we have observed the following.

1.	Almost all elementary functions, functions "that every emacs
should have," are always bound to the same keys, ^H and ^Z being the
only problems.  These key bindings are brought together in Class A in
the proposal.

2.	Most of the non-essential functions have a "home", a binding
about which a majority of the emacses agree.  Those for which a home
could be identified are grouped in Class B.

3.	All emacses agree that ^X- or ESC- followed by a capital
letter is either bound to nothing or to the same function as ^X- or
ESC- followed by the corresponding small letter.

4.	None of the emacses directly solves the problems caused by
the fact that on some systems ^S and ^Q are preempted by the
terminal communication, as X-OFF and X-ON.  Any emacs should supply
reasonable alternatives.

This has led us to submit the attached proposal, which is
accompanied by a rationale.  The version presented here is version
2, into which we have incorporated reactions to version 1; these
reactions have helped to clear up many details.

We welcome further comments and suggestions, which will serve for
version 3, to be issued perhaps a year from now.  In the meantime we
shall endeavour to give the present proposal as wide a dissemination
as possible.  We thank all those who have given us their support.

			Dick Grune		dick@vu44.UUCP
			Sjoerd Mullender	sjoerd@vu44.UUCP
			Vrije Universiteit
			de Boelelaan 1081
			1081 HV  Amsterdam
			the Netherlands


2. PROPOSAL

	Proposal for recommended key bindings in emacs-like editors.
		Version 2.			May 1986.

SCOPE
The recommendations in this proposal apply to the key bindings as
they appear initially --upon calling the editor-- to the user who has
given no customization or initialization information.

This proposal is NOT to be construed as a recommendation against
differing local or personal key bindings, and is intended solely to
reduce confusion in the unsuspecting user and as matter for
consideration to future emacs authors.  It concerns itself primarily
with the use as a document text editor rather than a program text
editor.

The editor functions are grouped into 3 classes, according to their
relative importance:

	Class A: functions the user can expect to be present.
	Class B: optional functions, which the user can nevertheless
		expect to be present in a wordprocessor/development
		environment.
	Class C: specialized optional features, which are common
		enough for a recommendation to be in order.

In addition to these classes, two general recommendations are given.

Class A:

	Character commands:
	^B	go backward character
	^D	delete next character
	^F	go forward character
	^T	transpose characters
	^?	delete previous character

	Line commands:
	^A	go to beginning of line
	^E	go to end of line
	^K	delete to end of line

	Intra-line commands:
	^N	go to next line
	^P	go to previous line

	Word commands:
	ESC-b	go backward word
	ESC-d	delete next word
	ESC-f	go forward word
	ESC-^?	delete previous word

	Window commands:
	^V	page this window
	^Z	scroll forward
	^X-1	delete other windows
	^X-2	split window
	^X-d	delete window
	^X-o	go to other window
	ESC-^V	page other window
	ESC-<	go to beginning of file
	ESC->	go to end of file
	ESC-v	page backward
	ESC-z	scroll backward

	Buffer commands:
	^X-^B	list buffers
	^X-b	switch to named buffer
	^X-k	delete named buffer

	File commands:
	^X-^F	find named file
	^X-^I	insert named file
	^X-^M	save modified files
	^X-^R	read named file
	^X-^S	save file
	^X-^W	write named file

	Region commands:
	^@	set mark
	ESC-SPACE set mark
	^W	delete region to internal buffer
	^Y	insert from internal buffer
	^X-^X	exchange cursor and mark

	White space commands:
	^I	insert tab
	^J	insert newline and indent
	^M	insert newline
	^O	insert newline and backup

	Search commands:
	^R	search reverse
	^S	search forward
	ESC-q	query replace string
	ESC-r	replace string

	Miscellaneous commands:
	^C	exit
	^X-^C	exit
	^G	abort				(directly mapped)
	^L	redraw screen
	^Q	quote next character
	^U	argument prefix
	^^	replacement for ^Q		(directly mapped)
	^\	replacement for ^S		(directly mapped)
	^]	alternate prefix

Class B:

	Word commands:
	ESC-t	transpose words

	Sentence commands:
	^X-^?	delete to beginning of sentence
	ESC-a	go backward sentence
	ESC-e	go forward sentence
	ESC-k	delete to end of sentence

	Paragraph commands:
	ESC-[	go backward paragraph
	ESC-]	go forward paragraph
	ESC-j	justify paragraph

	Window commands:
	^X-^	enlarge window

	Region commands:
	ESC-w	copy region to internal buffer
	ESC-^W	delete region to end of internal buffer

	Case commands:
	ESC-c	capitalize word
	ESC-l	lower case word
	ESC-u	upper case word

	White space commands:
	^X-^O	delete blank lines
	ESC-\	delete horizontal space

	Macro commands:
	^X-(	start keyboard macro
	^X-)	stop keyboard macro
	^X-e	execute keyboard macro

	Information commands:
	^X-=	display cursor position
	ESC-?	help

	System commands:
	^X-^E	compile
	^X-^N	display next error
	^X-!	give command to command interpreter
	^_	call command interpreter

Class C:

	Line commands:
	^X-^T	transpose lines
	ESC-m	go to first non-blank

	Window commands:
	^X-n	go to next window
	^X-p	go to previous window
	ESC-,	go to beginning of window
	ESC-.	go to end of window

	Buffer commands:
	ESC-~	set buffer not modified

	Case commands:
	^X-^L	lower case region
	^X-^U	upper case region

	Internal editor commands:
	ESC-ESC	evaluate internal expression
	ESC-x	execute internal command
	^X-*	display version number

	Abbreviations:
	^X-^A	add local abbreviation
	^X-^H	inverse add local abbreviation
	^X-+	add global abbreviation
	^X--	inverse add global abbreviation

	Layout control:
	^X-.	set indent column
	^X-;	set comment column
	^X-f	set fill column
	ESC-;	indent to comment column

	Scroll sideways:
	^X-<	scroll left
	^X->	scroll right

	Parentheses:
	ESC-^B	go backward parenthesis
	ESC-^F	go forward parenthesis



CAPITAL LETTERS IN A PREFIXED COMMAND
Key strokes consisting of a prefix (^X- or ESC-) followed by a
capital letter should be bound to the same command as the prefix
followed by the corresponding small letter.

DIRECT MAPPING OF ^S, ^Q AND ^G
All key bindings that include a ^S or ^Q should have a corresponding
binding with ^\ substituted for ^S and ^^ for ^Q; all key bindings
that include ^G should result in abort.  If the editor supports
direct mapping (low-level interpretation), this should be used, so
that new bindings will automatically inherit the substitution.  If
not, appropriate explicit bindings should be supplied.

END OF PROPOSAL


3. RATIONALE

3.1 The concept
The reason for this proposal at all is the same as that for any
standard: some design decisions are to a large extend arbitrary, and
to reduce the ensuing complexity, additional artificial order has to
be imposed.  We feel that the subject has at present reached a
certain maturity and has not yet petrified.

For an editor to be used efficiently, the user must be able to
operate it by reflexes only. Having to learn a slightly different
set of reflexes leads to much aggravation, more so than having to
learn, e.g., a variant of a programming language.

3.2 The approach
We have considered the initial key bindings of
	emacs2.10 (Unipress/Gosling),
	jove (Jonathan Payne/Unison World),
	PerfectWriter (Perfect Software),
	MicroEmacs (Curt Jutzi, jutz@pogo),
	GNU (Richard M. Stallman),
	scame (Leif Samuelsson, leif@erisun),
	MicroEMACS (Dave Conroy, conroy@dec-rex).
For Class A and B we only considered those key bindings that were
defined in at least four of the above.  The key bindings for which
no rationale is given below were either unanimous or defined by some
and not contradicted by any of the others.

We have not concerned ourselves with small semantic differences:
"next-paragraph" will go to the beginning of the next paragraph on
some editors and to the end of this paragraph on others;
"transpose-characters" may transpose cursor[-2..-1] or
cursor[-1..0], etc.  These are considered equivalent, since the user
has direct optical feedback.

3.3 Specific key bindings
^H is left unbound.  It is usually bound to go-backward-character or
to delete-previous-character, without clear preference for either.
Both of these are available under other keys (^B and ^?).  Users
working on low-grade telephone lines may need to avoid ^? since it
is often generated by noise; they may bind delete-previous-character
to ^H and unbind ^?.

^Z
Some systems have the possibility to suspend a running process; this
action is traditionally coupled to the ^Z key.  It is, however, not
at all universal and requires considerable OS support.  We feel
therefore that we can still use ^Z (and its companion ESC-z) for
scrolling  --with suspending, calling the command interpreter, etc.,
bound to ^_ .

^]
Most editors do not use a third prefix besides ^X and ESC; among
those that do, there is no consensus, with ^H, ^Z, ^\, ^^ and ^X-4
being used.  ^] is not used by any editor for anything.

ESC-SPACE
Not all terminals or OSs can transmit a NUL character (^@).
ESC-SPACE can serve to bind set-mark to.  Since no more single
characters are available, a direct mapping cannot be found, nor is
one needed, in the absence of compound key sequences with ^@.

^X-^F, ^X-^R
Generally there exist two commands, "read file into new buffer" and
"read file into existing buffer", called "find named file" and "read
named file" respectively here.  They are bound to various
permutations of ^X-^F, ^X-^R and ^X-^V, the latter being called
"visit file", but being identical to "find named file".  The
proposed assignment seems more mnemonic and seems to have a slight
majority.


3.4 Capital letters in a prefixed command
The beginning user would have difficulty in telling apart ^X-^S,
^X-s, ^X-S, ESC-^S, ESC-s and ESC-S, with assorted meanings like
save-file, forward-search, call-spelling-checker, center-line or
scratch-buffer.  Some tutorials print ^X-S when they mean ^X-s.
Some users may want to use their terminals with CAPS LOCK on.

Some terminals with function keys send ESC-@ to ESC-O for them; if,
however, function keys are to play a role, local customization will
be necessary anyway, which is outside the scope of this proposal.

3.5 ^S and ^Q
^S and ^Q are used by some communication protocols and will then
cause a great deal of confusion, both to the user and to the
computer.  It seems preferable to lift this problem out of the user
realm and into the editor.

The mapping
	^S -> ^\		^Q -> ^^
is preferable to
	^S -> ^^		^Q -> ^\
since ^^ is difficult to produce on some terminals and ^Q is the
rarer of the two.  It is the binding in much of the material that
comes with GNU, Unipress and jove.

3.6 Fancy search facilities
Many emacses provide two levels of search facilities, one searching
for a simple string match, and a fancier one, e.g., incremental
search or search for a regular expression.  We do not provide
recommendations for the latter, since we feel that those who use
them will want to choose their own key bindings (like binding them
in the place of the simple ones).  Some editors govern the choice
with a mode variable.

END OF RATIONALE