Two Useful Emacs Extensions

# VM and Html-Helper-Mode for Emacs

by Larry Ayers
<layers@vax2.rain.gen.mo.us>
Copyright (c) 1996

##### Published in Issue 8 of the Linux Gazette

### Introduction

Aside from the tremendous versatility and configurability of the editor itself, a major reason for the enduring popularity of Emacs is the wide variety of add-on lisp modules which are available.

Lately I've been excited about two of these in particular:

- The VM Mail Interface, with the Win-VM Extension
- Html-Helper-Mode

### The VM Mail System

If you use Emacs at all for editing, it can be convenient to use it as an e-mail client as well, thus retaining familiar keystrokes and Emacs' powerful editing capabilities. I have found the Emacs mail composing facility to be efficient as well as easy to configure and use. (I'm using Gnu Emacs 19.31.) Emacs seems to work well with either sendmail or smail.

The built-in mail-reader, Rmail, I found less useful. Rmail uses a proprietary format which is not readable by other mail-programs; when you read mail with Rmail, you have effectively decided to use nothing but Rmail.

Kyle E. Jones wrote a replacement for Rmail called VM (View Mail) which seems to have gathered quite a following, judging by usenet postings regarding it. This lisp package makes Emacs a full-featured mail-reader, with support for multiple folders and a useful header-index window. When used in conjunction with Paul D. Smith's win-vm.el, your mail-reading session will be opened in another frame and give mouse support in the header window, as well as new menubar items for VM.

Rather than configuring VM with lisp code in the ~/.emacs file, a separate file called ~/.vm can be created, containing entries customizing any of the plentiful VM variables.

As an example, the following entries will cause VM to open with a header-index view, with the cursor kept to the center of the display:

    (setq vm-startup-with-summary t)
    (setq vm-follow-summary-at-cursor t)
    (setq vm-auto-center-summary t)

VM offers many other features, such as virtual folders, which I haven't explored yet, but a new user can benefit from the basic default setup.

I usually use Pine to quickly scan new mail and delete obvious junk, as well as for typing a quick reply or two. Later when I've started emacs I'll load VM, which moves new mail into its own Inbox file, then displays the first unread message. (If configured as in the example above, the header index is shown first.)

It's really a quite useful and pleasant-to-use system; if you're an Emacs user I recommend that you give it a try! Both packages can be obtained via ftp from ftp.uu.net, as well as its mirror sites.

### Nelson Minar's Html-Helper-Mode

Nelson Minar , at the Santa Fe Institute in New Mexico, has over the past couple of years created a feature-rich and easy-to-learn HTML-editing mode for Emacs.

It's called html-helper-mode.el, and it was originally inspired by an early HTML mode for Emacs written by Marc Andreessen of Netscape fame.

Html-helper-mode started out as simply a set of key-bindings for basic HTML tags, but as other Emacs users began to use the mode various useful add-ons for it began to appear. These now include an excellent font-lock mode, a mode for passing a file to a browser, and support for Netscape extensions.

The current beta version of html-helper (which is very stable, and only called a beta because the docs haven't been updated yet), is available from Nelson's website. Get this version if you can, because this one adds an HTML menu to the menu-bar. This is very helpful for learning the keybindings; as with many emacs add-ons, the key-bindings are rather long and not completely intuitive. The menu serves as a quick reference and a way to use the more obscure tags which don't really need to be memorized.

The above web-site also has links to all of the extensions which others have contributed, plus the documentation which can be browsed online.

Html-helper also has a tag-completion feature; typing esc-tab will complete a partially typed tag. I had a little trouble surrounding selected text with a tag, but eventually found that typing cntrl-u will cause the subsequent tag-command to do this properly.

When a new *.html file is created a basic template is inserted in the file, complete with an automatic timestamp at the end. Here is a screenshot showing the default layout with font-lock enabled:

Html-Helper Sample

The mode is enabled by adding lisp code to your ~/.emacs file. As is true with other emacs modes, the mode is only loaded into memory when a file with the *.html extension is loaded or created. VM mode (discussed in the first section) works the same way. This is a great advantage to the emacs user, giving access to a variety of specialized editing modes without burdening your system with multiple user interfaces.

Back up to Linux Gazette T.O.C

Last modified: Sun Jun 2 16:10:51 CDT 1996