Hemlock is an Emacs-like editor which for a long time was a part of CMUCL. It was believed that it is tied to this particular implementation of Common Lisp. But this is no longer true.
So, here is Portable Hemlock! An attempt to free Hemlock from its CMUCL prison.
The stuff that works is opening files, editing them and saving your work -- what you expect from an editor. Lisp mode works too. Missing is: tty mode operation, typescript buffers (inferior shell and inferior lisp), spell checking, netnews and mail.
Portable Hemlock was tested in:
Anonymouns CVS access is available. Just follow the instructions below:
$ export CVSROOT=:pserver:anonymous@common-lisp.net:/project/phemlock/cvsroot
$ cvs login
Logging in to :pserver:anonymous@common-lisp.net:2401/project/phemlock/cvsroot
CVS password: anonymous
$ cvs co -P phemlock
New release having the SBCL patches in.
The source code of Hemlock showed unportability (or better its age) in the following areas:
Buffers sometimes also serve as streams. As Hemlock was written there was no universal de-facto standard interface for user defined streams and thus the authors defined CMUCL streams. These days we have Gray streams.
File I/O was tied to both CMUCL and Unix to accommodate probably slow machines. The file I/O functions called unix-read and unix-write beaming data directly to and fro system areas. I changed that using standard CL functions doing I/O on a line-by-line basis now.
The TTY interface is inherently unportable. Currently it is disabled altogether. I think we could reclaim some useful code from Hemlock's TTY interface and morph it into a CLIM TTY port. And since my graphics card cannot even display a text console interface on my monitor, this has very low priority on my list, though other people might want to have it.
The X11 interface uses the SERVE-EVENT facility of CMUCL, which naturally is only available there. I provided a thin portability layer to provide the same API using just the standard CLX interface.
This already summaries pretty well the current state of Portable Hemlock. You can edit files using the X11 interface on an ANSI CL which provides for CLX.
The next steps I have in mind are:
Port the missing files except the TTY interface.
Hemlock has the idea that characters are 8-bit wide. We need to teach it otherwise as we have Unicode strings now. This involves syntax tables and probably searching.
I want a CLIM Hemlock.
How exactly to do this is still not decided. I see two possibilities:
After that is done, we can talk about extending Portable Hemlock in various
ways like syntax highlighting, color, new modes, ... you name it.