Clementson's Blog

Bits and pieces (mostly Lisp-related) that I collect from the ether.

April 2006
Sun Mon Tue Wed Thu Fri Sat
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Mar  May

Emacs Nostalgia

Saturday, April 15, 2006

People come to Lisp in a variety of different ways. If you look at the different main roads that people took to Lisp (from "The Road to Lisp" survey), you'll see that a lot came by way of Emacs. That was true for me as well. I started programming in the early 80's on systems that most people today have probably never heard of (e.g. - CP/M, IBM S32, Advanced Revelation). At the time, for me, Lisp was just a paragraph in a computer languages text and I was far more interested in C.

Then, in the late 90's, I came across Emacs. It was like a virus that, once infecting me, spread slowly but pervasively. I don't even remember how I was first introduced to it. I think it was because some of the editors that I was using at the time had Emacs key bindings and I was curious why an editor manufacturer would be targeting Emacs users. I initially did the online tutorial and was just a "user"; however, after a while, I wanted to learn more and read Learning GNU Emacs and Writing GNU Emacs Extensions (aka - the Giraffe book). After that, I was hooked! I had done some basic .emacs customizations but wanted to do some more sophisticated stuff. The two biggest contributors to my elisp education were the Giraffe book and the wealth of code examples available in Emacs itself. I read both the GNU Emacs Lisp Reference Manual and Programming in Emacs Lisp. At the time, I had no one I was discussing Lisp with so books and online resources were my only sources of information about Lisp and I would read everything I got my hands on about Elisp programming. I also read GNU Emacs and XEmacs and Sams Teach Yourself Emacs in 24 Hours but I think that the Giraffe book had the biggest impact on me. Then, one day, I stumbled across c.l.l. and gradually started moving more towards CL as I saw it as a way to actually use Lisp in application work as opposed to just Emacs customizations. And, as they say, "the rest is history"! ;-)

Initially, I was using Emacs primarily as an editor; however, over the years, I have come to use it for a variety of different tasks. The synergies that you gain from being able to customize other Emacs applications and use them together within Emacs in many cases outweighs the advantages of using a "more featureful" stand-alone application. The main things that I use Emacs for today (I use Emacs for a lot of different things; however, these are currently the primary day-to-day things that I use Emacs for) are:

I started off using Emacs on Win32 boxes so I wasn't exposed to terminal or X-Windows Emacs implementations. A couple of years ago, I moved over to Mac OS X and have been using Emacs exclusively on Macs since then. Unlike many people who came to Emacs via Unix/Linix, I never really used the terminal version of Emacs. On Win32, there wasn't one available and on Mac OS X, there have been Carbon ports of Emacs available ever since I first switched over. So, I was pleasantly surprised this weekend when I tried out Emacs in a terminal on Mac OS X. The version that comes standard with Mac OS X is 21.2.1 and I'm used to using Aquamacs (a Carbon port of CVS Emacs that I've posted about previously), so I decided to first download and build CVS Emacs. It takes a while to download and build, but it's pretty easy to do:
## Step 1/3 - CVS download
cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/sources/emacs login
cvs -z3 -d:pserver:anonymous@cvs.sv.gnu.org:/sources/emacs co emacs
## Step 2/3 - configure
cd emacs
./configure --enable-carbon-app
## Step 3/3 - make  
make bootstrap
make
sudo make install
This creates a Carbon Emacs app and installs it in "/Applications/Emacs.app". However, the standard emacs executable is included in the the app bundle, so I then modified my .bash_profile file to include the following line:
alias emacs='/Applications/Emacs.app/Contents/MacOS/Emacs -nw --debug-init'
(I could have just modified the configure statement above to include a "--prefix=/usr" parameter. This would have overwritten the terminal emacs that ships with Mac OS X; however, I decided on a more conservative approach and just created an alias)

Running emacs in the terminal brought back memories of working on some other systems in the 80's! It was actually quite fun and Emacs running in a terminal is quite a "snappy" application - "Eight Megabytes And Constantly Swapping" indeed! ;-)

Emacs in Terminal

Incidentally, in addition to the above-mentioned paper/online books, there are a number of other good sources of Emacs information:

emacs Copyright © 2006 by Bill Clementson