Emacs – Working with Regions

In this weeks segment on Emacs wizardry let’s learn some of the basic commands for working with regions of text so you can move around your Emacs region faster than Blackberry’s are forgotten about.

Keystrokes Command Name Action
C-@ or C-SPACE set-mark-command Mark the beginning (or end) of a region.
C-x C-x exchange-point-and-mark Exchange location of cursor and mark.
C-w or SHIFT-DELETE kill-region Delete the region
C-y or SHIFT-INSERT yank Paste most recently killed or copied text.
ESC-w or C-INSERT kill-ring-save Copy the region.
Esc-h mark-paragraph Mark paragraph.
C-x C-p mark-page Mark page.
C-x h mark-whole-buffer Mark buffer.
ESC-y yank-pop After C-y, pastes earlier deletion.

Installing Emacs on Ubuntu 10.04 from Source

Here is how you can compile the mother of all editors on Ubuntu 10.04 from source:

1. Obtain the source archive for Emacs from ftp://ftp.gnu.org/gnu/emacs/

2. Open a Terminal in Ubuntu and type:

A. sudo apt-get install build-essential libxpm-dev libgif-dev libtiff4-dev

B. This will install the necessary packages to compile Emacs.

3. Extract the Emacs archive downloaded in step 1 by typing: tar xvzf emacs-major_version-minor_version.tar.gz.

4. Change to the Emacs source directory. a.k.a. cd emacs-major_version-minor_version

5. Type: ./configure

6. Type: make

7. Type: sudo make install

Enjoy.