Appendix B. Emacs Lisp Packages

The tables in this appendix list the most useful Lisp packages that come with Emacs. All Lisp packages are typically located in the directory emacs-source/lisp, where emacs-source is the directory in which you placed the Emacs source distribution. We have omitted all of the packages that provide "basic" Emacs support; likewise, we have omitted many packages whose functionality is obsolete or unspeakably obscure.

While some of these packages are described in some detail in this book, most aren't; you will have to rely on GNU Emacs' help for precise descriptions of what the package does. See Chapter 14 for details about help; the most important help commands you will need for finding out about the functionality of Lisp packages are C-h p (for finder-by-keyword), C-h f (for describe-function), and C-h m (for describe-mode).

C-h p is especially helpful. It lets you navigate through a hierarchy of information about all packages available on your system, from general areas of functionality, like those in the tables in this appendix, to the C-h m information about each individual mode. Unfortunately, the detailed information is sometimes incomplete and also lists many packages that could not possibly be interesting to anyone other than hard-core Emacs customizers.

Wherever it is reasonable, the tables in this appendix give commands that "start" the package. This startup information has the following meanings:

Finally, a word on using the packages. Some packages are automatically loaded when Emacs starts; some are loaded when you visit a file with the appropriate suffix (such as many of the modes for programming languages); some are automatically loaded whenever you give the appropriate command (for example, M-x shell Enter loads the package shell.el for shell-mode); and some are never automatically loaded. So how do you know which is which?

You don't really have to concern yourself with this issue. In the tables, the Startup column tells you what command (or commands) put the package to work. Start Emacs, and give this command (M-x startup-command Enter). If Emacs complains no match, the package wasn't loaded automatically and you need to load the package "by hand." To do so during an Emacs session, use the command M-x load-library name Enter, where the package's "name" is given in the first column of the table. You can also tell Emacs to load packages automatically at startup time by putting lines in your .emacs file that have this form:

(load-library "name")

Finally, if you're interested in looking at the source code of the libraries, which can be a great way to pick up techniques as you develop skills in programming Emacs Lisp, check out the find-library-file function presented in Chapter 11.

Now, without further ado, here are the tables of Lisp packages.

Table B-1. Support for Java, C, and C++ programming


Table B-2. Support for Lisp programming


Table B-3. Support for other programming tasks and languages

Package

Description

Startup

gud

Major mode for working with many different debuggers including jdb, gdb, sdb, dbx, xdb, perldb, pdb (Python), and bash

jdb, bashdb, gdb, and many others

perl-mode

Major mode for working with Perl source

perl-mode, suffixes .pl, .pm, .perl, .al, and capitalized variants

cperl-mode

Major mode for working with Perl source, which many prefer to the older Perl mode

cperl-mode, suffixes .pl, .pm, .perl, .al, and capitalized variants

python

Major mode for editing Python source files

python-mode, suffix .py

tcl

Major mode for editing TCL source files

tcl-mode, suffixes .tcl, .exp, .itcl, .itk

sql

Major mode for editing SQL queries

sql-mode, suffix .sql

ada-mode

Major mode for editing Ada source files

ada-mode, suffixes .ada, .adb, .ads, .adb.dg, .ads.dg

pascal

Major mode for editing Pascal source files

pascal-mode, suffixes .p, .pas

modula2

Major mode for editing Modula-2 source code

modula-2-mode

fortran

Major mode for editing Fortran source files

fortran-mode, suffixes .f, .F, .for

f90

Major mode for editing source code in the Fortran 90 dialect

f90-mode, suffixes .f90, .f95

asm-mode

Major mode for editing assembly language source code

asm-mode, suffixes .s, .S, .asm

awk-mode

Major mode for editing awk code

awk-mode, suffix .awk

m4-mode

Major mode for editing m4 macro source

m4-mode, suffixes .m4, .mc

ps-mode

Major mode for editing PostScript code

ps-mode, suffixes .ps, .eps, with any capitalization

compile

Major mode for compiling programs (often through make or ant) and allowing easy access to the source lines on which errors are reported

compile


Table B-4. Support for Text Processing


Table B-5. Emulations for other editors

Package

Description

Startup

vi

Major mode for emulating the vi editor

vi-mode

vip

Another major mode for emulating vi

vip-mode

edt

Function to set key bindings to emulate the VAX/VMS EDT editor

edt-emulation-on


Table B-6. Interfaces to operating system utilities[3]

Package

Description

Startup

shell

Major mode for interacting with the command-line shell.

shell-mode

find-dired

Run the find command and use dired on the resulting list of files.

find-dired

tar-mode

Access files inside a tar archive through a dired-like interface.

tar-mode, suffix .tar

arc-mode

Access files in several other archive formats through a dired-like interface.

archive-mode, suffixes .arc, .zip, .lzh, .zoo, .ear, .jar, .war, as well as capitalized variants; .sxd, .sxm, .sxi, .sxc, .sxw

lpr

Print the contents of a buffer or region.

lpr-buffer, print-buffer, lpr-region, print-region

sort

Sort the contents of a buffer.

sort-columns, sort-fields, sort-lines, sort-numeric-fields, sort-paragraphs, sort-regexp-fields

spell, ispell

Various tools for checking spelling.

See Chapter 3

diff, ediff

Tools to help in comparing files.

See Chapter 12

[3] Some of these will be useful on Windows only if you've installed a Unix compatibility package like Cygwin (see http://www.cygwin.com).


Table B-7. Networking support


Table B-8. Games and amusements


Again, this is only a sampling of some available packages, to give you a sense of the breadth and depth of capabilities that ship with Emacs. The list isn't close to complete even with respect to what's available at this time, and new features are always being added. Your best bet is to explore for yourself using the tools mentioned at the beginning of this appendix. And don't forget to search the Web for nonstandard additions that might be just what you need for your own environment and projects!