An Emacs Primer

Version 0.3
Christopher Wood, Oct 1995.


  1. 1. About emacs.
  2. 2. Basic editing.
  3. 3. Getting Help In Emacs.
  4. 4. Some Slightly More Obscure Features.
  5. 5. Customising Emacs.
  6. 6. Useful functions for programmers.
  7. 7. Emacs Key Bindings

1. About emacs

1.1 Features

Essentially, if it can be done in a text editor emacs probably does it or can be configured to do it. Emacs was designed so that a small kernel of the code is written in C for efficiency, and the rest of it is implemented in "elisp". (the dialect of Lisp which emacs uses for customisations) If you don't like some feature of emacs (and if you're good enough with elisp) you can probably change it.

1.2 History

There are a number of different versions of emacs out there, of which the GNU flavour seems the most common.
  1. Dark ages - the original TECO based emacs and various derivitives, including microemacs (a cut-down light-weight version)
  2. GNU emacs-18.59 and earlier are small, light-weight versions with some minimal X support but lacking multiple overlapping windows etc.
  3. micro GNU emacs (mg) is a light-weight, rather useless subset which is compatible with GNU emacs.
  4. A schism occurs where "epoch" a version of emacs with better X support emerges. Most epoch features are later included into emacs-19.XX.
  5. GNU emacs-19.xx is the current GNU flavour of emacs which supports frames and has many enhancements over the original emacs.
  6. Lucid emacs (now called "Xemacs") has a much nicer X interface than the standard GNU version and is branching off away from the mainstream GNU emacs. (another schism) It seems to be becoming the defacto standard.

2. Basic Editing

Emacs: "Escape Meta Alt Control Shift"

Most keystrokes are a combination of control keys (the idea being to (a) make them efficient for touch-typists and (b) make them portable across different keyboards). The Meta (typicaly Alt) key is used to prefix some commands.

The notation:

C- is used to indicate a control key.
M- is used to indicate Alt+key. (ESC then pressing the key has the same effect)


C-x b   - means Control-x then the "b" key.
C-x C-b - means hold down control while pressing both "x" and "b".
M-v     - hold down the "meta" (alt) key or press Esc, then "v".
A minimal subset of editing commands is given below:

Moving Around

C-e	end-of-line                 (jump to the end of the current line)
C-a     beginning-of-line           (jump to the beginning of the current line)
C-v     scroll-up                   (scroll text up. i.e. page down)
M-v     scroll-down                 (scroll text down. i.e. page up)
M->     end-of-buffer               (as it says)
M-<     beginning-of-buffer         (as it says)

File, Buffers and Windows
C-x C-c  - save-buffers-kill-emacs  (save and exit)
C-x C-f  - find-file                (open a new file)
C-x C-w  - write-file               (write the current buffer under a different
                                    filename. Essentially a "Save as ...")
C-x b    - switch-to-buffer         (switch to some file you were editing
                                     in another buffer)
C-x C-b  - list-buffers             (show a list of edit buffers. i.e. files
                                     that you have been editing in this
                                     emacs session)     
C-x 1    - delete-other-windows     (make the window the cursor is in, the
                                     only one -- emacs windows are a division
                                     of an X window. A "frame" is an X window)
C-x o	 - other-window             (switch to the next window in the current
                                     frame. i.e. the current X window)


C-d      - delete-char	            (delete char under cursor)
C-k	 - kill-line                (kill from cursor to end of line)
C-@      - set-mark-command         (used for delimiting a region of text
                                     for a copy/paste)
C-y      - yank                     (paste text from previous kill)
C-w	 - kill-region	            ("cut" the region between the mark and
                                     and cursor)
M-w      - kill-ring-save           ("copy" text between mark and cursor
           copy-region-as-kill       into a kill ring from which it can
                                     be pasted back into the text)


C-s	 - isearch-forward          (incremental forward search.  Incremental
                                     search allows you to enter a string and
                                     jumps to the next match as you enter
                                     each character in the search key - try 
C-r      - isearch-backward         (incremental reverse search)  
M-%      - query-replace            (search for a string and interactively
                                     choose whether or not to replace it
                                     with the replacement string you specify)

3. Getting Help In Emacs

The help functions are invoked using the C-h prefix.

C-h t        help-with-tutorial      (run the emacs tutorial)
C-h b        describe-bindings       (list key bindings in another window)  
C-h C-h      help-for-help           (how to use the emacs help system ;-)  
C-h i        info                    (read the online documentation - called

If you are completely new to emacs, it is probably worth running the introductory tutorial (with C-h t) and working through it.

It is probably worth your while to learn how to use the "info" mode to read the online documentation. "info" is invoked with "C-h i" (info) and puts you into a hypertext mode. In info mode, hyperlinks are prefixed with a * character. To follow one, you essentially hit "m".

There are various useful commands in this mode, (see the info tree's documentation on itself) but the most important are:

m - info-menu      (select an item in an info tree menu)
u - info-up        (move up in the info tree - back to where you came from)
p - info-prev      (go to the previous item in the info tree.  This does
                   not mean the item you just came from, unfortunately) 
q - info-exit      (revert back to ordinary emacs mode)

4. Some Slightly More Obscure Features

Emacs functions can be invoked directly using "M-x function-name" (then ENTER) eg. "M-x compile" invokes the "compile" function. This is often useful if you can't remember the appropriate key-binding, or if you want to test a function.

Emacs is also capable of running textual applications such as shells, compilers, grep, diff etc. inside an emacs buffer. eg. "M-x shell" gets you a shell inside of an emacs window. "M-x grep" can be used to search for matches to sub-strings/patterns in a collection of files and "next-error" used to iterate through them.

Keyboard macros are useful in combination with a numeric argument when you need to make large numbers of similar changes to a document. Essentially the idea is that you start recording key-strokes to do the operation once, then invoke the macro with a numeric argument. eg. "M-10 C-x e" invokes the macro you have defined 10 times. Imagine, for example that you want to change a variable name in many different source files. You can run "M-x grep variable-name *.c" to get a list of occurences of the variable in all the files. Then you can define a keyboard macro which changes the variable to the new value, then invokes "next-error" to jump to the next occurence.

4.1 More Useful Functions/Keys

M-~     not-modified    (if you have modified a buffer then changed it back
                         this unsets the modify flag.  Ocassionally useful) 

C-x u   undo            (undo the last change to the buffer.  If you do this
                         more than once, it will go backwards through your
                         history of changes, undoing them)

M-C-y   yank-pop        (after a yank, this will cycle through items in
                         the kill-ring.  The kill-ring is a list of cuts/copies
                         from your emacs buffers) 

M-.	find-tag	(having run etags(1) (eg. "etags *.c *.h") in a 
                         directory you will have a file called "TAGS" which
                         contains an index of the functions in your code. 
                         This prompts you for a function name and will jump
                         you to it)

unbound compile         (run a compile process inside emacs)

C-x `   next-error      (go to the next line containing an error)

C-x (   start-kbd-macro (start defining a keyboard macro)

C-x )   end-kbd-macro   (finish defining a keyboard macro)

5. Customising Emacs

Emacs customisations typically take the form of Lisp code in your ~/.emacs file.

5.1 Setting foreground and background Colours

Putting the following in your .Xdefaults or .xrdb file and using xrdb to load them as you start X, can be used to do this. Some people prefer a white foreground with a black background:
! The old emacs 18.59 and emacs-19 use "emacs" as a program name.
emacs*background: white
emacs*foreground: black

! Lucid Emacs aka Xemacs uses:
Emacs*background: white
Emacs*foreground: black

5.2 Key Binding

Keys can be bound to functions in a context-specific fashion, so that they are only bound in a particular editing mode, or they can be bound in all modes. The function used to do the latter, is "global-set-key". eg.

; bind M-` to run the "compile" function ...
(global-set-key "\M-`" 'compile) ; since next-error is C-x `

5.3 Turning off auto-save and backup files

By default emacs automatically creates backup files for you, and auto-saves your document periodically. If these features annoy you, they can be turned off with the following:
(setq auto-save-default nil) ; turn off auto save
(setq make-backup-files nil) ; and backup files

5.4 Associating an editing mode with filenames

You can associate a filename suffix-with an emacs mode by adding a Lisp pair into the elisp variable "auto-mode-alist".


; force emacs to come up in c-mode for files ending in .c and .h
; It probably does this by default ...

(setq auto-mode-alist (cons (cons "\\.c$" 'c-mode) auto-mode-alist))
(setq auto-mode-alist (cons (cons "\\.h$" 'c-mode) auto-mode-alist))

; go info fundamental-mode (ordinary editing mode) rather than html-mode
; when editing files ending in .html ...
; This is useful if you hate the emacs HTML mode ;-)

(setq auto-mode-alist (cons (cons "\\.html$" 'fundamental-mode) 

5.5 Some More Traditional Search Functions

The following elisp fragments defines 2 functions: ccw-search-forward and ccw-search-backward, which prompt you for a string and invoke a regular expression search on it. They also remember the last string searched for and offer it to you as a default.

; forward-search & backward-search hacks which remember last search
; -----------------------------------------------------------------
; Christopher Wood, Feb 88.
; OK ... so it's an ugly hack ;-)

(defun ccw-last-search '()) ; thing last searched for ...

(defun ccw-search-forward ()
   (setq ccw-this-search (read-string "forward-search (REGEXP): "))
   (cond ((not (string-equal ccw-this-search ""))
          (setq ccw-last-search ccw-this-search)
          (re-search-forward ccw-this-search))
	 (t (re-search-forward ccw-last-search))))

(defun ccw-search-backward ()
   (setq ccw-this-search (read-string "backward-search (REGEXP): "))
   (cond ((not (string-equal ccw-this-search ""))
          (re-search-backward ccw-this-search)
	  (setq ccw-last-search ccw-this-search))
	 (t (re-search-backward ccw-last-search))))

; bind M-s and M-r to the functions.

(global-set-key "\M-s" 'ccw-search-forward)
(global-set-key "\M-r" 'ccw-search-backward)

5.6 An Example .emacs File

; .emacs - uncompiled emacs initialisation file 
; ---------------------------------------------
; Christopher Wood.

(setq auto-save-default nil) ; turn off auto save
(setq make-backup-files nil) ; and backup files
; (setq explicit-shell-file-name "/bin/csh") ; M-x shell gives csh
; (setq scroll-step 1) ; scroll 1 line only when at bottom of page

; set up C-mode
(setq c-indent-level 4) ; C-mode indents 4 spaces with tab.
(setq c-argdelc-indent 0) ; make it work for K&R style code
(setq c-brace-offset 0)

(defun current-line ()
    (+ (count-lines (window-start) (point))
         (if (= (current-column) 0) 1 0)

; forward-search & backward-search hacks which remember last search
; -----------------------------------------------------------------

(defun ccw-last-search '()) ; thing last searched for ...

(defun ccw-search-forward ()
   (setq ccw-this-search (read-string "forward-search (REGEXP): "))
   (cond ((not (string-equal ccw-this-search ""))
          (setq ccw-last-search ccw-this-search)
          (re-search-forward ccw-this-search))
	 (t (re-search-forward ccw-last-search))))

(defun ccw-search-backward ()
   (setq ccw-this-search (read-string "backward-search (REGEXP): "))
   (cond ((not (string-equal ccw-this-search ""))
          (re-search-backward ccw-this-search)
	  (setq ccw-last-search ccw-this-search))
	 (t (re-search-backward ccw-last-search))))

(global-set-key "\M-\C-f" 'fill-paragraph)
(global-set-key "\M-s" 'ccw-search-forward)
(global-set-key "\M-r" 'ccw-search-backward)
(global-set-key "\C-x\C-k" 'global-set-key)
(global-set-key "\M-\C-y" 'yank-pop)
(global-set-key "\C-xp" 'scroll-down)
(global-set-key "\C-xn" 'scroll-up)
(global-set-key "\C-x\C-z" 'save-buffer)
(global-set-key "\M- " 'set-mark-command)
(global-set-key "\M-`" 'compile) ; since next-error is C-x `

(define-key c-mode-map ":" 'self-insert-command)

;(defun c-or-c++ ()
;  (interactive)
;  (load "c-or-c++.el")
;  (define-key c++-mode-map ":" 'self-insert-command))

; Set up the following suffixes to load "c-or-c++.el"

;(setq auto-mode-alist (cons (cons "\\.cc$" 'c-or-c++) auto-mode-alist))
;(setq auto-mode-alist (cons (cons "\\.c$" 'c-or-c++) auto-mode-alist))
;(setq auto-mode-alist (cons (cons "\\.h$" 'c-or-c++) auto-mode-alist))

; set up cursor keys a la VT100 ...

(defvar CSI-map (make-sparse-keymap))
(define-key esc-map "[" CSI-map)
(define-key CSI-map "A"  'previous-line)
(define-key CSI-map "B"  'next-line)
(define-key CSI-map "C"  'forward-char)
(define-key CSI-map "D"  'backward-char)

;(load "/app/emacs/lisp/gnuserv.el")
(global-set-key "\C-xg" 'goto-line)

; (server-start)

; (defun suspend-emacs-hook () nil)

6. Useful Functions For Programmers

People who are accustomed to Windows/DOS development environments, may want to know how to do compiles, error-tracking, debugging etc. inside the editor. These functions are available (including many that are not available in the afore-mentioned environments) under emacs. There are some quite sophisticated elisp programs for class-browsing, interacting with interpreters within emacs, error tracking, debugging, automatically indenting programs etc. And you can always write you own.

To list a few of the more useful functions:

compile		- prompts for a command line to run in a compile window.
                  Typically this will be a "make", a call to a compiler etc.
                  You can invoke it with M-x compile, or bind it to a key.

next-error      - jumps you to the next error in a compile. Often bound
                  to "C-x `"  

find-tag        - having run etags(1) (eg. "etags *.c *.h") in a 
                  directory you will have a file called "TAGS" which
                  contains an index of the functions in your code. 
                  This prompts you for a function name and will jump
                  you to it)

grep            - run grep in a window and use next-error to track through
                  the errors.
[To be completed ...]

7. Emacs Key Bindings

This list was produced using "list-bindings" (C-h b)

Global Bindings:

key             binding
---             -------

backspace	Kbd Macro: delete
tab		indent-for-tab-command
kp_tab		Kbd Macro: tab
linefeed	newline-and-indent
kp_enter	Kbd Macro: return
return		newline
space .. ~	self-insert-command
delete		delete-backward-char
 .. 		self-insert-command
SunCopy		Kbd Macro: copy
SunCut		Kbd Macro: cut
SunFront	Kbd Macro: front
SunOpen		Kbd Macro: open
SunPaste	Kbd Macro: paste
SunProps	Kbd Macro: props
again		fkey-repeat-complex-command
begin		fkey-beginning-of-line
button1		mouse-track
button1up	release-toolbar-button
button2		mouse-yank
button3		popup-mode-menu
cancel		Kbd Macro: stop
copy		x-copy-primary-selection
cut		x-kill-primary-selection
down		fkey-next-line
end		fkey-end-of-line
f11		Kbd Macro: stop
f12		Kbd Macro: again
f13		Kbd Macro: props
f14		Kbd Macro: undo
f15		Kbd Macro: front
f16		Kbd Macro: copy
f17		Kbd Macro: open
f18		Kbd Macro: paste
f19		Kbd Macro: find
f20		Kbd Macro: cut
f21		Kbd Macro: pause
f22		Kbd Macro: prsc
f23		Kbd Macro: scroll
f24		Kbd Macro: kp_subtract
f25		Kbd Macro: kp_divide
f26		Kbd Macro: kp_multiply
f27		Kbd Macro: home
f29		Kbd Macro: pgup
f31		Kbd Macro: kp_5
f33		Kbd Macro: end
f35		Kbd Macro: pgdn
f36		Kbd Macro: stop
f37		Kbd Macro: again
find		ow-find
help		help-for-help
home		fkey-beginning-of-line
insert		fkey-overwrite-mode
kp_delete	backward-delete-char-untabify
kp_down		fkey-next-line
kp_end		fkey-end-of-line
kp_home		fkey-beginning-of-line
kp_insert	fkey-overwrite-mode
kp_left		fkey-backward-char
kp_next		fkey-scroll-up
kp_prior	fkey-scroll-down
kp_right	fkey-forward-char
kp_up		fkey-previous-line
left		fkey-backward-char
menu		fkey-popup-mode-menu
next		fkey-scroll-up
paste		x-yank-clipboard-selection
pgdn		fkey-scroll-up
pgup		fkey-scroll-down
prior		fkey-scroll-down
r13		Kbd Macro: end
redo		fkey-repeat-complex-command
right		fkey-forward-char
undo		undo
up		fkey-previous-line
C-backspace	Kbd Macro: C-delete
C-tab		fkey-other-window
C-space		set-mark-command
C--		negative-argument
C-/		undo
C-0 .. C-9	digit-argument
C-<		mark-beginning-of-buffer
C->		mark-end-of-buffer
C-@		set-mark-command
C-]		abort-recursive-edit
C-_		undo
C-a		beginning-of-line
C-b		backward-char
C-c		<< mode-specific-command-prefix >>
C-d		delete-char
C-e		end-of-line
C-f		forward-char
C-g		keyboard-quit
C-h		<< help-command >>
C-i		indent-for-tab-command
C-j		newline-and-indent
C-k		kill-line
C-l		recenter
C-m		newline
C-n		next-line
C-o		open-line
C-p		previous-line
C-q		quoted-insert
C-r		isearch-backward
C-s		isearch-forward
C-t		transpose-chars
C-u		universal-argument
C-v		scroll-up
C-w		kill-region
C-x		<< Control-X-prefix >>
C-y		yank
C-z		suspend-or-iconify-emacs
C-SunCopy	Kbd Macro: C-copy
C-SunCut	Kbd Macro: C-cut
C-SunFront	Kbd Macro: C-front
C-SunOpen	Kbd Macro: C-open
C-SunPaste	Kbd Macro: C-paste
C-SunProps	Kbd Macro: C-props
C-begin		fkey-beginning-of-buffer
C-button1	mouse-track-insert
C-button2	x-set-point-and-move-selection
C-cancel	Kbd Macro: C-stop
C-down		Anonymous Compiled Function
C-end		fkey-end-of-buffer
C-f11		Kbd Macro: C-stop
C-f12		Kbd Macro: C-again
C-f13		Kbd Macro: C-props
C-f14		Kbd Macro: C-undo
C-f15		Kbd Macro: C-front
C-f16		Kbd Macro: C-copy
C-f17		Kbd Macro: C-open
C-f18		Kbd Macro: C-paste
C-f19		Kbd Macro: C-find
C-f20		Kbd Macro: C-cut
C-f21		Kbd Macro: C-pause
C-f22		Kbd Macro: C-prsc
C-f23		Kbd Macro: C-scroll
C-f24		Kbd Macro: C-kp_subtract
C-f25		Kbd Macro: C-kp_divide
C-f26		Kbd Macro: C-kp_multiply
C-f27		Kbd Macro: C-home
C-f29		Kbd Macro: C-pgup
C-f31		Kbd Macro: C-kp_5
C-f33		Kbd Macro: C-end
C-f35		Kbd Macro: C-pgdn
C-f36		Kbd Macro: C-stop
C-f37		Kbd Macro: C-again
C-home		fkey-beginning-of-buffer
C-insert	x-copy-primary-selection
C-kp_end	fkey-end-of-buffer
C-kp_home	fkey-beginning-of-buffer
C-kp_next	fkey-scroll-left
C-kp_prior	fkey-scroll-right
C-left		fkey-backward-word
C-next		fkey-scroll-left
C-pgdn		fkey-scroll-left
C-pgup		fkey-scroll-right
C-prior		fkey-scroll-right
C-r13		Kbd Macro: C-end
C-right		fkey-forward-word
C-up		Anonymous Compiled Function
M-backspace	Kbd Macro: M-delete
M-tab		lisp-complete-symbol
M-linefeed	indent-new-comment-line
M-escape	eval-expression
M-space		set-mark-command
M-!		shell-command
M-$		ispell-word
M-%		query-replace
M-'		abbrev-prefix-mark
M-(		insert-parentheses
M-)		move-past-close-and-reindent
M-,		tags-loop-continue
M--		negative-argument
M-.		find-tag
M-/		dabbrev-expand
M-0 .. M-9	digit-argument
M-;		indent-for-comment
M-<		beginning-of-buffer
M-=		count-lines-region
M->		end-of-buffer
M-@		mark-word
M-O		<< Prefix Command >>
M-[		<< Prefix Command >>
M-\		delete-horizontal-space
M-^		delete-indentation
M-`		compile
M-a		backward-sentence
M-b		backward-word
M-c		capitalize-region-or-word
M-d		kill-word
M-e		forward-sentence
M-f		forward-word
M-g		goto-line
M-h		mark-paragraph
M-i		tab-to-tab-stop
M-j		indent-new-comment-line
M-k		kill-sentence
M-l		downcase-region-or-word
M-m		back-to-indentation
M-q		fill-paragraph-or-region
M-r		ccw-search-backward
M-s		ccw-search-forward
M-t		transpose-words
M-u		upcase-region-or-word
M-v		scroll-down
M-w		kill-ring-save
M-x		execute-extended-command
M-y		yank-pop
M-z		zap-to-char
M-{		backward-paragraph
M-|		shell-command-on-region
M-}		forward-paragraph
M-~		not-modified
M-delete	backward-kill-word
M-SunCopy	Kbd Macro: M-copy
M-SunCut	Kbd Macro: M-cut
M-SunFront	Kbd Macro: M-front
M-SunOpen	Kbd Macro: M-open
M-SunPaste	Kbd Macro: M-paste
M-SunProps	Kbd Macro: M-props
M-cancel	Kbd Macro: M-stop
M-down		fkey-forward-paragraph
M-end		end-of-buffer-other-window
M-f11		Kbd Macro: M-stop
M-f12		Kbd Macro: M-again
M-f13		Kbd Macro: M-props
M-f14		Kbd Macro: M-undo
M-f15		Kbd Macro: M-front
M-f16		Kbd Macro: M-copy
M-f17		Kbd Macro: M-open
M-f18		Kbd Macro: M-paste
M-f19		Kbd Macro: M-find
M-f20		Kbd Macro: M-cut
M-f21		Kbd Macro: M-pause
M-f22		Kbd Macro: M-prsc
M-f23		Kbd Macro: M-scroll
M-f24		Kbd Macro: M-kp_subtract
M-f25		Kbd Macro: M-kp_divide
M-f26		Kbd Macro: M-kp_multiply
M-f27		Kbd Macro: M-home
M-f29		Kbd Macro: M-pgup
M-f31		Kbd Macro: M-kp_5
M-f33		Kbd Macro: M-end
M-f35		Kbd Macro: M-pgdn
M-f36		Kbd Macro: M-stop
M-f37		Kbd Macro: M-again
M-home		beginning-of-buffer-other-window
M-kp_end	end-of-buffer-other-window
M-kp_home	beginning-of-buffer-other-window
M-kp_next	fkey-scroll-other-window
M-kp_prior	scroll-other-window-down
M-left		fkey-backward-sexp
M-next		fkey-scroll-other-window
M-pgdn		fkey-scroll-other-window
M-pgup		scroll-other-window-down
M-prior		scroll-other-window-down
M-r13		Kbd Macro: M-end
M-right		fkey-forward-sexp
M-up		fkey-backward-paragraph
M-C-backspace	Kbd Macro: C-M-delete
M-C-space	mark-sexp
M-C--		negative-argument
M-C-0 .. M-C-9	 digit-argument
M-C-@		mark-sexp
M-C-[		eval-expression
M-C-\		indent-region
M-C-a		beginning-of-defun
M-C-b		backward-sexp
M-C-c		exit-recursive-edit
M-C-d		down-list
M-C-e		end-of-defun
M-C-f		fill-paragraph
M-C-h		mark-defun
M-C-i		lisp-complete-symbol
M-C-j		indent-new-comment-line
M-C-k		kill-sexp
M-C-l		switch-to-other-buffer
M-C-n		forward-list
M-C-o		split-line
M-C-p		backward-list
M-C-r		isearch-backward-regexp
M-C-s		isearch-forward-regexp
M-C-t		transpose-sexps
M-C-u		backward-up-list
M-C-v		scroll-other-window
M-C-w		append-next-kill
M-C-y		yank-pop
M-C-z		activate-region
M-C-delete	backward-kill-sexp
M-C-SunCopy	Kbd Macro: M-C-copy
M-C-SunCut	Kbd Macro: M-C-cut
M-C-SunFront	Kbd Macro: M-C-front
M-C-SunOpen	Kbd Macro: M-C-open
M-C-SunPaste	Kbd Macro: M-C-paste
M-C-SunProps	Kbd Macro: M-C-props
M-C-button3	popup-buffer-menu
M-C-cancel	Kbd Macro: M-C-stop
M-C-f11		Kbd Macro: M-C-stop
M-C-f12		Kbd Macro: M-C-again
M-C-f13		Kbd Macro: M-C-props
M-C-f14		Kbd Macro: M-C-undo
M-C-f15		Kbd Macro: M-C-front
M-C-f16		Kbd Macro: M-C-copy
M-C-f17		Kbd Macro: M-C-open
M-C-f18		Kbd Macro: M-C-paste
M-C-f19		Kbd Macro: M-C-find
M-C-f20		Kbd Macro: M-C-cut
M-C-f21		Kbd Macro: M-C-pause
M-C-f22		Kbd Macro: M-C-prsc
M-C-f23		Kbd Macro: M-C-scroll
M-C-f24		Kbd Macro: M-C-kp_subtract
M-C-f25		Kbd Macro: M-C-kp_divide
M-C-f26		Kbd Macro: M-C-kp_multiply
M-C-f27		Kbd Macro: M-C-home
M-C-f29		Kbd Macro: M-C-pgup
M-C-f31		Kbd Macro: M-C-kp_5
M-C-f33		Kbd Macro: M-C-end
M-C-f35		Kbd Macro: M-C-pgdn
M-C-f36		Kbd Macro: M-C-stop
M-C-f37		Kbd Macro: M-C-again
M-C-r13		Kbd Macro: M-C-end
Sh-SunCopy	Kbd Macro: Sh-copy
Sh-SunCut	Kbd Macro: Sh-cut
Sh-SunFront	Kbd Macro: Sh-front
Sh-SunOpen	Kbd Macro: Sh-open
Sh-SunPaste	Kbd Macro: Sh-paste
Sh-SunProps	Kbd Macro: Sh-props
Sh-button1	mouse-track-adjust
Sh-cancel	Kbd Macro: Sh-stop
Sh-f11		Kbd Macro: Sh-stop
Sh-f12		Kbd Macro: Sh-again
Sh-f13		Kbd Macro: Sh-props
Sh-f14		Kbd Macro: Sh-undo
Sh-f15		Kbd Macro: Sh-front
Sh-f16		Kbd Macro: Sh-copy
Sh-f17		Kbd Macro: Sh-open
Sh-f18		Kbd Macro: Sh-paste
Sh-f19		Kbd Macro: Sh-find
Sh-f20		Kbd Macro: Sh-cut
Sh-f21		Kbd Macro: Sh-pause
Sh-f22		Kbd Macro: Sh-prsc
Sh-f23		Kbd Macro: Sh-scroll
Sh-f24		Kbd Macro: Sh-kp_subtract
Sh-f25		Kbd Macro: Sh-kp_divide
Sh-f26		Kbd Macro: Sh-kp_multiply
Sh-f27		Kbd Macro: Sh-home
Sh-f29		Kbd Macro: Sh-pgup
Sh-f31		Kbd Macro: Sh-kp_5
Sh-f33		Kbd Macro: Sh-end
Sh-f35		Kbd Macro: Sh-pgdn
Sh-f36		Kbd Macro: Sh-stop
Sh-f37		Kbd Macro: Sh-again
Sh-find		ow-find-backward
Sh-insert	x-yank-clipboard-selection
Sh-r13		Kbd Macro: Sh-end
C-Sh-tab	fkey-backward-other-window
C-Sh-button1	mouse-track-delete-and-insert
M-Sh-button3	popup-menubar-menu

C-c C-f		comint-find-source-code

C-h ?		help-for-help
C-h A		command-apropos
C-h a		hyper-apropos
C-h b		describe-bindings
C-h c		describe-key-briefly
C-h d		describe-function
C-h e		describe-last-error
C-h f		describe-function
C-h h		hyperbole
C-h i		info
C-h k		describe-key
C-h l		view-lossage
C-h m		describe-mode
C-h n		view-emacs-news
C-h p		finder-by-keyword
C-h q		help-quit
C-h s		describe-syntax
C-h t		help-with-tutorial
C-h v		describe-variable
C-h w		where-is
C-h help	help-for-help
C-h C-c		describe-copying
C-h C-d		describe-distribution
C-h C-f		Info-elisp-ref
C-h C-h		help-for-help
C-h C-i		Info-query
C-h C-k		Info-emacs-key
C-h C-n		view-emacs-news
C-h C-p		describe-pointer
C-h C-w		describe-no-warranty

C-x tab		indent-rigidly
C-x escape	repeat-complex-command
C-x space	gdb-break
C-x $		set-selective-display
C-x &		send-gdb-command
C-x '		expand-abbrev
C-x (		start-kbd-macro
C-x )		end-kbd-macro
C-x +		balance-windows
C-x -		shrink-window-if-larger-than-buffer
C-x .		set-fill-prefix
C-x /		point-to-register
C-x 0		delete-window
C-x 1		delete-other-windows
C-x 2		split-window-vertically
C-x 3		split-window-horizontally
C-x 4		<< ctl-x-4-prefix >>
C-x 5		<< ctl-x-5-prefix >>
C-x 6		window-configuration-to-register
C-x ;		set-comment-column
C-x <		scroll-left
C-x =		what-cursor-position
C-x >		scroll-right
C-x [		backward-page
C-x ]		forward-page
C-x ^		enlarge-window
C-x `		next-error
C-x a		<< Prefix Command >>
C-x b		switch-to-buffer
C-x d		dired
C-x e		call-last-kbd-macro
C-x f		set-fill-column
C-x g		goto-line
C-x h		mark-whole-buffer
C-x i		insert-file
C-x j		jump-to-register
C-x k		kill-buffer
C-x l		count-lines-page
C-x m		mail
C-x n		scroll-up
C-x o		other-window
C-x p		scroll-down
C-x q		kbd-macro-query
C-x r		<< Prefix Command >>
C-x s		save-some-buffers
C-x u		advertised-undo
C-x v		<< Prefix command vc-prefix-map >>
C-x x		copy-to-register
C-x {		shrink-window-horizontally
C-x }		enlarge-window-horizontally
C-x delete	backward-kill-sentence
C-x C-space	pop-global-mark
C-x C-@		pop-global-mark
C-x C-[		repeat-complex-command
C-x C-b		list-buffers
C-x C-c		save-buffers-kill-emacs
C-x C-d		list-directory
C-x C-e		eval-last-sexp
C-x C-f		find-file
C-x C-i		indent-rigidly
C-x C-k		global-set-key
C-x C-l		downcase-region
C-x C-n		set-goal-column
C-x C-o		delete-blank-lines
C-x C-p		mark-page
C-x C-q		vc-toggle-read-only
C-x C-r		find-file-read-only
C-x C-s		save-buffer
C-x C-t		transpose-lines
C-x C-u		upcase-region
C-x C-v		find-alternate-file
C-x C-w		write-file
C-x C-x		exchange-point-and-mark
C-x C-z		save-buffer

M-O P		<< Prefix Command >>
M-O Q		<< Prefix Command >>
M-O R		delete-other-windows
M-O S		delete-window
M-O l		yank
M-O m		copy-region-as-kill
M-O n		keyboard-quit
M-O q		list-buffers
M-O r		transpose-chars
M-O s		open-line
M-O t		set-mark-command
M-O u		scroll-up
M-O v		enlarge-window
M-O w		<< Prefix Command >>
M-O x		scroll-down
M-O y		execute-extended-command

M-[ 1		<< Prefix Command >>
M-[ 2		<< Prefix Command >>
M-[ 3		<< Prefix Command >>
M-[ 4		<< Prefix Command >>
M-[ 5		<< Prefix Command >>
M-[ 6		<< Prefix Command >>
M-[ A		previous-line
M-[ B		next-line
M-[ C		forward-char
M-[ D		backward-char

C-x 4 .		find-tag-other-window
C-x 4 a		add-change-log-entry-other-window
C-x 4 b		switch-to-buffer-other-window
C-x 4 d		dired-other-window
C-x 4 f		find-file-other-window
C-x 4 m		mail-other-window
C-x 4 r		find-file-read-only-other-window
C-x 4 C-f	find-file-other-window
C-x 4 C-o	display-buffer

C-x 5 0		delete-frame
C-x 5 2		make-frame
C-x 5 b		switch-to-buffer-other-frame
C-x 5 f		find-file-other-frame
C-x 5 m		mail-other-frame
C-x 5 o		other-frame
C-x 5 r		find-file-read-only-other-frame
C-x 5 C-f	find-file-other-frame

C-x a '		expand-abbrev
C-x a +		add-mode-abbrev
C-x a -		inverse-add-global-abbrev
C-x a e		expand-abbrev
C-x a g		add-global-abbrev
C-x a i		<< Prefix Command >>
C-x a l		add-mode-abbrev
C-x a C-a	add-mode-abbrev

C-x r space	point-to-register
C-x r b		bookmark-jump
C-x r c		clear-rectangle
C-x r g		insert-register
C-x r i		insert-register
C-x r j		jump-to-register
C-x r k		kill-rectangle
C-x r l		bookmark-bmenu-list
C-x r m		bookmark-set
C-x r o		open-rectangle
C-x r r		copy-rectangle-to-register
C-x r s		copy-to-register
C-x r t		string-rectangle
C-x r w		window-configuration-to-register
C-x r x		copy-to-register
C-x r y		yank-rectangle
C-x r C-space	point-to-register
C-x r C-@	point-to-register

C-x v =		vc-diff
C-x v ?		vc-file-status
C-x v a		vc-update-change-log
C-x v c		vc-cancel-version
C-x v d		vc-directory
C-x v h		vc-insert-headers
C-x v i		vc-register
C-x v l		vc-print-log
C-x v r		vc-retrieve-snapshot
C-x v s		vc-create-snapshot
C-x v u		vc-revert-buffer
C-x v v		vc-next-action
C-x v ~		vc-version-other-window

M-O P M-O	<< Prefix Command >>
M-O P M-[	<< Prefix Command >>

M-O Q E		<< Prefix Command >>

M-O w E		<< Prefix Command >>

M-[ 1 7		<< Prefix Command >>
M-[ 1 8		<< Prefix Command >>
M-[ 1 9		<< Prefix Command >>
M-[ 1 ~		ccw-search-forward

M-[ 2 0		<< Prefix Command >>
M-[ 2 1		<< Prefix Command >>
M-[ 2 3		<< Prefix Command >>
M-[ 2 4		<< Prefix Command >>
M-[ 2 5		<< Prefix Command >>
M-[ 2 6		<< Prefix Command >>
M-[ 2 8		<< Prefix Command >>
M-[ 2 9		<< Prefix Command >>
M-[ 2 ~		insert-file

M-[ 3 1		<< Prefix Command >>
M-[ 3 2		<< Prefix Command >>
M-[ 3 3		<< Prefix Command >>
M-[ 3 4		<< Prefix Command >>
M-[ 3 7		<< Prefix Command >>
M-[ 3 8		<< Prefix Command >>
M-[ 3 9		<< Prefix Command >>
M-[ 3 ~		delete-char

M-[ 4 1		<< Prefix Command >>
M-[ 4 3		<< Prefix Command >>
M-[ 4 4		<< Prefix Command >>
M-[ 4 6		<< Prefix Command >>
M-[ 4 8		<< Prefix Command >>
M-[ 4 9		<< Prefix Command >>
M-[ 4 ~		query-replace

M-[ 5 2		<< Prefix Command >>
M-[ 5 ~		scroll-down

M-[ 6 ~		scroll-up

C-x a i g	inverse-add-global-abbrev
C-x a i l	inverse-add-mode-abbrev

M-O P M-O R	other-window
M-O P M-O S	recenter
M-O P M-O l, M-O P M-O m   kill-region
M-O P M-O q	detailed-help
M-O P M-O r	find-file
M-O P M-O s, M-O P M-O t   recenter
M-O P M-O u	next-buffer
M-O P M-O v	shrink-window
M-O P M-O x	previous-buffer

M-O P M-[ A	beginning-of-buffer
M-O P M-[ B	end-of-buffer
M-O P M-[ C	end-of-line
M-O P M-[ D	beginning-of-line

M-O Q E [	<< Prefix Command >>

M-O w E [	<< Prefix Command >>

M-[ 1 7 ~	other-window

M-[ 1 8 ~	save-buffer

M-[ 1 9 ~	delete-whole-line

M-[ 2 0 ~	call-last-kbd-macro

M-[ 2 1 ~	delete-char

M-[ 2 3 ~	mark-paragraph

M-[ 2 4 ~	kill-region

M-[ 2 5 ~	exchange-point-and-mark

M-[ 2 6 ~	overwrite-mode

M-[ 2 8 ~	help-for-help

M-[ 2 9 ~	save-buffers-kill-emacs

M-[ 3 1 ~	recenter

M-[ 3 2 ~	save-buffer

M-[ 3 3 ~	what-cursor-position

M-[ 3 4 ~	kill-line

M-[ 3 7 ~	split-window-vertically

M-[ 3 8 ~	write-file

M-[ 3 9 ~	kill-paragraph

M-[ 4 1 ~	kill-word

M-[ 4 3 ~	start-kbd-macro

M-[ 4 4 ~	end-kbd-macro

M-[ 4 6 ~	no-tab-mode

M-[ 4 8 ~	detailed-help

M-[ 4 9 ~	save-and-exit

M-[ 5 2 ~	save-some-buffers

M-O Q E [ A	scroll-down
M-O Q E [ B	scroll-up

M-O w E [ A	beginning-of-buffer
M-O w E [ B	end-of-buffer
M-O w E [ C	end-of-line
M-O w E [ D	beginning-of-line