		GNU EMACS Quick Reference Card 

C-A means Control-A, etc. (also called ^A)
M-A means Meta-A, etc.  (also called Escape-A)
C-M-A means Control-Meta-A (also called C-M-A)

These mean hold down the 2 or 3 keys simultaneously.

On Sun and Dec workstations, the Meta key is usually the one to the
left of the space bar.  On ASCII terminals, M-A may be replaced by the
2-character sequence ESC-A.  For commands involving the C- or M-
prefix, case is insignificant, so C-A = C-a and C-M-A = C-M-a.
Otherwise, case is significant.

****************************************************************

Initialization:

	Emacs is a customizable text editor with a powerful window facility.
In order to run emacs effectively on our system, you need to put a file
called .emacs in your home directory.  See the section "Customization" below
on how to do this for now.

****************************************************************

Getting started/getting out:

to start:		emacs filename
to exit:		C-x C-c (it will ask which modified files should
				 be saved, so this can be used for both
				 normal and abnormal exits)
illegal-operation	C-g	(to abort a command)
undo			C-x u	(to undo a command)    
redisplay		C-l	(to redisplay the screen)

****************************************************************

Cursor Motions:
       			Move		Delete		Undo
			L    	R	L    	R

Character		C-b   	C-f     DEL  	C-d
Word			M-b   	M-f	M-DEL 	M-d
Lines			C-p   	C-n
Beg/End of Line		C-a   	C-e	C-k		C-y
Sentence		M-a   	M-e
Next/Prev Window	C-x o  	C-x o	C-x 0
Page			M-v   	C-v
Paragraph		M-[   	M-] 
Beg/End of File		M-<   	M->
S-expression		C-M-b   C-M-f
Region			C-x C-x C-x C-x	 C-w		C-y

****************************************************************

Navigating:

If you load the standard dotfiles (see "Initialization" below), you can
navigate using the keypad of your terminal.  This is usually easier than using
the raw cursor motion commands above.  On a VT100 or Decstation, these are:

  -----------------------------------------------------------------
  |PF1            |PF2            |PF3            |PF4            |
  |backward-      |forward-       |backward-      |forward-       |
  |-sentence      |sentence       |paragraph      |paragraph      |
  |---------------+---------------+---------------+---------------|
  |7              |8              |9              |-              |
  |beginning-of-  |    	          |               |scroll-down    |
  |line	       	  |previous-line  |end-of-line    |[M-v]          |
  |---------------+---------------+---------------+---------------|
  |4              |5              |6              |,              |
  |backward-char  |set-mark-      |forward-char   |scroll-up      |
  |[C-p]       	  |command     	  |[C-f]          |[C-v]          |
  |---------------+---------------+---------------+---------------|
  |1              |2              |3              |Enter          |
  |               |               |               |               |
  |backward-word  |next-line      |forward-word   |               |
  |---------------+---------------+---------------|               |
  |0                              |.              |               |
  |                               |kill-line      |yank           |
  |kill-region  [C-W]             |[C-k]       	  |[C-Y]          |
  -----------------------------------------------------------------

On a Sun3, these are:

  ------------------------------------------------
  |R1             |R2             |R3             |
  |backward-      |backward-      |scroll-down    |
  |sentence       |paragraph      |[M-v]          |
  |---------------+---------------+---------------|
  |R4             |R5             |R6             |
  |forward-       |forward-       |scroll-up      |
  |sentence       |paragraph      |[C-v]          |
  |---------------+---------------+---------------|
  |R7             |R8             |R9             |
  |beginning-of-  |    	          |               |
  |line	       	  |previous-line  |end-of-line    |
  |---------------+---------------+---------------+
  |R10            |R11            |R12            |
  |backward-char  |set-mark-      |forward-char   |
  |[C-p]       	  |command     	  |[C-f]          |
  |---------------+---------------+---------------+
  |R13            |R14            |R15            |
  |               |               |               |
  |backward-word  |next-line      |forward-word   |
  |---------------+---------------+---------------|

The arrow keys are supported on almost all keyboards.  Under the X window
system, mouse motion is also supported (see below).

****************************************************************

The Region:

	The region is the space between the dot (just to left
of cursor) and the mark. Useful commands:

set-mark-command		M-1, C-@  [also on keypad]
exchange-dot-and-mark		C-x C-x
delete-region-to-kill-buffer	C-w
copy-region-as-kill		M-w	Like C-w but doesn't delete
yank-from-killbuffer		C-y

	The standard way to move or copy blocks of text is to
use C-w and C-y.  You can C-y the same text several times.  

****************************************************************

The Mouse:

Under the X window system, mouse motion is supported.  The commands
on the mouse buttons are:

left 		point to mouse pos
shift-left	point to mouse pos and redisplay
control-left	scroll-up    [C-v]
meta-left	scroll-down  [M-v]

middle 		x-paste-text (insert X selection)
meta-middle 	yank         [C-y]

right 		x-cut-text	region to emacs kill-buffer (like M-w)
				and also to X selection buffer 
meta-right 	x-cut-and-wipe-text  	same, but also deletes the region.
control-right 	x-cut-sexp-backward


****************************************************************

Buffers:

	A buffer is a chunk of text.  It may or may not be
associated with a file.  A buffer is displayed by associating it
with a window (an area on the screen).

find-file		C-x C-f	(the standard way of switching files)
list-buffers		C-x C-b
switch-to-buffer	C-x b
save-some-buffers	C-x s	(saves modified buffers; asks about each)

****************************************************************

Windows:

	A window is an area on the screen, usually associated
with a buffer.

delete-window		C-x 0 	(deletes current window)
delete-other-windows	C-x 1
other-window		C-x o
split-windows-vertically C-x 2	(splits screen into 2 windows)

****************************************************************

Getting help:

	GNU Emacs has a powerful help command.  Help commands are always
accessed by C-h.    The learn-by-doing tutorial (C-h t) is highly recommended.
Some of the options are:

help-with-tutorial	C-h t	(select the learn-by-doing tutorial)
apropos			C-h a	(prints list of relevant commands
                                 --very useful)
describe-command	C-h d
describe-key		C-h k
describe-bindings	C-h b	(makes list of current key bindings)
describe-mode		C-h m	(describes features of current major mode)
help-with-help		C-h C-h	(describes options for help command)

****************************************************************

Searches:

isearch-forward		C-\, C-s (C-s works inside X windows, but not from 
				  a terminal)
isearch-reverse		C-r 	(these are incremental searches)
query-replace-string	M-%	(use C-h  for help here, too)

****************************************************************

Miscellaneous:

redisplay screen	C-l 
newline-and-indent	LF	(useful for pgms)
quote-character		C-^,C-q (Yes, that's C-^.  C-q works inside X windows,
				 but not from a terminal. Useful for putting 
				 ctl chars in files)
filter-region		M-|	(run region thru unix filter pgm)
shell			M-s	(starts inferior shell in a window)
capitalize word		M-c	(works on FOLLOWING word!)
upper-case word		M-u	(works on FOLLOWING word!)
lower-case word		M-l	(ditto)
fill-paragraph		M-q	(works on whole definitions in programs)
dabbrev-expand		M-/	(copy recent similar word; useful for pgms!)
insert-time		M-2	(inserts date stamp)

****************************************************************

Extended Commands:

	There are too many commands in emacs for any reasonable
set of keys.  Hence any command can be executed by typing M-x
followed by its name. 

****************************************************************

Scheme Mode:

M-x run-scheme                  start inferior scheme process in a window
indent-line            TAB      indent current line correctly
newline-and-indent     LF	newline and indent it
scheme-send-defun-and-go  C-M-x   send current definition to scheme process
        Files with extensions .s, .ss, or .scm will automatically be put in scheme mode. 

****************************************************************

Sending and receiving mail

mail		C-x m		Begin composing a mail message
mail-send-mail	C-c C-c
rmail		C-x r		Read your mail with the RMAIL mailreader

Commands in rmail:
SPC	Scroll to next screen of this message.
DEL	Scroll to previous screen of this message.
n	Move to Next non-deleted message.
p	Move to Previous non-deleted message.
M-n	Move to Next message whether deleted or not.
M-p	Move to Previous message whether deleted or not.
M-s	Search for string and show message it is found in.
d	Delete this message, move to next nondeleted.
C-d	Delete this message, move to previous nondeleted.
u	Undelete message.  Tries current message, then earlier messages
	till a deleted message is found.
s	Expunge and save the file.
q       Quit Rmail: expunge, save, then switch to another buffer.
C-x C-s Save without expunging.
g	Move new mail from system spool directory or mbox into this file.
m	Mail a message (same as C-x m).
r	Reply to this message.  Like m but initializes some fields.
f	Forward this message to another user.
o       Output this message to an Rmail file (append it).
C-o	Output this message to a Unix-format mail file (append it).

Caution: Rmail keeps its mail file (called RMAIL) in Babyl format, which is
incompatible with standard mbox format, and it will automatically convert your
mbox file to this format.  So if you've never used rmail before, be sure save
a copy of your mbox somewhere else in case you decide to go back to it.  Once
you adopt rmail as your primary mail reader, this will be unnecessary.

****************************************************************

Reading netnews:

gnus		C-x g		Read netnews using the gnus newsreader

Gnus has several different screens and modes associated with it.

"?" displays the first 4 commands you need.

C-c TAB in any gnus window will get you to the Info documentation for that
window. 

~wand/emacs/gnus.mode-help contains a compilation of the mode-help (C-h
M) screens for the three buffers that gnus creates.

gnus maintains a .newsrc in a format compatible with rn, so you can use either
newsreader (not like readnews).  Gnus is far easier to deal with than
rn/postnews.  Try it, you'll like it.

****************************************************************

Customization:

	Emacs allows the user to create his own modes and commands and to
define his own key bindings.  On our system, it is necessary to do a small
bit of this because we use C-S and C-Q for flow control.  To do this, create a 
file in your home directory, called .emacs, consisting of the line:

(load "~wand/emacs/Dotfiles/.emacs")

and in your .cshrc, you should include the line

setenv EMACSLOADPATH ~wand/emacs:/usr/local/emacs/lisp

If you have installed the Standard Dotfiles, this will already be in place,
along with many other goodies.

To see if you have the standard dotfiles, compare your .cshrc with
/usr/local/contrib/Dotfiles/.cshrc .  To install the standard dotfiles, run
/usr/local/contrib/Dotfiles/install .

****************************************************************

