next_inactive up previous


Basic Emacs Tutorial
Statistics Orientation

helpdesk@stat.rice.edu

21 August 2003
1:30 PM - 4:30 PM

Introduction

On a very basic level, Emacs is a text editor. However it is much more versatile than other less sophisticated editors in the UNIX environment, such as for example pico. More specifically, Emacs can work together with other applications, such as TEX, LATEX, and S-Plus, to provide a sort of graphical user interface. We will get an example of this when we begin to use ESS (Emacs Speaks Statistics) and LATEX.

Dot Emacs Files

These files make your life a lot easier. By color coding the syntax (for example in TEXfiles), it is easy to see if you've made a syntax error, because it ``won't look right''. In your Tutorial folder, there is a beginners .emacs file. Copy this to your home directory before proceeding- it will make things a lot easier (it is intended for use on the stat network with ESS and includes keybindings- see the ESS reference sheet, http://www.stat.rice.edu/~helpdesk/FAQ/ess.ps).

The Emacs Tutorial

While there was no tutorial command in tcshell, there is a tutorial included with Emacs, and can be accessed after starting Emacs with ctrl-h, t. There are a few things that will be helpful here, if you ever want to cancel the command you're working on, just type ctrl g once or twice. To exit, it's ctrl-x, ctrl-c. Now you should be ready to start the emacs tutorial. Don't worry about getting all the way through it. Just get comfortable with the first quarter or so of it. Then try to open a file, like the README file in the Tutorial directory. The tutorial should look like this:
Copyright (c) 1985 Free Software Foundation, Inc;  See end for conditions.
You are looking at the Emacs tutorial.

Emacs commands generally involve the CONTROL key (sometimes labeled
CTRL or CTL) or the META key (sometimes labeled EDIT or ALT).  Rather than
write that in full each time, we'll use the following abbreviations:

 C-<chr>  means hold the CONTROL key while typing the character <chr>
	  Thus, C-f would be: hold the CONTROL key and type f.
 M-<chr>  means hold the META or EDIT or ALT key down while typing <chr>.
	  If there is no META, EDIT or ALT key, instead press and release the
	  ESC key and then type <chr>.  We write <ESC> for the ESC key.

Important note: to end the Emacs session, type C-x C-c.  (Two characters.)
The characters ">>" at the left margin indicate directions for you to
try using a command.  For instance:

Special Keys, Tricks

If you want to change the font in emacs, you can hold down shift and then hold down the left mouse button. (When you're at a terminal, hold down control and press the right mouse button to change the font size)

Here are some keys that can save you time (in emacs as well as at the tcsh command line (character movement/delete options only) ). Remember that the meta key is the same as escape on a windows keyboard.

ctrl-g cancel current command ctrl-x, ctrl-c quit
ctrl-x, ctrl-f open file ctrl-x, ctrl-s save file
ctrl-x, ctrl-w save file with a different name ctrl-x k close file
ctrl-b switch buffer ctrl-x 1 make 1 window
ctrl-x 2 make 2 windows ctrl-o switch to other window
ctrl-s incremental search ctrl-h ? help menu
ctrl-d delete forwards meta-d delete words forward
ctrl-w kill previous word backspace deletes backwards
ctrl-k cuts current line of text ctrl-y pastes the line of text
ctrl-a go to beginning of line crtl-e go to end of line
meta-f move forward one word meta-b move backwards one word
ctrl-h t Emacs tutorial ctrl-_ undo (control-underscore)
Note that you can change these key bindings in several ways (like using cua) to get windows-style key bindings or other key bindings.

About this document ...

Basic Emacs Tutorial
Statistics Orientation

This document was generated using the LaTeX2HTML translator Version 2002-1 (1.68)

Copyright © 1993, 1994, 1995, 1996, Nikos Drakos, Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999, Ross Moore, Mathematics Department, Macquarie University, Sydney.

The command line arguments were:
latex2html -local_icons -no_subdir -split 0 emacstut.tex

The translation was initiated by Statistics Helpdesk on 2003-08-15


next_inactive up previous
Statistics Helpdesk 2003-08-15