gnu Emacs

Invoke gnu Emacs with the command "emacs" on CS department DEC workstations.

Why I Use gnu Emacs

For the ability to customize:
You can insert Emacs lisp into a ".Emacs" file in your home directory to customize key bindings. So you can make emacs look like your favorite editor. (In fact, there is a "vi" mode built into Emacs!) Here's one example (from Brian Wentz):
;;; Define some cool actions for all of those function keys
;;; These keys mimick the editor I love, e

(define-key global-map  [f1]            'info)                    ; F1
(define-key global-map  [f2]            'save-buffer)             ; F2
(define-key global-map  [f3]            'kill-emacs)              ; F3

For its modes:

latex-mode
Here are some example functions in latex-mode:
C-c C-f saves the buffer and then processes the file.
C-c C-p prints the .dvi file made by any of these.
C-c C-v previews the .dvi file made by any of these.
C-c TAB runs bibtex on the file of the current buffer.

language modes: c-mode, c++-mode, ...
First, you can invoke a compilation from within Emacs. Emacs will scroll error messages and the source together! Second, various keys are bound to useful shortcuts to typing and indenting programs. Examples:
TAB		c-indent-command
}		c-electric-brace
{		c-electric-brace
;		c-electric-semi&comma (insert comment)

html-mode
In html-mode, certain keystrokes are bound to insert many html tags. A < is automatically converted to the code sequence ampersand-l-t-semicolon. Particularly convenient are the keystrokes that insert a template for entire lists, or that enclose the text between the mark and the cursor in an anchor (with emacs prompting you for the link).

Here are some examples:

C-c C-p		html-add-preformatted  (adds "pre" tags)
C-c C-f		html-add-fixed         (adds "tt" tags)
C-c s		html-add-list          (adds the UL tag with LI tag inside)
C-c g		html-add-img
C-c C-r r	html-add-reference-to-region
C-c C-r l	html-add-normal-link-to-region
C-c a		html-add-address

gdb-mode
gdb mode will open a window in emacs and run the gdb debugger in it. If you run a program from gdb, and the program aborts, a second window will be automatically opened to show you the source code line at which the program aborted.

Here are some examples of other gdb-mode functions:

C-c C-b sets a breakpoint at the current file and line.  
C-c C-d removes breakpoints on the current file and line.
C-x C-a C-l displays in the source window the last line referred to
    in the gud buffer.
C-c C-s, C-c C-n, and C-c TAB do a step-one-line

For the ability to program new functions:
Here's a function that prints an error message if the .emacs file is used with an old emacs version (also from Brian Wentz):
(if (and (boundp 'emacs-version)
         (or (and (boundp 'epoch::version) epoch::version)
             (string-lessp emacs-version "19")))
    (error "This file was compiled for Emacs 19"))

How to Get Started with gnu Emacs

Tutorial

To start the on-line tutorial, be sure that /usr/local/bin is on your path, and then type "emacs". The inital screen should give you instructions on running the tutorial:

GNU Emacs 19.22.3 of Wed Apr 20 1994 on sequoia.cs.vt.edu (berkeley-unix)
Copyright (C) 1993 Free Software Foundation, Inc.

Type C-h for help; C-x u to undo changes.  (`C-' means use CTRL key.)
To kill the Emacs job, type C-x C-c.
Type C-h t for a tutorial on using Emacs.
Type C-h i to enter Info, which you can use to read GNU documentation.

From the text above, type a control-h followed by a "t" to invoke the tutorial.

Reference Card

Click here to see the gnu Emacs reference card.