Umics

Umics -- a complete(*) pure-Python(**) replacement(***) for Emacs

Copyright 2003 by Andrew Plotkin (****). Licensed under the GPLv2.

(*) Umics is nowhere near complete.
(**) Python 2.2, that is. It should work on any Python 2.*.
(***) Do not attempt to replace Emacs with Umics.
(****) My email address is erkyrath@eblong.com.

Download the Python source code for Umics (such as it is)


What is this?

In 2003, I decided I wanted to write an extensible data editor in Python. (It was to be an add-on for Boodler, as it happens.) It would be a terminal-window app, since I figured that would be most portable. It would support multiple editing buffers, like Emacs. In fact, I wanted to use all of Emacs's editing features -- except for Lisp. Lisp isn't any fun. (For me.) I wanted to write the editor in Python.

Somewhere in there, I decided it would make the most sense to just replicate Emacs in Python. Once I had the buffers and windows and keyboard commands all set up, I could then start writing the Boodler part. Right?

You won't be surprised to learn that after about three weeks, I drifted off to some other project. I never wrote any Boodler-specific code at all. But I made quite a bit of progress in that time!

"Umics", like "Emacs", doesn't stand for anything.

What can you do?

Umics supports multiple windows, multiple buffers, command bindings, and a minibuffer. You can create a text buffer, although text-editing commands don't exist, so you can't type in it. You can save the contents of a buffer in a file, though.

Why am I releasing this software in such a completely useless state? Like I said on my web site: "Zarfhome is about what I do, and Zarfhome is about how I do it." That includes unfinished projects. Maybe you have a use for the bare skeleton of a Python-based editor. If so, here you go. If not, hey -- you have a slightly better idea how I think now.

I'm afraid the thing is completely uncommented. Yes, I normally comment my code. But not in a project's earliest stages, when I'm still rearranging and replacing chunks every few days. Sorry! It's probably simple enough to figure out by inspection. (It better be, since I don't remember how it works either.)

Run through a demo

In a terminal window, change to this directory, and type:

python umics.py

(The file umics.py and the umics directory must both be in the current directory. Or you can install umics somewhere else on your PYTHONPATH, although I don't see why you'd bother.)

You'll see an empty scratch buffer, with "Welcome to Umics" at the bottom. Much like Emacs! Only not.

(No, you can't type "python umics.py file" to open an existing file. Sorry!)

If you really want to invite the Emacs nostalgia, type "meta-x ?" for a list of commands. "ctrl-G" will cancel the prompt, as expected. However, "ctrl-H" isn't the help key; just hit "?" for help.

As I said, there are no text editing commands. However, you can add text to the scratch buffer by typing "meta-x textbuf-append-line" and then typing some text in the minibuffer. (It's like a text editing command, but stubbier.) Do that a few times, then try "ctrl-X ctrl-S". It prompts you for a file! And does tab completion! And saves the file!

If you want a large text buffer to experiment with, type "? l" or "meta-x help-license" to bring up the GPL license in a new buffer.

You can use "ctrl-X 2" to split the window, and the other common "ctrl-X" commands to work in multiple buffers.

For some Python fun, type "meta-x eval-expression" to compute an arbitrary Python expression. Note that Python exceptions are caught and displayed in the status line.


Last updated June 15, 2011.

Zarfhome (map) (down)