Greg
Greg's Emacs environment
Greg's home page
Greg's diary
Greg's photos
Greg's links
Google
I started using Emacs-style editors in about 1980, starting with Craig Finseth's MINCE (a left-recursive acronym for “Mince Is Not Complete Emacs”). People who don't know any better say nasty things about Emacs (“Eight Megabytes And Continually Swapping”—doesn't that give the lie? Emacs is no longer a memory hog: it's not in the same league things like any web browser that you care to mention), but for me it was love at first sight. One of the reasons I got involved with UNIX ten years later was probably the availability of a good text editor (GNU Emacs version 18.51 at the time). If you haven't used Emacs, don't listen to the bad publicity: try it. It's easy enough for beginners to use (a thing you can't say for vi), but it offers unparalleled power.

But I didn't write this page to fan another holy war. Over the 15 years since I started using GNU Emacs, I've developed a number of macros. Most of them are horrible hacks, and I often find myself modifying them every time I use them. I'm putting up here despite all this, without documentation and in the hope that they won't inspire too much ridicule. The files are:

These files are symbolic links to my macros, so they will change from time to time without notice.

I don't claim ownership of all of this code. Some is duplicate, some is dead, some is hacked code from earlier versions of Emacs. Caveat non-emptor.

Some macros of interest

Despite lack of documentation, there are some macros worth mentioning:

Macros for HTML

I write a lot of HTML (like this page). I do it with Emacs (of course!) and a mode called html-fill mode. As the source of this and every page will show, it starts with:
<!-- for Emacs, this is a -*- html-fill -*- document -->
This mode builds on the standard HTML mode that comes with Emacs, and adds some other things (flyspell-mode to check spelling and autofill-mode to wrap the lines at 90 characters. Why 90? It looks good on the screen with the indentation that my .tidyconfig provides. Unfortunately, when I started writing these macros, I didn't know about associating them with a mode. That's not serious, except that it means that the macros aren't documented in the mode help screen. You'll have to read the .emacs file to find them and what they do. It's probably worth mentioning the html-tidy macro, which I bind to m-Q (i.e. with the shift key pressed). This reformats the document with HTML tidy and then tidies up the tidy features I don't like.

Macros for groff

In a similar manner to the HTML fill mode, I have an nroff-fill-mode, which is really for groff: the name is hysterical. My groff documents start with:
.\" This file is in -*- nroff-fill -*- mode
The additions are pretty similar to the HTML fill mode. I use a keyboard with function keys on the left of the main keyboard, where it's easy for a touch-typist to find them, so I make great use of function key and modifier key combinations. In html-fill and nroff-fill modes, the same function key combinations perform similar functions.


Greg's diary Greg's photos Greg's links Greg's home page
Valid XHTML 1.0! $Id: index.html,v 1.1 2005/07/23 22:21:39 grog Exp $