6. Working online

This section explores many of the tasks you would commonly perform using the Internet, including browsing the web, chatting online, reading e-mail, etc.

6.1. Browsing the Internet

The best way to browse the Internet from within Emacs is using W3. W3 is a full-featured web browser written just for Emacs. It does not come with Emacs, but it can be downloaded from ftp://ftp.xemacs.org/pub/xemacs/emacs-w3/w3.tar.gz. The latest release of W3 is version 4.0, information about it from the W3 at http://www.cs.indiana.edu/elisp/w3/docs.html.

Once you've downloaded W3, you'll need to perform the following tasks to install it:

  1. Open an Emacs shell as root, using the command M-x emacspeak-root.

  2. Use the cd command to change to the directory where the w3.tar.gz file is.

  3. Uncompress the w3.tar.gz file, using the following commands:

    1. At the root command prompt, type gunzip w3.tar.gz. You'll be left with a file calledw3.tar.

    2. At the root command prompt, type tar -xvf w3.tar. You'll be left with a directory called w3-4.0pre.46.

  4. Change directories to the w3-4.0pre.46 directory.

    Note that the next several steps are also covered in extensive detail in the INSTALL file included in the w3-4.0pre.46 directory. If you'd like more detailed instructions, please refer to that file.

  5. At the command prompt, type /.configure. Your makefile will be configured as is appropriate for your system.

  6. When your machine has finished creating the makefile, type make install at the command prompt. The application will be compiled so that it can be executed.

    W3 is a native Emacs application. In addition, W3 has already been speech-enabled, and the emacspeak-w3.el file that provides speech was pre-installed with Emacspeak into your /emacs/site-lisp/emacspeak/lisp/ directory.

  7. Once your machine has finished making the application, open your .emacs file (located in your home directory) and add the following line:

    (autoload 'w3 "w3" "Interface for w3 on Emacs." t)

    Including this line in your .emacs file causes W3 to load automatically when you start an Emacs session.

  8. Save and close your .emacs file when you are finished editing.

  9. To start using w3, type M-x w3-fetch and press Return.

  10. Supply the start URL.

When browsing, you will find files that you want to download. Although it is possible to download files using W3 by pressing "D" when the cursor is over a link, the wget application is a much better way to do downloads. Using the wget command to download files is discussed in Downloading files.

As a web browser, W3 has many functions that can be accessed by typing M-x w3- and then pressing the Tab key. Emacs will provide you with a list of options to complete the string.

Some of the common commands for navigating in W3 are listed below:

Return

Pressing Return when over a hyperlink follows that hyperlink. Note that if the hyperlink goes to an FTP site, you may get an error.

Tab

Tabs between the various links on the page.

Goes to the beginning of the document.

>

Goes to the end of the document.

M-s

Saves the current document to the local disk as HTML source, formatted text, LaTeX source, or binary

space

Scrolls down in the buffer.

backspace

Scrolls up in the buffer.

q

Kills the buffer.

For a complete listing of W3 commands, refer to the User's Manual located at http://www.cs.indiana.edu/elisp/w3/docs.html

6.2. Chatting online

There are any number of IRC (Internet Relay Chat) applicationsthat you can install, two of which are recommended: AOL Instant Messenger for Emacs (called TNT), and ERC.

6.2.1. AOL Instant Messenger for Emacs (TNT)

There's a special version of AOL Instant Messenger (AIM) written just for Emacs, called TNT. The main site for TNT is at http://sourceforge.net/projects/tnt/, and you can download the necessary files from http://download.sourceforge.net/tnt/tnt-2.3.2.tar.gz. Don't download any files from AOL's site, as you'll end up with the graphical version of AIM instead of the Emacs version. In addition to installing TNT, you'll also need to set up an Instant Messenger account with AOL, and you can do so at http://www.aol.com/aim/homenew.adp.

Once you've signed up for an account and downloaded the files, you'll need to complete the following steps:

  1. Open an Emacs command shell as root, using the command M-x emacspeak-root.

  2. Change directories using the cd command to the directory containing the downloaded file.

  3. Unzip the file using the command gunzip tnt-2.3.2.tar.gz, then expand the resulting tarball using the command tar -xvf tnt-2.3.2.tar.

  4. Change directories into the new tnt-2.3.2 directory.

    The next several steps are covered in detail in the INSTALL file that can be found in the tnt-2.3.2 directory. If you'd like more details than are covered here, please refer to that file.

  5. Copy all the .el and .elc files into a directory that is in your Emacs load-path. Typically this directory is /emacs/site-lisp/ (you should be able to see a number of other .el and .elc files in there).

  6. Open your .emacs file and add the following lines:

    (setq load-path (cons "/full/path/to/tnt" load-path)) (load "tnt")

    When you add these lines to your .emacs file, be sure to change the "full/path/to/tnt" to the directory where you placed the .el and .elc files.

  7. Save and close your .emacs file.

  8. Restart Emacs so that the changes take place.

To start TNT, type M-x tnt and follow the instructions. You'll probably want to read the README file contained in the tnt-2.3.2 directory, as it contains excellent descriptions of all the commands used by TNT.

6.2.2. ERC

ERC is an IRC (Internet Relay Chat) client written especially for Emacs. The main site for ERC is located at http://sourceforge.net/projects/erc, and you can download and install the appropriate files as follows:

  1. Go to http://prdownloads.sourceforge.net/erc/erc.el. Save the page (it is the ERC application) into a new file called erc.el.

  2. Place the new file in your Emacs load-path, typically in the directory/usr/share/emacs/site-lisp.

  3. Open your .emacs file andn add the following line:

    (require 'erc)
  4. Save and close your .emacs file.

  5. Exit and restart Emacs so that the changes take place. You won't need to download any Emacspeak-enabled .el files, as those are already included in your /emacspeak/lisp directory.

Once you have installed ERC, it can be started from Emacs using the command M-x erc-select to select an IRC server.

For more documentation, refer to the erc.el file. It contains installation and usage instructions in the comments at the top of the file.

6.3. Using e-mail

There are multiple mail programs available for e-mail purposes. One that is recommended is VM (View Mail), an Emacs-native application that allows you to do all the things you'd expect of an e-mail application. Alternatively, you can use Rmail, a slightly less sophisticated but built-in e-mail application. Both are speech-enabled and discussed in this section.

6.3.1. VM

Although VM is Emacs-native, it does not come with Emacs. You can download it from the VM homepage at http://www.wonderworks.com/vm. This page also contains links to the VM user's manual, FAQ, and a list of sites where you can download VM, depending on your location. If you want to modifying source code, download one of the sources; otherwise, download one of the binaries as it will be easier to install.

Assuming that you downloaded a binary, it's probably named vm.elc.gz. To install, follow these steps:

  1. Open an Emacs shell using the command M-x shell.

  2. Unzip the file using the command gunzip vm.elc.gz. You should be left with a file named vm.elc.

  3. Move the file vm.elc to a directory specified in your Emacs load-path, such as /usr/share/emacs/site-lisp/.

  4. Open your .emacs file and add the following line:

    (autoload 'vm "vm" "Start VM on your primary inbox" t)
  5. Save and close your .emacs file. Then restart Emacs so that the changes will take effect.

If you decide to install the source files instead of the binary, you'll download vm.tar.gz. Installation instructions are in the README file included in the download.

Once you've installed VM, you can start it using the command M-x vm.

6.3.2. Rmail

An alternative to VM is Rmail, a built-in Emacs mail reader. As such, you don't need to download or install anything to make it work. To start Rmail, use the command M-x rmail.

There is a chapter about Rmail in the GNU Emacs documentation, available at http://www.gnu.org/manual/emacs-20.3/html_chapter/emacs_31.html. This chapter includes all the information and commands you might need to use Rmail.