Software: Emacs Lisp

With a few exceptions, I either wrote or coauthored all these programs. I haven't bothered making other people's programs available here unless I made modifications that I felt were noteworthy.

You can read descriptions below, or simply browse the source directory. There are probably some programs there which I have not documented here.

For a description of recent changes, please see the ChangeLog.

Major | Minor | UI | Editing | Mail | Processes | Network | Lib | Fun | Misc


Major Modes


These major modes don't include those implemented for interacting with inferior processes, network applications, or any of the other categorizations here. As a consequence, this section is fairly small.


My hyperactive replacement for the standard buffer menu. You can define the fields you want to appear in the buffer (by default it shows some that do not normally appear, such as the version control number and process status, if any); determine which buffer names to show or hide; sort the entries by any criteria you want, e.g. major mode or buffer size; and so on. Field alignment is generally better than that in the standard command as well (and more adjustable), so it's easier to read.


Minor Modes



This is a minor mode for Emacs Lisp and Lisp Interaction Mode buffers which shows you the parameter list for functions as you type or move over s-expressions. It also shows you the meaning of documented global variables. The inspiration for this mode came from a similar feature on some lisp machines.

This package comes standard in XEmacs 19.15 and later, and Emacs 20.1 and later, but you should always be able to find the latest version here.


Make matching parentheses, brackets, etc. blink in Emacs. Works even on ASCII terminals; it brought new life to my Ann Arbor Ambassador, I tell you!

Don't use this in XEmacs. XEmacs has blink-paren.el already.


Dynamically resize the minibuffer when you're typing in it, so that you can always see everything you type. To enable it, just use the resize-minibuffer-mode command.

This program has been part of Emacs 19 for a long time. An older version was included in XEmacs starting with version 19.12; the file name is rsz-minibuf.el there.

Some history: Roland McGrath wrote the first version of this program for Emacs 18, inspired by an even earlier hack by Skip Montanaro called minibuf.el. In order to make it work Roland had to hack every entry in every minibuffer keymap (all four of them) rather severely by consing a wrapper around every binding to do the window resizing. I did the rewrite for Emacs 19 which, thanks to the addition of various hooks, made hacking keymaps unnecessary.

This package has been obsolesced in Emacs 21. It took 10 years, but the minibuffer and echo area have finally been integrated and automatic resizing of this window region is built into the editor now.


This program helps you learn shortcuts for commands. That is, when you type the full name of a command using M-x some-extended-command notation, the command is run and then a messsage appears with a list of shorter keybindings (if any) for that command.

Starting with Emacs 19.30, a feature like this is already built in, and controlled with the variable suggest-key-bindings. XEmacs has a similar feature controlled by the variable teach-extended-commands-p. I find both of these variants somewhat irritating because you have to sit there and look at the little message about the keybinding you could have used, and meanwhile your command isn't getting executed; it wants to show you the keybindings first.

I prefer the behavior of my mode better, which shows you the keybindings after the command has completed. (Note: Emacs 20.1 and later adopts my behavior of showing the keybindings after finishing the command.) I also noticed that both Emacs and XEmacs 19 get it wrong for commands that read input from the user, because they depend on the value of this-command to figure out which command to look up. My version tries to look up the command in the command history, which makes it a little more accurate.

I'm not 100% sure where the idea for this feature originated. For years I had a wrapper around the execute-extended-command command to display key bindings in Emacs 18. It's entirely possible that I stole the idea from Roland McGrath and that he stole the idea in turn from Kyle Jones, who wrote a program called execcmd.el in 1989 (which I did not discover until I did some research for this document in 1997). Kyle, in turn, claims to have gotten the idea from Evan Bigall. Anyway, at some point I ripped the hooks out of my .emacs file and made a standalone package.


This is a monitor for Emacs which schedules typing breaks and reminds you to take them. Aside from using a simple timer, it has various heuristics for guessing if you're typing unusually heavily and may pre-empt the timer and make you take typing breaks sooner. If you don't take the typing breaks when it suggests them, it gets in your face about it (but it won't lock up the keyboard since that would prevent you from saving critical buffers and so forth). It has a couple of display hacks it can run while you're taking your break.

The objective is to make you stop working and take a break by getting up and walking around once in a while, like various ergonomics studies suggest you should do. It may help prevent you from getting Tendinitis or Carpal Tunnel Syndrome, as I had for many years. Of course, it's only really useful if you live entirely in Emacs like I do. If you switch betwen windows a lot, the keystroke monitor will be useless.


User Interface Enhancements


These are various interface extensions I've written to make Emacs easier for me to use; either by virtue of reducing keystrokes, working better with the surrounding window system, etc.


A complete replacement for time.el, which implements the standard display-time command. This package defines a new command, disptime-enable, which has a different customization interface.

One advantage of this package over older versions of the standard one is the ease with which you can enable/disable parts of the modeline display, or write your own extensions. One extension I wrote actually queries a POP server to determine how many unread messages you have incoming, and displays that.


This file replaces the standard eval-expression command. A complete list of improvements is described in the comments at the beginning of the file.

This program is inspired by an earlier implemention written by Joe Wells called eval-expression-fix.el. That version was originally written for Emacs 18 and, while it worked with some quirky side effects in Emacs 19, created even more problems in Emacs 20 and didn't work in XEmacs at all. It also seems to be impossible to find Joe Well's original code anywhere on the internet, although I still have a copy available if anyone wants to see it.


This is a sort of session manager for emacs, inspired by the unix screen program. This version works in every emacs version and variant I've ever gotten my hands on, in both X and ASCII terminal mode, so it's pretty portable and gives you a fairly consistent interface for switching back and forth between different session configurations, even though some if its functionality has been duplicated by standard facilities in some newer versions of Emacs.

You can save and restore arbitrary data when switching configurations. Among some of the default things saved are the window sizes and layout, buffer marks, the state of narrowed regions (so you can create two narrowed views of the same buffer simply by switching screens), menu bars, buffer order, etc.

I have not yet implemented persistent storage of this data across invocations of emacs.


This package provides you with a bunch of shortcuts for visiting or inserting many different kinds of files without having to know their full path name in the file sytem. For example, you can quickly locate shell scripts in your executable path, search for TeX input files, use the locate command (part of the GNU findutils package) to find files anywhere on the system without a predetermined search path, etc.

Included is a documented set of library routines for writing your own extensions.


Extensions to fff to provide support for locating emacs lisp libraries and function definitions. You can visit the source code for any lisp function you've loaded from libraries or your own .emacs startup files; this package figures out where it was loaded from and just takes you there. Just like the lisp machines used to do!

This package may be redundant with find-func.el, which is included as a standard part newer Emacs and XEmacs distributions. But my implementation predates it.


Extensions to fff to provide support for locating IETF Request For Comments (RFC) documents. You can search for local copies of the documents or fall back to locating remote documents via transparent ftp.


A quick hack for keeping bookmarks of visited nodes in Info trees. This is probably completely obsolesced by Karl Fogel's bookmark.el, which is standard in Emacs 19.


Some quick hacks for working with LUDE depots. See also ludeconf.


Library routines and interactive commands for optimizing redisplay when creating or closing windows. There are also some scrolling and line-wrap toggling commands.


Commands for manipulating xterm terminals when running emacs under them. You can select fonts, foreground and background colors (in versions of xterm which support this), set icon and window titles, etc.


Recent versions of xterm from the XFree86 4.0 distribution, or as distributed by Thomas Dickey, can be compiled to support 8, 16, 88, or 256 colors. This file enables Emacs 21 running under xterm to take advantage of 256-color mode. (It will not work with earlier versions of Emacs because they do not support faces in tty frames.)

Emacs 21.3 implements native 256 color terminal support. At the time of this writing (2002-06-21) I have not yet verified whether this package interfaces properly with that builtin support or not.


Editing Utilities


These programs fall into two general categories: new commands for manipulating text, and extensions to existing editing and buffer-related commands.


This package lets you quickly comment out sections of code in various different languages, or use it to quote attributed text in mail and news messages. You can customize the comment style somewhat.


This may be obsolesced by recent versions of emacs; I haven't checked.

It allows you to set enable-local-variables and enable-local-eval so that you can be queried about whether to set local variables in files when you visit them. You can set local variables never, always, ask first, or ask first only when the file being visited isn't owned by you.


Damnit, Jim. I'm a hacker, not a lawyer!

Narrow buffers to hide the godforsaken multi-page copyright notices that appear at the beginning of most source files.

Unknown to me or to Ben Mesander (the primary author of this mode) at the time, Jamie Zawinski wrote a similar thing for Lucid Emacs (now XEmacs), called hide-copyleft.el. But I still think Ben came up with a better name.


This implements kill-buffer-hook and kill-buffer-query-functions for Emacs 18.


Perform conversion of some Latin-1 (same as iso8859-1) to equivalent 7-bit ascii sequences when possible.

I wrote this for converting mail and news article reply buffers so they would not contain 8-bit characters needlessly. Otherwise, the buffer has to be converted to quoted-printable before sending, and that makes it harder to read for the recipient if they do not have a MIME-capable reader.


Prior to version 21.1, Emacs cannot visit pseudofiles in the linux /proc filesystem because they are all reported as zero-length files and emacs believes there is nothing to read. This package installs a special handler which enables emacs to visit these files normally.

This package is not needed in Emacs 21, which has addressed the problem internally. It does not work at all in XEmacs.


Nukes trailing whitespace from the ends of lines, and deletes excess newlines from the ends of buffers, every time you save. It's mode-sensitive, so for some modes it will ask you before doing anything; in some cases it will clean up whitespace unconditionally; and in other cases it will never do so.

There is a whitespace.el included with Emacs since 1999, but that is not the same as this version. My version predates that one, but I declined to have mine bundled with Emacs for vague technical reasons.


Mail Utilities



This program is for use with the Insidious Big Brother Database. This program's main entry point, bbdb-to-pilot-file, will write out all BBDB records into a CSV-format text file containing records suitable for loading into the PalmOS address book with the pilot-addresses command.

Currently, synchronization is one-way; you cannot sync records back to BBDB yet.

Jamie Zawinski wrote this program originally (hence the name), but he doesn't use a PDA very much anymore, so I'm maintaining it for now.


My library of general-purpose mail header parsing routines and mail mode extensions. This is required by many of the other packages in this category.


View mail or news buffers by dispatching a copy off to a running Mozilla (Netscape) browser. This is particularly useful for decoding S/MIME encrypted or signed messages, or even for viewing HTML-enriched messages quickly.

Presently this program is integrated with GNUS, VM, and RMAIL, but it needs to interface better with the mailbox URL protocol in Mozilla so you can use the mail window instead of the browser window for viewing messages. (Note: this may never happen. Netscape completely broke the mailbox handling in Communicator 4.0, and it is unclear at this moment how the Mozilla 5.0 mail reader will work.)


This is a mail mode extension that sorts your outgoing message headers. As the comments in the source file say, only an anal retentive pedant would actually use this. (And just think: I not only use this, but I wrote it.)


I wrote this before VM supported MIME, to help make quoted-printable messages a little easier to read. VM 6.0 and later have much better (and more general) support for this kind of thing already, although RMAIL users might still find this useful.

Even though this package is obsolete, I still provide it in case it would be a useful base of code for anything else.


Mail mode normally looks for mail aliases defined in your ~/.mailrc file, which is also used by the Berkeley Mail command (also known as mailx in some versions of unix).

This package lets you use a Sendmail style aliases file instead. It even supports the :include: directive, so you don't need to store all your mail aliases in a single file.

Roland McGrath wrote this program originally, but later stopped using it in favor of Jamie Zawinski's Insidious Big Brother Database (BBDB). I still use this program, however, so I'm maintaining it now.


I'll probably regret telling other people about this hack. It generates random silly mail headers to put in your outgoing messages. For example, it can add scathing remarks about the X Window System or Emacs, Zippy quotes, Tom Swifties, flames, shopping lists, and other inanities.

This program contains a number of databases of amusing texts. I am not the author of many of those texts, but I did write all the code from scratch.


This package provides a routine for generating MIME multipart boundary separator strings which contain subversive words and phrases.

Spookmime insinuates itself into VM when loaded so that VM uses these generated boundaries when sending or forwarding multipart MIME messages. A hook for using it with GNUS is also provided, but must be enabled manually.


This is a library of low-level routines for parsing vcard records, as well as for formatting them for display. Vcards are a standardized, 7bit address book format that is in popular use with some mail agents, including (but not limited to) Mozilla. Typically they are included as text/x-vcard MIME attachments.

I've written an interface to these routines for VM, one emacs-based mail reader. Those stubs are in a separate file, vm-vcard.el. Recent versions of GNUS already know how to use this library if it's installed. Hooks for BBDB and TM are in the works.

If you write stubs for other mail user agents, please send them to me!


This is my vcard interface for VM.


Various commands and customization routines I've written for working with VM. In addition to some new interactive user commands, there are routines for manipulating the auto-folder-alist, automatic deletion of messages based on virtual folder selectors, etc.


These are some additional enhancments like those provided by vm-addons.el, but they modify existing VM functions via the emacs advice mechanism and thus cannot be autoloaded.


This package lets you reply or forward messages from within VM, setting your return address to match whatever address was used to reach you in the first place.

For example, my regular address is However, I still sometimes use the address when I'm sending email that's related to the GNU Project. Using this package, if someone sends email to the latter address, my From and Reply-To headers are automatically filled in with that address so that it looks like I am continuing to correspond from MIT, even though the rest of the time my correspondence looks like it comes from my regular address.

In order for this to work, all you have to set a lisp variable to contain a list of all your known email addresses and load this file as part of your emacs initialization.




These are major modes, minor modes, and miscellaneous Emacs interface enhancements for dealing with inferior processes not relating specifically to network applications.


This is an extension of pb-popup.el which is tailored for optimal behavior in shell, telnet, and most other kinds of interactive process buffers.


This is pretty trivial. It defines a new shell command, fshell, which can launch multiple shell sessions when you use a prefix argument.

This package exists because I lobbied Richard Stallman to make this the standard behavior for shell mode, but he thought it was too complicated.


If you run processes under emacs (e.g. telnet sessions), this package notifies you when new output arrives in buried buffers by popping up a new window for them. You can control where new windows will appear, and what counts as a ``presently displayed'' buffer. For example, you can specify a dedicated frame for a particular process buffer, select whether to look for buffer windows in iconified frames, etc. There are several other user preferences you can set.

This package implements general-purpose behavior. For most interactive processes, you will want to use the higher-level interface comint-popup.el, which uses this package.


This package implements some useful process filters, especially for unix shell process buffers. While this package does not implement any kind of general terminal emulation, it does make it possible to run programs which attempt to updating the screen in place and be readable inside an emacs buffer.

As an example, recent versions of the ftp command have a tick command which will output a running counter of bytes transferred instead of writing out hash marks. Whenever the counter is to be updated, the new counter is preceded by a carriage return so that the old counter is overwritten on most displays. Ordinarily in emacs, the carriage return would be displayed literally followed by the new output. However, if you put proc-filter-shell-output-filter on comint-output-filter-functions, the output is displayed as intended on a terminal.

The aforementioned filter presently handles the display of other program output as well, including scp, mpg123, cdparanoia, and more. Writing new handlers or other filters is easy.


The commands defined in this package allow you to create buffers which cannot be killed accidentally. You can mark ``precious'' buffers, then gleefully kill all the rest of your buffers in the buffer menu.

There are two minor modes defined. The first mode protects a buffer only so long as a process is still associated with it. You can use this to keep from killing your *shell* buffer until you exit the shell process first.

The second mode unconditionally prevents a buffer from being killed. Turning off the minor mode makes the buffer killable again.


This lets you preview regions of TeX sources using xdvi. It's supposed to notice \input sequences and include them to satisfy macro dependencies, but I've never thoroughly tested this.


This is a kind of ``dired'' mode, but for unix processes. It displays a list of all your processes, or of all the processes on the system, in a buffer where you can mark them and send them signals.

This is a mode written originally by Kyle Jones, but I've made several trivial modifications over the years.


Network Applications



This is an interface for silverchat, a local-area chat system in Austin, TX.


This package lets you use your own network stream implementation (via external processes), rather than using the built-in one. Some people choose to use an external process to avoid wedging emacs while waiting for client connections to establish.

There is one caveat for emacs lisp programs which expect that their network streams are really internal streams and not inferior process objects: The value returned by process-status for open network streams is open, whereas it will return run for regular processes. Process sentinels and filters might be confused by this. It's best to check for both return values, but not all programs do this.


My telnet mode. It features remote directory tracking and other features I stole from myself after writing rlogin.el. See also ssh.el.


Interface to ZenMOO, and optionally make emacs auto-meditate. Remember, your keyboard is not the path to enlightenment.

Historical note: the code for this program was the starting point for ZenIRC.


This is a comint-based interface for connecting to remote hosts via rlogin. It features remote directory tracking via transparent ftp. See ftelnet.el and ssh.el for some other remote shell interfaces with similar functionality.

rlogin.el has been distributed with Emacs 19 since its first release, and with XEmacs since version 19.12, I believe. The most up-to-date version can always be found here.


This is a comint-based interface for connecting to remote hosts via ssh. It features remote directory tracking via transparent ftp, a feature I stole from myself after writing rlogin.el. See also ftelnet.el.


An interface to some kinds of dictionary servers. This is my own implementation; it's not the same as either of the two different interfaces that are provided with XEmacs.


Fetch stock quote information from Yahoo.


ZenIRC is an IRC client written in Emacs Lisp. Please see the ZenIRC home page for more information.


Library Routines


These packages consist of various Emacs Lisp library routines which don't fall into any of the other categories. Some of them may provide some minor mode behavior (e.g. dbfrobs.el), but this is not necessarily the case.


Some routines for modifying buffer contents or display.


Bytecode maintenance functions. In particular is a method for allowing you to specify that the compiled file corresponding to a given source file lives in a different directory. This makes it easier to have one source tree but different bytecode directories for different variants of emacs.


Emacs 19.34 and earlier, and XEmacs 19.14 and earlier, do not have the defcustom or defgroup syntax used for declaring user options.

As of May 1997, many of my own programs use these forms, so I provide a stub for backward-compatibility with earlier versions of emacs.


These are some emacs-lisp level debugger enhancements which I find useful for customizing the kinds of exceptions which should trigger the debugger. This may only be interesting to hackers.


Functions for building directory-tree lists.

I use the function build-subdirectory-list (and its friends) to initialize my load-path, among other things. At the root of my lisp directories I have ".build-subdirs.els" files which specify subdirectories which should also go into the path.


Various routines for determining the variant of emacs running (e.g. Emacs, XEmacs, MULE) and version number information.


Functions for querying about or acting on files. One command, load-offer-compile, will offer to compile an emacs lisp library if it is out of date.


Assorted frame manipulation commands.


Functions for querying host name information.


Keyboard input and keymap utility functions. Most of these are just syntactic sugar for creating keymaps, keyboard translation tables, etc. as well as making completely buffer-local instances of them.


Routines I frequently use for searching or manipulating different kinds of lists. In addition to some general-purpose routines like set-alist-slot, there are also routines for manipulating special Emacs data structures such as the auto-mode-alist, minor-mode-alist, load-path, after-load-alist, etc. in a convenient manner.


A library routine for traversing all the windows in an emacs frame (or in all frames) and evaluating s-expressions. It's similar to the walk-windows function in Emacs 19.


Some trivial arithmetic routines for computing greatest common divisors, least common multiples, powers of two, etc.


Various motion commands for e.g. moving to the longest line in a buffer. This package mostly contains various buffer-narrowing commands at present.


Some routines for manipulating obarrays.


This is a useful macro for preserving undo boundaries when implementing interactive commands which modify buffer contents. Exactly what this macro does and why requires a complicated explanation which is given in the comments of this copiously-documented file. If you are not concerned with emacs arcana, this will not interest you.


General-purpose routines for searching strings or converting them to other data types.


Commands for resolving top-level domain letters into country names and vice-versa.

This library was inspired by the what-domain command defined in mail-extr.el, which is shipped with Emacs. This is a more feature-complete version: you can search by 2-letter, 3-letter, or numeric country codes, and you can display all domains whose country name match a regular expression. And this version is probably more up to date than what is shipped with older Emacs distributions.


Fun Stuff



Constructive diacriticism for GNU Emacs.

Let's face it: languages are more fun when they are peppered with excessive diacritical marks. I've always appreciated how the French really outdid themselves with Vietnamese, surpassing their own older written alphabet. It's probably too late to enhance English in this manner, but there's no reason you can't sprinkle random, gratuitous diacritical marks in your text anyway. This program provides commands to do just that.


Play an audio file instead of signalling a normal bell. This only works on unix systems that support some kind of audio device like /dev/audio, e.g. Linux or Solaris.

You'll have to get your own sound files to use with this. As some people might have guessed from the package name, I use an interjection frequently used by Homer J. Simpson.


Ever wondered what the acronym EMACS actually stands for?


``This program has a chequered past.''

Generate random flames and insults. Richard Stallman removed it from the Emacs 19 distribution for copyright reasons (neither of us could locate Ian Batten, the original author of the emacs lisp version, at the time). That version is still distributed with XEmacs as of version 21.4.

My version is a complete rewrite.


A complete waste of time to hack off the sort of pinheads who think geek code is cool.

Over the years I think people have written automatic ``geek code decoders'' so you can translate what this ridiculous babble actually means. It is my sincere hope that the pseudocode generated by my program will crash those decoders. Well, I can dream, can't I?


Originally written by Bob Manson in ksh, this program generates random horoscopes. Fun for hours. And just as accurate as the readings you can get from those $4.99/minute phone services! Here's a small sample:
      Tomorrow your wonderful pet piglet will adjust your girdle.  Beware of
      someone you know bearing a deadly disease.  Days from now wearing
      clothes may seem expensive.  You will meet a wallflower this week.
      You'll later be a Borg.  12 is your lucky number.


I don't think I can really explain what this is. You'd better just read alt.religion.kibology and figure it out for yourself.

Kibo (James Parry) wrote this program, basing it on the Emacs 18 implementation of flame.el. I've rewritten it.


This program is a reimplementation of a brilliantly-conceived hack written by Brian Rice in C while he was a student at Oberlin College, c. 1989. It generates random shopping lists. Here is a small sample:
      Here is your shopping list:
      (1) Idiotic frivolity confirmers
      (2) Claustrophobic chowder
      (3) Bicentennial travesty
      (4) Chaotic ecclesiastical Garden Weasel selectors


This is a cute mode line display hack. This was originally written by Jim Blandy and further hacked on by Roland McGrath. That version used a separate process to provide inputs and act as a kind of timer. With the advent of built-in timers in Emacs and XEmacs, this seemed unnecessary to me so I rewrote the whole thing from scratch.


Generate U-Boat death messages, patterned after Iron Coffins. This is another hack written originally by Bob Manson in ksh. Here's some sample output:


This is an annoying signature generator I wrote in 1993 to demonstrate how unimaginative some people's signatures were. If you don't know already, making fun of someone's idiotic and/or oversized signature is known as warlording, hence the name of this program.

Note that vcards have rendered some signatures so boring, they're not even worth warlording. Ah, for the good old days.


Generates advertisements in the style of AT&T's ``You Will'' campaign, c. 1992. Here's an example:
      Have you ever thought it was unhealthy to have three Ann Arbor
      Ambassador terminals to defend against spinach?  Or tasted brussel
      sprouts and thought it was tasty roadkill?  Or been assaulted by
      crazed Korean traffic cops in a garbage dump?  You will.  And the
      company that will bring it to you: AT&T.


Extensions to yow.el. You probably do not need this because I already added these functions to the standard Emacs distribution years ago; it's just here for the sake of users of older Emacs versions. Are we OBSOLETE yet?


Miscellaneous Stuff



``Cheezy Scheme''

This is the start of a Scheme interpreter for Emacs, written entirely in elisp. (Scheme is a lexically-scoped dialect of lisp with tail recursion elimination, first-class procedures, and first class continuations a standard part of the language definition.)

There are some major pieces missing in this implementation including continuations, a reader, and a great many R4RS procedures. I think most of the required syntax (except for low-level macros) is there, the implementation has general tail call elimination, and even has a few extras like first class environments. But I wouldn't call it even halfway complete.

I doubt it's worth taking this implementation ``all the way''. It was fun to write, but it's not practical for anything.

Major | Minor | UI | Editing | Mail | Processes | Network | Lib | Fun | Misc