0 index
1 Why learn an editor?
2 Pico
3 Vi
4 Why Emacs?
5 More Features
6 Using the Menus
7 Using Keystroke Sequences
8 Keystroke Strategies
9 Get me out of here!!
10 More Complex Control Commands
11 The Meta Key
12 The M-x commands
13 Online Help
14 Online Help (continued)
15 Essential Commands
16 More Commands
17 References

outline
created using slideshow.cgi by Andy Harris















CSCI N241 Web Design: Emacs
1. Why learn an editor?
  • As a web author, you should know something about UNIX and be able to work in the UNIX environment
  • This mean learning an editor as much of your work will be in a text editor
  • Three most popular are vi, pico and emacs



































CSCI N241 Web Design: Emacs
2. Pico
  • A little text editor packaged with pine
  • You will outgrow quickly as it does not support keyboard macros, multiple files or quick HTML commands



































CSCI N241 Web Design: Emacs
3. Vi
  • Better than pico in a sense, however commands are a bit odd
  • Has an edit mode and command mode
  • Pressing a key gives a different response in the different modes
  • Easy to forget which mode you are in



































CSCI N241 Web Design: Emacs
4. Why Emacs?
  • Has a number of features that make it will suited to web programming
    -an html mode
    -ability to look at directories from within the editor



































CSCI N241 Web Design: Emacs
5. More Features
  • -ability to have multiple windows open at once
    -running a command line shell without leaving the editor
    -easy creation of keyboard macros
    -online menus and powerful keystroke commands
    -powerful programming language



































CSCI N241 Web Design: Emacs
6. Using the Menus
  • Activated by using F10, if that doesn't work use Esc then ` (accent character, NOT the ' single quote/apostrophe)
  • The menu will show you the keystroke sequence that is a lot faster to use than the menu



































CSCI N241 Web Design: Emacs
7. Using Keystroke Sequences
  • Emacs uses a control key to execute many commands
  • Emacs is so powerful, and there are so many commands, that the control key with other keys will still not give you access to all the commands



































CSCI N241 Web Design: Emacs
8. Keystroke Strategies
  • Control commands
    -the control key works as you would expect, is almost always held down as you press other keys
    -holding the control key and then pressing the 'f' key moves one character to the left
    -Emacs documentation shows as: C-f



































CSCI N241 Web Design: Emacs
9. Get me out of here!!
  • C-g means 'cancel current command'
  • If you are having strange things happen in Emacs, C-g is a good bet



































CSCI N241 Web Design: Emacs
10. More Complex Control Commands
  • The control key does not give you enough functionality on its own
  • C-x s allows you to save a file (C=the Ctrl key, x= the x key, s = the s key)
  • The C-x is a special command that says "housekeeping command coming"
  • Most commands that deal with controlling Emacs itself begin with C-x



































CSCI N241 Web Design: Emacs
11. The Meta Key
  • 'Secondary' control key, 'alt' key on Windows, 'Apple' key on Macs
  • This key can be used to run other Emacs commands
  • The most common way to use the meta key, however, is the Esc key
  • Not used exactly at the Ctrl key, press the Meta key (Esc or Alt), release then hit the next key
    -example: M-f press Esc, release, press 'f' key



































CSCI N241 Web Design: Emacs
12. The M-x commands
  • Every command in Emacs has a long, English-like name
  • If you want to run a particular command, use M-x to run the command by its full name, you will receive a selection to choose from



































CSCI N241 Web Design: Emacs
13. Online Help
  • Best way to learn is by doing
  • To use the online help
    -enter Emacs and type C-h t
  • This loads a text file from which you will learn to move the curser around, copy/paste text, save/load files, etc.



































CSCI N241 Web Design: Emacs
14. Online Help (continued)
  • C-h a calls the 'command-apropos' command which is an index in a more traditional help system
    -it allows you to type in a word or phrase and returns a list of commands that contain that phrase
    -scroll through the list to the command needed



































CSCI N241 Web Design: Emacs
15. Essential Commands
  • Key
    Command
    What it does
    C-h
    help-command
    enters the online help
    C-x C-s
    save-buffer
    saves file
    C-x C-c
    save-buffer-kill-emacs
    Exit emacs
    C-x u
    advertised-undo
    undo last edit(can repeat)
    C-g
    keyboard-quit
    abort current command
    C-x u
    advertised-undo
    undo last edit(can repeat)
    C-f(right arrow)
    forward-char
    move forward one character



































CSCI N241 Web Design: Emacs
16. More Commands
  • Key
    Command
    What it does
    C-b(left arrow)
    backward-char
    moves backward one character
    C-p(up arrow)
    previous-line
    move up one line
    C-n(down arrow)
    next-line
    move down one line
    M-f
    forward-word
    move forward one word
    M-b
    backward-word
    move backwards one word
    C-v
    scroll-up
    move forward one screen
    M-v
    scroll-down
    move backward one screen



































CSCI N241 Web Design: Emacs
17. References
  • Emacs help
  • UNIX in a Nutshell by Daniel Gilly, O'Reilly & Associates, Inc., 1992



































outline

Why learn an editor?

Pico

Vi

Why Emacs?

More Features

Using the Menus

Using Keystroke Sequences

Keystroke Strategies

Get me out of here!!

More Complex Control Commands

The Meta Key

The M-x commands

Online Help

Online Help (continued)

Essential Commands

More Commands

References